Friday, April 25, 2008

Advice for a New PhD Student

To succeed as a PhD student you must publish several papers in the best conferences and journals and become a world-renowned expert in your research area. For the first 2-3 years, classes and teaching will limit the amount of research you can do, so you should:

  • Review research literature - Before you can contribute, you must be an expert on the current state of research in your and peripheral areas.
    • Read lots of papers (IEEE, ACM, CiteSeer).
    • Take notes for each paper you read because you will forget! Write a Related Work-style paragraph. Write notes directly on the paper indicating the overall paper quality, whether it should be cited, tools mentioned that you can use, and important points.
    • Hint: References are valuable for finding relevant papers and conferences.

  • Start by publishing workshop papers - Don't make the mistake I did and submit to a top-tier conference like PLDI from the get go. You'll just waste a lot of time and have nothing to show for it but rejection letters. Make sure you vet your ideas by communicating extensively with your research peers and by publishing workshop papers. The benefits of publishing workshop papers are:
    • You can publish preliminary results and unfinished ideas to determine if your ideas are worth pursuing, find flaws in your logic/arguments, and learn what the main sticking points are and the common questions people ask.
    • Allows your paper/ideas to be peer reviewed so the workshop paper is really just a rough draft for a future conference paper
    • Meet people in your community
    • Pad your publication record
    • You gain practice giving talks. Hint: Practice your talk 2-3 times and make sure you don't exceed the alotted time.

  • Attend conferences and workshops - In the beginning of your PhD program, you should go to conferences and workshops even if you don't have a paper there. This helps to:
    • Make your name known. Remember, by the time you finish your PhD you should be "world renowned." This requires both publications and networking.
    • Find future co-authors
    • Get on future program committees

  • Learn your venues
    • Find out the best conferences and journals in your field (for Software Engineering, look here). Find out where important people in your field publish papers. Subscribe to the SEWORLD and ECOOP Info lists to find out about calls for papers.
    • Create a publication schedule that shows all the conferences and workshops in your area along with their deadlines. Eventually, your life will be structured around these deadlines. Periodically update the schedule so that you are always aware of upcoming deadlines.
    • When considering publishing at a venue, become familar with the papers published in previous years. Is it easy to obtain the papers? Do the papers show up on searches like Google, ACM, IEEE? If the answers are no, publishing at this venue may lessen your paper's impact.

  • Get a summer research internship
    • Line up post-PhD career - Summer internships are really just a recruiting vehicle. The company uses them to determine if they should hire you; for example, to determine if you can do great research. You should knock their socks off so they'll want to hire you after you graduate. Make sure you publish a paper.
    • Fun and profit - Internships are usually great fun, you meet a ton of other interns and contacts, and you make a lot more money than if you stayed at school.
    • Publish a paper - The best indicator of success for an internship is publishing a paper, either at the end of the internship or shortly after. This also communicates to the company that you can do research.
    • Make contacts
    • Hint:Apply in January
The last few years of your PhD should be devoted to research. You should be cranking out high-quality papers during this period and establishing a reputation for high-quality research.
  • Publish, publish, publish - My advisor (Al Aho) requires his PhD students to have "2 good ideas." This translates into 2 papers published in the best conferences (PLDI, POPL, ICSE, FSE, ECOOP, OOPSLA, etc.) and journals (TSE, etc.).
  • Participate - Try to serve on several program committees, serve on an organizing committee, and organize a workshop.
  • Find a job - You should be looking for a job now, not after you graduate.
    • Talk to people at conferences, etc. When these people are deciding who to hire, it will help tremendously that they know you.
    • Subscribe to job postings (CRA, Chronicle, SEWORLD)
    • Try to graduate in May since universities and research labs typically hire on a regular academic schedule. Assistant professor positions for Sept are usually posted in Oct and Sept of the previous year, application deadlines are usually in Jan and Feb, interviews are in Feb and Apr, and offers are made in Feb-May. Labs usually use the same schedule although the start date is immediate.

