6 bước để cưa bạn Thu

January 14th, 2010 Fu4ny 2 comments
Thợ Cưa

Thợ Cưa

  1. Liệt kê danh sách các hoạt động của bạn ý từ năm nhất
  2. Hỏi các bạn trong lớp hoặc trong nhóm ( tốt nhất là có tay trong ) và xin 1 cái ảnh
  3. Cọ cọ cái ảnh xuống đất ( cho cũ =)) ),  sau đó tìm gặp.
  4. "A em có phải là cái em blah...blah...."
  5. ....
  6. Please Login or Register to read the rest of this content.

Hình ảnh chỉ mang tính minh họa :">

Categories: Post Tags:

Python factorial handbook

January 10th, 2010 Fu4ny No comments

Here is a small code-snippet I found and collected.

It takes extract 1 argument and return its factiorial ( n! )

Read more...

Categories: Post Tags: ,

Things you should do when you have 10.000.000$

December 26th, 2009 Fu4ny 2 comments
  1. Buy Google's stock. Currently at 618.48$
  2. Watch it grow
  3. Profit!

Easy meh!

Arrg btw Google met their resistence,  their currently resistence might be around 750-800$, so buy it fast =)

Categories: Post Tags: ,

Reading number from file in Python

December 10th, 2009 Fu4ny No comments

Err, that was  a long time since my last tutorial. I'm learning Python now, and I decided to write some tutorials for it.

As you know, there's a simple concept about Python: "You have plenty of way to do things". This is, sometime, a advantages, but sometimes it's hard to decide the way you do "your things".

Today, I'll show you some ways to read number from file input, The good, the bad, and the ugly

The good, tradition, easy:

1
2
3
4
5
6
fin = open("input.txt","r")
for line in fin.readlines():
   #unpack with line.split()
   p = line.split()
   #Get your variable
   n = int(p[0])

Why it's good: it's easy to understand, easy to maintain, easy to write (but slow as hell ).

It's just do the job: read line one by one, split and pack number in to a tuple

The bad, tradition, and still works

1
2
3
4
5
fin = open("input.txt","r")
t = fin.read()
inputTuple = t.split()
for i in inputTuple:
    print i

Thingy: it's just read all the file, split and store all the number into a tuple, whenever you want them or not. It's just eating you RAM, *yum yum*

The ugly, if you want one-liner

1
[i for x in [x.split() for x in open('input.txt')] for i in x]

It's just very good, do all the thing in "The bad" ways, but with only one-line. Do it if you don't want anyone to understand your code.

The IDK, if you just want to read 1 number

1
2
3
4
fin = open("input.txt",'r')
n = ''
while ( n[-1] != ' ' ): n += fin.read(1)
n = int(n[:-1])

Another, just works, easy to understand code.

Is there any other ways that you know ;)

Categories: Post Tags: , ,

Và, bạn đã yêu…

November 20th, 2009 Fu4ny 1 comment

Khi người ấy đang ở bên cạnh, bạn giả vờ thờ ơ để rồi khi người ấy vắng mặt, bạn lại bắt đầu liếc tìm.

Lúc đó, hình như bạn đã yêu...

Mặc dù xung quanh có nhiều người trò chuyện với bạn nhưng ánh mắt, suy nghĩ và sựchú ý của bạn chỉ hướng về một hướng.

Lúc đó, hình như bạn đã yêu...

Bạn luôn thích thú với vài dòng tin nhắn ngắn ngủn từ người ấy mà lờ đi những lá thư thật dài của nhiều người khác.

Lúc đó, hình như bạn đã yêu...

Khi có một cặp vé đi xem phim, người đầu tiên bạn nghĩ đến là...

Lúc đó, hình như bạn đã yêu...

Bạn luôn tự nhủ rằng "chúng ta chỉ là bạn thôi" nhưng bạn nhận ra mình không tránh khỏi sự rung động trái tim trước sự thu hút của người ấy.

Lúc đó, hình như bạn đã yêu...

Khi đọc những dòng chữ này, bạn nghĩ ngay đến một người...

Và, bạn đã yêu...

I do ;)

Categories: Post Tags:

Friends

October 30th, 2009 Fu4ny 2 comments

12

I got your back. You got mine
I'll help you out. Anytime!
To see you hurt, to see you cry.
Makes me weep, and wanna die.
And if you agree to never fight.
It wouldn't matter, whos wrong or right.
If a broken heart, needs a mend.
I'll be right there, till the end.
If your cheeks are wet, from drops of tears,
Don't worry, let go of your fears.
Hand in hand, love is sent,
We'll be besties...Till the end!!!!

LoveBesties

I love my Friends :x

Categories: Post Tags: ,

Fu4ny@2009-10-11

October 11th, 2009 Fu4ny No comments
  • Ra sân bay Cam Ranh về Hà Nội nào! #
  • Bế mạc, liên hoan, nhạc sống....nhức đầu quá #
  • Thi xong rồi, ta có quyền được buồn chứ nhỉ! #
  • at Cam Ranh airport, cac em tiep vien cha xinh gi ca, gia qua >"< #
Categories: Asides Tags: ,

Fu4ny@2009-10-04

October 4th, 2009 Fu4ny No comments
  • I'm serious! #
  • Everything is OK, I'm used to it! Cục đá là ko có thật! #
Categories: Asides Tags: ,

Linux, GNU and Linux

October 3rd, 2009 Fu4ny No comments

Linux often used to define GNU/Linux. When people mention about "Linux", they were talking about "GNU/Linux" most of the time.

But, Linux ( I mean the kernel ) isn't GNU. It doesn't require any GNU tools such as GCC to be built.

The problem is,  Linux itself is a GNU covered, it released under GNU/GPL, and it should be a GNU software.

So yeah~ GNU/Linux ( that often used as the distro ) is GNU, but Linux itself isn't GNU, it's GNU software. Quite complicated! heh~

Categories: Post Tags: , ,

Fu4ny@2009-09-27

September 27th, 2009 Fu4ny No comments
  • Mọi thứ đều....ko có thực. Theo đuổi những thứ không có thực. Kết thúc sớm đi cho nó có hậu...bay thôi! Sắp đi Nha Trang ^^ #
  • Cánh hoa rơi...hương thầm còn vương đâu đây...! Đâu phải tình yêu nào cũng đẹp... #
  • Cảm giác như sắp sụp đổ, mệt mỏi quá....ko có ai quan tâm đến ta hết.... #
  • Though we may part, our memories of these past, will always remain with us...warm in our hearts... #
  • You don't love because you're loved...You want to be loved because you love ! #
  • I don't wanna run away but I can't take it, I don't understand...I don't know why you're so far away #
  • That's the most thing I want to cherish :(. Everything gonna be all right.... #
  • Mưa, đứng nhìn dòng người đang chảy ngoài đường...đâu là chỗ cho ta... #
Categories: Asides Tags: ,