Sunday, December 11, 2011

Custom resolution for Ubuntu VM running in VirtualBox on Linux

So, I've got a Ubuntu server linux box where I run VirtualBox VM's, including an Ubuntu Desktop machine that I remotely display on my Windows box. (Yeah, I know, confusing and overly complicated.) Anyway, when running Gnome on the Ubuntu desktop, the maximum resolution it would give me was 1360x768. Since I have a 1920x1200 monitor on my Windows machine where I run my X server, I wanted a bigger Ubuntu desktop.

The most useful post I found was this: http://www.ubuntugeek.com/how-change-display-resolution-settings-using-xrandr.html

I ran the following commands:

  1. cvt 1680 1050 -- get a X modeline similar to "1680x1050_60.00" 146.25.... (more numbers)
  2. xrandr --newmode {output of the previous modeline}
  3. xrandr --addmode VBOX1 1680x1050_60.00 (causes the X display to flash)
  4. Use System > Preferences > Monitors to pick my new resolution
Voila. Easy, peasy. Works great now.


Friday, November 4, 2011

Windows 7 idle screen saver doesn't start with KVM and wireless mouse

I noticed after installing Windows 7 on my machine that it no longer goes to screen saver when the machine sits idle for a while. Originally, I suspected this was due to the KVM that I had hooked up. It must be sending some kind of heartbeat signal which keeps the screen from going idle. Some googling revealed there was a known issue with using a MS wireless mouse that can cause this problem. The fix was to install some optional Windows Update fixes that deal with HID drivers. After installing the fix, it started going to sleep properly on my desktop. Unfortunately, I don't seem to have the same update options available for my Windows 7 Professional Dell laptop, so I'm not sure if it's a global fix.

In the end, I discovered that the real cause was, in fact, the old-school MS wireless mouse. I replaced it with a newer one and the problem magically went away on both my laptop and desktop machines.

Tuesday, October 25, 2011

Repairing 'svnsync: malformed file' error with subversion


I recently had a sync or other failure of svnsync which left me with a bum repository. Every time we tried to do svnsync, it reported "svnsync: malformed file." I got the same error with all svnadmin access.

I found this link: http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1892873&orderBy=createDate&orderType=desc and provided some good clues. I noticed that my file in db\revprops\0 had junk in it instead of normal stuff. It should have looked like this:

K 8
svn:date
V 27
2010-07-21T02:55:12.203323Z
K 17
svn:sync-from-url
V 45
https://portal.secureci.com/svn/secureci
K 18
svn:sync-from-uuid
V 36
b443ad56-1e36-4a4f-97ef-7144cc153033
K 24
svn:sync-last-merged-rev
V 1
0
END


What I did to fix it:

  • cd c:/temp
  • svnadmin create svn-sync2
  • Copy hooks/pre-revprop-change.bat file from broken repository to new one
  • svnsync --username svnsync initialize file:///c:/temp/svn-sync2 https://portal.secureci.com/svn/securci
  • Copy the db/revprops/0/0 file from the new repos to the broken one
  • Edit the 0 file and fix the 'sync-last-merged-rev' entry to have the correct number.
    • Look in db/revprops/2 (or highest number) and locate the most recent numbered file (e.g., 2437)
    • Change '0' value below "V 1" to be "2437"
    • Change the V1 line to be "V 4" for 4 character length
  • Run 'svnadmin verify .' in the main directory of your broken repository to make sure that it has everything intact. (This may take a little while.)
  • Run 'svnsync --username svnsync synchronize file:///c:/SecureCIdata/svn/repos/secureci' and make sure synchronization goes smoothly
That's it. Syncing should work normally now.

Wednesday, October 5, 2011

DOS batch file stderr redirection

I never remember the whether the syntax of DOS file redirection is similar to normal Unix file redirection. It is. So I'm writing it down where I can find it.

CALL .\somescript.bat >> logfile.log 2>&1

Of note, I recently learned that redirecting output from a PowerShell script does NOT work very well and gives file handle errors. That's another story, entirely.

Common DOS batch file error handling mistakes I make

I write a decent amount of batch scripts now days to automate things on windows server boxes. Unfortunately, I don't do it quite frequently enough to remember all the crazy syntax of DOS commands. One of these errors is error handling. These are the things I commonly need to deal with.