More advice:

  • Ruthlessly eliminate activities from your life that do not get you closer to finishing your PhD. Throughout your PhD, and especially before embarking on time-consuming activities, ask yourself, "Will this be in my thesis?" If you're spending most of your time coding, there's something wrong. No one cares how much code you write and the elaborate tools and systems you create. They only care about how many good papers you author. For example, I wasted several semesters creating an elaborate system for dynamic aspect-oriented programming and it never produced any publications and was not even mentioned in my thesis. Of course, all research requires some coding. However, rarely does the code see the light of day after you graduate. So keep it simple, quick, and dirty (e.g., PERL is fine). Also, use off-the-shelf software or get someone else to write it (see below). Research papers are a great source for finding out about tools that you can use such as metrics, profilers, compilers, static analyzers, etc.
    The only exception to this is if you are building something that many people will use, thus increasing your reputation. Your dissertation defense committee will appreciate this kind of research contribution. Companies also appreciate this kind of practical work. However, you'll need to develop, support, and market the software, which can be a huge time waster, especially if you don't have any help.

    The same caution about coding goes for teaching, reading, reviewing, meetings, demos, administrivia, etc.

  • Mentoring - Undergrads and master's students can help shoulder some of the coding burden. However, they can also be a huge waste of time and result in a negative net gain.
    • Experience - I like excellent programmers with industrial experience. Industrial experience means they are more likely to produce quality code, are good at collaborating and taking direction, and are likely to be familiar with source control. The more the student needs to learn (programming language, OS, source control, etc.), the more of your time they'll require, and the longer it will take for them to be productive (if ever). For this reason, I eschew undergrads, since they usually have very little programming or industrial experience.
    • Time constraints - I required all students to commit to at least 8 hours a week to working on my project. If the student is taking more than 2 other classes, it is likely they won't be able to meet this. This is another reason why I eschew undergrads, since they usually take a full course load and give the project low priority.
    • Management - You want self-motivated and self-managing students, otherwise you'll spend alot of time managing them. Create a project roadmap that provides enough detail for them to go complete the project. It should include an overview, requirements (checklist of things they need to do), use cases (concrete examples of scenarios they must support), and milestone dates. They should agree to the roadmap before signing up for the class. If you have the time, a good technique is to meet with the students in-person once a week for a combined status meeting and coding session. Create an agenda for student meetings to ensure all issues are addressed
  • Go deep - My mentor at Microsoft Research told me to find a concrete problem and "go deep." Don't try to solve a problem in the abstract. What do you want other people to consider you to be an expert on? Decide what that is and then know that thing better than anyone else in the world. While it may be fun to learn about tangential research areas, you want to be a world renowned expert in one thing not a jack-of-all-trades.
  • Focus on the hard problems - What's the point of getting a PhD if your work has no impact. Your success is measured by your contribution. If you're not working on the most important and hardest problems in your field, then you're contribution is muted. My advisor liked to ask, "Is this a $1000 problem or a $1B problem?"

Tuesday, February 19, 2008

Did I mention that graphics in Word 2007 suck?

A graphic in Word 2007 can be a drawing (created using Shapes), text box, drawing canvas, picture, equation, table, chart, etc. In addition to the layout issues I mentioned in the last post, it is very hard to transfer a graphic between Word 2007 and other programs, including other Microsoft Office programs. In one case I needed to transfer an equation to PowerPoint. In other case I needed to save a drawing and found out that I first had to copy-and-paste the drawing into another program to save it (i.e., there is no way to directly save a graphic in Word). Let me demonstrate how this goes horribly wrong.

I created the following graphic in Word 2007 using shapes inside a drawing canvas (the image below was created using a screen capture (ALT+Print Screen)):

