Posts Tagged ‘source code’

ruby

How to add text to pictures using Ruby

As I have already done with python (in How to add a text to a picture using python) , I'm going to write a simple program which adds a text over an image. This is a preview of How... Read more
ruby

How to resize an image using Ruby

Ruby is a fantastic programming language, it provides a lot of features. It can use the imagemagick to handle and filter pictures. In this short script I'm going to resize a png image and then I'm going to save... Read more
Python-Logo

Automatic resizing of a set of pictures using python

  Last week we've seen how to resize a picture using PIL. This is a preview of Automatic resizing of a set of pictures using python. Read the full post (516 words, 1 image, estimated 2:04 mins reading time) Read more
Python-Logo

How to add a text to a picture using python

Python provides a lot of useful tools and libraries to handle images. If you want to modify an image you can use the PIL (Python Image Library) to apply filters, draw a line, draw a rect, draw an oval,... Read more
resize

Resize an image using python

Python provides a lot of useful tools and libraries to handle images.  If you want to resize an image, for example if you want to create a thumbnail, you can use the following few lines of python code:  ... Read more
c2

Non blocking read over the serial line

When I'm working on embedded systems (running Linux), one of the most common task is waiting for data on the serial line. Sometimes the read must be a blocking read, more often I need to do a non blocking... Read more
email

A simple objective C method to validate email addresses

Emails are a must have, everyone has at least one email address. If you are planning to develop an application you should take care of emails. An email address identifies an email box to which email messages are delivered. The... Read more
library

How to create a shared library using the GCC on Linux

Before starting this task I want to say something about "Shared Libraries Pros & Cons" PROS - They give to you the ability to split your code in conceptually separated sections. Each section will be loaded only if it... Read more
iossdk

is NSDateFormatting returning wrong date? RTFM

Yesterday I experienced a strange behaviour while I was using NSDateFormatter. I had the need to read data from an sqlite database starting from 2012-12-31 ending to today. So I prepared the date to insert into the sql query... Read more
email

How to send an email in html format from a php script

In the article How to send a simple email from a php script we have seen how to send a simple email using a php script. This is a preview of How to send an email in html format from a... Read more
cocos2d_banner

How to take a screenshot in cocos2d

  "Cocos2d is an open source 2D game framework. The original Cocos2D framework is written in Python but has since been ported to other languages and platforms. Most notably cocos2d-iphone written in Objective-C targets iOS and Mac OS X.... Read more
circular_queue

A simple implementation of a circular queue in C language

Also known as circular buffer, the circular queue is a data structure with a First In First Out access policy, it can be used in several different applications, for example: Message passing buffering Multimedia streaming This is a preview... Read more
linkedlist

A simple linked list implementation in C – source code

From the wikipedia: "A linked list is a data structure consisting of a group of nodes which together represent a sequence. Under the simplest form, each node is composed of a datum and a reference (in other words, a... Read more
stack

A simple implementation of a stack – C language

A stack is a last in, first out (LIFO) abstract data type and linear data structure. It  is characterized by two fundamental operations, called push and pop. The push operation adds a new item to the top of the... Read more
email

How to use PEAR to send an email from a PHP script using SMTP authentication

In another post I showed how to send an email using the PHP 4/5 builtin function mail(). The mail() function is very simple and you can develop the code to send an email quickly. But if you have to... Read more
standard_deviation

A simple program that computes the standard deviation

From the wikipedia:   Standard deviation is a widely used measure of variability or diversity used in statistics and probability theory. It shows how much variation or "dispersion" there is from the average (mean, or expected value). A low... Read more
optimization

Using tables to optimize your code for speed (C/C++).

Often you can obtain a great improvement of performances simply using tables instead of algorithms. For example, if you need to compute factorials you can use three different approaches, a recursive function (which is the natural solution for the... Read more
crc

A public domain implementation of the CRC function in C

This is a preview of A public domain implementation of the CRC function in C. Read the full post (1190 words, 1 image, estimated 4:46 mins reading time) Read more
email

How to send a simple email from a php script

In a site or a webapp the capability to send an email is a must have. The PHP language is a very complete language and provides a lot of functions to simplify your devloping. Inside the tons of functions... Read more
roulette

How to rotate a UIImageView – ios sdk roulette tutorial

Animating an object using the ios sdk is very simple, but it's very difficult to retrieve an howto on the internet. So here you are a simple example In this simple tutorial I'm going show to you how run... Read more