I found this page (and site) very helpful for all DOS related stuff: http://www.robvanderwoude.com/errorlevel.php

  1. Use "IF %ERRORLEVEL% NEQ 0 SET MYERROR=1" to record whether the previous command resulted in an error code. Alternately, you can check for "IF ERRORLEVEL 1 ..." if you want to look for a specific error level.
  2. Be cautious of manipulations with ERRORLEVEL. It's not really an environment variable like other variables. In particular, do NOT ever use "set ERRORLEVEL=5" or similar. It will corrupt any further use of %ERRORLEVEL% syntax by fixing it at a value.
  3. Use "CALL FOO.BAT" instead of just "FOO.BAT" when calling subscripts. Otherwise, when that script completes it will not return to the current script.
  4. Use "EXIT /B 1" to return an exit code from your script. If you use "EXIT 1" it will exit the entire command shell, including closing your current window if it's running in one.
  5. Consider using SETLOCAL and ENDLOCAL within your script to prevent temporary environment variables from carrying through to outer shells.

Below is an example script.


:: Sample script with some error handling
SETLOCAL
SET MYPARAM=%1
if "%MYPARAM%"=="" goto :USAGE

CALL .\childscript.bat %MYPARAM%
if %ERRORLEVEL% NEQ 0 set MYERROR=1

echo.
echo Finished child script. Handling errors now...

if %MYERROR%==1 GOTO :ERROR

echo It worked!
ENDLOCAL
set SOME_EXTERNAL_VARIABLE=1


GOTO :EOF
:USAGE
echo Please provide a command line parameter.
EXIT /B 2


:ERROR
echo It didn't work, dude.
EXIT /B 1 

Update: I was wrong about the ERRORLEVEL syntax earlier, so I updated after some testing.

Monday, October 3, 2011

Change Windows 7 default logon screen background

When you change your desktop background in Windows 7, it does not change the background for the logon screen. Since I have multiple machines connected to a KVM on my setup, I like to have different colors to signify which machine I'm actually looking at.

Windows 7 doesn't provide a good mechanism through the UI for changing this. To do it, you need to change a registry key and store your background as the correct file.

I found this post which was helpful: http://www.kodyaz.com/articles/change-windows-7-logon-screen-background-using-registry-oobe.aspx

Bascially,
  1. Navigate to this registry key path with regedit.exe: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\
    Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background
  2. Make sure the OEMBackground DWORD key is set to 1.
  3. Navigate to C:\Windows\System32\oobe\info\backgrounds directory
  4. There will probably already be a bunch of backgrounds there. Pick the one you want and save it as 'backgrounddefault.jpg'
That's it. You're done. Hit Windows-L to lock your screen and you should see the new background file.

Sunday, September 18, 2011

Using rsync to copy/sync two file systems

I've used the rsync command a number of times to synchronize a couple files systems. It's particularly useful for doing backups of one set of files to another. These are some EXTREMELY loose notes about how I did things a couple times that I found in old emails.

Example 1: Replicate on directory to another place on same machine.
cd /data
rsync -a dir1 /dest

Copies all the files from /data/dir1 and drops them in /dest/dir1.

Example 2: Doing on windows with cygwin between two separate windows boxes. Very loose instructions, but a long time ago I was able to make this work between two windows boxes by using a client/server model (e.g. remotely connecting between the two boxes.)

  • install cygwin
  • Map \\axis\backup as X:
  • mkdir -p /cygdirve/x/LaptopBackup/Users-rmills
  • cd C:/Users
  • rsync -a rmills /cygdrive/x/LaptopBackup/Users-rmills
Effectively copies everything from my /Users/rmills directory to the backup directory.

Example 3: Starting from scratch and copying a lot of stuff

On a windows server box, setup K: in /rmills/rsync
  • Create rsync.conf
  • Create rsync.scrt
  • On Server:
    • rsync --verbose --daemon --config=./rsync.conf --no-detach
    • (Take away --no-detach after prove it works.)
  • On Client:
    • rsync -progress -av SomeDirectory rmills@server::vol1
    • (consider "--update" to see if it just copies a few files)
 This basically allows two rsync processes to reach out to each other and copy files.

Friday, September 16, 2011

Parameterizing deployment of ASP applications with VS and MSDeploy

I've worked with a few ASP applications recently where I've wanted to be able to custom-configure the Web Config upon deployment depending on whether it's going to a developer's machine, test server, or production environment. In particular, I'm working on an application now that needs to pull data via SOAP or WCF from a neighboring SharePoint server. The URL of this server will, of course, be different depending on the environment.

There are a variety of situations I wanted to handle.
  1. Local deployment and testing on a development rig
  2. Fully scripted deployment using Web Deploy through a continuous integration server onto our development server
  3. On-demand deployment using the IIS "Deploy > Import Application" wizard
I more-or-less ignored case #1 because this is what developers do every day and they just hack whatever the way to make it work. (Sigh.) I did, however, want to make sure that the parameterization I did continued to work in their environment(s).

