Matheus Marabesi website, sharing ideas about software development - Listing posts on page 11

GitHub badges! (PHP repository) - Tutorial with Travis and GitHub

Disclaimer : If you don’t know what are badges I’d suggest a quick view to https://poser.pugx.org which is a open source project with badges for PHP projects. Also for this post I’m assume you have a experience with GitHub already and know how to commit, push, pull or use GitHub from web interface. Repository used for this post you can find here. Badges that we’re going to use: Build Status Coverage Status Total Downloads Latest Stable Version Latest Unstable Version License Final result Travis CI First step is go to https://travis-ci.org and click in Sign in with GitHub and Travis will ask...

ARE YOU NOT USING TDD?! – PART 2 (Legacy code)

In the part one I introduced the life cycle of TDD you can see here and how it works, but often people come to me and ask about the legacy code how can we start using TDD with legacy code? Should we start from zero? Should we use baby-steps? I decided to share my experience in how I used TDD in legacy code and how I did to get this task done also I have to say many thanks to my friend Alexandre Cintra who helped my a lot giving me gold tips. Edit: Jun 17, 2015 You can find...

Stop complaining, do it now.

I’ve been working with software development for 4 years now with different groups and different companies. But nothing has changed as much as TDD did with my style of programming, thinking and solving problems. Fear, comfort zone Since I decided to learn TDD and apply it to my work I had a lot of questions. Does TDD really works? Why should I spend my time writing test first? Though, those are questions often asked by who is starting with TDD but we can’t stop on the first rock, we must keeping going. Instead what I’ve seen in many developers are the same excuses to not...

Raspberry Pi + PHP socket

Recently I did a post about HTML5 WebSockets and it had a purpose. I was preparing the material of my talk at Samsung Ocean and my goal was create a RC car with an Hybrid application to control it and not use java as a server-side language. The final result you can check on my github and play around with the code. The following steps are to getting the socket working in your raspberry, here I’m going to use the model B+. First of all We need to to access our Pi trough the SSH, for this example I’m going...

Getting started with Xpath

Its been a long time since my last post and now I came up with a new subject interesting to me because I could find around me people that know and understand Xpath, so here I’m going to show what I’ve found about Xpath and the little particularities on it in PHP.  A little bit of history The first version (1.0) of Xpath was released in 1999 and the second version (2.0) came in 2011 and nowadays we have the Xpath 3.0 released in 2014. Xpath was created to be able to easily navigate between nodes in a XML document and be...

ARE YOU NOT USING TDD?! - PART 1

I’ve been working with TDD for while and everyday I see developers creating excuses to do not start with TDD, and I ask myself why they do that? Is there any reason for ? Maybe the procrastination and the fear of new challenges comes to mind. TDD has basically a life-cycle to be follow and and here I’ll try to show how to getting started with. Here is a couple of slides of my presentation “Introduction to TDD (PHPunit examples)”. It may help you to understand the TDD world combined with this post content, so I hope you enjoy the...

The definitive guide to HTML5 WebSocket

The book “The definitive guide to HTML5 WebSocket” is a short book with a great content, if you are looking for web sockets this book is definitely a good start. Book content Chapter 1: Introduction to HTML5 WebSocket Chapter 2: The WebSocket API Chapter 3: The WebSocket protocol Chapter 4: Building instant Messaging and Chat over WebSocket with XMPP Chapter 5: Using Messaging over WebSocket with STOMP Chapter 6: VNC with the Remote Framebuffer Protocol Chapter 7: WebSocket Security Chapter 8: Deployment Considerations Highlight sections I would like to highlight three sections of the book that I do recommend a second...

WebSocket - HTML5

HTML5 brings a lot of new features came to help developers to create amazing apps and amazing user experience, one of these features is called web socket which provides new powers under the HTTP protocol. Web socket resolves the lack of HTTP when we need updating our clients with real time data and also server events regardless of a request. The client side First of all let’s have a look in the javascript code the easiest step to get web sockets working. var mySocket = new WebSocket('ws://myserver'); mySocket.onopen = function() {}; mySocket.onclose = function() {}; mySocket.send = function() {}; mySocket.onerror...

Bitwise operators – The Journey Part II

If you didn’t see the first part of this post click here and enjoy! The « (Shift left) operator Do you remember of our bitwise table in part I? We are not going to need it anymore. What we are going to do here is simple math, so let’s start with the left shift operator that uses multiplication ( * ). The full definition from php is : “Shift the bits of $a $b steps to the left (each step means “multiply by two”)” The formula is: bit leftmost *  2 ^ bit rightmost <?php echo ( 7 << 9 ); bit...

Head first - Design Patterns

You can find the source code in the already but also you can have a look at the github and learn a bit more about the book content. If you want to order a copy for you go ahead and visit O Reilly website. Welcome to Design Patterns The section “Welcome to Design Patterns” is a quick review through the object oriented programming and of course the paradigm  inheritance X composition. Although in the end you will learn your first pattern the Strategy! Keeping your Objects in the know Moving on the next pattern is the Observer. And in this...