The font for the code is Courier New and for the rest is Palatino Linotype. If you look closely at the screenshot you'll see that the letters are not completely black. This is because they were rendered using the Clear Type font smoothing technology.

The first problem is that there is no way to save this graphic to a file directly. I have to first paste it into another program. Okay, no problem, let's try Microsoft Paint:



WYSIWYG my ass! As you can the fonts and line spacing have changed drastically. The Java code inside the middle box and the "Program Elements" text have been cutoff. Okay, so next I try pasting into PowerPoint 2007. Here's what I got after trying all the different paste options:

As HTML

Above is the closest I get to the screenshot. Notice how the font is different and much darker.

As PNG (same As GIF and As Extended Metafile)

These (PNG, GIF, and Extended Metafile) all look the same as pasting into Microsoft Paint, that is, pretty bad.

As Microsoft Office Graphic Object




What's the most disturbing about the above is that this is Microsoft's own graphic object format for Microsoft Office, designed for compatibility with other Microsoft Office programs. As you can see, it looks horrible. The Windows Metafile format below, another one of Microsoft's compatability formats, also looks really bad:

As Windows Metafile

However, nothing prepared me for what came next:

As JPEG



I guess black is the new white.

It is sad that the best reproduction of a Word 2007 graphic is via ALT+Print Screen.

Thursday, February 14, 2008

Layout in Word 2007 sucks!

Layout of pictures, tables, drawing canvases, text boxes, spreadsheets, and equations is seriously broken in Word 2007. First, there's no universal way to layout non-text. For example, Drawing Canvases were a nice addition to Word 2007 but they are not very useful since you can't embed tables, spreadsheet, or equations. For tables, you can work around this by embedding the table in a text box, and then embedding the text box in the drawing canvas. However, for spreadsheets and equations, you're out of luck. Perhaps this is a problem when trying to embed any OLE document, although I would assume Microsoft could get this to work properly for their own office suite.

Far more annoying is the schizophrenic layout algorithm in Word 2007. I assume that behind the scenes it's trying to balance keeping paragraphs whole, avoiding orphaned section titles, anchoring, etc., but the outcome is often surprising and wrong. For example, I'll insert a graphic into a page and it will cause the previous page to now have a blank spot that takes up 90% of the page. Most surpising: the graphic could easily fit inside that blank spot!