For case #2, I've been using msdeploy.exe via the App.deploy.cmd script that appears when you do "Build Deployment Package" from Visual Studio. This can be invoked from a script by simply doing MSBuild /t:Package during build. I'll leave the dynamics of that out of scope for this post. I'm more interested in how you set up the "SetParameters.xml" file properly so that you can feed MSDeploy some scripted parameters during installation to get the Web.Config the way you want it.

For case #3, I've been using the Deploy > Import Applications wizard to pull in the ZIP file produced by the "Package" step of #2. This works well and has a "Enter Application Package Information" page/panel for setting application parameters such as "Application Path" and "Connection String." I wanted to find a way to add parameters to this panel requesting other values.

As it turns out, there are a two primary techniques for building these kinds of configurations. The first is to use "Configurations" in Visual Studio to create additional Web.Config transforms that will substitute values that can be compiled into the applications for different environments. This works well if you know (ahead of time) what the parameters will be in all your configuration environments.

Build Configuration for Web.config

To make this work, you can first create a visual studio "Configuration" in Build > Configuration Manager. Then, create a "New..." configuration.




 I created one called "Staging"


Then, in your Solution Explorer, you use "Add Config Transformations" on the Web.config file.



 This will look at your configurations and create a Web.config transformation file for any new Configurations you have.



 Open your new Web.staging.config file and add an entry:

 
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <appSettings>
     <add key="MySetting" value="My Value"
         xdt:Transform="Replace" xdt:Locator="Match(key)"/>
  </appSettings>
</configuration>

Now, when you select the "Staging" configuration and do a "Build Deployment Package" from Visual Studio, it will automatically replace the setting in your master Web.config with this value. You may have to use Build > Configuration Manager to select the build configuration you want to use (e.g., Staging). You can deploy this package an it will automatically be set properly. This is especially useful for Database connection strings that tend to be fairly well known in most development and testing environments, as long as you're not worried about checking those values into your version control system. I used the following for a DB connection string for the ASP application we were building:

 
  <connectionStrings>
    <add name="ApplicationServices"
      connectionString="data source=TestDBServer;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
      xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
  </connectionStrings>

Parameters.xml

The second way to parameterize your web config is to establish a "parameters.xml" file for your application that creates these transforms in an externalized way that can be set at deployment time. This is the technique that actually works for cases #2 and #3 above. By setting up parameters.xml, I get a entry to appear in the SetParameters.xml file as well as in the deployment wizard within IIS manager. I'll focus on that for the rest of this post.

First, create a new XML file called "parameters.xml" and store it in the root of your project. Put the following entries to modify your parameters:


 
 <parameters>
  <parameter name="External SP Server Url"
             description="URL of external SharePoint server. Example: http://externalsp.portal.local "
             defaultValue="http://localhost"
             tags="">
    <parameterEntry
        kind="XmlFile"
        scope="obj\\Debug\\Package\\PackageTmp\\Web\.config$"
        match="//appSettings/add[@key='Portal.ExternalSPServerUrl']/@value" />
  </parameter>
</parameters>

This will generate the proper "External SP Server Url" entry in your SetParameters.xml file for scripting as well as place it on the wizard when you deploy with IIS. This replaces a key="Portal.ExternalSPServerUrl" in configuration/appSettings section of the web.config. It took me a while to get the "match" criteria set properly to find it and set the value.

Both these solutions work together -- parameters.xml and Web.config configuration files. One thing to note is that the "defaultValue" in the parameters.xml file will trump whatever settings you have in the web.config templates, so you need to provide a proper value during installation.

References

I found the following links valuable in figuring this out:
  • http://msdn.microsoft.com/en-us/library/ff398068.aspx - how to use parameters to configure deployment
  • http://vishaljoshi.blogspot.com/2009/03/web-deployment-webconfig-transformation_23.html - web config transformation using configurations
  • http://msdn.microsoft.com/en-us/gg454290 - transforming web config for deployment

Thursday, September 15, 2011

Deploying ASP web application with command line msdeploy without deleting all files on server

.
This mimicks the IIS wizard prompt "No, just append the files in the application package to the destination" on the "Overwrite Existing Files" panel. I used the "-enableRule:DoNotDeleteRule" for msdeploy.exe to accomplish this.


First, Use "Package" option within Visual Studio 2010 or via MSBuild.exe on the command line. This produces a "MyApp.deploy.cmd" along with a matching "MyApp.SetParameters.xml" that goes with your MyApp.ZIP file.

Then, simply invoke the CMD file to deploy the application using the "enableRule" parameter.

C:\>call MyApp.deploy.cmd /Y /m:myhost /u:my_user /p:my_password -enableRule:DoNotDeleteRule -debug -setParamFile:C:\MyPath\MyApp.SetParameters.xml

This will prevent configuration files such as web.config from being deleted as it deploys the application over top of the previous installation.

