I’m using Gravity to tweet.

July 6th, 2009 Fu4ny No comments

I'm using Gravity to tweet.

Categories: Asides Tags: ,

New Friends

July 5th, 2009 Fu4ny 1 comment
New Friends

New Friends

Categories: Post Tags:

Google Update Changes

July 4th, 2009 Fu4ny No comments
Google

Google

The Google Update process was the bane for many Internet users as it seemed to come up again even if it was disabled on the computer system. The process googleupdate.exe was running all the time on the computer system trying to connect to Google to see if there were any updates for Google software available. It could even happen that the updating process was still running if no Google software programs were installed on the computer system.

It also did feel strange that Google needed a process to update their programs while other companies like Mozilla did not. Especially if the only software by Google was their web browser Google Chrome.

Google has announced changes yesterday that will please many computer users. They basically changed Google Update from running in the background permanently to a process that would check for updates periodically which basically eliminates the googleupdate.exe process in the background as it will terminate after the check for updates.

Googles Cron Tasks

Google's Cron Tasks

Users can check the Task Scheduler in the Windows Control Panel to change the frequency of the update checks. The Google team points out that the process might be running continuously on some computer systems if problems are encountered with the task scheduler and Windows Services.

via Google Update Changes.

Categories: Post Tags:

The secret of my birthday :>

July 3rd, 2009 Fu4ny 2 comments

This is the results :

You were born on 8th of March.

:: Cheerful.
:: Creative, social, friendly, romantic and easy going.
:: Like to begin something but not eager to finish it.
:: Like to make others happy; will do anything to achieve it.
:: Popular and Idealistics.
:: Need to learn looking things in realistic manner.

Categories: Post Tags: ,

Fu4ny@30/06

June 30th, 2009 Fu4ny 3 comments

Các bạn bảo khi đi xe bus mà vô tình ( cố ý ) ngủ dựa đầu vào vai 1 bạn gái ( xinh ) thì có phải là biểu hiện của dê ko :-ss.

Categories: Post Tags: ,

Singleton class, nó là gì ?

June 18th, 2009 Fu4ny No comments

Bạn đã nghe thấy thuật ngữ Singleton class ? Đó là 1 class mà trong toàn bộ chương trình chúng ta chỉ có thể tạo 1 "instance" ( thực thể ) duy nhất của nó.

Với bài viết này, tôi mong các bạn có 1 cái nhìn tổng quan về Singleton class, và cách cài đặt nó trong Java và C++.

Đầu tiên là về ý tưởng.

Đối với Singleton class, thì chương trình chỉ được phép tạo 1 instance duy nhất của nó, vì vậy

  1. Constructor của class là private
  2. Class phải có reference ( tham chiếu ) đến cái instance duy nhất đó, tức là chúng ta dùng 1 tham chiếu tới class = 1 biến static
  3. Do ko có constructor public, nên ta cần có 1 phương thức để khởi tạo class.

Đó là các yêu cầu dành cho Java.

Giả sử chúng ta xây dựng 1 class SingleTon trong Java.
Đúng tinh thần phải có 1 tham chiếu đến thực thể duy nhất, ta tạo 1 biến static. Và đương nhiên là 1 constructor thuộc tính private. Trong constructor này bạn cài đặt như bạn muốn.

1
2
3
4
public class SingleTon {
    private static SingleTon _singleRef = new SingleTon();
    private SingleTon() {};
}

Tiếp theo là 1 hàm getInstance để lấy địa chỉ của thực thể của class đó.

1
2
3
4
5
6
7
8
9
10
11
12
13
public class SingleTon {
	private static SingleTon _singleRef = new SingleTon();
	private SingleTon() {};
	public static SingleTon getInstance() {
		if ( _singleRef == null ) {
			_singleRef = new SingleTon();
		}
		return _singleRef;
	}
	public void sayHello () {
		System.out.println("Hello! I'm the one!");
	}
}

Giải thích: nếu tham chiếu chưa chỉ đến vùng nhớ nào, thì ta tạo 1 thực thể mới ( thực ra việc này để đảm bảo rằng instance luôn có ). Nếu nó đã trỏ đến 1 vùng nhớ thì ta trả giá trị vùng nhớ.

Sử dụng nó thế nào ? Có 2 cách
1. Tạo class trỏ đến vùng nhớ

1
2
3
4
5
public static void main(String[] args) {
	SingleTon obj = SingleTon.getInstance();
	if ( obj == null ) System.err.println("Cannot creat instance");
	obj.sayHello();
}

2. Sử dụng trực tiếp không qua khai báo

1
2
3
public static void main(String[] args) {
	SingleTon.getInstance().sayHello();
}

Đây là toàn bộ cài đặt dành cho Java, cài đặt cho C++ có 1 vài cái khác phức tạp hơn mà tôi sẽ trình bày ở trang sau

Categories: Post Tags: , ,

Answer to Life, the Universe, and Everything

June 14th, 2009 Fu4ny 2 comments

The Ultimate Question, "Ý nghĩa của cuộc sống, của vũ trụ, của tất cả mọi thứ", hay thường được viết ngắn gọn là "Meaning of Life"

Câu hỏi lớn với 1 câu trả lời đơn giản, 1 fundametal cho tất cả lập trình viên, bài toán đầu tiên mình làm trên spoj với nhận xét: "bọn điên" =)).

