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

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...

Bitwise operators - The Journey

If you are trying to search about bitwise operators on web you will find loads of information, although, when I was learning about bitwise none of those in the web could clarify my mind. But finally I have got a way to me is easier and faster to understand bitwise, I hope it will help you either. The bitwise table 128 64 32 16 8 4 2 1 The table above represents the chain of bit that we have. This table will be our guide through the bitwise word, before we continue just have look at the table and see...

Converting Hexadecimal(16) to Decimal(10)

The Hexadecimal system work in base 16 which  means that we have 15 (fifteen) numbers as shown bellow. HEX Value 0 0 1 1 2 2 3 3 4 4 0 0 0 0 5 5 6 6 7 7 8 8 9 9 A 10 B 11 C 12 D 13 E 14 F 15 PHP and Hex In the table above we have 16 numbers and its corresponding values, the highest is 15 and the lowest is 0. Knowing this rule what will the code bellow will output? <?php echo 0xFF; The right answer is 255! When I...