You Are Here Home > Fun

Fun

My favorite TED talk

Watch all of it ;)

My favorite TED talk
Comments (0)   Filed under: Fun,General,Space,Technology   Posted by: Codehead

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!"

:)

Decorating Python’s sys.stdout
Comments (0)   Filed under: Fun,Programming,Python   Posted by: Codehead

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 :)

Computers of the future
Comments (0)   Filed under: Fun,General,Operating Systems   Posted by: Codehead

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!

Happy Halloween
Comments (0)   Filed under: Fun,General   Posted by: Codehead

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.

A PHP Competition
Comments (13)   Filed under: Fun,PHP,Programming   Posted by: Codehead

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

Comparing Programming Languages
Comments (2)   Filed under: C Programming,Fun,General,Programming   Posted by: Codehead

How Small Are We???

How Small Are We???
Comments (0)   Filed under: Fun,General   Posted by: Codehead

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

Bill Gates in Doom
Comments (0)   Filed under: Fun,General,Hobbies   Posted by: Codehead

Frog leap test, see if you can do it

http://funstufftosee.com/frogleaptest.html

It can be done:


:)

Frog leap test, see if you can do it
Comments (10)   Filed under: Fun   Posted by: Codehead

Cutest picture of Nou, my daughter

Cutest picture of Nou, my daughter
Comments (2)   Filed under: Fun,General   Posted by: Codehead
« Newer PostsOlder Posts »