This has a few assumptions:
  1. You've already gone through the whole set of configuration plumbing needed to set up the MSDeploy command to properly work for remotely deploy the application to IIS server. 
  2. You already have things working such that you can deploy the ZIP file using IIS manager with Deploy > Import Application and stepping through the wizard.

Friday, June 3, 2011

Sync multiple google calendars on iPhone

I find it annoying that every time my wife adds another calendar to her google account, I have to spend 10 minutes googling (!) to find some secret link that you have to surf to to select which calendars appear for sync. I'm not sure why this link is not on the first hit any time you search for this.

https://www.google.com/calendar/iphoneselect

Anyway, surf here with safari on you iPod or iPad or iPhone, pick the calendars you want to appear, then magically they will be selectable on your apple device.

Recorded for myself and posterity.

Tuesday, May 24, 2011

Finding active file in Vistual Studio 2010 solution explorer

I often use Ctrl-, (control comma) or another search variant to locate files when I'm working in Visual Studio 2010. Unfortunately, it often leaves me with a bunch of open windows and no easy way to navigate to the project, directory, or other tree area within my solution where the file actually lives. The pop up search box often gives the path, but it is still a nuisance to go expand a bunch of "+" signs to go find it. I knew there had to be an easy way.
As it turns out, there is. Visual Studio has an option (Tools > Options > Projects and Solutions > General) called "Track Active Item in Solution Explorer" that will automatically update the solution explore to hop to the file that is active.
The downside, of course, is that it ALWAYS does this. I originally found the feature via another post that tells how to create a macro to do this on-demand: [locate-file-in-solution-explorer-visual]. Now I just have to figure out how to add a macro to vStudio. :-)

Happy coding.

Wednesday, May 4, 2011

Working with XML and XSD schemas in Visual Studio

I recently started working with XML files as part of a SharePoint project I was working on in Visual Studio. As the project evolved, I started creating some crazy XML files that defined the structure of a SharePoint site. It wasn't long before the crazy schema I invented on the fly started become confusing. Worse, I started forgetting the structure of the elements I had invented and had to start looking through the source code that processed it to try to remember what the structure and options were supposed to be.

Better solution: Create an XSD file with the structure definition in it. Basically, I followed these steps.
  1. Reverse engineer the XSD from my XML file
  2. Annotate the XSD file with some documentation about what it all meant
  3. Add a reference to the XSD in the XML file
  4. Continue editing the XML file in Visual Studio
Reverse Engineering the XSD 
First step was to create an XSD. I didn't want to type it all by hand, so I found this link: http://www.dotkam.com/2008/05/28/generate-xsd-from-xml/. It referenced a tool called "Trang" which processes and XML file and produces an XSD. Download it here.

I created a simple batch file:
@echo off
: Batch file to invoke Trang to convert an XML file to a XSD
set JAVA_HOME=C:\apps\jdk1.6.0_20
set TRANG_HOME=C:\apps\trang
%JAVA_HOME%\bin\java.exe -jar %TRANG_HOME%\trang.jar %*
 Then I converted my existing XML file:
xml2xsd.bat myFile.xml schema.xsd

And it produced a reasonable XSD file that I could begin using. What's nice, is if you load this file into Visual Studio, it provides some nice tools for exploring and viewing your schema. (I have NOT found any good ways for actually editing the schema other than hacking on the XSD code.)

Annotate XSD Schema

Once you get the basic XSD file, it's nice to add some explanation to it. You can easily use the "xs:annotate" and "xs:documentation" elements to do that.

<xs:annotation>
<xs:documentation xml:lang="en">
Documentation about your element.
Hint: First line is shown as "documentation"
<xs:documentation>
<xs:annotation>


This allows you to self-document the XSD file so you can look at it later and remember what the hell you were thinking when you first made it. It also has the added benefit of showing up when you turn on "Show Documentation" in Visual Studio Schema Model view.

A quick note on Visual Studio: When you open an XSD file in Visual Studio, it shows you the "XML Schema Explorer." From there, you can select elements and "Show in Content Model" which allows you to expand elements and browse through your schema. There are other modes, too, but I haven't figured them out.

Add Reference to XSD in XML File

Once you have an XSD, it's nice to actually make use of it. You can do this by annotating the root element in your XML file:

<RootNode  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="MySchema.xsd">

This allows anything processing the XML file to actually find the XSD and determine whether your XML file is "correct."  In my case, my XSD file was in the same directory as the XML file, so I didn't have to post the XSD anywhere.

Continue Editing XML File in Visual Studio

After doing all this, you're back to editing your XML file. The nice side effect of all this in Visual Studio is that it activates Intellisense for XML editing. This means:
  1. It will suggest name completion as you start typing elements and attributes
  2. It will suggest elements and attributes that can be inserted in a location
  3. It will suggest errors when you type elements that don't exist