Bạn không hiểu :)), thử mở Google.com, gõ vào "the answer to life, the universe and everything", và câu trả lời là "42".

WolframAlpha, với cùng 1 câu hỏi ở trên, cũng cho câu trả lời 42.

Tại sao lại là 42, câu trả lời có thể có nếu bạn đọc The_Hitchhiker's_Guide_to_the_Galaxy, 1 fiction đã quá nổi tiếng.

Cuộc sống thật là đơn giản phải ko ?

Categories: Post Tags: ,

How to get the girl ?

June 9th, 2009 Fu4ny 5 comments
Get the Girl

Get the Girl

Categories: Post Tags: ,

Nào thì trả tag

June 4th, 2009 Fu4ny No comments

Máy hỏng vì vậy tạm thời dùng lib trong N78, cũng khá nhiều nên coi như là chính xác :">

RULES:
1. Put your iTunes, Windows Media Player, etc. on shuffle.
2. For each question, press the next button to get your answer.
3. YOU MUST WRITE THAT SONG NAME DOWN NO MATTER HOW SILLY IT SOUNDS.
4. Tag 15 friends.
5. Everyone tagged has to do the same thing.
6. Have Fun!

1) IF SOMEONE SAYS "IS THIS OKAY" YOU SAY...
Back for More - A*Teens.

2) WHAT WOULD BEST DESCRIBE YOUR PERSONALITY?
Love of My Life - Jim Brickman ( omg, I love this song =) )

3) WHAT DO YOU LOOK FOR IN A GUY/GIRL?
Firefly - A*teens ( Lại A*Teens )

4) HOW DO YOU FEEL TODAY?
The Things You Are To Me - Elaine Paige

5) WHAT IS YOUR LIFE'S PURPOSE?
From the Bottom of My Broken Heart - Brit ( Mình còn ko nhớ là có bài này trong lib nữa =)) )

6) WHAT IS YOUR MOTTO?
The Summerland Love - Bradin and Sar

7) WHAT DO YOUR FRIENDS THINK OF YOU?
Muteki No Power - Buono! ( Invicible Power :-? )

8) WHAT DO YOU THINK ABOUT VERY OFTEN?
Rottara Rottara - Buono! ( a lot of love, ha ha, chuẩn thế )

9) WHAT IS 2+2?
If tomorrow never comes - Ronan Keating ( ơ hơ )

10) WHAT DO YOU THINK OF YOUR BEST FRIEND?
Love of my life - Jim Brickman ( AGAIN! :"> )

11) WHAT DO YOU THINK OF THE PERSON YOU LIKE?
Perfect - Simple Plan ( Oái, =)) )

12) WHAT IS YOUR LIFE STORY?
Forever Love - C-ute ( Trời, sao mà quiz chuẩn thế =)) )

13) WHAT DO YOU WANT TO BE WHEN YOU GROW UP?
Last Forever - Buono!

14) WHAT DO YOU THINK WHEN YOU SEE THE PERSON YOU LIKE?
Lalala Shiawase no Uta - C-ute ( Song of Happiness )

15) WHAT DO YOUR PARENTS THINK OF YOU?
Massara Blue Jeans - C-ute ( Brand new Blue Jeans, wat the hell.... )

16) WHAT WILL YOU DANCE TO AT YOUR WEDDING?
I love you came too late - Joey McIntyre

17) WHAT WILL THEY PLAY AT YOUR FUNERAL?
Fly Alone - SuperStar ( ... )

18) WHAT IS YOUR HOBBY/INTEREST?
Why do I love you - Westlife ( hối hận vì đã yêu ai chăng :-s )

19) WHAT DO YOU THINK OF YOUR FRIENDS?
I lay my love on you - Westlife ( Sao Friend == love thế nhỉ :| )

20) WHAT'S THE WORST THING THAT COULD HAPPEN?
When you're gone - Avril Lavinge

21) HOW WILL YOU DIE?
Internet Cupid - Buono! ( Chết trên mạng =)) )

22) WHAT IS THE ONE THING YOU REGRET?
Kiss! Kiss! Kiss! - Buono! ( Hối hận vì chưa được hôn à :-s )

23) WHAT MAKES YOU LAUGH?
If you're not the one - Daniel Bedingfield  ( :-s )

24) WHAT MAKES YOU CRY?
Only Love - Trade mark

25) WILL YOU EVER GET MARRIED?
When I'm with you - Westlife

26) WHAT SCARES YOU THE MOST?
Unchained Melody ( Ghost chăng :-s )

27) DOES ANYONE LIKE YOU?
How can I not love you ? - Enriquez ( Hé )

28) IF YOU COULD GO BACK IN TIME, WHAT WOULD YOU CHANGE?
If we hold on together - Diana Ross

29) WHAT HURTS RIGHT NOW?
Coz I Love You - North ( Ohhhh...my...god... )

30) WHAT WILL YOU POST THIS AS?
Before your love - Kelly Clarkson

Airiin

Airiin

Quiz tạo ra dành riêng cho mình ư :-s

Categories: Post Tags:

[3rd June ] – What I’ve done

June 3rd, 2009 Fu4ny No comments
twitter (feed #3)
New blog post: [3rd June ] - What I've done http://bit.ly/Oa8pR [#]
14:28pm via Twitter
Categories: Post Tags: