kvasir top 50 search keywords at 10am

July 26th, 2007

Kvasir is a big norwegian searchengine.

On their top 50 keywords list, i found these keywords at 10 am.

kvasir top 50 search keywords at 10am

Read the rest of this entry »

Simple use of cookies with php

July 26th, 2007

With php you can set a “cookie” in a users session, which stores a small amount of data on the users computer.

Cookies can be useful to check if the user recently logged in to your webpage,
recently visited your webpage, or such.

With the use of cookies are pretty simple…

Heres how you create the cookie:

  1. <php
  2. setcookie( "user", $_SERVER[‘REMOTE_ADDR’], time()+3600 );
  3. ?>

Read the rest of this entry »

Princess Juliana airport at St Maarten

July 20th, 2007

This is the famous airport which the airplanes come in for landing straight above the beach!

You can see of the image how close the planes are to the beachstrip Maho beach.

There are lots of videos of this to be found at youtube.
Like this one: Read the rest of this entry »

Some art i made in 3ds max

July 20th, 2007

Just a small post to show you some simple small art I made in 3ds studio max.

3ds studio max is a great program for creating stuff in 2d and 3d. modelling,

creating animated movie clips and so on, amazing software from autodesk.

A kind of prison cell, with some chrome balls in the sunshine :p

Cellen Read the rest of this entry »

How to create and store a thumbnail in php

July 19th, 2007

Here I will show you guys how to create a thumbnail from a larger image file ( .jpg file)

You create a new .php file, and enter this function:

  1. <?php
  2.  
  3. function thumbnail($file, $size, $save_as) {
  4.  list($width, $height) = getimagesize($file) ;
  5.  $modwidth = $width * $size;
  6.  $modheight = $height * $size;
  7.  $tn = imagecreatetruecolor($modwidth, $modheight) ;
  8.  $image = imagecreatefromjpeg($file) ;
  9.  imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ;
  10.  imagejpeg($tn, $save_as, 100) ;
  11.  }
  12.  
  13. ?>

then you can call the function like this:

  1. <?php
  2.  
  3. thumbnail(‘original_image.jpg’, ‘0.60′, ‘new_image.jpg’);
  4.  
  5. ?>

The last part calls the function, and tells it to create a thumbnail from the “original_image.jpg”, with 0.6 the size of the original, and store the new image as “new_image.jpg” in the same folder as the script.

Some of the code in the function is explained in this post.

Simple :)

Simple php visitor counter

July 18th, 2007

This shows a simple way to log number of visitors to your site, there is no need of any database, it uses flat files (plain textfiles) only.

Create an empty file named stats.txt.

Create a php file, call it counter.php or something, and put it in the same directory as the stats.txt file.

Open it in notepad and enter this php code

  1. <?php
  2. $counter_file = ("stats.txt");
  3. $visits = file($counter_file);
  4. $visits[0]++;
  5. $fp = fopen($counter_file , "w");
  6. fputs($fp , "$visits[0]");
  7. fclose($fp);
  8. echo "Visitors: $visits[0]";
  9. ?>

What the code does:

  1. Define the textfile with stats
  2. Read the stats from the file
  3. increase the stats with 1
  4. open the stats file in writing mode
  5. write to the file
  6. close the file
  7. and finally, print out the content

How to disable the “send error report” message

July 17th, 2007

 A big annoying feature in windows xp is the “send error report” message you get everytime a program crashes.

Here I show you how to turn off the message…

Open up the control panel, click on “system” or click on “performance and maintenance” you you use the new control panel style.

In the system settings, click on the advanced tab, click on the
error reporting button on the bottom.

Select ”disable error reporting” and you’re rid of it!…

Video and picture top sites

July 17th, 2007

Here I will collect a list of the best and biggest video and picture sites, It will be updated frequently with more links.

The list: 

If you have any other good sites, just post’em and i will add them to the list

How to create a shutdown shortcut for your desktop

July 17th, 2007

Have you ever wanted an icon on your desktop that you could use to shutdown you computer with?

It’s pretty simple, you just right click your desktop, choose New -> Shortcut and at the ”File location” screen you just type in the following command

%windir%\System32\Shutdown.exe -s -t 00

That is for running the shutdown application with the parameters “-s” for “this computer” and “-t 00″ for the time in seconds, which would be right away…

You could also use these commands: Read the rest of this entry »

Simple VisualBasic script

July 17th, 2007

This is a simple demonstration of input, output and a small calculation done in VisualBasic.

The script asks the user to input a number of days, and the script
outputs how many seconds those days are.

The code is simple, open up notepad, or your text editor, and enter this:

  1. Dim Input
  2. Input = InputBox("Enter a number of days")
  3. sek = (input * 84600)
  4. msgbox (input & " days,  are " & sek & " seconds")

Read the rest of this entry »

Partypoker

July 17th, 2007

Partypoker is an online client for card games (perhaps worlds biggest), it’s free and you can start playing in some simple steps.

  1. Download the client from their site (6 mb)
  2. Install the client
  3. When you run the client, you may log in or create a new user. Then you can play.
    Creating a new user is simple, and it says you need an email address, but they don’t email you anything, so you can register even if you don’t want to give them you email account information.

When you sign up a new account, you are given 10 000 “playchips” which is the games free currency. Read the rest of this entry »

Simple use of CAPTHCA on your website with php

July 16th, 2007

 First, what is CAPTCHA?

Captcha is a “Completely Automated Public Turing test to tell Computers and Humans Apart”.

In these days, Im sure you have already seen one or many versions of captcha on the internet. In forms for registering, uploading, searching or posting comments.

Captcha is used to prevent robots spamming your website with ads or such,
and to stop ”mass registering” on websites, by non-human users.

There are different methods to tell if the user is human or a bot. Read the rest of this entry »

9 Reasons not to get Windows Vista

July 15th, 2007

After having tried Vista a couple of days, I just could not handle it anymore, so i had to format and install xp again…

Heres a couple of reasons why I didn’t like it, and why it’s not better than xp.

  1. It costs too much! The much cheaper Windows xp is a far better alternative. For the same amount of cash you pay for a lisence of Vista, you could get a cheap ”low-end” computer.
  2. Theres almost nothing new and special in Vista, except for the resource-using glass theme aero. Heres what Microsoft would say are news and good reasons to get vista.
  3. Read the rest of this entry »

Blacklist IPs from viewing your webpage

July 15th, 2007

This is a simple small piece of code that allows you to ban visitors fro viewing your webpage, if you know their ip adresses…

This can be made much more advanced.

With the use of a database such as Mysq (or in some cases just a textfile),  you can create a management system for adding, editing and deleting blacklisted ips.

  1. <?PHP
  2. $ip = $_SERVER[‘REMOTE_ADDR’];
  3. $ban = array(
  4. "74.89.41.93",
  5. "123.40.1.63",
  6. );
  7.  
  8. if(in_array($ip, $ban)){
  9. die("Sorry, you are banned!");
  10. }
  11. ?>

Read the rest of this entry »

Having fun with webpages

July 15th, 2007

 Found some funny javascripts…

This first one makes you able to edit the webpage you are viewing…
changing text and moving stuff around…

  1. javascript:document.body.contentEditable=‘true’; document.designMode=‘on’; void 0

this second one messes up all the pictures on the site…

  1. javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName("img"); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position=‘absolute’; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval(‘A()’,5); void(0);

How to use: 

Go to the webpage in your browser, in the adress field, replace the url
with the javascript and press enter.
(make sure you get the whole script on one single line)

have fun :)