I immediately found that this helped me work with my XML files much more quickly without creating bad formatting errors.

Wednesday, February 2, 2011

Upgrade and clone hard drive in laptop

I recently bought an upgraded hard drive to put into my laptop.

Side note: Momentus XT 500 GB "hybrid" hard drive. This is a 7200 RPM drive with 4GB of solid-state disk internal to act as a write-through cache. It's supposed to drastically speed up the performance of the drive for executing common things (like booting, swapping, running apps).

Goal: clone current hard drive, swap, then boot.

Approach 1: purchase Apricorn EZ Gig product that comes with a cable and a software package to clone the drive. Price: $39. Unfortunately, they were out of stock locally, so I attempted the poor-man's approach.

Approach 2: Use an adapter kit I had laying around to hook up the drive to USB, then use CloneZilla to do it.


  1. Visit http://clonezilla.org/clonezilla-live.php and download clonezilla ISO. (I got the AMD64 arch for my E5500 laptop)
  2. Visit http://tuxboot.org/download.php so I can burn the ISO to a USB stick.
    1. Follow to source forge, go into the latest date directory, and download the tuxboot-windows.exe version.
  3. Run tuxboot.exe (it wants admin access to write to the device)
  4. Burn the image to the USB device. Don't worry about rebooting since you won't be booting to this machine immediately.
  5. Reboot onto the USB stick
  6. Follow prompts to start up clonezilla
  7. Choose drive-to-drive clone
  8. Follow prompts, pick the right drives for source and destination
  9. Let it churn. My machine was doing approximately 2-3 GB/min, so it took a few hours.
When it finished, I simply swapped the drives and the system magically booted up. Easy, peazy, lemon squeezy.

Upgrade to Momentus XT hybrid drive

I just upgraded my old Hitachi 5400 RPM 250 GB laptop drive to a Seagate Momentus XT 7200 RPM 500GB "Hybrid" drive. It's got 4GB of build in SSD solid-state NAND gate flash memory that acts as a smart cache with what they call "Adaptive Memory Technology." Supposedly it figures out the files you use the most and drops them on the SSD portion of the disk to speed things up.

First step was to hook up the drive with a SATA-to-USB adapter and connect it to my drive. The I used Clonezilla to clone drive-to-drive and it reproduced my 170 GB partition from the old drive onto the new one as a bit-by-bit copy. Then, simply switch the drives in the PC and everything magically works just like it did before. Easy as pie. (I don't know why people say this. Have you ever baked a pie? It's a PITA.)

It certainly SEEMS faster, even after a few minutes of using it. Rebooting my 64-bit windows 7 laptop is very quick. It boots in less than 30 seconds now to the login screen. It used to be over 40 sec. I ran a benchmark utility (Passmark Performance Test) and it claimed the new drive was 2-4x faster for sequential read-write performance. I'm sold.

I read some reviews and they were generally positive with a people complaining that the drive didn't spin down very often, it was noisy, or it vibrated a lot. I'm not sure, but I think it's a little louder. Considering my laptop sits on a desk and not my lap most of the time, I don't care much.

