Wednesday, December 5, 2007

Create a 404 error page

  1. Open a text editor (notepad in Windows) and write the following: ErrorDocument 404 /error-page.html
    Save the file as .htaccess.txt
  2. Create a page which will contain your error message and save it as error-page.html
  3. Upload the 2 files you have created (.htaccess.txt and error-page.html) using an FTP program (like Filezilla) to the main directory of your site.
  4. Rename the file .htaccess.txt to .htaccess

Thats all. You can see an example of 404 error page here.

Friday, November 30, 2007

More buttons

The photo below are in .png format, so you can take it and edit it (you can change the colors,text and the size).


buttons with fireworks

Wednesday, November 28, 2007

Distributed calculator – Socket programing in C

Problem (Description)

Four researchers want to execute a series of calculations for their research. However, their systems have processors which are very fast for only specific calculations. For example, W’s computer executes addition fast but is slower when it comes to multiplications. These are the constraints:
1)W’s computer can only do addition fast
2)X’s computer can only do subtraction fast
3)Y’s computer can only do multiplication fast
4)Z’s computer can only do division fast

Therefore there is a need to create a distributed system that will utilize the optimized hardware in each computer and execute a series of calculations in the shortest possible time.

Each unique calculation takes 1 seconds to execute.

Rules

During the execution a process can only take care of the calculations that it specializes and must obtain help from other processes for other calculations. Simple mathematical rules of priority must be utilized to ensure correctness of calculations.

Solution

You can download the source code from here

And the problem report, where i explain every line of the code here
Part of the report is in Greek language, but you will find it easy to understand my code.

Remember

first, we run our 4 servers (server_add.c, server_sub.c, server_mul.c and server_div.c) :
gcc server_add.c -o add
./add
...
...

and then we run one by one the clients (client1.c, client2.c, client3.c and client4.c)
gcc client1.c -o c1
./c1 localhost calc.txt
...
...

Friday, November 23, 2007

Button with Fireworks

I think video tutorials are much better way to explain your techniques and what are you doing. This is the first one i made. It is a tutorial to make a simple button with Fireworks. Basically, i made this tutorial just to see the effect of the video tutorial. I hope you like it.
I forget to tell you that i will put also the .png file of the button, so do not worry.


Watch the Video Tutorial - Click Here


I have made few buttons with differend colors. The photo below are in .png format, so you can take it and edit it (you can change the colors,text and the size).


Button Fireworks

Friday, November 16, 2007

ROCKY VII

You have to see this video. Very funny.




More funny videos: http://www.nimportequi.com

Sunday, November 11, 2007

Automatically tag any song

Recognize song title and artist software

Does this look familiar to you: You listen to this great song on radio or you favourite online radio station. You love the song and you want to download it (legally of cource :)) or buy the CD, and you are desperate to know the artist and the song title.

What would you do ?

Try to catch some lyrics and then desperately to try to find it throught Google ...

Or

TUNATIC

Ever thought what is this song? Let Tunatic hear it and you will get the artist's name and the song's title within seconds

Tunatic is a great small free easy-to-use program. You can download it here. What it does is to automatically regognize any song from any source! It looks like this:

Tunatic Ready Click To Identify





All you have to do is click the Search button next to "Tunatic ready" and the song title and artist will magically appear :)

Tunatic Identifying song




Tunatic Song Recognized





Clicking on the arrow in the right you can see some links to download your song through iTunes or download a ringtone.

It can be used with microphone or directly with the pc, throught Media Player, or Winamp or whatever.

Cool huh ?

Getting Started With PHP and MySQL in Windows with EasyPHP - Part 2

MySQL Tutorial - Configuring MySQL in EasyPHP for Windows


MySQL Logo

Intro
This is the second part of the tutorial Getting Started With PHP and MySQL in Windows with EasyPHP witch you can find see here. Make sure you see this first.

In this tutorial we will see:
  • Running MySQL server with EasyPHP
  • Configuring MySQL server
  • Adding a user in MySQL
  • Running queries MySQL command line interpreter
Running MySQL server with EasyPHP

Goto Start - Programs - EasyPHP and Click on EasyPHP.exe. This will start the Apache webserver, PHP and MySQL automatically

Configuring MySQL server

This is a step you do only once every installation.
Goto Start - Run - and type "C:\Program Files\EasyPHP1-8\mysql\bin\mysqladmin.exe" -uroot password secret
where secret is you password and click Run
What this command does is set the root (administrator, the guy that can do anything in the system) to have the password "secret" in this case. Make sure you note is somewhere you might need it at a later time.

To test that this is ok, start the Command
interpreter:
goto Start - Run and type