Most of the time I want a block graph at the top or bottom of the page but Word seems to have a prediliction for inserting graphics inline (e.g., newspaper style) and moving the graphics with the text. To accomplish this Word appears to "anchor" images at the point of insertion. I wish there was a way to completely turn off the anchors (no, Lock Anchor and Top and Bottom Text Wrapping doesn't do this) and for Word to just flow text around the blocks.

I've been struggling with this issues for years. I wish I had learned LaTex!

Sunday, February 10, 2008

Table of Contents in Word 2007 sucks!

The Table of Contents feature in Word 2007 is seriously broken. Sometimes the entries for figures have different fonts, which makes the toc look like a ransom letter. I had to go to a correct figure caption and then copy-and-paste it into the incorrect captions to make all the entries consistent. What's most annoying is that the incorrect entries effectively ignore the style setting specified in "Insert Table of Contents..." -> Formats="From Template" -> "Modify..."

Worse, I'll save my document and then reopen it, and a bunch of seemingly random lines from the cover page, other parts of the document, etc. suddenly appear in the Document Map and TOC. For some unknown reason, the Outline Level for these lines is set to "Level 1." After I change the Outline Level for all the lines to "Body Text," everything looks fine. However, if I change the Outline Level for the "Table of Contents" line to "Body Text," and save and then reopen, all the lines are set back to Level 1 and show up in the TOC again!

Workaround
The field code for my TOC is

{TOC \o "1-3" \h \z}

This pulls in all headers at outline level 1-3 and all other text with Outline Level 1-3. To pull in things like "List of Figures" and "Bibliography" I create a new style and set the Outline Level to 1. Make sure the text "Table of Contents" that immediately preceeds the actual TOC is not a heading style.

I hope this helps! If anyone has a better solution, please leave a comment!

Wednesday, July 04, 2007

Newborn Tips

Disclaimer: These things worked for us. Your mileage may vary.

Here's some tips for parents of newborns:

  • Try to sleep when the baby sleeps. Swaddling helped us tremendously to get our babies to sleep. Velcro swaddlers are super easy.
  • If the baby is crying, check if she's hungry, lonely, sleepy, wet, hot/cold, etc. Sometimes she cries for no apparent reason (she could be gassy (most common), over-tired, over-stimulated, cranky, or just blowing off steam after a long day). If you keep trying different things to appease her, either you'll fix the problem, or eventually enough time will pass, and she'll stop crying.
  • Practice Dr. Karp's five S's: swaddle, side/stomach position (we didn't use this one), shushing, swinging, and sucking. They work miracles! http://www.babyslumber.com/happiestbaby.html. I recommend getting his book and DVD. A pacifier is also very helpful.
  • Get a Boppy. Makes it easier to breast- or bottle-feed, and keeps her at an angle after feeding to reduce likelihood of spit-up. The boppy helped both our babies fall asleep.
  • Get a Baby Papasan, rocker, or (big) swing. This will keep some babies occupied for a 1/2 hour or so.
  • Get a Baby Bjorne. Easier than a stroller for short jaunts. Babies often fall right asleep in this.
  • Take a break! Friends/family will offer to babysit. Take them up on it! You both need a break from the baby and each other to stay sane.
  • Get a baby book like "How To Understand Your Baby's Symptoms." Babies do all sorts of alarming things like spit up, throw up, wheeze, gag, cry, etc. The more knowledge of what is normal vs abnormal will help alleviate anxiety.
  • Moms should join a "new moms" group (or several). You'll make a ton of new friends who will have a lot in common (to replace the many non-parent friends you'll lose). It's extremely helpful to know that other moms are dealing with the same issues as you, and what worked or didn't. Don't just listen to your parents' advice! :) This new network is also great for organizing babysitting exchanges, organizing play dates, obtaining babysitter/nanny/pediatrician/school/etc. references, barrowing baby gear, tips/advice, etc. etc.

Here's a bunch of stuff that's really handy to have for newborns:

  • Pacifier - Sooths the baby and helps them fall asleep.
  • Baby Papasan, rocker, or (big) swing
  • Boppy
  • Microwave sterilizer - If you feel you need to sterilize bottles, nipples, etc.
  • Velcro swaddlers - Helps baby fall asleep during the first 3 months.
  • Bjorn baby carrier
  • Graco MetroLite LE stroller - We've had one for over 2 yrs. Extremely sturdy and has a great storage basket.
  • "Happiest Baby on the Block" book
  • "Healthy Sleep, Happy Child" book - Both our babies were sleeping through the night at 2 months thanks in part to this book.
  • "How To Understand Your Baby's Symptoms" book
And for toddlers:
  • Bumkin bib
  • FisherPrice booster seat

Sunday, February 04, 2007

Begin With the End in Mind

Imagine your funeral and listen to what you would like the eulogist to say about you. This should reveal exactly what matters most to you in your life.

