jump to navigation

Written by a Delta pilot on approach to Tokyo during earthquake March 28, 2011

Posted by viboon in : Uncategorized , add a comment

An interesting story from a 767 captain who approached Tokyo just as the earthquake struck
(Written by a Delta pilot on approach to Tokyo during earthquake)

I’m currently still in one piece, writing from my room in the Narita crew hotel. It’s 8am. This is my inaugural trans-pacific trip as a brand new, recently checked out, international 767 Captain and it has been interesting, to say the least, so far. I’ve crossed the Atlantic three times so far so the ocean crossing procedures were familiar
(more…)


Tags: , , , ,

Related posts:

Earth Hour 2011 March 26, 2011

Posted by viboon in : Uncategorized , add a comment

เริ่มจากการดับไฟทั้งเมืองที่ Sydney, Australia ในปี 2007 ทำให้หลายประเทศเริ่มตระหนักถึงปัญหา Climate change มากขึ้น

ในปีนี้มาร่วมกันดับไฟเป็นเวลา 1 ชั่วโมง ตั้งแต่ 20.30 ถึง 21.30 ในวันที่ 26 มีนาคม 2011


Tags: , ,

Related posts:

Object และ Methods ใน Python March 26, 2011

Posted by viboon in : Python , add a comment

object.method(argument)

>>> x=[1,2,3]
>>> x.append(4)
>>> x
[1, 2, 3, 4]
 
>>> y=[10,11,12]
>>> x.extend(y)
>>> x
[1, 2, 3, 4, 10, 11, 12]
 
>>> text=['ant','bat','cat','bat']
>>> text.count('bat')
2
>>> text.count('rat')
0
 
>>> text.index('cat')
2
>>> text.index('bat')
1
 
>>> text.insert(1,'rat')
>>> text
['ant', 'rat', 'bat', 'cat', 'bat']
 
>>> text.pop(2)
'bat'
>>> text
['ant', 'rat', 'cat', 'bat']
 
>>> text.remove('bat')
>>> text
['ant', 'rat', 'cat']
 
>>> text.reverse()
>>> text
['cat', 'rat', 'ant']

Tags: , ,

Related posts:

Slicing และ List ใน Python March 26, 2011

Posted by viboon in : Python , add a comment
>>> text=list('helloworld')
>>> text
['h', 'e', 'l', 'l', 'o', 'w', 'o', 'r', 'l', 'd']
>>> text[5:]=list('mars')
>>> text
['h', 'e', 'l', 'l', 'o', 'm', 'a', 'r', 's']
>>> numbers=[1,2,3,4,5]
>>> numbers
[1, 2, 3, 4, 5]
>>> numbers[2:2]=[9,9,9]
>>> numbers
[1, 2, 9, 9, 9, 3, 4, 5]
>>> numbers[3:7]=[]
>>> numbers
[1, 2, 9, 5]

Tags: , ,

Related posts:

Ubuntu Hotkeys March 26, 2011

Posted by viboon in : Ubuntu , add a comment

General

Ctrl+A = Select all (In Documents, Firefox, Nautilus, etc, not Terminal)
Ctrl+C = Copy (In Documents, Firefox, Nautilus, etc, not Terminal)
Ctrl+V = Paste (In Documents, Firefox, Nautilus, etc, not Terminal)
Ctrl+N = New (Create a new document, not in terminal)
Ctrl+O = Open (Open a document, not in terminal)
Ctrl+S = Save (Save the current document, not in terminal)
Ctrl+P = Print (Print the current document, not in terminal)
Ctrl+E = Send To… (Send the current document to an email recipient or remote location, not in terminal)
Ctrl+W = Close (Close the current document, not in terminal)
Ctrl+Q = Quit (Quit the application, not in terminal)
Ctrl + Alt + F1 = Switch to the first virtual terminal
Ctrl + Alt + F2(F3)(F4)(F5)(F6) = Select the different virtual terminals
Ctrl + Alt + F7 = Switch to current terminal session with X
Ctrl+Alt++ = Switch to next X resolution (Depends of your X configuration)
Ctrl+Alt+- = Switch to previous X resolution (Depends of your X configuration)
Ctrl + Alt + Backspace = Kill X server
Printscrn = Print sreen
Ctrl + Alt + D – Show Desktop/ Restore open windows
Ctrl + Alt + L Locks the screen.
Ctrl + Alt + Left/Right Arrow – Move to Workspace on Left/Right
Ctrl + Alt + Shift+Left/Right Arrow – Move current window to another workspace
Alt + Shift+ Up Arrow – This initiates a cool looking window switcher interface with which you can switch between windows using Arrow keys while holding Alt + Shift
Win+E – Shows all workspaces in a nifty way and lets you switch between workspaces easily.
Win + W Enables the ‘scale’ effect, it shows all windows from the current workspace.
Win + A Enables the ‘scale’ effect, it shows all windows from all workspaces.
Win + N Invert colours of the focused window.
Win + M Invert colours for the whole screen.
Win + Mousewheel – Zoom in / Zoom out Desktop. This one’s pretty useful if you are having a wireless keyboard/mouse.
Alt-F1 opens the Applications menu, then use the arrow keys to navigate the submenus.
Alt-F2 opens the Run Application dialog box.
Alt-F3 opens the Deskbar Applet (F3 opens the search bar at the bottom of the window).
Alt-F4 closes the current window.
Alt-F5 unmaximizes the current window (if it’s maximized, of course).
Alt-F7, followed by arrow keys or mouse movement, adjusts the current window’s position.
Alt-F8 resizes the current window.
Alt-F9 minimizes the current window.
Alt-F10 maximizes the current window.
Alt-Left mouse button Move focused window.
Alt-Middle mouse button Resize focused window.
Alt-Right mouse button Show window menu.
Alt-spacebar opens the window menu.
Alt-Tab moves between open windows.
Ctrl-Alt-Tab moves between open panels on the desktop.