One suggestion I found was to upgrade from SD23 firmware so SD24. So I went to the page and did it. (http://seagate.custkb.com/seagate/crm/selfservice/search.jsp?DocId=215451). The problem is, it got stuck when I downloaded and ran the upgrade.

When I booted the machine, it would give me "Invalid System Disk. Press any key..." After that, it would boot into Windows 7 fine. Rebooting many times and re-running the utility did nothing.

Eventually I figured it out. I hit "F12" during start up to get boot options. Then I simply selected "Boot from internal HDD" and it magically fired up the upgrade utility for the firmware. 30 seconds later, it finished, shut down, restarted and now it works fine. Problem solved.

A little wonky, but it worked. Dunno if it made the drive any better. Time will tell.

Monday, January 24, 2011

Neat tire sizing tool

I came across this neat tire size comparison tool:

http://www.rimsntires.com/rt_specs.jsp

It allows you to plug in various sizes of tires and it analyzes how it will changes clearance, indicated speed, etc. on your vehicle.

Wednesday, January 12, 2011

2008 G35x Driving Impressions: First Few Weeks

Update: I had this sitting in "draft" mode for a really long time. I'm posting it now because I forgot to do so a long time ago.

As I wrote in my original post, I recently purchased a 2008 Infiniti G35x Sedan. I've been driving it for a few week and overall, I really like it. It definitely has a different feel from my previous daily driver, a 2005 Subaru WRX Sport Wagon. Of obvious note: it's got a 3.5L 300 hp torquey V6 instead a 225 hp turbo-charged 2.0L 4-banger, it weighs 3800 lbs instead of 3300, and it's got a "sport" automatic 5 speed transmission instead of a 5 speed manual.

First, I really like the motor. It's eager to rev, but doesn't need to for producing power. I like the instant-torque of the bigger motor. It's got a nice, throaty growl to it. I've seen C&D and other reviewers claim it's kind of raspy and unrefined compared to some of the BMW's, but I've never had a BMW, so I don't really care.

The 3800 lbs is noticeable. When cornering, there car definitely wants to push. It's also got a good amount of sway in the car due to all the mass. Expansion joins on exit ramps produce a nice shimmy in the rear end of the car although the suspension keeps all the wheels planted. Launching the car from a stand-still makes good use of the AWD and the car rockets forward with a very satisfying amount of thrust.

As a life-long stick driver, the manumatic transmission takes some getting used to. As I wrote in my other post, I'm used to manual transmissions that do exactly what I want them to do and ONLY when I want them to do it. I admit it -- I'm a control freak. Further more, the throttle has a direct linkage to the wheels without any RPM slop due to a torque converter. With that said, I'm slowly getting used to the new transmission. I like the fact that I can put it in manual mode for cruising on the highway or in traffic. On the highway, I want to be able to apply full throttle to get a short jolt of speed without the transmission down-shifting and winding out to 6000 RPM's. In this case, the slush-box torque converter actually works well to allow the revs to increase slightly and get some additional power. (In most cases, I still prefer it if it just locks-up and keeps the revs matched to the wheel speed.) In traffic, I like to be able to put it in a gear and drive with the throttle instead of jamming on the brakes all the time to slow down slightly. It's actually a blessing to not have a clutch to deal with. Finally, I like being able to manually select a gear during almost-stop turns (e.g., making a turn in an intersection) so you don't get the delay-down-shift-surge lurch while the tranny tries to figure out what gear it wants to be in.

The car has two automatic modes: Drive (D) and Drive Sport (DS). While cruising around, they both seem kind of similar. DS is more aggressive during braking: it automatically down shifts, anticipating your going to get back in the throttle. This is a little annoying when approaching a stop sign, but could be beneficial if you were driving around a track or on a curvy road. However, in both those situations, I would probably have the car in manual mode, regardless, so the point becomes kind of moot.

I tend to use the automatic modes when I'm puttering around not paying attention. (Now I know what the other 90% of the population feels like. Frankly, I like actually having something to do and concentrate on during driving.) In fact, I find my most common gear pattern to be as follows: cruise in 5th gear manual, slow to a stop, pop shifter into "D" to reset "auto mode", then back into "DS" to get in automatic-but-ready-to-manually-shift mode. Accelerate normally, allowing the transmission to up-shift as it goes. Once I reach speed, bump shifter forward to "5" manual mode and cruise there. Apply as much throttle as I want to change speed. When necessary, bump down a gear for additional speed, then return to tall gear for cruising in 5th. If I need to stop, rinse and repeat.

Overall: I really like the car. It's a bit of a heavy pig compared to the WRX, but it's also a lot faster and pleasurable to drive. I'll have to write more about my recent experiences in the snow as well as my general impressions of the various technology and luxury features of the car.

2008 G35x Sedan Driving Impressions: The Facts

So, I recently upgraded my 2005 Subaru WRX Sport Wagon to a 2008 Infiniti G35x Sedan. The WRX was a great little sport compact car, but at its core it was still a suped-up Impreza compact car with very basic attributes. I was interested in getting something a little bigger, a little stronger, and with some more luxury.  My basic criteria:
  • Sport sedan or wagon
  • 300-ish HP from a non-turbo charged engine
  • 4 doors, big enough to take on weekend trips with family
  • More luxury features (bluetooth, ipod connector, HID lights, leather, etc.)
  • AWD. (I don't need it THAT often, but really enjoy having it during the few times it snows every year.)
  • "Sporty" transmission (either 5+ speed manual or decent manu-matic)
  • Couple years old to save on depreciation
The combination actually makes it a short list. I looked at the 2007 Acura TL Type-S which I really liked. It had good power, lots of features, good fit and finish, and looks very sharp. Unfortunately, I really don't like FWD cars much, so opted out. Lexus IS AWD was good option: very sport looking, handles well, but only comes in the 250 motor which is a little underpowered for the weight of an AWD car. BMW 3-series IX, but the 328 is kind of underpowered and frankly I didn't want to pay the price of maintaining a BMW. The 335 IX kicks ass, but I wasn't willing to pay the price. Audi would have been a good option, but I didn't want another 2.0L turbo and there weren't another option with going with the S4 was kind of pricey. This left me with the G35x, which hit well on all elements and I just generally liked. The 2nd generation '07+ sedans got a major styling make over which drastically improved the looks, in my opinion. The G35 fit the bill and I've been very happy with it.

Some general facts about the car:

The Motor. Potent V6 that makes 306 hp, 268 lb-ft of torque which is good for 0-60 in approximately 5.6 seconds. This is close to the rated times of my 1994 RX-7 (when it was stock) and not bad for a 3800 lb car. Overall - it feels very strong and it's an nice change to be able to stomp on the gas in a high gear and have it go somewhere without having to downshift. (See below: automatic transmission that will actually stay in a gear.) The motor's additional power in the 2nd generation seems to have come from running higher compression with some other minor tuning adjustments.

The Transmission. The AWD "x" model only comes with a 5 speed automatic. Historically, I really don't like auto trannies very much, but I'm slowly getting used to this one. I don't care so much about the clutch, but I really want the transmission to do WHAT I want WHEN I want it to do it, and NOT to do things I don't want when I don't want it. So far, this one isn't bad. It has normal "(D)rive" mode, "(D)rive (S)port" mode, and manual shift mode. Drive mode is as you would expect. It is smooth in normal driving and responds with fairly crisp upshifts when wound out to high revs. It's fairly down-shift happy and drops a gear any time you give it moderate throttle, which I personally find annoying. Drive-Sport mode is a little more aggressive, holding the revs longer before up shifting and automatically rev-match down shifting during moderate or hard braking. It's still a little shift-happy, IMHO. Entering DS mode from D usually results in a down shift from current gear (e.g., 5th to 4th) but it will eventually up shift back to the higher gear if you cruise with steady throttle for a while. Manual mode is entered by bumping the shift lever up or down while in DS mode. It switches to manual-only shifting with a dash indicator of the current gear. Unlike some other (lousy) manumatics that I have drivent, it WILL actually stay in the gear you tell it to, including bumping off the rev limiter if you wind it out too far. (Err ... oops.) It will, however, down shift automatically to 1 when you come to a stop. It responds rapidly with crisp down shifts (maybe 0.25 second) when you bump the lever, but has very sluggish up shifts (0.75-1.5 seconds, perhaps). This lag is kind of annoying some times when I want to get on the throttle briefly, then back off and upshift a couple times to resume cruising mode. Supposedly, the models that include paddle shifters will allow you to bump gears up and down while in D mode, then it will resume normal D mode after a brief delay. (This seems desirable to me and the paddle shifters are actually a bolt-on addition that I might get.) The torque converter has about a 2000 RPM swing between full throttle and coast-down off throttle when cruising in a high gear. This amount of swing seems a little extreme, but allows the motor to rev up nicely and apply torque when cruising around in a single gear. This is a welcome change for me compared to the anemic turbo-laggy 4-banger that I've been driving for 6 years. The slush-box does lock up when cruising so throttle application has a more direct effect on the wheels at highway speeds. 

Styling. This is, of course, subjective but I think the car has very crisp, sporty styling that is just slightly on the "soft" side. I really like the changes they made to the back end for the 2nd generation remake they did in 2007. I do think the front-end styling on the base and "journey" models is a little "soft" however and I prefer the sport models that have a more aggressive, angular front air dam. I think a slightly more angular set of ground effects (front lip, side skirts, rear bumper) would improve the sportiness of the car quite a bit. It's possible a rear spoiler might sharpen it up a bit, but it also might ruin the clean lines of the car. For reference, I like the look of some of the Lexus IS sedans as well as the Acura Type-S.

Features. I seem to have picked a version of the car that has almost all the options available with the exception of paddle shifters, sport seat, and active suspension (which I'm not sure is available on the AWD car). It does not have the larger brakes, either, but those don't seem to be available on the AWD model, even on the G35xS "sport package" (not to be confused with G35S sport *model*) which I did not get, hence the missing paddle shifters and sport seats. Here are some noteable features:
  • "Intelligent" Cruise Control (part of Technology Package) with laser-guided distance sensing system that automatically controls speed if you approach another car. This means if you're set at 65 and you come up on the bumper of another car, the system will automatically will slow down and maintain safe following distance (3 selectable distances). If you get too close, it will actually apply up to 25% braking force (while moving the pedal and showing the brake lights). The sensor is embedded in the front left bumper and looks like a 4" reflective sensor with a redish tint. (It took me a while to figure out what it was when I bought the car.)
  • HID auto-adjusting headlights (part of Technology Package) that actually turn direction with the steering wheel. This is very noticeable at slow speed where the inner headlight literally pivots toward the direction of the curve when you turn the wheel.
  • Traction Control (Vehicle Dynamic Control) with selectable Snow Mode that, most importantly, can be (almost) completely turned OFF. With AWD, the system does some magical combination of adjusting torque to each wheel, retarding engine power, and individually applying the brakes to a slipping wheel to attempt to control vehicle dynamics and allow the car to maintain grip and a stable forward direction. I had a recent opportunity to drive it in the snow and the system (while "on") does a good job at sensing vehicle dynamics and correcting the car in slides. If the car starts to slide under power, you can actually feel the system cut power and apply brakes to a slipping wheel. Combined, this has a very effective ability to bring the car back into line and allow you to maintain a forward trajectory. A steady, moderate throttle allows the wheels to independently drag you in the right direction. It's fairly impressive. The "Snow Mode" switch further retards engine response to prevent you from spinning wheels. Most importantly, hitting the "VDC Off" button seems to do just that: stop the system from intervening when you actually want to have some fun with the car. (More on my adventures in the snow with this in a later post, perhaps.) Side note: I read somewhere that the system might still intervene with brakes on a slipping wheel, but I haven't seen any indications of this yet.
  • Navigation system (07-08 maps) with backup camera that has guided steering lines when you turn the wheel. It's driven by either touch screen or 8-way control pad and/or limited steering wheel up/down/select controls. It also has lots of physical buttons which I like. Generally, I find the system fairly easy to use and the Nav seems to be adequate. One pet peeve: it shows "remaining time" to destination instead of "estimated time of arrival." This makes it difficult to play my favorite game of "beat the clock" when driving to destinations. It's got simplistic voice activated menus that allow you to pick choices and set destinations hands-free while driving.
  • Bluetooth integration that syncs with up to 8 different phones, so you and your wife and kids and friends can all connect their phones (one at a time). It can download the phone book, but I've had weird experiences of it duplicating my phone book entries. The search mechanism SUCKS and you basicallly have to just scroll through your list at 3-letter increments (A-C, D-F, etc.) looking for entries. You can add individual ones to your local phonebook in the car, which are the only ones accessible while the car is in motion. The voice activated menus for dialing work here, as well, and seem to be adequate. I have to say, it's VERY nice to jump in the car and have it automatically connect to my phone so I can make and receive hands-free calls. I can still dial from the phone, if necessary, but it auto-switches to the car as a bluetooth head set after dialing. There's easy to hit menu items for "use handset" if you decide NOT to talk on speaker phone. I've been told that the call quality is pretty good, so overall I give it a thumbs up.
  • iPod integration which can be controlled from the on-screen navigation. Seems nice enough. Also has 3 RCA jacks for auxiliary input in case you have a non-iPad music player. Supposedly, it can display video on the Nav system monitor while parked, but I haven't tried it. I don't know if it will let you play iPod videos, but I doubt it.
  • Compact-Flash card slot for playing MP3's and maybe some other stuff.
  • Music Box 10GB internal hard drive that can rip music from CD's and store internally. Seems nice enough, but I haven't bought any CD's in years. It does not seem to let you just copy MP3's into the system or transfer from your iPod, so I'm not sure I'll use it much.
  • Proximity-Sensing Keyless Entry with Push-button Start. Kind of a neat feature, but it allows me to unlock and enter the car, then push a button to start it without taking my keys out of my pocket.
  • Auto-positioning power seats that have a "1" and "2" setting so my wife and I can automatically set our positions. Supposedly, it can sense which key fob is in the car and automatically set it that way, but I haven't configured that yet. This also includes positioning of the power mirrors and tilting extendable power steering wheel column.
  • Heated seats ("Go bummy!") and Heated Mirrors which have already come in handy this winter.
  • Homelink Garage Door Opener which eliminates one other do-dad that I would otherwise have to hang on my visor.
  • Leature seats that I'm still getting used to. Leather is, in my opinion, not as comfortable as a good sport cloth, too slippery, too cold in the winter, and too hot in the summer. It is, however, the ONLY option available in most modern high-end cars. It has the advantage of being easy to clean, which I'm looking forward to considering what my kids have done to our other cloth-upholstered cars. The seat itself is reasonably comfortable, but I find myself sliding around in it a bit too much. Perhaps the one thing I wish I'd know about and possible searched for was the sport seat in the "sport package" that has better thigh and side bolsters. Oh, well.
  • Rear pass-through panel into the trunk. I would much prefer it if the seats actually folded down, but that doesn't seem to be common in any of these cars.
It's also got some other decent features like bottle-holder slots in the map pockets in the doors, analog clock in the dash, faux-wood finish, proper knobs for the radio, dual-zone automatic climate control (with knobs), and kid-activated map lights in the rear seat.

Next up: driving impressions (as my daily driver) and some fun driving in the snow (aka "slippy slidey" in 10-year-old boy speak) that earned me the humorous name of "drift king" from one of my son's teachers.