(From Randy Paush's Time Mangement talk.)

Thursday, January 18, 2007

My consumer self, summed up in one image

I got this off of my My Amazon page.

Pretty accurate (except for "Romance", "Chevy Chase", and "Erotic" (WTF?)). Perhaps when we meet someone new, we should compare word maps.

Thursday, December 28, 2006

Stuff They Did Right in Vista

To be fair, I do have to mention a few things I LIKE about Vista:


Task Manager
The Processes tab now shows the command-line and a description for each process. You can also right-click on a process and view its properties or open the executable's folder. These improvements make it real easy to figure out what each process is for (especially for identifying services associated with svchost.exe processes), and for rooting out spyware and gratuitous resource hogs.





The new Services tab is much more convenient than the Services applet. You can navigate directly to the process associated with a service by right-clicking on the service and selecting "Go to process".






Resource Monitor
You can see which processes are consuming the most CPU, memory, network bandwidth, and disk access. This takes the guesswork out of figuring out who is hogging up the network bandwidth.



Ubiquitous and fast search
There's a search box in the Start Menu, Open File dialogs, IE 7, and Windows Explorer. Definitely speeds things up.

Oooohhh, pretty!
The Windows Aero glass interface looks very nice. My nontechie wife was won over by the new photo screensaver.

Automatic offline file synchronization

Haven't tried this yet.

Windows Explorer
Tasks are now placed in a dedicated toolbar instead of the XP way where a task panel fought with the folders panel for screen real estate.

The new drop down arrows in the address bar make it very easy to navigate your directory hierarchy, especially when you need to backtrack to a neighboring subdirectory (I find that I do this a lot).

Other new features are the Open Command Prompt Here and Restore Previous Version right mouse menu items. Vista automatically stores previous versions of files and folders. It must be doing something fancy under the covers to not store the entire contents of the file/folder (perhaps it's using the differencing algorithms used by offline file synchronization).

I like the level of detail control for listing files (CTRL+mouse wheel).

The only thing I don't like is that the default folder that you start in is your profile folder which is totally useless. Just getting to the C:\ drive takes several clicks and scrolling. Much more painful than with XP.

Saturday, December 16, 2006

Stay away from Vista RTM!

My computer is now completely screwed because of Vista RTM. After I upgraded from XP to Vista RTM, I encountered numerous problems:

(Note: Most of these problems were for my desktop. Strangely, my laptop has had no problems with Vista RTM.)
  1. RTM not ready for primetime. Many devices (printers, pocket pc, etc.) don't work. For example, Canon and HP aren't planning on providing Vista drivers until 2007. Dell won't support Vista until March 2007. If you have problems with your Dell system after installing Vista RTM, you're out of luck! Even several Microsoft products (SQL Server, VS 2005) don't support Vista yet.
  2. Diagnostics suck. Event Viewer is useless. Clicking on the "Get Help Online" link for an event shows a web page that says "yada yada, OS (Vista) not supported, yada yada". No Error Reporting or Dr. Watson. Programs die silently like they used to for Win 95.
  3. Outlook 2007 crashes. (This happens on my desktop not my laptop.) I eventually had to uninstall Office 2007, install Office XP, and upgrade to Office 2007.
  4. SLOW! My overall impression of Vista is that everything related to the shell is slower than with XP. Startup is very very slow (~10 mins). Event Viewer reports errors confirming the slowness. (This is only a problem for my desktop computer, my laptop has no problems.)
  5. Registry Editor no longer highlights the open key. So when you do a search, you have to track down the right key manually.
  6. Security is totally annoying! I seriously have to click on 5 different versions of "Allow" in order to install a piece of software. I have to click a nag box even for simple things. I'm close to turning off User Account Control and other security features just because it is so annoying.
  7. Overall flakiness. I suspect this is because of the new User Account Control feature. For example, clicking on "Update my score" in Performance Information and Tools eventually causes a message about a problem with WinSTA. Many installation programs (including Microsoft's) assume you are running as Administrator and will fail in mysterious ways.
  8. Hard to customize the Start Menu. It used to be as simple as dropping program icons into a new folder. For some reason (probably User Account Control) I'm not able to do this.

UPDATE: I finally gave up on Vista RTM after realizing that my printer, Pocket PC, Outlook, VPN connection to my office, and audio DO NOT WORK and most other things are SLOW or FLAKY. I decided to rollback to Windows XP. Curse you Vista RTM! You cost me 4 days! KAAAAAAAAAAAHNN!

Monday, December 04, 2006

Creating Desktop Shortcuts for Outlook 2007 notes

I like to have a desktop shortcut for my TODO note in Outlook. The way this is done changed in Outlook 2007:

1. Right-click on your desktop and select New -> Shortcut
2. You'll be prompted for a target program. Locate outlook.exe.
3. Right-click on the new shortcut and select Properties
4. Add the /select switch to the command-line. Here's an example:

"C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE" /select outlook:Notes/~TODO

The name after the tilde (~) is the name of note you want to open.

Tuesday, November 14, 2006

Tips to Save Money, or "Cheap Seats for My Cheap Ass"

As a PhD student I've had to cut back quite a bit on expenses. I've managed to cut back my yearly budget by $10k. Here are some of my tips:

1. Get rid of your landline. You can use your cell phone or Skype (calls in the US are now free) for all your calls. I was paying $46 for basic local service (no long distance!) from AT&T! I also consolidated my cell phone plans under a family plan and now pay $10 less. Check if your company or school offers a cell phone discount. Reducing these unnecessary monthly costs results in tremendous savings over the year.

2. Temporarily suspend cable and phone when away. Have phone and cable company temporarily suspend service if you're going away for more than a few weeks.

3. Save on electricity. Use a fan or open windows instead of AC. Turn off lights. Try not to leave the frig open. Turn off computer when you aren't using it. Turn off and unplug all appliances when you go on vacation. Unplugging them is necessary because many appliances still consume energy when turned off.

4. Don't pay retail for clothes. I buy almost all my clothes from TJ MAX, Marshall's, Filene's Basement, outlet stores, or when a retail store is having a mad sale. And I always get complements on my clothes! Don't buy too many clothes or they will end up getting lost in the clutter that is your closet. We were able to cut our budget down by 30% by simply reducing clothes shopping.

5. Did you seriously pay retail for a DVD or CD? Buy them used! They still sound and look the same. Do your really need to own the movie? Come'on, how many times do you really think you'll watch it. Rent it from NetFlix or use PayPerView. Exchange your used CDs using LaLa.

6. Books want to be cheap or free. Half.com consistently has the lowest prices. However, checkout AddAll, the best used & new book price comparison shopping engine around. The library has a ton of books and videos which you can checkout for free. Why buy a travel book you are only going to use for a few days? Get it from the library!

7. Comparison shop online. I get significant savings by comparing the prices of different car rental companies (I never rent without using a coupon), airlines, hotels, photo gift companies, electronics companies, book stores, etc., and using any coupons I can find. Beware though, while the savings are substantial, doing a thorough comparison including mining coupons can take hours.

8. Online coupons rawk! Right before I purchase something I google for a coupon ("snapfish coupons"). Surprisingly, this works most of the time. Although I haven't gone to this extreme, for high priced items it may be worth it to buy a coupon on eBay. BTW, mail-in rebates suck! People often don't mail in the rebate and companies make it as hard as possible to get the rebate. Not worth the trouble!

9. BUY electronics and games as LATE as possible. I get very frustrated by the breakneck pace that new versions of electronics are put out and prices drop. I bought a 1 GB flash card for $200 a few years ago and now its $15. Postpone buying electronics as long as possible and you'll either be rewarded with lower prices or a better version at the same price.

10. SELL electronics, games, and textbooks ASAFP. Electronics and textbooks depreciate like crazy. If you are no longer using it, sell it as soon as possible. This reduces the chance that a newer version will come out that people will want instead. No one will buy your v1 textbook when professors are assigning v2. This is even more true for electronics and games. Used games start to saturate the resell market soon after the game is released. Selling your used game as soon as your done with it will get you the best price.

11. Eat for less. Buy things in bulk. Cook what's on sale that week. Use coupons. If you are really brave hearted, buy restaurant coupons from restaurant.com (tips: verify with restaurant before buying a coupon or eating there, and don't stockpile coupons when they go on sale). I try not to go out to eat completely famished or else I end up getting appetizers and filling up on bread. When the waitress takes your order, tell her discretely you want a separate check. That way, you don't get stuck paying for someone else's extravagances. Making your own breakfast, lunch, and dinner will save you a ton. Try making the food in bulk to save time and even more money.

12. Brew your own coffee. Those $3 lattes from Starbucks add up. I make my own coffee at about $.50 a cup and it invariably tastes better than from a coffee shop. I use a thermos so I can drink coffee throughout the day.

13. Reuse is the best recycle. I try to reuse stuff (aluminum foil, freezer bags, plastic takeout containers, scrap paper, plastic grocery bags, etc.) as much as possible instead of discarding or recycling it. Okay, so this doesn't save you much money, but your left with a warm feeling inside.

14. The baby doesn't know it's a Bugaboo. Don't buy brand-new designer baby gear or clothes for your kid. The baby a) will outgrow it faster than you can say WTF, b) will destroy it at a rate that's proportional to its worth, c) will not appreciate the extra expense, and d) will slowly be spoiled rotten. The best baby stuff (gear, toys, clothes) is second hand and eventually passed on to the next child.

