CFA Level II Study Schedule

General No Comments »

I will be taking the CFA Level 2 exam on June 6, 2009. I have developed the following study schedule for my reference:

Week # Start Date End Date Task
1 1/5/2009 1/11/2009 Readings 1-4
2 1/12/2009 1/18/2009 Readings 5-7
3 1/19/2009 1/25/2009 Readings 8-11
4 1/26/2009 2/1/2009 Readings 12-14
5 2/2/2009 2/8/2009 Readings 15-18
6 2/9/2009 2/15/2009 Readings 19-21
7 2/16/2009 2/22/2009 Readings 22-25
8 2/23/2009 3/1/2009 Readings 26-28
9 3/2/2009 3/8/2009 Readings 29-32
10 3/9/2009 3/15/2009 Readings 33-35
11 3/16/2009 3/22/2009 Readings 36-39
12 3/23/2009 3/29/2009 Readings 40-42
13 3/30/2009 4/5/2009 Readings 43-46
14 4/6/2009 4/12/2009 Readings 47-49
15 4/13/2009 4/19/2009 Readings 50-53
16 4/20/2009 4/26/2009 Readings 54-56
17 4/27/2009 5/3/2009 Readings 57-60
18 5/4/2009 5/10/2009 Readings 61-63
19 5/11/2009 5/17/2009 Readings 64-67
20 5/18/2009 5/24/2009 Readings 68-71
21 5/25/2009 5/31/2009 Practice Exams
22 6/1/2009 6/7/2009 Practice Exams and CFA Exam

Half Marathon Training

General No Comments »

My wife and I have decided to train for a half marathon. Our target for the race is January, 2010.

I created a training schedule based on a three workout per week schedule with a gradual increase in total mileage, along with our current running abilities. Here it is:

Week Start Date End Date Workout 1 Workout 2 Workout 3 Total
1 12/1/2008 12/7/2008 2 mi 2 mi 2 mi 6 mi
2 12/8/2008 12/14/2008 2 mi 2 mi 2 mi 6 mi
3 12/15/2008 12/21/2008 2 mi 2 mi 2.5 mi 6.5 mi
4 12/22/2008 12/28/2008 2 mi 2 mi 2.5 mi 6.5 mi
5 12/29/2008 1/4/2009 2.5 mi 2 mi 2.5 mi 7 mi
6 1/5/2009 1/11/2009 2.5 mi 2 mi 2.5 mi 7 mi
7 1/12/2009 1/18/2009 2.5 mi 2 mi 3 mi 7.5 mi
8 1/19/2009 1/25/2009 2.5 mi 2 mi 3 mi 7.5 mi
9 1/26/2009 2/1/2009 2.5 mi 2.5 mi 3 mi 8 mi
10 2/2/2009 2/8/2009 2.5 mi 2.5 mi 3 mi 8 mi
11 2/9/2009 2/15/2009 2.5 mi 2.5 mi 3.5 mi 8.5 mi
12 2/16/2009 2/22/2009 2.5 mi 2.5 mi 3.5 mi 8.5 mi
13 2/23/2009 3/1/2009 3 mi 2.5 mi 3.5 mi 9 mi
14 3/2/2009 3/8/2009 3 mi 2.5 mi 3.5 mi 9 mi
15 3/9/2009 3/15/2009 3 mi 3 mi 3.5 mi 9.5 mi
16 3/16/2009 3/22/2009 3 mi 3 mi 3.5 mi 9.5 mi
17 3/23/2009 3/29/2009 3 mi 3 mi 4 mi 10 mi
18 3/30/2009 4/5/2009 3 mi 3 mi 4 mi 10 mi
19 4/6/2009 4/12/2009 3 mi 3 mi 4.5 mi 10.5 mi
20 4/13/2009 4/19/2009 3 mi 3 mi 4.5 mi 10.5 mi
21 4/20/2009 4/26/2009 3.5 mi 3 mi 4.5 mi 11 mi
22 4/27/2009 5/3/2009 3.5 mi 3 mi 4.5 mi 11 mi
23 5/4/2009 5/10/2009 3.5 mi 3 mi 4.5 mi 11 mi
24 5/11/2009 5/17/2009 3.5 mi 3.5 mi 5 mi 12 mi
25 5/18/2009 5/24/2009 3.5 mi 3.5 mi 5 mi 12 mi
26 5/25/2009 5/31/2009 3.5 mi 3.5 mi 5 mi 12 mi
27 6/1/2009 6/7/2009 4 mi 3.5 mi 5.5 mi 13 mi
28 6/8/2009 6/14/2009 4 mi 3.5 mi 5.5 mi 13 mi
29 6/15/2009 6/21/2009 4 mi 3.5 mi 5.5 mi 13 mi
30 6/22/2009 6/28/2009 4 mi 4 mi 6 mi 14 mi
31 6/29/2009 7/5/2009 4 mi 4 mi 6 mi 14 mi
32 7/6/2009 7/12/2009 4 mi 4 mi 6 mi 14 mi
33 7/13/2009 7/19/2009 4.5 mi 4 mi 6.5 mi 15 mi
34 7/20/2009 7/26/2009 4.5 mi 4 mi 6.5 mi 15 mi
35 7/27/2009 8/2/2009 4.5 mi 4.5 mi 7 mi 16 mi
36 8/3/2009 8/9/2009 4.5 mi 4.5 mi 7 mi 16 mi
37 8/10/2009 8/16/2009 4.5 mi 4.5 mi 8 mi 17 mi
38 8/17/2009 8/23/2009 4.5 mi 4.5 mi 8 mi 17 mi
39 8/24/2009 8/30/2009 5 mi 4.5 mi 8.5 mi 18 mi
40 8/31/2009 9/6/2009 5 mi 4.5 mi 8.5 mi 18 mi
41 9/7/2009 9/13/2009 5 mi 5 mi 9 mi 19 mi
42 9/14/2009 9/20/2009 5 mi 5 mi 9 mi 19 mi
43 9/21/2009 9/27/2009 5.5 mi 5 mi 9.5 mi 20 mi
44 9/28/2009 10/4/2009 5.5 mi 5 mi 9.5 mi 20 mi
45 10/5/2009 10/11/2009 5.5 mi 5.5 mi 10 mi 21 mi
46 10/12/2009 10/18/2009 5.5 mi 5.5 mi 10 mi 21 mi
47 10/19/2009 10/25/2009 6 mi 6 mi 10 mi 22 mi
48 10/26/2009 11/1/2009 6 mi 6 mi 10 mi 22 mi
49 11/2/2009 11/8/2009 6.5 mi 6 mi 10.5 mi 23 mi
50 11/9/2009 11/15/2009 6.5 mi 6 mi 10.5 mi 23 mi
51 11/16/2009 11/22/2009 6.5 mi 6.5 mi 11 mi 24 mi
52 11/23/2009 11/29/2009 6.5 mi 6.5 mi 11 mi 24 mi
53 11/30/2009 12/6/2009 7 mi 6.5 mi 11.5 mi 25 mi
54 12/7/2009 12/13/2009 7 mi 6.5 mi 11.5 mi 25 mi
55 12/14/2009 12/20/2009 7 mi 7 mi 12 mi 26 mi
56 12/21/2009 12/27/2009 6.5 mi 6.5 mi 9 mi 22 mi
57 12/28/2009 1/3/2010 5 mi 5 mi 8 mi 18 mi
58 1/4/2010 1/10/2010 3 mi 3 mi RACE

I am using Runners’ World free training log to monitor my progress.

Pseudoloc

Win32 No Comments »

I have released a pseudolocalization tool I wrote for 32-bit Windows resource DLLs here.

Google’s Wonderful PR

Software / Technology 1 Comment »

Today, Google is releasing a beta version of its new web browser, called Chrome. Apparently this event is big news; it merited a front-page article in the Wall Street Journal.

I’ve read a few blog posts about this announcement, such as Is Google Chrome an IE/Firefox/Opera/Safari killer?, and it really seems to me the hype is overdone. From the above blog post, the browser will be:

Open source, built from scratch

Not exactly. The most important piece of a web browser is its layout / rendering engine, and as the blog post later mentions, Google is not writing one from scratch; it is using WebKit.

Revolutionary use of tabs (the tabs will be at the top of the window rather than below the address bar)

This is revolutionary? Really?

Support multiple processes so each tab runs in isolation so bugs and slow-downs only hit a single tab (creating what’s called in the comic book a “sad tab”) rather than bring the browser crashing down

Internet Explorer 8 did this first.

I see nothing wrong with Google writing their own web browser, and I wish them luck in their endeavors, but I don’t understand the uproar over this event. It seems to me the only truly new piece of their browser may be their JavaScript engine, V8; the rest is reuse-and-recycle (probably as it should be).

Update 2008-09-02 7:40 PM: After playing with Chrome for a while, a thought occurred to me — maybe Chrome’s strength isn’t in its technology but in its execution. Chrome is fast, attractive, and minimalist.

Stitched Panorama Pictures

General 2 Comments »

Using Hugin (based on a recommendation from Keith) and some pictures I took last summer, I have created a few stitched panoramic pictures from last year’s Wisconsin vacation:

