Python: [socket] A simple TCP client

This article will show how to connect to a remove TCP server using python's socket module.

In this tutorial, we are going to connect to a server, send some data and then read from the socket.

Python: Embedding a Virtual Terminal in a GTK widget with python vte library

python-vte bindings allow you to embed a simplistic virtual terminal in any of your GTK apps real easy.
This tutorial will show how you can add a terminal to a widget in less than 30 lines, 4 lines only being necessary to set a the terminal session.

How To trim a string in perl

trimming a string from whitespaces does not come out of the box in perl. Like for many other operations, we need to use regexes.

This tutorial will show how to trim, ltrim and rtrim a string in Perl.

How-To: Serializing variables in perl

Serialization is used to store data and objects into a file for instance. The serie of bytes that is generated can then be re-used to generate an object that will be identical (a clone) to the stored object.

In Perl this can be achieved through the Storable module.

This tutorial will quickly show how to store and retrieve such objects.

Perl: Calculate the md5 sum of a file

This code sample shows how one could compute the md5sum of a file using Perl's Digest::MD5 module.

Perl: checking if a value is a float

While some languages offer an is_float function, Perl seems to only rely on regex.
This tutorial will show how to find if a variable contains an integer or not.

Perl: checking if a value is an integer

While some languages offer a isint function, I could not find it in perl.
This tutorial will show how to find if a variable contains an integer or not.

Python: Conditional expression or C ternary select

Conditional expressions in python does not have the same syntax than in C.
Python uses the and and or statements instead of the a ? b : c .

This code sample shows how to get the same result in python.

Perl: Finding the last word of a string

This code sample will show how to find the last word in a string. A word being composed of letters and numbers only.

Perl: Looping through an array

How to go through each elements of an array.

Syndicate content