Arturito.net

C++ Press any key to continue

Posted by: arturito on: April 21, 2009

When I write some console application in Bloodshed Dev C++ or Visual Studio, I hate bringing up comand line and typing in the whole path to the program I’ve just written. I found two short ways of having “Press any key to continue…” before the console window disappears. One of them is a good one and the other is bad.

1. Good one

int main()

{

// do something

cout<<”Press Enter to continue…”;
cin.get();
}

Well, this one really is “Press Enter to continue…”, which shouldn’t be a problem :-)

2. Bad one

int main()

{

// do something

system.(“PAUSE”);
}

This one is very bad! If you want to know why, read this article:

http://www.gidnetwork.com/b-61.html

Wikipedia says FBI is Gay Deuch Bag of the year

Posted by: arturito on: April 4, 2009

03.04.2009 :-)

untitled-2

C++ Delay Function

Posted by: arturito on: March 24, 2009

#include <ctime>

void delay(int n)
{
clock_t start_time, cur_time; start_time = clock();    while((clock() – start_time) < n * CLOCKS_PER_SEC)
{}
}

int main()
{
// do something
delay(5);
// delays 5 seconds
}

Too much Ubuntu

Posted by: arturito on: February 26, 2009

sandwichLOL!

C++ Integer to String conversion

Posted by: arturito on: February 24, 2009

I wrote this little function which converts integer type variable to string. Always very handy!

#include <sstream>

string toString(int n)
{
string str;
stringstream out;
out<
return str = out.str();
}

box_logo

You Tube Street Fighter

Posted by: arturito on: January 22, 2009

!What an original idea! Play Street Fighter on You Tube!

http://uk.youtube.com/watch?v=LPQ1XrllZmA

The best firewall you can ever have!

Posted by: arturito on: January 22, 2009

Best Firewall you can ever have!

Famous Computer Quotes

Posted by: arturito on: December 7, 2008

“There is no reason anyone would want a computer in their home.”
- Ken Olson, president, chairman and founder of Digital Equipment Corp., 1977

“This ‘telephone’ has too many shortcomings to be seriously considered as a means of communication. The device is inherently of no value to us.”
- Western Union internal memo, 1876.

“So we went to Atari and said, ‘Hey, we’ve got this amazing thing, even built with some of your parts, and what do you think about funding us? Or we’ ll give it to you. We just want to do it. Pay our salary, we’ll come work for you.’ And they said, ‘No.’ So then we went to Hewlett-Packard, and they said, ‘Hey, we don’t need you. You haven’t got through college yet.’”
- Apple Computer Inc. founder Steve Jobs on attempts to get Atari and HP interested in his and Steve Wozniak’s personal computer.

“Computers in the future may weigh no more than 1.5 tons.”
- Popular Mechanics, 1949

“I think there is a world market for maybe five computers.”
- Thomas Watson, chairman of IBM, 1943

“640K ought to be enough for anybody.”
- Bill Gates, 1981

“Computers are magnificent tools for the realization of our dreams, but no machine can replace the human spark of spirit, compassion, love, and understanding.”
-Louis Gerstner

“But what … is it good for?”
- Engineer at the Advanced Computing Systems Division of IBM, 1968,
commenting on the  microchip.

and my favorite:

“Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live.”
- Martin Golding

Time in Italian

Posted by: arturito on: November 18, 2008

Oblong’s g-speak: the ‘Minority Report’ OS!

Posted by: arturito on: November 18, 2008

Remember the film Miniority Report and the cool computer that Tom Cruise was operating by moving his hands in the air? Well, they made one. Check this out: