Why I still use paper

and pencil for jotting ideas

Visual Note-taking Conference Call Notes by Austin Kleon.

Try that electronically!

A quick list of advantages of the good old way of taking notes:

  • When ideas flow, only pencil can keep up with their speed.
  • Doodling actually helps with the idea flow.
  • Ideas are random, typing is linear.
  • You can get away with drawing something on paper to depict a long sentence. Doing the same on a computer will mean sidetracking into finding a clipart.
  • No pesky distractions, including those from the spelling or grammar checkers.
  • My best UI design always starts on paper
  • Easy to create mind maps.
  • Paper is truly portable, I can take it anywhere.
  • Only once I have all the thoughts on paper, do i try to organise them and make them electronic

How about you? What do you prefer, electronic or paper based note taking?

PS: I do like freemind when I am in mood for electronic note taking.

Windows 7 shortcuts

One thing that is clear from the feedback on my previous article on hidden Windows 7 features: we love our keyboard shortcuts. So here are a few more selected shortcuts.

Press this key To do this
Desktop Shortcuts
win logo key Open or close the Start menu.
win logo key + R Open the Run dialog box.
win logo key + D Display the desktop.
win logo key + Spacebar Preview the desktop.
win logo key + P Choose a presentation display mode.
Window Management
win logo key + M Minimize all windows.
win logo key + Shift + M Restore minimized windows to the desktop.
win logo key + Up Arrow Maximize the window.
win logo key + Left Arrow Maximize the window to the left side of the screen.
win logo key + Right Arrow Maximize the window to the right side of the screen.
win logo key + Down Arrow Minimize the window.
win logo key + Home Minimize all but the active window.
win logo key + Shift + Up Arrow Stretch the window to the top and bottom of the screen.
win logo key + Shift + Left Arrow or Right Arrow Move a window from one monitor to another.
Task Switching
win logo key + T Cycle through programs on the taskbar.
win logo key + Tab Cycle through programs on the taskbar by using Aero Flip 3-D.
Ctrl + win logo key + Tab Use the arrow keys to cycle through programs on the taskbar by using Aero Flip 3-D.
Ctrl + win logo key + B Switch to the program that displayed a message in the notification area.
win logo key + G Cycle through gadgets.
Taskbar Shortcuts
win logo key + number Start the program pinned to the taskbar in the position indicated by the number. If the program is already running, switch to that program.
Ctrl + win logo key + number Switch to the last active window of the program pinned to the taskbar in the position indicated by the number.
Alt + win logo key + number Open the Jump List for the program pinned to the taskbar in the position indicated by the number.
Windows Explorer Shortcuts
win logo key + Pause Display the System Properties dialog box.
win logo key + E Open Computer.
win logo key + F Search for a file or folder.
win logo key + L Lock your computer or switch users.

If you are interested in drinking from the fire hose, here is the definitive list of shortcuts.

Adding context to your logs

joysaphine @ flickr

If you have ever worked on a multi-threaded application or even any application of significant scope, one of the unwritten requirement is a log file that helps in supporting the application.

The challenge is to be able to piece together all the scattered log entries that belong together, may be as a single transaction, or a user’s session. So the goal is to have a unique identifier in each log entry that will aid greping. If you have ever faced this, you either did it cleanly as I will detail below, or you had to hack in a ‘context’ to each log entry by appending / prefixing some unique id.

I will talk about the two most commonly used logging frameworks are Apache’s log4j and log4net.

The bad (obvious) way:

logger.info(uid + " I am doing something important");
logger.debug(uid + " I am doing something else");

The problems with this approach are

  • might not have access to the uid in each function that is called
  • need to remember to append the uid everywhere
  • no way to do it in common code, utility libraries, etc.

The good news is, support for such a use case is baked into log4j and log4net.
Continue reading

Windows 7, hidden features

It’s been over 6 months, and Windows 7 still surprises me, pleasantly. The last time I felt the same about Windows was in 1995. Let me share a few things I found, which are generally not discussed.

Note: I never used Vista, so if some of these were present in Vista, I wouldn’t know.

The Windows Explorer

I think the explorer has seen the most refinement, there are nice things in all corners. My favourite features:

Pin to Windows Explorer

You might have heard about ‘pin to task bar’, but did you know that you can pin to windows explorer, which adds a folder to the Windows Explorer task bar shortcuts jump list. Wow, those were too many words but still doesn’t explain it right, so here’s a picture instead.

Drag a folder to the task bar

Pin to Explorer

And the folder shows up in the jump list

(right click on the icon)

Jump List

Continue reading

Django Flowchart

Based on my current understanding of Django, this is how a user request is responded to.

Django Flowchart

  1. User requests a page
  2. Request reaches Request Middlewares, which could manipulate or answer the request
  3. The URLConffinds the related View using urls.py
  4. View Middlewares are called, which could manipulate or answer the request
  5. The view function is invoked
  6. The view could optionally access data through models
  7. All model-to-DB interactions are done via a manager
  8. Views could use a special context if needed
  9. The context is passed to the Template for rendering
  1. Template uses Filters and Tags to render the output
  2. Output is returned to the view
  3. HTTPResponse is sent to the Response Middlerwares
  4. Any of the response middlewares can enrich the response or return a completely new response
  5. The response is sent to the user’s browser.

Please leave a comment if I have got something wrong.

Week with python & Django

Spent the last week picking up Python and Django. Notes to self and anyone else who wants a quick start on Python/Django on Windows. Most Linux flavours already come with most tools needed for python development.

Requirements:

  • Installed ActivePython 2.6
  • Installed Komodo Edit
  • Installed Python Win32 Extensions (not sure why, but was recommended in some blog post and the project itself does not say much of what it does. Stuff like this gives me the heebie-jeebies.)
  • Installed Pinax, which in turn installed Django.
  • Installed PyQt4
  • Installed Eric4 (uninstalled after using it for 10 minutes)

Problems faced:

  • Pinax installation was a bit flawed, it could not install all dependencies. Worked around by manually installing (pip install else easy_install)
  • Windows 7 was not passing command line arguments to .py scripts. Had to hack registry and add %* to the end to make it work. See the Key and value below.

Registry screenshot

Getting started:

Python: Like everyone else, I followed and recommend ‘Dive Into Python’. But more importantly, this page of titbits is amazing extract from the book and quickly brings a Java dev up to speed. I should blog about ‘Python for Java developers’. Time spent 4 hrs.

Pinax: Stopped at the installation step. Will delve further after understanding Django better.

Django: Followed the tutorial, then the Django Book, and finally the Django Docs for a deep dive. Time spent 8 hrs.

Django is surely one on the best documented project and also very straight forward. It suits my style of writing code and I did not feel like giving up in few hours, like the experience I had with RoR. Will surely blog about Django more.