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