Nautilus

Shift+Ctrl+N – Create New Folder, Very useful shortcut
Alt + Enter – Show properties of a selected file/folder without requiring to right click on it and select Properties.
Ctrl + 1/2 – Change folder view to icon/list.
Ctrl + W – close current Nautilus Window
Ctrl + Shift + W – close all open Nautilus Windows
Ctrl+T – Open a new tab in Nautilus
Alt + Up/Down Arrow – Move to Parent Folder/ Selected folder
Alt + Left/Right Arrow – Move Back/forward in Nautilus
Alt + Home – Move directly to your Home Folder
F9 – Toggle display of Nautilus Sidepane
Ctrl + H – Toggle Display of hidden files and folders

Command line / Terminal shortcuts

Ctrl-C kills the current process.
Ctrl-Z sends the current process to the background.
Ctrl-D logs you out.
Ctrl-R finds the last command matching the entered letters.
Ctrl-U deletes the current line.
Ctrl-K deletes from the cursor right.
Ctrl-W deletes the word before the cursor.
Ctrl-L clears the terminal output.
Shift-Insert pastes the contents of the clipboard.
Alt-F moves forward one word.
Alt-B moves backward one word.
Ctrl+A = Home (Move cursor to beginning of line)
Ctrl+E = End (Move cursor to end of line)
Tab = List available commands from typed letters (Ex: type iw and click tab, output = iwconfig iwevent iwgetid iwlist iwpriv iwspy)
Arrows up and down = Browse command history
Shift+PageUp / PageDown = Scroll terminal output

Ref:
- http://www.ubuntu-unleashed.com/2008/02/list-of-ubuntu-keyboard-shortcuts.html
- http://allhotkeys.com/ubuntu_hotkeys.html


Tags: ,

Related posts:

Japan 2011: Dream will never die March 19, 2011

Posted by viboon in : Uncategorized , add a comment


Tags: , , , ,

Related posts:

การใช้ Lists และ Sequences ใน Python March 19, 2011

Posted by viboon in : Python , add a comment
>>> subjects = ['math', 'physics', 'history', 'chemistry']
>>> subjects[1]
'physics'
>>> subjects[-2]
'history'
>>> 'This is a string'[5]
'i'
>>> 'This is a string'[-5]
't'

สำหรับการใช้ slicing ทำได้ทั้ง backward และ forward

>>> x=[0,1,2,3,4,5]
 
>>> x[2:5]
[2, 3, 4]
 
>>> x[-3:-1]
[3, 4]
 
>>> x[-3:]
[3, 4, 5]
 
>>> x[2:]
[2, 3, 4, 5]
 
>>> x[:4]
[0, 1, 2, 3]
 
>>> x[:]
[0,1,2,3,4,5]
 
>>> x[0:5:2]
[0, 2, 4]
 
>>> x[5:0:-2]
[5, 3, 1]
 
>>> x[5::-2]
[5, 3, 1]
 
>>> x[::2]
[0, 2, 4]

การรวม sequence สามารถทำได้โดย

>>> [1, 2, 3] + [4, 5, 6]
[1, 2, 3, 4, 5, 6]

หรือการทำซ้ำ

>>> [10] * 5
[10, 10, 10, 10, 10]

การหาค่าใน list

>>> subjects = ['math', 'physics', 'history', 'chemistry']
>>> 'biology' in subjects
False
>>> 'math' in subjects
True

functions อื่นๆ เกี่ยวกับ list

>>> numbers=[4,2,7,5,10]
>>> len(numbers)
5
>>> max(numbers)
10
>>> min(numbers)
2
>>> numbers[2]=15
>>> numbers
[4, 2, 15, 5, 10]
>>> del numbers[1]
[4, 15, 5, 10]

แปลง string ให้อยู่ในรูป list ก็ได้

>>> list('hello')
['h', 'e', 'l', 'l', 'o']

Tags: , , ,

Related posts:

String ใน Python March 19, 2011

Posted by viboon in : Python , add a comment

String
ใช้ print “xxxxxx” ก็ได้ หรือ “xxxxx” หรือ ‘xxxx’ ก็ได้

>>> 'hello'
'hello'
>>> "hello"
'hello'
>>> print "hello"
hello
 
>>> a="hel"
>>> b="lo!"
>>> a+b
'hello!'

String กับ ตัวเลข
ต้องแปลงตัวเลขเป็น string ก่อนทุกครั้ง จะใช้ str(x) function หรือ `x` ก็ได้

>>> x = str(5)
>>> print "x is " + x
x is 5
 
>>> x = 5
>>> print "x is " + `x`
x is 5
 
>>> x = input("Enter x: ")
Enter x:10
>>> 'x is ' + str(x)
'x is 10'

การรับค่าเป็นตัวเลขใช้ input(x) การรับค่าเป็น string ใช้ raw_input(x)

1
2
3
4
5
6
print "Hello"
name=raw_input("Enter your name: ")
"Hello, " + "\"" + name + "\""
age=input("Enter your age: ")
'You are now ' + str(age)
raw_input("Press Enter to continue")

Tags: ,

Related posts: