Archive

Author Archive

[VB.NET] Detect whether the USB device is plugged in or taken out without timer

May 3rd, 2009


.NET programming
The following VB.NET code will help you to check whether a USB device is plugged in or taken out. No timer is used here. You can integrate this tip to your program just by copy and paste.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
    Private WM_DEVICECHANGE As Integer = &H219
 
    Public Enum WM_DEVICECHANGE_WPPARAMS As Integer
        DBT_CONFIGCHANGECANCELED = &H19
        DBT_CONFIGCHANGED = &H18
        DBT_CUSTOMEVENT = &H8006
        DBT_DEVICEARRIVAL = &H8000
        DBT_DEVICEQUERYREMOVE = &H8001
        DBT_DEVICEQUERYREMOVEFAILED = &H8002
        DBT_DEVICEREMOVECOMPLETE = &H8004
        DBT_DEVICEREMOVEPENDING = &H8003
        DBT_DEVICETYPESPECIFIC = &H8005
        DBT_DEVNODES_CHANGED = &H7
        DBT_QUERYCHANGECONFIG = &H17
        DBT_USERDEFINED = &HFFFF
    End Enum
 
    Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
        If m.Msg = WM_DEVICECHANGE Then
            Select Case m.WParam
                Case WM_DEVICECHANGE_WPPARAMS.DBT_DEVICEARRIVAL
                    MsgBox("USB device is just plugged in!")
                Case WM_DEVICECHANGE_WPPARAMS.DBT_DEVICEREMOVECOMPLETE
                    MsgBox("USB device is just taken out")
            End Select
        End If
        MyBase.WndProc(m)
    End Sub
Author: SquallLTT Categories: Programming Tags: ,

How to register free hosting at pipni.cz

May 1st, 2009


This webpage will guide you how to register a free hosting at pipni.cz

Note that: firstly you need to own a domain .com or .net or .org e.tc.

All right, here we go: …
Read more…

Author: SquallLTT Categories: IT Tags: , , ,

Hot Tea and a Heart Attack

May 1st, 2009

Drink Warm Water After A Meal

This is a very good article. Not only about the warm water after your meal, but about heart attack.

The Chinese and Japanese drink hot tea with their meals, not cold water, maybe it is time we adopt their drinking habit while eating. For those who like to drink cold water, this article is applicable to you. It is nice to have a cup of cold drink after a meal. However, the cold water will solidify the oily stuff that you have just consumed. It will slow down the digestion.
Read more…

Author: SquallLTT Categories: Life Tags:

(JavaScript hack) Edit any webpage

April 30th, 2009

Hi every1, today I’m gonna share with you a very simple JavaScript hack, all you need to do is copy and paste the code below into your web browser, then you can edit everything on that page. It’s just for fun, coz everything will return to original once the page is reloaded.

Code:

javascript:document.body.contentEditable='true'; document.designMode='on'; void 0

The above Javascript trick can apply to any website including Google, Yahoo or MSN. It’s make a website editable and allow user to change the content. However the changes only apply to the current browser and no affect on the “real content”.

Author: SquallLTT Categories: IT Tags: ,

Heaven and Hell

April 28th, 2009

A holy man was having a conversation with the Lord one day and said,’Lord, I would like to know what Heaven and Hell are like.’ The Lord led the holy man to two doors. He opened one of the doors and the holy man looked in. In the middle of the room was a large round table. In the middle of the table was a large pot of stew, which smelled delicious and made the holy man’s mouth water. The people sitting around the table were thin and sickly. They appeared to be famished. They were holding spoons with very long handles that were strapped to their arms and each found it possible to reach into the pot of stew and take a spoonful. But because the handle was longer than their arms, they could not get the spoons back into their mouths. The holy man shuddered at the sight of their misery and suffering.

The Lord said, ‘You have seen Hell.’ They went to the next room and opened the door. It was exactly the same as the first one. There was the large round table with the large pot of stew which made the holy man’s mouth water. The people were equipped with the same long-handled spoons, but here the people were well nourished and plump, laughing and talking. The holy man said, ‘I don’t understand. It is simple,’ said the Lord. ‘It requires but one skill. You see they have learned to feed each other, while the greedy think only of themselves.’

Author: SquallLTT Categories: Life Tags:

Don’t give up

April 28th, 2009

One day I decided to quit…
I quit my job, my relationship, my spirituality… I wanted to quit my life.
I went to the woods to have one last talk with God.

“God”, I asked, “Can you give me one good reason not to quit?”
His answer surprised me…
“Look around”, He said. “Do you see the fern and the bamboo?”

“Yes”, I replied.
“When I planted the fern and the bamboo seeds, I took very good care of them.

I gave them light.
Read more…

Author: SquallLTT Categories: Life Tags:

Sand and dust (Dusty sand)

April 28th, 2009

“Cát bụi”, Trịnh Công Sơn.

Hạt bụi nào hóa kiếp thân tôi
Để một mai vươn hình hài lớn dậy
Ôi cát bụi tuyệt vời
Mặt trời soi một kiếp rong chơi

Hạt bụi nào hóa kiếp thân tôi
Để một mai tôi về làm cát bụi
Ôi cát bụi mệt nhoài
Tiếng động nào gõ nhịp không nguôi

Read more…

Author: SquallLTT Categories: Life Tags:

Applying digital image processing and neural network for my FYP (demo)

April 28th, 2009

This is the robot that I’ve developed machine vision capability for. Digital image processing and neural network are used effectively here ^^  o:-)

Hope you guys enjoy this video clip as i did try my best for my final year project.

machine_vision_image_processing_neural_network_1

Just a demo for “Laser recognition” capability ^^

April 28th, 2009

This is my Final Year Project robot. The following video clip shows a demo using image processing technique to do laser recognition :)

The program is written by me – SquallLTT using C#

Giving WordPress Its Own Directory

April 25th, 2009

Giving WordPress its Own Directory While Leaving Your Blog in the Root Directory

Many people want WordPress to power their site’s root (e.g. http://example.com) but they don’t want all of the WordPress files cluttering up their root directory. WordPress allows you to install the WordPress files to a subdirectory, but have your blog exist in the site root.

The process to move WordPress into its own directory is as follows:
Read more…

Author: SquallLTT Categories: IT Tags: