Today I’ve implemented a simple IP Packet Sniffer.
Sometimes is useful to know what’re the IP packages that transit on your network, for Analyze network problems, Monitor network usage, Debug client/server communications or Debug network protocol implementations.
The tool is very simple, but I think that can be useful to learn something more about IP and TCP packets and Protocols implementation.
Maybe you can extend this Tool to support other Transport Layer Protocol.
When I’ve started working on Mac OS X with Core Animation, I was impressed by an Example (I don’t remember the link, if someone knows it, post it in the comments! thanks)… Very few lines of code for a great effect.
After a year, or probably more.. this example was came back to my mind, so I’ve decided to clone using Qt. And below you can see a short Demonstration Video. Your desktop jump away.. full screen is fantastic
PyCon3 was finished, Only one week is passed and I already miss it. Guido van Rossum, Alex Martelli, Ariya Hidayat, Raymond Hettinger, David Boddie, Fredrik Lundh… C/C++ and Python Developer not .NET “coders” (I hate even more my boring .NET job).
Following the PyCon week, here a simple example of PyQt4 that allows you to see up to 500 photos tagged PyCon3 on Flickr.
This is Just a simple code that maybe all the Linux C Developer knows, but if someone is still learning, This is a function that wrap the standard read function adding the non blocking feature. It’s Really useful in relation with Sockets.
Alan has asked my How I’ve implemented the Touch and Rotate feature of the Moko. The answer is very simple, It’s all Magic! There’re very few lines of code to do it, because all the magic is made by atan2.
Atan2 is a variation of the arctangent function. For any real arguments x and y not both equal to zero, atan2(y, x) is the angle in radians between the positive x-axis of a plane and the point given by the coordinates (x, y) on it.
JSON, short for JavaScript Object Notation, is a lightweight computer data interchange format. It is a text-based, human-readable format for representing simple data structures and associative arrays (called objects).
One way to use JSON with Qt4 is using the QScriptEngine (engine.Evaluate(jsonSource)), But I like Reinventing the wheel, so I’ve written a simple JSON Stream Reader that works “almost” like the QXmlStreamReader.
You’ve a readNext() method that read the next token and returns its type, and two properties name() and values() that Returns the name of the Property, Object or Array and the Value of the Property in a QVariant that can be Bool, Int, Double or String.
Below there’s an Example of How to use the JSON Stream Reader. Maybe you can use it to create an automatic Object Mapper like the Xml Object Mapper that I’ve posted a couple of weeks ago.
Today, I’m looking at Google services, Contacts, Maps, Search… to use all this service in your app you need to get The Authentication Token (see the Google Auth For Installed Apps page). So, I’ve implemented a simple class to do this.