Skip to content

Tag: programação

Image convertion to GrayScale/Binary/R/G/B

Hello,

This is a small exercice of Multimedia class (INE5431). We need to implement:

1) Transform the image to GrayScale
2) Generate one image to each component color (R/G/B)
3) Transform the GrayScale image to binary

To transform RGB to GrayScale we need to use this expression:

Y = 0.3R + 0.59G + 0.11B;

And them, to convert the GrayScale to Binary

if (Y > 127) {b = 1; } else { b = 0; }

If we want just one color component, we need to get all image pixels and leave just the component that we want, or just copy the component to a new image.

In this project, we access an image and we have some functions to do what we want, convertion to GrayScale, Binary, and Component RGB. From the source image, we create a buffer image of the same size to all images and we create a for to go over all pixels and make the transformation and put it to the new buffer image.

Continue reading Image convertion to GrayScale/Binary/R/G/B

URL Shortener using Auto-Increment field.

Good Night,

This is a new version of URL-Shortener that don't create random IDs to websites, it uses the auto-increment field and replace it to other base.

Continue reading URL Shortener using Auto-Increment field.

Quick Flickr Widget 1.2.10.2, WordPress

Hello, The author of Quick-Flickr-Widget the Konstantin Kovshenin just launched a new version. So I decided to re-update his plugin with my modifications to get…

Continue reading Quick Flickr Widget 1.2.10.2, WordPress

Chart to your URL Shortener with Statistics.

Hello I decided to implement a Chart vision of the access to a address of the last 30 days. THe system that I choosed is…

Continue reading Chart to your URL Shortener with Statistics.

Statistics on your URL Shortener.

Hello A few weeks ago I showed you how to create your own URL-Shortener. I decide to improve it, creating a simple system to control…

Continue reading Statistics on your URL Shortener.

Creating your own Url shortener.

Good Night,

Here I will show you how to create your own url shortener.

First of all you need to create a table like this:

CREATE TABLE IF NOT EXISTS `urls` (
`uid` int(11) NOT NULL auto_increment,
`url` text default NULL,
`unique_chars` varchar(25) BINARY NOT NULL,
PRIMARY KEY (`uid`),
UNIQUE KEY `unique_chars` (`unique_chars`)
);

This code was taken from Abhise in this post "Create your own tinyurl with php and mySQL" that was my bigest reference, from it I took some functions and update other ones to be more efficient. For an example I changed the field to BINARY so it be CASE SENSITIVE (aaaa different from AAAA)

The Abhise says to create many files, I particularly, created one file with all functions where I add all the functions and just called the functions in the files.

Continue reading Creating your own Url shortener.

Quick Flickr Widget, WordPress.

Hello, I found this interesting plugin for wordpress Quick-flickr-widget. A widget to show pics from Flickr in your blog. You can configure it in many…

Continue reading Quick Flickr Widget, WordPress.

Linked List, Data Structure

Hello,

What is a Linked List? Linked-list is a list that each element has a pointer to the next one.

The professor once again send us an enunciation to solve and it is too big. And I will not translate it. Inside the problem it have a Linked list.

Problem using linked-list..

Regards,
Matheus

PS: You can see the enunciation in portuguese and then use google translate to translate it

Continue reading Linked List, Data Structure

List, with pointers, Data Structure

Hello,

Today I will introduce you to a list using pointers. This list doesn't have limit of elements (if you have infinite memory). Again the enunciation is too big, so take the file, read it and learn.

Stack with pointers implementation

Regards,
Matheus

PS: You can see the enunciation in portuguese and then use google translate to translate it
Continue reading List, with pointers, Data Structure

Netbeans 6.5.1, Line-spacing

Hello, I was using NetBeans in Ubuntu 9.04 when i started a new project and I realized that the line-spacing is so fucking bigger. To…

Continue reading Netbeans 6.5.1, Line-spacing