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.
A blog for me to record random things I do. I really don't expect anyone other than myself to ever look at it, but I'm happy if they do. Don't be surprised if posts are half complete, poorly edited, or don't make any sense. I'm sure they made perfect sense to me at the time. ;-)
Friday, June 3, 2011
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.
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.
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:
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.
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:
Better solution: Create an XSD file with the structure definition in it. Basically, I followed these steps.
- Reverse engineer the XSD from my XML file
- Annotate the XSD file with some documentation about what it all meant
- Add a reference to the XSD in the XML file
- Continue editing the XML file in Visual Studio
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 offThen I converted my existing XML file:
: 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 %*
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:
- It will suggest name completion as you start typing elements and attributes
- It will suggest elements and attributes that can be inserted in a location
- It will suggest errors when you type elements that don't exist
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.
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.
- Visit http://clonezilla.org/clonezilla-live.php and download clonezilla ISO. (I got the AMD64 arch for my E5500 laptop)
- Visit http://tuxboot.org/download.php so I can burn the ISO to a USB stick.
- Follow to source forge, go into the latest date directory, and download the tuxboot-windows.exe version.
- Run tuxboot.exe (it wants admin access to write to the device)
- Burn the image to the USB device. Don't worry about rebooting since you won't be booting to this machine immediately.
- Reboot onto the USB stick
- Follow prompts to start up clonezilla
- Choose drive-to-drive clone
- Follow prompts, pick the right drives for source and destination
- 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.
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.
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.
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.
Subscribe to:
Posts (Atom)