Sunday, October 11, 2009
Take a browser as an example, it needs to serialize user options, bookmarks, cookies and history. The designer can choose to keep each kind of persistence in different files. For example, options in one file and bookmarks in one file. The designer can also choose to keep user options in Windows registry, while keeping the bookmarks in a file.
Can we keep everything (or almost everything) in a single place? Sure, database to the rescue! I am not talking about client/server database system like Oracle and SQL Server. I am talking about small but powerful database system such as SQLite and embedded Firebird. For a real world example, Firefox 3 uses SQLite to keep bookmarks, histories and cookies.
There are several apparent advantages of using database to keep data. It is easy to backup and restore if everything is kept in one database. You are also free from opening and closing various files. Retrieving data quickly is easily accomplished by using index. You can also avoid data inconsistency by using transactions.
Some people will complain that using database to keep small set of data is an overkill. You’ll have to judge that by yourself. Do you want to free yourself from headaches such as creating indexes and creating your own file formats? If so, start to serialize your data to database now. You can then focus on developing your software and release it quicker.
And yes, there are people who keep big list of bookmarks and histories.
Friday, October 9, 2009
XIII was rescued by an old couple after being coma on a tree with a parachute. He woke up without remembering who the hell he was and what in the world he did, yet his could still show off his various skills.
He tried to use the old folk’s machine which had Opera installed (notice the dot dot dot (…) button?):
Opera couldn’t connect:
Old man said the internet has not been functioning for more than a year, it must have been disconnected. XIII said that some ISPs are so lazy that they just disable users by blocking hardware ID. So he took off the modem cover (which was not screwed or glued together at all), adjusted a DIP switch,
spoofed the MAC address,
and voilà, he’s online with HOT hit (#1 user-rated search engine)!
“You can't even remember your own name. How did you manage to do that?” the old man asked with a curious look.
“I have no idea,” XIII replied.
Monday, October 5, 2009
Windows 7 added some useful shortcut keys and mouse shortcuts.
The following keys affect the current window. They works only if Aero Snap is enabled which is enabled by default. If yours is somehow disabled, go to Ease of Access Center -> Make the mouse easier to use –> clear the “Prevent windows from being automatically arranged when moved to the edge of the screen" checkbox.
- Win+Up: Maximize window (if it can be maximized).
- Win+Down: Restore window if it is currently maximized, or minimize if it is not currently maximized.
- Win+Shift+Up or Double-click the top border: Maximize window vertically.
- Win+Shift+Left / Right: Move window to the another monitor.
- Win+Left: Dock to the left of the screen, press this repeatedly to cycle the window through different monitors.
- Win+Right: Dock to the right of the screen, press this repeatedly to cycle the window through different monitors.
- Win+Spacebar = Take a peek at the desktop.
- Win+Home = Minimize all other windows except the current window. Press again to undo.
In Windows Vista and Windows 7, you can press Win+T to focus the taskbar. You can do these when the taskbar has the keyboard focus:
- Left or Right arrow: move between tasks.
- Home: focus the first task button. Works only in Windows 7.
- End: focus the last task button. Works only in Windows 7.
- Press the first letter of a task title: That task button will be focused.
- Up arrow: focus the Aero Peek window. When you are at a Aero Peek window, you can press left/right/home/end to move around. Press down arrow or Esc to focus back to the task button.
- Enter or Spacebar: switch to the selected task.
TrayPress Win+B to focus the tray. Then:
- Left or Right arrow: move between icons.
- Press the first letter of a icon tooltip: That icon will be focused. The tooltip is the text that appears when you hover a tray icon with the mouse.
- Enter or Spacebar: this is the same as double-clicking the icon.
- Drag a tray icon from the taskbar and drop it outside the taskbar: this will hide that tray icon from the taskbar, unless it has notifications.
- Drag a icon from the hidden icon box to the taskbar: this will show that tray icon on the taskbar, making it always visible.