"C:\Program Files\EasyPHP1-8\mysql\bin\mysql.exe" -uroot -psecret
and click Run

You should see something like "Welcome to MySQL monitor. (....)

mysql>

If you see this you are ready. You have successfully configured MySQL server.

Adding a user in MySQL

You have configured the root account, and know you are ready to start experimenting. But using the root account is not the safes way to play with you database. The coolest thing to do is add a user to every MySQL database and use that account so that you don't mess everything up when you make a mistake. The way to do this is:

  • Start the MySQL Command Interpreter with your root account: Start - Run -
    "C:\Program Files\EasyPHP1-8\mysql\bin\mysql.exe" -uroot -psecret
  • Create a database: Just type "create database database_name" where database_name is the name you want. For now we will just name it "people". So you type "create database people"
  • Then you have to create the user and add it to the database. This is done with one command: GRANT ALL PRIVILEGES ON people.* TO 'my_user'@'localhost' IDENTIFIED BY 'my_password' WITH GRANT OPTION; - where my_user you put your user and my_password you password. For this tutorial will be user and pass. So
  • "GRANT ALL PRIVILEGES ON people.* TO 'user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
  • There is no need to explain exactly what this command does and i don't thing that you really care :). In few word that command says to the server "Hey user witch uses password pass can do anything to the people database"
  • To login with this user and password Start - Run -
    "C:\Program Files\EasyPHP1-8\mysql\bin\mysql.exe" -uuser -ppass
This is the "official" end of this tutorial. The goal was to install PHP and MySQL to your Windows Machine, so that you can use all that beautiful tutorials you can find through Google. What's next is some simple SQL commands, only the basics without much details so you can get to the point.

Running queries and SQL commands in MySQL command line interpreter

The official definition of queries is "To interrogate a collection of data such as records in a database". This in simple words means that queries are the questions you give to the server and the response you get. An example of query is: "Give me the names of all people that live in New York and there last name is "Davis"". SQL (not MySQL) is the official language, the way to write this so that the computer understands what you want.

We will see the basics of MySQL in the next tutorial. For now i will give you just an example; Just type in the Command Line Interpreter:

use people
- This selects the database witch you are about to work with. in this case people database witch we just have created

CREATE TABLE example (
id INT,
name VARCHAR(100),
address VARCHAR(100)
);

MySQL Create Table Example

- This creates a table witch has an integer id, a name and an address. Varchar basically means text. More on that in next Tutorials.

Now Type:

SELECT * FROM example;

MySQL Select Example

- This command tell the MySQL serve to give you a list with all the entries in the example table. Since there aren't any entries you get:
"Empty Set" Respones. You can imaging what that is

Ok lets put some entries in there. The command for this is:

INSERT INTO example VALUES ('1', 'Nikos', 'New York');
INSERT INTO example VALUES ('2', 'Elias', 'Paris');
INSERT INTO example VALUES ('3', 'James', 'New York');

now run that Select command again:

SELECT * FROM example;

MySQL Select * Example

SELECT * FROM example WHERE address like "%New York%";


MySQL - People From New York

Saturday, November 10, 2007

Manage multiple fonts with "FontFrenzy"

FontFrenzy is probably one of the best font application i have ever try. It gives you the ability to install/uninstall/view your fonts with simple steps. The most important thing: it is free, you need only to make a registration which can be done in 5 minutes.

One importand thing is that FontFrenzy does not consume too much memory like other programs. Remember that when viewing fonts with FontFrenzy it does not install them to the font folder of windows (if that was happened it would slow your system - we all know that windows can not handle a lot of fonts).

You can install FontFrenzy from here: Download

FontFrenzy features:


  • DeFrenzy - Removes all fonts except those originally shipped with Windows XP, or to a previous snapshot. You can specify a folder where all removed fonts will be stored.

  • FrenzySnap - Takes a snapshot of your currently installed fonts, allowing you to later ReFrenzy back to that font configuration.

  • ReFrenzy - Guides you through installing new fonts quickly and easily, from a previous snapshot.

  • FrenzyMan - A font management tool that allows you to easily install, remove, and store your fonts.

  • FrenzyInfo - Help file and information on how to receive a free book.

A screen shot of FontFrenzy:


FontFrenzy

Friday, November 9, 2007

SearchStaus: a cool tool that let you see the rankings of your site.

SearchStatus is a toolbar extension for Firefox and Mozilla that allows you to see how any and every website in the world is performing. Designed for the highly specialised needs of search engine marketers, this toolbar provides extensive search-related information about a site, all conveniently displayed in one discreet and compact toolbar.