What I’m Reading

General 1 Comment »

Now that I have completed my degree in Computational Finance from DePaul University, I have far more time for leisurely activities such as reading books. Here’s what I’ve been reading recently:

How to Lie With Statistics How to Lie With Statistics by Darrell Huff and Irving Geis.
When Genius Failed When Genius Failed: The Rise and Fall of Long-Term Capital Management by Roger Lowenstein.
The Underpants The Underpants by Steve Martin.
The Intelligent Investor The Intelligent Investor: The Definitive Book on Value Investing (Revised Edition) by Benjamin Graham.

2008 Cubs Predictions: Take 4

Baseball No Comments »

Chicago Cubs Logo

Latest Cubs prediction: 110-54 (0.362 team OBP, 3.66 team ERA, underlying equation). (Previous predictions: 112-50, 113-49, 90-62)

We’ll have to see how Soriano’s broken finger affects the Cubs’ team OBP and thus the prediction.

Balloon Tooltips

Win32 2 Comments »

In the Windows XP login screen, the password text box will warn you with a balloon tooltip if you accidentally turn Caps Lock on:

Windows XP Caps Lock Warning Message

The balloon tooltip appears to be a Windows tooltip common control with the TTS_BALLOON style.

To replicate this functionality, I decided to write a function called ShowMsgBalloon() which, given a control and the various balloon tooltip parameters, creates and shows the balloon tooltip below the control.

The key insight to making ShowMsgBallon() work as intended was to use the TTF_TRACK option to create a tracking tooltip. This will immediately show the tooltip without requiring the user to position the mouse over the control. The main downside to using TTF_TRACK is that the tooltip will not move with the control if the window is moved; you need to manually move the tooltip using TTM_TRACKPOSITION as required. One could probably make this automatic by subclassing the tooltip’s parent control and handling WM_WINDOWPOSCHANGED messages.

Here is the source code to ShowMsgBalloon(). When you are done with the balloon, call DestroyWindow() on the returned HWND. Note: you may want your application to use comctl32.dll version 6 as it will lead to a nicer visual style, including a close button.

  1. #include <windows.h>
  2. #include <commctrl.h>
  3.  
  4. // Options to ShowMsgBallon() (see dwOpts parameter).  These are the
  5. // standard icon types for balloon tooltips.
  6. #define SMB_ICON_INFO    (1 << 0)
  7. #define SMB_ICON_WARNING (1 << 1)
  8. #define SMB_ICON_ERROR   (1 << 2)
  9.  
  10. // Given the options passed to ShowMsgBalloon(), determine what
  11. // parameter to send to TTM_SETTITLE for the balloon tooltip’s icon.
  12. static DWORD
  13. GetTitleIcon(DWORD dwOpts)
  14. {
  15.     if (dwOpts &amp; SMB_ICON_INFO)
  16.         return TTI_INFO;
  17.     else if (dwOpts &amp; SMB_ICON_WARNING)
  18.         return TTI_WARNING;
  19.     else if (dwOpts &amp; SMB_ICON_ERROR)
  20.         return TTI_ERROR;
  21.     else
  22.         return 0;
  23. }
  24.  
  25. // Create and show a balloon tooltip immediately below the control
  26. // hwndCtrl with the given title, message, and options.
  27. HWND
  28. ShowMsgBalloon(HWND hwndCtrl, LPCTSTR szTitle, LPCTSTR szMsg,
  29.                DWORD dwOpts)
  30. {
  31.     HWND hwndRet = NULL;
  32.     HWND hwndTT = NULL;
  33.     TOOLINFO ti = { 0 };
  34.     RECT rc;
  35.  
  36.     // Even though TTS_CLOSE is always specified, a close button will
  37.     // only be shown if your application has a manifest that requires
  38.     // comctl32.dll version 6.
  39.     hwndTT = CreateWindow
  40.         (
  41.         TOOLTIPS_CLASS,
  42.         TEXT(""),
  43.         WS_POPUP | TTS_NOPREFIX | TTS_BALLOON | TTS_CLOSE,
  44.         CW_USEDEFAULT, CW_USEDEFAULT,
  45.         CW_USEDEFAULT, CW_USEDEFAULT,
  46.         hwndCtrl,
  47.         NULL,
  48.         NULL,
  49.         NULL
  50.         );
  51.     if (hwndTT == NULL)
  52.         goto Cleanup;
  53.  
  54.     // By using TTTOOLINFO_V1_SIZE rather than sizeof(TOOLINFO),
  55.     // we don’t require users to be using comctl32 version 6.
  56.     ti.cbSize = TTTOOLINFO_V1_SIZE;
  57.     ti.uFlags = TTF_TRACK;
  58.     ti.hwnd = hwndCtrl;
  59.     ti.lpszText = const_cast<lptstr>(szMsg);
  60.     if (!SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) &amp;ti))
  61.         goto Cleanup;
  62.     if (!SendMessage(hwndTT, TTM_SETTITLE, GetTitleIcon(dwOpts),
  63.                      (LPARAM) szTitle))
  64.         goto Cleanup;
  65.  
  66.     // Position the tooltip below the control
  67.     if (!GetWindowRect(hwndCtrl, &amp;rc))
  68.         goto Cleanup;
  69.     SendMessage(hwndTT, TTM_TRACKPOSITION, 0,
  70.                 MAKELONG(rc.left + 10, rc.bottom));
  71.  
  72.     // Show the tooltip
  73.     if (!SendMessage(hwndTT, TTM_TRACKACTIVATE, TRUE, (LPARAM) &amp;ti))
  74.         goto Cleanup;
  75.  
  76.     hwndRet = hwndTT;
  77.     hwndTT = NULL;
  78.  
  79. Cleanup:
  80.     if (hwndTT != NULL)
  81.         ::DestroyWindow(hwndTT);
  82.  
  83.     return hwndRet;
  84. }

