A hungry mind
Site url: A Hungry mind
Some Important Keyboard Shortcuts
Here are some important keyboard shortcuts which may increase your speed while you are using Windows XP:
Windows system key combinations
| • | F1: Help |
| • | CTRL+ESC: Open Start menu |
| • | ALT+TAB: Switch between open programs |
| • | ALT+F4: Quit program |
| • | SHIFT+DELETE: Delete item permanently |
Windows program key combinations
| • | CTRL+C: Copy |
| • | CTRL+X: Cut |
| • | CTRL+V: Paste |
| • | CTRL+Z: Undo |
| • | CTRL+B: Bold |
| • | CTRL+U: Underline |
| • | CTRL+I: Italic |
Mouse click/keyboard modifier combinations for shell objects
| • | SHIFT+right click: Displays a shortcut menu containing alternative commands |
| • | SHIFT+double click: Runs the alternate default command (the second item on the menu) |
| • | ALT+double click: Displays properties |
| • | SHIFT+DELETE: Deletes an item immediately without placing it in the Recycle Bin |
General keyboard-only commands
| • | F1: Starts Windows Help |
| • | F10: Activates menu bar options |
| • | SHIFT+F10 Opens a shortcut menu for the selected item (this is the same as right-clicking an object |
| • | CTRL+ESC: Opens the Start menu (use the ARROW keys to select an item) |
| • | CTRL+ESC or ESC: Selects the Start button (press TAB to select the taskbar, or press SHIFT+F10 for a context menu) |
| • | ALT+DOWN ARROW: Opens a drop-down list box |
| • | ALT+TAB: Switch to another running program (hold down the ALT key and then press the TAB key to view the task-switching window) |
| • | SHIFT: Press and hold down the SHIFT key while you insert a CD-ROM to bypass the automatic-run feature |
| • | ALT+SPACE: Displays the main window's System menu (from the System menu, you can restore, move, resize, minimize, maximize, or close the window) |
| • | ALT+- (ALT+hyphen): Displays the Multiple Document Interface (MDI) child window's System menu (from the MDI child window's System menu, you can restore, move, resize, minimize, maximize, or close the child window) |
| • | CTRL+TAB: Switch to the next child window of a Multiple Document Interface (MDI) program |
| • | ALT+underlined letter in menu: Opens the menu |
| • | ALT+F4: Closes the current window |
| • | CTRL+F4: Closes the current Multiple Document Interface (MDI) window |
| • | ALT+F6: Switch between multiple windows in the same program (for example, when the Notepad Find dialog box is displayed, ALT+F6 switches between the Find dialog box and the main Notepad window) |
Shell objects and general folder/Windows Explorer shortcuts
For a selected object:| • | F2: Rename object |
| • | F3: Find all files |
| • | CTRL+X: Cut |
| • | CTRL+C: Copy |
| • | CTRL+V: Paste |
| • | SHIFT+DELETE: Delete selection immediately, without moving the item to the Recycle Bin |
| • | ALT+ENTER: Open the properties for the selected object |
To copy a file
Press and hold down the CTRL key while you drag the file to another folder.To create a shortcut
Press and hold down CTRL+SHIFT while you drag a file to the desktop or a folder.General folder/shortcut control
| • | F4: Selects the Go To A Different Folder box and moves down the entries in the box (if the toolbar is active in Windows Explorer) |
| • | F5: Refreshes the current window. |
| • | F6: Moves among panes in Windows Explorer |
| • | CTRL+G: Opens the Go To Folder tool (in Windows 95 Windows Explorer only) |
| • | CTRL+Z: Undo the last command |
| • | CTRL+A: Select all the items in the current window |
| • | BACKSPACE: Switch to the parent folder |
| • | SHIFT+click+Close button: For folders, close the current folder plus all parent folders |
Windows Explorer tree control
| • | Numeric Keypad *: Expands everything under the current selection |
| • | Numeric Keypad +: Expands the current selection |
| • | Numeric Keypad -: Collapses the current selection. |
| • | RIGHT ARROW: Expands the current selection if it is not expanded, otherwise goes to the first child |
| • | LEFT ARROW: Collapses the current selection if it is expanded, otherwise goes to the parent |
Properties control
| • | CTRL+TAB/CTRL+SHIFT+TAB: Move through the property tabs |
| • | Press SHIFT five times: Toggles StickyKeys on and off |
| • | Press down and hold the right SHIFT key for eight seconds: Toggles FilterKeys on and off |
| • | Press down and hold the NUM LOCK key for five seconds: Toggles ToggleKeys on and off |
| • | Left ALT+left SHIFT+NUM LOCK: Toggles MouseKeys on and off |
| • | Left ALT+left SHIFT+PRINT SCREEN: Toggles high contrast on and off |
Microsoft Natural Keyboard keys
| • | Windows Logo: Start menu |
| • | Windows Logo+R: Run dialog box |
| • | Windows Logo+M: Minimize all |
| • | SHIFT+Windows Logo+M: Undo minimize all |
| • | Windows Logo+F1: Help |
| • | Windows Logo+E: Windows Explorer |
| • | Windows Logo+F: Find files or folders |
| • | Windows Logo+D: Minimizes all open windows and displays the desktop |
| • | CTRL+Windows Logo+F: Find computer |
| • | CTRL+Windows Logo+TAB: Moves focus from Start, to the Quick Launch toolbar, to the system tray (use RIGHT ARROW or LEFT ARROW to move focus to items on the Quick Launch toolbar and the system tray) |
| • | Windows Logo+TAB: Cycle through taskbar buttons |
| • | Windows Logo+Break: System Properties dialog box |
| • | Application key: Displays a shortcut menu for the selected item |
Microsoft Natural Keyboard with IntelliType software installed
| • | Windows Logo+L: Log off Windows |
| • | Windows Logo+P: Starts Print Manager |
| • | Windows Logo+C: Opens Control Panel |
| • | Windows Logo+V: Starts Clipboard |
| • | Windows Logo+K: Opens Keyboard Properties dialog box |
| • | Windows Logo+I: Opens Mouse Properties dialog box |
| • | Windows Logo+A: Starts Accessibility Options (if installed) |
| • | Windows Logo+SPACEBAR: Displays the list of Microsoft IntelliType shortcut keys |
| • | Windows Logo+S: Toggles CAPS LOCK on and off |
Dialog box keyboard commands
| • | TAB: Move to the next control in the dialog box |
| • | SHIFT+TAB: Move to the previous control in the dialog box |
| • | SPACEBAR: If the current control is a button, this clicks the button. If the current control is a check box, this toggles the check box. If the current control is an option, this selects the option. |
| • | ENTER: Equivalent to clicking the selected button (the button with the outline) |
| • | ESC: Equivalent to clicking the Cancel button |
| • | ALT+underlined letter in dialog box item: Move to the corresponding item |
An old article remind me some important points
Link:
www.norvig.com/21-days.html
Models Of Software Acceptance
www.dreamsongs.com/NewFiles/AcceptanceModels.pdf
There is also an ebook about patterns in software by the same author:
www.dreamsongs.com/NewFiles/PatternsOfSoftware.pdf
Basic Threads and How they work
Threads are a way for a program to split itself into two or more simultaneously running tasks.Modern operating systems provide multiple threads of control within a process - these are called Threads or lightweight processes. All threads within a process share the same address space. This means that a thread shares its code and data section with other threads. Each, however, has its own program counter, stack and register set. The program counter etermines which instruction the thread is currently executing. This may or may not be the same as that for other threads. The register set is needed because when threads are suspended, their state must be saved. Upon resumption, this state is loaded into the machine registers.
Like traditional processes, threads can be in different states - running, ready or blocked .
Why do we have them?
To see why multiple threads of control within a process are useful, consider what a web browser such as Firefox must do to load a web page containing multiple images. For each image, it must set up a separate connection to the page's home site and request the image.
[This multithreading generally occurs by time slicing (where a single processor switches between different threads) or by multiprocessing (where threads are executed on separate processors). Threads are similar to processes, but differ in the way that they share resources.] By having multiple threads within the browser process, the images can be requested in parallel with the user scrolling through the content that has already been received, greatly enhancing the response time for the user. Also, extensive sharing of resources makes CPU switching between threads inexpensive, compared with switching between traditional or heavyweight processes. A register-set switch is still required but no memory-management related work needs to be done.
How do Threads Work?
Two kinds of implementation schemes are in vogue for threads - user-level and kernel-level. User-level threads are managed entirely in user space. The operating system is not aware of their existence. Thread switching does not involve a call to the operating system or an interrupt to the kernel. Switching is thus independent of the operating system and very quick. One disadvantage of this scheme is that if a user-level thread blocks while executing a system call, the kernel blocks the entire process since it is not even aware that other threads exist.
In systems supporting kernel-level threads, the operating system is aware of the existence of multiple threads per process, so when a thread blocks, the operating system chooses the next one to run, either from the same process or a different one.
Some systems support a hybrid approach in which both user-level and kernel-level threads are supported. Solaris 2 is one such system.
Synchronizing Threads With Mutexes
One of the basic problems when running several threads that use the same memory space, is making sure they don't "step on each other's toes". By this we refer to the problem of using a data structure from two different threads.
For instance, consider the case where two threads try to update two variables. One tries to set both to 0, and the other tries to set both to 1. If both threads would try to do that at the same time, we might get with a situation where one variable contains 1, and one contains 0. This is because a context-switch (See below if you don't know what is it) might occur after the first tread zeroed out the first variable, then the second thread would set both variables to 1, and when the first thread resumes operation, it will zero out the second variable, thus getting the first variable set to '1', and the second set to '0'.For example, consider the classical producer-consumer problem:
Assume counter is initially 5. One interleaving of
statements is:
producer: register1 = counter (register1 = 5)
producer: register1 = register1 + 1 (register1 = 6)
consumer: register2 = counter (register2 = 5)
consumer: register2 = register2 – 1 (register2 = 4)
producer: counter = register1 (counter = 6)
consumer: counter = register2 (counter = 4)
Thread class in C++:
{
public:
Thread();
int Start(void * arg);
protected:
int Run(void * arg);
static void * EntryPoint(void*);
virtual void Setup();
virtual void Execute(void*);
void * Arg() const {return Arg_;}
void Arg(void* a){Arg_ = a;}
private:
THREADID ThreadId_;
void * Arg_;
};
Thread::Thread() {}
int Thread::Start(void * arg)
{
Arg(arg); // store user data
int code = thread_create(Thread::EntryPoint, this, & ThreadId_);
return code;
}
int Thread::Run(void * arg)
{
Setup();
Execute( arg );
}
/*static */
void * Thread::EntryPoint(void * pthis)
{
Thread * pt = (Thread*)pthis;
pthis->Run( Arg() );
}
virtual void Thread::Setup()
{
// Do any setup here
}
virtual void Thread::Execute(void* arg)
{
// Your code goes here
}Some useful resources:
users.actcom.co.il/~choo/lupg/tutorials/multi-thread
/multi-thread.html
en.wikipedia.org/wiki/Thread_%28computer_science%29
www.personal.kent.edu/~rmuhamma/OpSystems/Myos
/threads.htm
ftp://download.intel.com/support/performancetools/threadchecker
/threads.htm
msdn.microsoft.com/library/default.asp?url=/library/en-us
/cpref/html/frlrfsystemthreadingthreadclasstopic.asp
www.mcs.vuw.ac.nz/courses/COMP305/2004T1/Nachos
/Salsa/NachosFiles/threads
Context Switch:
When a multitasking-operating system stops running one process and starts running another. Many operating systems implement concurrency by maintaining separate environments or "contexts" for each process. The amount of separation between processes, and the amount of information in a context, depends on the operating system but generally the OS should prevent processes interfering with each other, e.g. by modifying each other's memory.
A context switch can be as simple as changing the value of the program counter and stack pointer or it might involve resetting the MMU to make a different set of memory pages available.
In order to present the user with an impression of parallism, and to allow processes to respond quickly to external events, many systems will context switch thousands of times per second.