15. Don't overpay for plane tickets. If you travel the same route each year, you should know what the fare range is. Use Farecast to find out what other people have paid for the tickets and forecast fare fluctuations. Then buy when the price is right. Several airline sites have a service (e.g., Orbitz DealDetector) that will notify you when the price goes below your threshold. Also, the standard tips apply: Buy in advance. Sat night stay. Travel on weekdays. Use the "flexible dates" option if possible. Ticket prices fluctuate like an Irishman's cadence so check back often. Finally, check for "last minute fares". Airplane seats are perishable goods and airlines prefer to sell them at a steep discount a few days before the flight rather then leave them empty.

16. Buy from a reseller or get it free. garage sales, craigslist.com, ebay.com, freecycle.org

17. It's all about the reward points. I pay almost all of my expenses using my credit card (phone, cell, cable, internet, groceries, medical, restaurants, shopping, etc.). I often buy $1 items using my CC. The best is when I can charge an item to my CC which my insurance or company will reimburse -- free points! When I eat out with friends, after everyone puts down their cash, I'll proclaim "Points!", grab the cash, and pay the whole bill with my CC. The only ones who mind also want points so we usually trade off. I rack up tens of thousands of points each year which translates into hundreds of dollars in gift cards (Macys, BR, Starbucks, etc.). Don't ever buy merchandise using points, stick to gift cards which have a better point-to-dollar ratio. Lamely, I only get about a 1% return, although several CCs have 1, 3, or 5% returns, and some even give you cash or credit instead of points. I've got so many vendors tied into my current CC that its too painful to switch! A great side benefit is that I get a year-end statement that shows all my expenses, which is invaluable when I do my yearly budget and tax deductions.