Update 2008-11-01 3:08PM: If you are targeting comctl32.dll version 6 or later, I recommend using the EM_SHOWBALLOONTIP message.  Comctl32.dll version 6 or later also automatically shows the caps lock warning balloon for edit boxes with the ES_PASSWORD window style.

Escaping Strings in XPath 1.0

C++, XPath No Comments »

XPath is a language for selecting nodes from an XML document. XPath is used extensively in XSLT and other XML technologies. I also vastly prefer using XPath (e.g. with XPathNavigator) over the XML DOM when manipulating XML in a non-streaming fashion.

In XPath, strings must be delimited by either single or double quotes. Given a quote character used to delimit a string, one can’t represent that same quote character within the string. This means that if you decide to use single quotes to delimit your XPath string, you couldn’t represent the string O'Reilly; use double quotes, and you can’t represent "Hello".

However, given a quote delimiter, you can represent the other quote character. We can use this observation along with the concat XPath function to devise a general quoting rule for XPath strings. It’s easiest to show this via a series of examples:

Original String Quoted XPath String
a 'a' (or "a")
O'Reilly "O'Reilly"
"Hello" '"Hello"'
"Hello, Mr. O'Reilly" concat('"Hello, Mr. O', "'Reilly", '"')

Below is a piece of C++ code which implements these quotation rules:

  1. std::string
  2. QuoteXPathString(const std::string& xpath)
  3. {
  4.     // If we don’t have any single or double-quote characters, quote the
  5.     // expression in single quotes.
  6.     std::string::size_type pos = xpath.find_first_of("’\"");
  7.     if (pos == std::string::npos)
  8.         return "’" + xpath + "’";
  9.  
  10.     // If we cannot find the alternate quotation character, quote the
  11.     // expression in the alternate quotation character.
  12.     char chOther = (xpath[pos] == ‘"’ ? \’ : ‘"’);
  13.     pos = xpath.find(chOther, pos + 1);
  14.     if (pos == std::string::npos)
  15.         return chOther + xpath + chOther;
  16.  
  17.     // The string has both quotation characters.  We need to use concat()
  18.     // to form the string.
  19.     std::stringstream ss;
  20.     ss << "concat("
  21.        << chOther
  22.        << xpath.substr(0, pos)
  23.        << chOther;
  24.     do {
  25.         chOther = (xpath[pos] == ‘"’ ? \’ : ‘"’);
  26.         std::string::size_type pos2 = xpath.find(chOther, pos + 1);
  27.         ss << ‘,’
  28.            << chOther
  29.            << xpath.substr(pos, pos2 - pos)
  30.            << chOther;
  31.         pos = pos2;
  32.     } while (pos != std::string::npos);
  33.     ss << ")";
  34.  
  35.     return ss.str();
  36. }

Usage looks like:

  1. std::string lastName = …; // May come from user input
  2. std::string xpath = "//Customer[LastName = " +
  3.     QuoteXPathString(lastName) + "]";

2008 Cubs Predictions: Take 3

Baseball 1 Comment »

Chicago Cubs Logo

Latest Cubs prediction: 112-50 (0.368 team OBP, 3.73 team ERA, underlying equation). (Previous predictions: 113-49, 90-62)

To contrast, a simple extrapolation of their current 28-19 record predicts 97-65. 97-65 seems a lot more realistic than 112-50.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in