Fun

My favorite TED talk

Watch all of it ;)

Archived under Fun, General, Space, Technology Comments

Decorating Python’s sys.stdout

Try this:

class stdoutflip:
 
    def __init__(self, sys):
        self.stdout = sys.stdout
        sys.stdout = self
 
    def write(self, txt):
        txt = list(txt)
        txt.reverse()
        self.stdout.write(''.join(txt))
 
 
class stdoutupper:
 
    def __init__(self, sys):
        self.stdout = sys.stdout
        sys.stdout = self
 
    def write(self, txt):
        self.stdout.write(txt.upper())

To test it do this:

out = stdoutupper(stdoutflip(sys))

Now try printing stuff:

print "Hello Python!"

:)

Archived under Fun, Programming, Python Comments

Computers of the future

They are going to be just a monitor, a touch screen monitor, there will be a keyboard on the screen if you want to type anything, there will be no keyboard, mouse or touch pad.
Probably in the next 5 years they will be everywhere, you might not be able to buy one of these either :)

Archived under Fun, General, Operating Systems Comments

Happy Halloween

Happy Halloween, I still have to go get some treats :) I have so much work too but I decided to work on Saturday too, it’s great to be a freelancer!

Archived under Fun, General Comments

A PHP Competition

OK, here is the competition:

Write the shortest piece of PHP code to convert:
Lorem_ipsum_dolor_sit amet,_consectetur_adipisicing_elit

Into this:
Lorem_Ipsum_Dolor_Sit amet,_Consectetur_Adipisicing_Elit

There is no prize other than I will write a post about you :)
Leave a comment.

Update:
Chris wrote a perfectly working line of code for the first string I posted, but you will have to write one that will still work if there is a space in one of the words. I fixed the example.

Archived under Fun, PHP, Programming Comments (9)

Comparing Programming Languages

I just found this great tool and I thought I’d share it, it compares performance and memory usage in any two programming languages, it has a good list of languages too.

For example, this is the comparison between PHP and C:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=gcc&lang2=php

PHP vs Python:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=python&lang2=php

Python vs Ruby:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=python&lang2=ruby

C vs Java:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=gcc&lang2=java

And finally C vs C++:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=gcc&lang2=gpp

Archived under C Programming, Fun, General, Programming Comments (2)

How Small Are We???

We humans, with all our egos, arrogance, ideas and hopes; are this small:

Archived under Fun, General Comments

Bill Gates in Doom

I know many of you probably know about this but here is the video for those who don’t:

http://en.wikipedia.org/wiki/Doom_(video_game)#Release_and_later_history

Archived under Fun, General, Hobbies Comments

Frog leap test, see if you can do it

http://funstufftosee.com/frogleaptest.html

It can be done:

:)

Archived under Fun Comments (4)

Cutest picture of Nou, my daughter

Archived under Fun, General Comments (2)

Secret Places on Google Earth

If you haven’t seen Google Earth yet, go ahead and download and install it here:
http://earth.google.com/

After you are done, put these coordinates in the search box (on top left):

1-
50° 0′38.20″N 110° 6′48.32″W

This one is really cool but it looks like it’s random.

2-
19°56′58.08″S 69°38′2.25″W
(Zoom in a little bit)

Now, this one is not random, it was made by someone, some say Mayans but remember, they couldn’t fly so I think making something like this that only someone in the air can see would be their last thought… Correct me if I’m wrong, I can’t find anything about this on the internet.
Honestly, it looks like an alien to me :)

3-
45° 7′25.87″N 123° 6′48.97″W
(Zoom in a little bit)

:) The Firefox logo!

4-
38°31′43.91″N 76°34′0.80″W
(Zoom back and forth a little)

5-
31°39′40.82″N 106°35′26.02″W

6-
37°33′49.94″N 116°51′3.91″W

7-
45°42′12.73″N 21°18′7.53″E

Archived under Fun, General Comments

Pandora, a radio that plays what you like all day, everyday!

It’s only available inside US.

Go to: http://www.pandora.com/ 

Create an account and then click on “Create a new station” then enter a name of a song or an artist that you like and Pandora will start playing similar songs!

You can also give songs thumbs up and thumbs down which will help Pandora fine tune your station more to match your taste.

It will probably be all you listen to everyday and also helps you find new music!

Enjoy :)

Archived under Fun Comments