18. Use loyalty cards. Keep using the loyalty cards for your favorite grocery store, coffee shop, deli, etc., and you'll eventually get something for free. For example, after spending $100 at Duane Reade you get a $5 off coupon. If you have a 529 plan for your child, you can register your loyalty cards, bank cards, and credit cards at upromise.com, and when you buy UPromise items you'll get a few cents deposited in your account.

19. Earn money by getting emails. Signup at MyPoints (tell 'em meaddy sent you if you want to be nice) and you'll get points for clicking on email ads. After a few hundred emails you get a $10 gift card.

Other tips:
http://www.creditcardlowdown.com/2006/11/101_ways_to_cut.html
http://www.thriftymommy.com/top-25-ways-i-save-money/
http://www.thriftymommy.com/25-more-ways-to-save-money/

Friday, October 06, 2006

Viewing another user's Desktop Folder on XP

I have two computers on my network and I like to move files back and forth. Normally, the user's account folder (C:\Documents and Settings\) is not accessible. However, if you know the login for that user, you can access it. Go to Control Panel, User Accounts, select the account you are currently logged in as, then Manage my network passwords, then click Add. Type the server and login for the user's account you want access to.

Monday, June 05, 2006

Wicca v2 website is up!

The Wicca v2 project website is now online. Wicca supports static and dynamic aspect-oriented programming (AOP) using byte code, source code, and breakpoint weaving.

Monday, May 29, 2006

Accessing mdbg COM wrappers from native C++

I needed a way to pass the Debugger COM object wrappers from mdbg to a COM library I wrote in native C++. Suppose you want to pass ICorDebugModule from mdbg (or, more likely, an mdbg plugin) to a C++ COM object:

  1. In your COM object's IDL file, add a method that will be called from mdbg:

    interface IHelper : IDispatch {
    ...
    HRESULT HelperMethod([in] LONGLONG piunkCorDebugModule);
    ...

  2. Add the method implementation:

    STDMETHODIMP IHelper::HelperMethod(/*[in]*/ LONGLONG piunkCorDebugModule)
    {
    CComPtr spiCorDebugModule;
    hr = ((IUnknown*) piunkCorModule)->QueryInterface(__uuidof(spiCorDebugModule.p),
    (void**) &spiCorDebugModule.p);
    ...

  3. Create a COM Interop assembly for your COM object so you can call it from managed code. Right click on mdbg (or your mdbg plugin) and select Add Reference. Click on the COM tab and select your COM object.
  4. Call the COM method from mdbg/plugin:

    using System.Runtime.InteropServices;

    IntPtr ptrUnkCorDebugModule = Marshal.GetIUnknownForObject(
    module.CorModule.CorModuleInterface);

    HelperLib.IHelper = new HelperLib.IHelper();
    helper.HelperMethod(ptrUnkCorDebugModule);

Thursday, April 20, 2006

Dynamic binary weaving using mdbg works!

I took one of the C# samples (see attached typefinder.cs) from the Microsoft SSCLI 2.0 package and built it using the regular C# compiler. I then launched it using Wicca and wove a Logging aspect at runtime:
mdbg.exe -verbosity 0 -nologo !load wicca.dll !wtype binary !wrun typefinder.exe html !weave LogAspect.dll !wgo !quit

Here's an explanation of the command-line:

mdbg.exe The Microsoft Managed Debugger.

-verbosity 0 Keep debugger messages to a minimum.

-nologo Don't display the Managed Debugger logo.

!load wicca.dll Load our plugin.

!wtype binary Use binary weaving. We also support breakpoint
weaving using the Debugger's Breakpoint API.

!wrun typefinder.exe html Launch the typefinder.exe
client program in suspended mode. Typefinder
is a sample program that searches for classes
and interfaces that include the string specified
on the command-line (we just specify "html").

!weave LogAspect.dll Weave in the Logging aspect (see attached
LogAspect.cs). The aspect causes all Reflection
calls made by typefinder.exe to be logged. We
use Phx.Morph to weave in the aspect. Our
AssemblyDiff component diffs the original and
woven executables and creates the delta files
(.dil and .dmeta). Wicca then calls the
Debugger's Edit-and-Continue API to patch the
running program using the delta files.

!wgo Resume execution of the newly woven Typefinder.
The output is attached (dotest.txt).

!quit Exit the Managed Debugger when Typefinder exits.

This is our first successful nontrivial test, but there are still numerous issues to work out. The goal is for dynamic (binary and breakpoint) weaving to be at parity with static weaving (using Phx.Morph). The only difference is that dynamic weaving is currently much slower.

Wednesday, April 12, 2006

Tricking ildasm Into Dumping a Metadata Delta File

I found a way to trick ildasm into dumping the metadata delta file. Just add .obj to the filename and constrain the output:

> ildasm HelloWorld.exe.1.dmeta.obj /text /metadata=raw /metadata=heaps