For every site you visit using, SearchStatus lets you view its Google PageRank, Google Category, Alexa popularity ranking, Compete.com ranking, Alexa incoming links, Alexa related links and backward links from Google, Yahoo! and MSN. This combined search-related information means you can view not only the link importance of a site (according to Google), but also its traffic importance (according to Alexa), so providing a balanced view of site efficacy.




Source: quirk.biz/searchstatus

Why my form has a space at the bottom on Internet Explorer

I was trying to solve this problem for a long time, i thought it was my mistake. But i find that this problem is appear because of the "margin" of the form and how Internet Explorer realize it.

The only thing you have to do is to add on your styles this code:

form{

margin:0px;

}

In Mozilla Firefox there is not any problem.

Thursday, November 8, 2007

Getting Started With PHP and MySQL in Windows with EasyPHP

Intro

I'm sure you have all heart one time or another about this cool stuff called "PHP" and MySQL, and some of you have probably heart that you need Linux to use this stuff.
Well that's not true. Of course, Linux is the best operating system for hosting a website, but Linux is not ideal way for a newbie to learn PHP.
All you need for your first steps in PHP and MySQL is a cool program called EasyPHP (Free here). Basically this is a collection of programs.
More Specific,


  • Apache the web server, the program that is responsible for viewing you sites and working together with PHP.
  • PHP Module For Apache
  • MySQL Database Server

Installation
All you have to do is download install and run the program. I recommend using the default Directory C:\Program Files\EasyPHP1-8 so that you will follow the tutorials easily.
After installation completes goto Start - Programs - EasyPHP - EasyPHP.exe
You should see an icon in your taskbar, double click on it. you should see something like this:

This is a question, if you want to update the program. Just click OK.

Then double click on the "e" on the taskbar. You should see this window:
If the little dots beside the Apache Button and MySQL button are Green, that means that you are ok, and ready to go!


Your First PHP Program


To test this open your favourite browser (Or Internet Explorer :p) and write 127.0.0.1

You should see something like this:
You are ready to start PHP Programming. the location for the files is C:\Program Files\EasyPHP1-8\www or something like this (where you have installed EasyPHP)
Go in that folder. you should see a file "index.php". Open it. You can use notepad, WordPad or any editor you want. I use Notepad++ and PHP Expert Editor. Whatever makes you feel better.
When you open the file, you see a mixture of HTML and PHP.
All PHP code is in the php tags. That is <?php and ?>
For example, a hello world program:

<?php
echo "Hello World !!!";
?>

Create a new file, for example index2.php and write the code above and save it. Then open with your browser http://127.0.0.1/index2.php
You should see this:









To check some PHP functions and view some interesting information about you system, write this into file under hello world example:

<?php phpinfo( ); ?>

You should see this:









That's all for now. The next example will be an introduction of the MySQL basics and a simple MySQL example.

Playing with Fireworks"Hue / Saturation"

Select an image.

Filters ->Adjust color -> Hue / Saturation

Original Photo




























Hue: 11
Saturation: 34
Lightness: 0







Hue: -180
Saturation: -100
Lightness: 0







Hue: -120
Saturation: 100
Lightness: -15







Hue: 1
Saturation: 73
Lightness: 0



Photo Frame Effects in Fireworks

Create a new document 300x284 px

We will create cool photo borders using the filter "Alien Skin Splat LE". This filter give a lot of choices. There are many edge modes. Below you can see there effect to the image.

Filters -> Alien Skin Splat LE -> Edges The Alien Skin window will be displayed. Select a mode edge. Play around with the other settings and view the result. I have used the default settings.

The option Transparent Fill makes the background of the image transparent.


Dot Edged Frame





















Line Edged Frame





















Pixels Frame






















Lumpy Edged Frame





















Rough Edged Frame






















Torn Paper Frame


Wednesday, November 7, 2007

Fireworks color replace tool

How can you change color in a photo? You can use Fireworks color replace tool.

original photo:


























Using color replace tool:


















Settings:





Final result:


























Result with color #00FFFF:

Make web 2.0 logos with Fireworks

Open Macromedia Fireworks.

Creat a new document 421x150.

Write your text. I use "Break Design logo. The font i use is "trebuchet ms", font size 50px, bold style and colour "#99CC00"

The first photo:












After i use the following styles: color -> fill options -> Texture: Line-Diag 1 50% -> Gradient: Linear (you can play how much fading is the color). The result is:











Then, i make a copy of the logo and i flip it vertical (Modify -> Transform -> Flip vertical)












Then i make a rectangle box (same size as the logo). I modify it like this -> color: white -> Blend mode: Erase -> Edge: Feather 25%. Then the box i place it on top of the vertically flip logo.











Thats is. I play with other colors. Have a look.

Color: #333333










Color: #FF6600











The .png file: