What is up.
RSS icon Email icon Home icon
  • VMWare Fusion

    Posted on January 18th, 2011 Alan No comments

    VMWare has been around for over 10 years.  It’s an amazing piece of technology.  I’ve not had a chance to use it until now.  VMWare let’s you run “virtual” OS s on your computer using virtualization. This is how VMWare defines virtualization:

    Today’s x86 computer hardware was designed to run a single operating system and a single application, leaving most machines vastly underutilized. Virtualization lets you run multiple virtual machines on a single physical machine, with each virtual machine sharing the resources of that one physical computer across multiple environments. Different virtual machines can run different operating systems and multiple applications on the same physical computer.

    Basically, it means you can run ANY version of Windows on a single Windows PC, or on a single Mac or a single Linux machine.  You can also run any version of Windows on a Mac which is what we have standardized on at TabbedOut. We get 13in Macbook Pros with 4 Meg of memory and a large external monitor.  We then install VMWare and run whatever version of windows we need to on it!  This combined with Spaces for the Mac makes for a pretty nice development environment.

    A few notes about VMWare Fusion:

    • To rename a VM, go to VM Library, select the VM you want to rename, select settings, then click on the name to change it in place.
    • To rename the folder containing a VM, remove the VM from the VM Library by selecting delete and removing it from the list but be sure to KEEP the file so you don’t remove it from disk.  Then just rename the folder and reload it back into the VM Library by using the File…Open command
    • To increase the hard drive size of a VM you must delete all snapshots, select hard drive settings and increase the hard drive size. Run the VM and in the OS increase the size of the partition.  For XP you must use a 3rd party app as this is not supported natively.  I used the free EASEUS Home edition.

    Explanation of files that make up a VM

  • Mac Spaces

    Posted on January 18th, 2011 Alan 1 comment

    I’m digging the Spaces feature of the Mac OS.  I should have been using this a long time ago!
    If you are unfamiliar with Spaces, the feature gives you multiple “virtual” windows that you can switch between.
    It’s like having multiple monitors connected to your computer each with different views of your running apps.

    In the Settings for Spaces I redefined the hotkeys that switches between spaces.  It was assigned to <Ctrl>arrows but that prevented me from using those hotkeys to move around (word advance) in Visual Studio (using VMWare).  I reassigned the hotkey to be <option>arrows which had the added benefit of disabling Windows 7 hotkey to resize the current window (which I find annoying).

  • Running Windows 7 on my new Macbook Pro

    Posted on November 29th, 2010 Alan No comments

    Who says you can’t have it all?   I’ll be leaving my current job soon and with it the use of a Windows laptop and MacBook Pro.  Last week I decided to go all in and spend the $2000 plus on a new MacBook Pro and install Windows 7 on it.  The installation of Windows 7 using Bootcamp went smoothly.  Windows 7 runs great and looks great on it!  I used the free copy of Windows 7 Ultimate I received in the mail.  I now have some great hardware that I can boot Mac OSX or Windows 7 on and do my Mac or Windows development from a single laptop.  The MacBook is fast and I have Vegas Movie Studio HD Platinum 10 installed to do video editing.  I can render out a video from Vegas and playback video real-time at the same time!

    I have to discover and get use to how to do things in Windows from the MacBook.  Here are some items of note:

    forward delete: <fn><delete>
    Start of line: <fn><left arrow>
    End of line: <fn><right arrow>
    Next word: <control><right arrow>
    Previous word: <control><left arrow>
    PageUp: <fn><arrow up>
    PageDn: <fn><arrow dn>
    Scroll Line Up: <fn><arrow up>
    Scroll Line Down: <fn><arrow down>
    Move cursor to top of screen: <control><fn><arrow up>
    Move cursor to bottom of screen: <control><fn><arrow down>
    <fn><Enter> Insert

    PrintScreen on Windows using Macbook Pro keyboard:

    fn-F11 or alt/option-fn-F11
    fn-F11 will print the entire screen. Adding the alt/option key targets just the active window.
    As a last resort, use Start > All Programs > Accessories > Accessibility > On-Screen Keyboard, where you’ll find a psc key.

    You can find all the Mac hotkeys here.

    Print Screen on Mac

    How to Print Screen to a file on the desktop on Mac

    The basic functionality of taking a screen capture of a window or desktop in Mac OS X takes an image and dumps it to a file on the Mac desktop. Each uses the pressing of Command and Shift keys concurrently as the basis for execution, followed by a number:

    • Command+Shift+3: takes a screenshot of the full screen (or screens if multiple monitors), and save it as a file to the desktop
    • Command+Shift+4: brings up a selection box so you can specify an area to take a screenshot of, then save it as a file to the desktop
    • Command+Shift+4, then spacebar, then click a window: takes a screenshot of a window only and saves it as a file to the desktop

    How to Print Screen to the Clipboard on a Mac

    This functions a lot more like Print Screen in the Windows world. If you want to do the equivalent of Print Screen to the clipboard so that you can paste it into another app, these are the commands you’d want to use:

    • Command+Control+Shift+3: take a screenshot of the entire screen (screens if multiple monitors), and saves it to the clipboard for pasting elsewhere
    • Command+Control+Shift+4, then select an area: takes a screenshot of selection and saves it to the clipboard for pasting elsewhere
    • Command+Control+Shift+4, then space, then click a window: takes a screenshot of a window and saves it to the clipboard for pasting
  • One Click Build with Visual Studio 2008 & Inno Setup

    Posted on November 4th, 2010 Alan No comments
    Creating installers using Inno Setup is possible as a post build step in Visual Studio.  You must have  the Inno Setup preprocessor installed.
    1. Add a new project of type Empty Project (I name it BuildAll).
    2. I like renaming the project in the solution as _BuildAll so that it appears first
    3. Change the  Configuration  Type to Utility (Configuration Properties…General)
    4. Delete default filter folders.
    5. Add install related files to the project.  Any readme files, the .iss Inno setup script, etc.
    6. Set project dependencies for the _BuildAll project
    7. Select project’s Post-Build Event setting (Configuration Properties…Build Events).  Add something similar to:

    iscc /DConfigurationName=$(ConfigurationName) “$(SolutionDir)\Installers\sample.iss”

    Be sure ISCC.exe is in the system path (Right-click Computer…Properties…Advanced system settings…Environment Variables).  Add C:\Program Files (x86)\Inno Setup 5  to the Path.

  • Should Johnny Learn to Program?

    Posted on October 29th, 2010 Alan No comments

    Points and counter points on whether programming should be something all  kids should learn: Should Johnny Learn to Program?

    I’m on the  side of no, programming is not a basic skill everyone should learn.  I like this counterpoint:

    The giant hole in our workforce isn’t entry level developers who can hash out c code and write a compiler from scratch. It is for people with combined skills who can APPLY encapsulated technology (lots thanks to companies has been encapsulated) to specific domains.

    Let’s stop trying to train the mass of high school students to become preservation carpenters, and instead make them very good contractors.

    My reply:

    I would recommend a deeper understanding of computing for the USER.  People don’t have a clue of the very basics of computing.

    How many people click on an attachment to save and can never find it again?  People don’t understand the concept of CC vs BCC.  Folks don’t not the difference between  an Operating System, a browser, and a website.  Learning how to program is NOT something everyone should learn.  Phillips is right on the mark in suggesting we adjust the education system to teach application of encapsulated technology.  A good book on the subject is Daniel Pink’s A While New Mind.

  • UAC

    Posted on August 26th, 2010 Alan No comments

    User Access Control has been causing me fits.
    With UAC on, if you attempt to open a registry key in the LOCAL_MACHINE hive and you specify WRITE permissions, it will fail (that was a bug on my part).
    Something else to consider is that processes of different  integrity levels cannot send/post messages to each other.  This post has a good explanation of that and a work around.

  • Mercurial For Source Control

    Posted on March 19th, 2010 Alan No comments

    It appears that Subversion is no longer where it’s at.  We now have Mercurial.

    Joel has a nice tutorial f or Mercurial.

    There is TortoiseHG for Explorer Integration which is what I installed which included Mercurial.

    Two plugins for Visual Studio exists as well: VisualHG, hgscc

    Update:  I was unable to get hgscc to work on Windows 7 VS 2008.  Any attempts to add a file from  within VS resulted in a generic error  message.  I uninstalled hgscc by right clicking the .msi install file and selecting uninstall

  • C Run-Time Error R6025 pure virtual function call

    Posted on March 3rd, 2010 Alan No comments

    I did a bad bad thing.

    Not so bad.  Calling a virtual pure function using a pointer to the abstract base class, or calling  it before the derived class has been initialized (in the constructor of the abstract class for example), is a no no.  I did the latter.

    Here is Microsoft’s explanation:

    No object has been instantiated to handle the pure virtual function call. This error is caused by calling a virtual function in an abstract base class through a pointer which is created by a cast to the type of the derived class, but is actually a pointer to the base class. This can occur when casting from a void* to a pointer to a class when the void* was created during the construction of the base class.

    And an explanation and example of the exact thing I did:

       /* Compile options needed: none
       */ 
    
       class A;
    
       void fcn( A* );
    
       class A
       {
       public:
           virtual void f() = 0;
           A() { fcn( this ); }
       };
    
       class B : A
       {
           void f() { }
       };
    
       void fcn( A* p )
       {
           p->f();
       }
    
       // The declaration below invokes class B's constructor, which
       // first calls class A's constructor, which calls fcn. Then
       // fcn calls A::f, which is a pure virtual function, and
       // this causes the run-time error. B has not been constructed
       // at this point, so the B::f cannot be called. You would not
       // want it to be called because it could depend on something
       // in B that has not been initialized yet.
    
       B b;
    
       void main()
       {
       }

    I was actually able to make the following adjustment:

    Before:

    A:A()
    {
    VirtualPureFunction();
    }

    B:B() : A()
    {
    }

    After:

    A:A()
    {
    // VirtualPureFunction(); //  Don’t call  here.  Derived object not guaranteed to be intialized
    }

    B:B() : A()
    {
    VirtualPureFunction(); // Safe to call here since A() constructor already called
    }

  • Writing portable code

    Posted on January 17th, 2010 Alan No comments

    Mozilla C++ Portability Guide – for portability across ALL C++ compilers

  • Registry Reflection (WOW6432)

    Posted on December 7th, 2009 Alan No comments

    Supporting 32-bit & 64-bit applications can be a bit hairy.  In regards to the Registry, Windows 7 washes it’s hands of the Registry Reflection business previously supported.