Thursday, November 18, 2010

Solution to a slow syncing iPad

I noticed sometimes my iPad takes FOREVER to sync. Specifically, my ipad takes forever to backup before it starts syncing. I recently stopped syncing it to my macbook pro and began syncing it on a windows 7 system - iTunes has been behaving awesome for me on Windows, contrary to frequent opinion. At first, I was careful, and only ever used my iPad cable... but it's just a USB cable, so eventually I slipped and starting using my iPhone cable.

I'm not sure what's special about the iPad cable, aside from combined with the iPad charger it is a higher power charger, but it appears that backing up your iPad (even when it has practically nothing on it - as I recently cleaned mine out) can take ages if you use the wrong cable. Facepalm. It took some reading up on this to realize what I as doing wrong. It's a double facepalm for this even being an issue - I am not sure why an iPhone 3G or 4 cable would cause slow syncing...but it looks like it does. In my case it's slow backing up...like 30 mins to an hour when nothing has even changed. Problem solved though - use the iPad cable.

Wednesday, November 17, 2010

Oracle: How to find the service name of a database instance (SID)

At work I ran into a surprising issue. It's hard to find a service name for an Oracle database when all you know is the SID if you don't know exactly where to look. Hard, even for large, corporate Oracle deployments with DBAs you can ask. I found it hard to believe, but we've had issues several times now where it has been difficult for customers to determine a service name for their oracle database instance. Now, of course our application lets you enter SID or Service Name and handles URL formats for you and everything - that is not the problem. The problem is when administrative work needs to be done. It usually isn't an oracle DBA handling administrative tasks for our software at a customer site, since the DBAs are a precious resource.

Now, first a quick refresher:

SID - System Identifier uniquely identifying a database instance. Each database instance has an SID - one and only one.
Service Name - An alias to one or more INSTANCES (useful for clustering, failover, without changing end-user configurations) - introduced in Oracle 8.

One SID could have a hundred service names pointing to it if you wanted to...but I'm pretty sure at a minimum it will have one. When you create an instance, Oracle makes you name them both. The 10g Configuration Assistant on Windows has a field named Global Database Name, which maps to Service Name. The SID is
frequently, but not always, the same as the initially specified Global Database Name.

After the creation of a database instance, Oracle tools refer strictly to the SID - after all, that is the name of the instance you'd be configuring. Since Service Name is just an alias, you wouldn't configure the character set or memory options of an alias.


Why do I care what the service name is if I have the SID?

Because knowing it lets me avoid relying on properly configured tnsnames.ora on each client machine. Sometimes, tnsnames.ora files appear to be controlled by a dark magic - the same tnsnames.ora file works fine on one machine, but fails inexplicably on another client machine. Sometimes TNS doesn't work right - and for a Java application that's going to be using JDBC, needing to configure tnsnames.ora is unnecessary work. For the command line tools like SQLPLUS and the import/export tools, you can use the EZCONNECT URL format and avoid TNS completely. There's a catch - EZCONNECT only accepts Service Names.

So, how do you determine the service name? Here's one way...

This assumes you have access to the oracle server. Provided you do, simply use the command:

lsnrctl status

This will print out various status information, as well as a compact listing of configured service names and which instances they point at. You could also use lsnrctl services for slightly more verbose services output - but depending on how many service names and instances there are, it may be harder to look at.

It's kind of anti-climatic, but that simple command ended the confusion. I thought Service Name was preferred (as it is more flexible than directly specifying the SID), but apparently it isn't always the case.

Booklist updated, no Tuesday post

No Tuesday post, but I did spend time working on a longer post that just isn't quite ready yet. Sleep is more important...

I did update my bookshelf the other night though. Eventually I'll better separate it into a recommendation section, what I've read, and my current queue of books awaiting reading. I often have bigger eyes purchasing books than I do reading, so I always have a long backlog.

Monday, November 15, 2010

Stumbleupon is neat

A coworker recently told me he finds some really cool stuff using Stumbleupon. Now, I had heard of Stumbleupon before, but I had never tried it. I'm not sure why. The concept is cool.

I gave it a spin today, and here's my experience so far. Account sign up? Fairly easy, though it did kind of nag me to use a facebook account and import some friends or something. Once that was setup, it was fairly straightforward.

So far I've found a couple of really cool links, after telling it I liked ~35 things, and disliked 5, and skipping a few.
  • 28 Rich Data Visualization Tools - some really cool graph and chart tools
  • UX Movement - a great site about user experience. I'm already learning some useful things, like better ways of presenting form data and search buttons. 
So, Stumbleupon is pretty neat. That's it for now.

Sunday, November 14, 2010

November month in Writing: Week 2 summary

I was able to broadly stick to my writing plan last week, as well as converted a couple of my drafts into finished posts. I read just shy of the first 50 pages of "Release It!", and I am enjoying it so far. Every weekday post was scheduled for 8:00AM. This doesn't appear to make a difference when you have no readership :) I need to write some meatier posts that I can submit to Dzone - that does makes a difference.

I failed at pursuing a Hudson / Opera issue that has plagued me. I'll restate the goal for this week... I just need to go through history, merge some modifications to prototype.js into prototype 1.6, then create a patch file and see if anyone is willing to take my patch for a spin (as well as stage it in my environment for a while).

As for general week's news:

Oracle and Apple Announce OpenJDK Project for Mac OS X  - the future of Java on OS X seems assured now. Cool.

Mozilla released Firefox 4 Beta 7 - this added JIT to their Javascript engine, and it's now faster than everything except Opera 11 alpha at Javascript. Woot - I was beginning to think IE9 would be faster, but I am glad to see Firefox 4 gain some serious speed. Competition is good, and it is my #2 browser.

Gold Nanoparticles Could Transform Trees Into Street Lights - this is just amazing. I spotted this on twitter and then later on engadget...

No specific ideas for topics this week yet...we'll see what happens.

Saturday, November 13, 2010

muCommander - the ultimate cross platform utility

Despite NTFS supporting very long path names, Windows frequently has issues with long filepaths. Sometimes you need to bring in another tool for the job.

My favorite tool for dealing with long filepaths is muCommander. It is a Java app that mimics the traditional "Norton Commander" user interface. Java uses the API in Windows that supports longer filepaths, so muCommander has no trouble dealing with extra long file paths. It's not just for Windows, though - it's available on a lot of platforms.

muCommander is much more than a better file explorer, too. It has built in support for loads of protocols:
Virtual filesystem with support for local volumes, FTP, SFTP, SMB, NFS, HTTP, Amazon S3, Hadoop HDFS and Bonjour
You mean I can have my local filesystem on one side, and an SFTP session on the other? Awesome.

It can even open and edit zip files in-place.


Plus - it has a sweet logo. 










muCommander is an awesome utility to keep in your toolbox.

Friday, November 12, 2010

Replacing Notepad with Notepad2

I've been using Notepad2 as a light-weight replacement for the notepad.exe that comes with Windows for several years. Let's face it, the original notepad.exe falls short on many levels - no auto-tab, no multi-line tabbing/untabbing, poor line endings support to start... I've always felt it was inferior to even the old MS-DOS EDIT, which is a pretty sad statement. In comes Notepad2, fixing all of its shortcomings while remaining lightweight, and adding some other nice features as well.



It's always been somewhat of a pain to perform the replacement to Notepad2, since notepad.exe is considered a protected operating system file in XP and Windows 7. Fortunately, Kai Liu wrote an installer that does this for you automatically! I just learned about this this week and figured I would share.




To download the installer, just go to http://code.kliu.org/misc/notepad2/ and scroll to the bottom, "Custom Notepad2 Builds", for both 32-bit and 64-bit machines.

Thursday, November 11, 2010

Desktop Java Apps - to bundle or not to bundle a JRE?

First - here is my definition of bundling the JRE. Shipping your application with a JRE, such that it is the one used by default from your application startup scripts, regardless of the environment on the target system. The bundled JRE is not registered with the system, so it should not affect other applications on the system.

There are probably some good reasons not to bundle a JRE. Taking a moment to ponder, I can think of at least the following:
  • Bloat
  • No automatic security updates
  • Less portable
There may be more - but I believe the pro's will outweigh them regardless, once I add some additional constraints. Specifically, I am concerned with Java on the Windows desktop. Further, I am talking about larger, high engineering effort commercial software deployed to big companies. Not a small, independent Java app deployed to individual consumers. (although there may still be cases where that simplifies things). At a minimum, I would argue for stating "Use 1.6 Update X or higher" somewhere in a README, even for a small app. I've just seen too many weird issues not to.


On to some reasons for bundling a JRE:
  • Control over major Java version (1.4,1.5, 1.6) - this is less of an issue today, since 1.5 has reached its end-of-life and 1.4 is far behind that. Thank goodness for that.
  • Control over the exact version (i.e. 1.6 Update 20) - to ensure mandatory functionality works properly
  • So the end users don't need to install something additional
  • So your program is not influenced by the system environment
  • So your program does not influence other applications in the environment 
  • Less variables for when customers report bugs
  • No automatic updates - which could break functionality
  • Less to test
See a theme? Better control. Also, better isolation from the environment and other things that can go wrong.

For instance, in the 1.5 days, I recall one release that had very misbehaved tabbing through components in a UI. In the era of Windows 7 - you need a minimum of 1.6.0 Update 18 - or you have missing icons in Open/Save File Dialogs. It is not acceptable to have a UI defect like that in a shipping app - any less, and you don't have full Windows 7 support. Except on 64-bit systems Update 18 has a bad habit of crashing the JVM a lot...so you need a more recent update. Then there's the Swing/AWT changes in Update 12 that alter behavior. Then I'm pretty sure depending on the version, applets load differently, if that's a factor (in one of our cases, integration with another process - it is).

You can avoid all that by picking a version you know works for your required situations. This means less to QA. Less potential headaches. The trade-off is losing faster security updates, increased application size (which believe it or not - still matters even in the age of 3TB hard drives), and portability. If you are in a Windows-only market, as I have seen several applications be, then portability isn't affected. Even if there are other target platforms - it's just a matter of repackaging for other platforms.

I believe there are some good reasons to bundle a JRE - on Windows, anyway.

Wednesday, November 10, 2010

Usability Fail - Confirm Then Swipe

I consider a fundamental goal of software, and technology in general, to make people's lives easier. To simplify, automate, and perform useful functions. When the above holds true, technology is a success. When technology gets in the way, is a hassle to use, or does not otherwise improve an existing process - it is a failing and does not have purpose.

First, a success story. Trader Joe's is a very pleasant place to shop, all the way through. The checkout process is one reason for this great experience. The first time I went to one was several years ago, and I was pleasantly surprised during checkout.

The Card Swipe device:
  1. Made it immediately obvious that I could swipe my card at any time
  2. Allowed me to enter DEBIT, PIN, Cashback options, all before the cashier had even finished scanning my items
  3. Provided a final confirmation once all items were scanned
This is pure win, on all levels. I have true respect for the makers of this device. Others get 2 & 3, but some fail to make it obvious to the user that they can swipe early. No one likes waiting in line - this helps people wait in line for less time - both the person using the card swipe, as well as anyone behind them.

Imagine my surprise when my local Market Basket got new card swipe devices a year or two ago, and they did not share this amazing feature. On the contrary - it required the exact opposite. Enter the "Confirm Then Swipe", a giant usability fail.

Here is a basic rundown of the Bad Card Swipe Device (TM):
  1. You must wait until the cashier has scanned the final item
  2. The cashier then usually asks credit or debit.
  3. The cashier reminds you to "Confirm then swipe"
  4. You confirm the amount
  5. You can then swipe your card
  6. Debit PIN
  7. Oops - you got your PIN wrong, try it again 
  8. Final confirmation (?)


What went wrong for a device with such a basic purpose to have been made this way? Is it short-sightedness of the developer? Is it due to the other vendor holding software patents? (more on software patents another day...) Whatever the cause - it really bums me out. How many wasted words are there on a daily basis, just to explain to the customers that they must confirm first? (plus the time that could have been saved if the swiping process was completed while items were still being scanned) How much time is lost by the patrons due to this every day? Per Year? This should not be the case, but sadly it is.

Tuesday, November 9, 2010

Thoughts on OpenID

I've had an OpenID for over two years now, since I joined StackOverflow during the beta. A lot has probably happened since then. If memory serves correct, at least one OpenID provider went out of business. Others may have changed ownership - and new ones have surely emerged.

How have my first 2 years with OpenID been? Well, I've only set it up on a whopping 2 websites, both of which are technically oriented. I have recently started seeing OpenID as an option on a few more websites, but not a lot.

I attempted to set it up on a third (DZone), and although it allowed me to login, I could not verify my account, or join it to my non-OpenID account. This is probably just an issue with DZone, but if it was important enough, I would hope it'd be resolved.

What implications are there to third party authentication such as OpenID over time? (say, 5-10 years). Quite a lot can happen to a company in that timeframe. Especially tech companies.

Is it easy to switch OpenID providers? It seems like that is limited by whether every site you use supports adding a second OpenID or not. That may be a requirement of participating, I have no idea - so far, the two I care about have supported this.

What happens if my OpenID provider, say, starts getting hosted in China. What happens if my OpenID provider goes down for good? Will I ever be able to reclaim my account?

What happens, for instance, if my OpenID provider's SSL certificate expires? I can't get to my websites unless I accept an expired cert?

For the record - back in August (when first typing this), the MyOpenID login page was doing just this - showing expired certificate messages. Even though it wasn't apparently needed for authentication (because rest assured - I reject expired certs), it was still alarming. I hadn't even seen the domain name before - which was also worrisome.




This is what got me pondering OpenID. The concept is nice, but is it succeeding?

I am glad Google is a provider - would OpenID be at all usable still if they weren't? I at least feel safe that my Google account isn't going anywhere anytime soon. Also, it is rather convenient as I'm usually logged into gmail and just need to confirm to login.

I am curious what others think. Do you use Open ID? Do you think it is succeeding - is it convenient, or a pain? What provider(s) do you use? What websites use Open ID for the sole authentication system?

Monday, November 8, 2010

November month in writing: week 1 summary

One week down - three to go. This year I am aiming to write my posts a day early, scheduling them for 8:00 AM the following day. That worked last week - but I am off to a late start this week. Fortunately, as of this writing, I already have the next two days' posts finished and scheduled to appear.
  • Tuesday will be some thoughts on Open ID
  • Wednesday will be a usability post
  • Thursday - goal is to discuss JRE bundling for Java on the Desktop
  • Friday will remain a mystery
As for last week, I felt OK but didn't think I wrote as much as I wanted to. Hopefully I can find room for a recent software experience and maybe a tutorial in the coming week or so.

Goals for this month:
  • Finish reading two books (not succeeding so far)
  • Finish tracking down a Hudson / Opera issue and hopefully submit a patch
  • Finish converting more of my drafts into completed posts

Sunday, November 7, 2010

Distributed Source Control Rocks


Hudson core still uses Subversion, and the java.net svn server is kind of slow. I needed to do some diffs when investigating a fix for an issue I encountered. I had to wait a couple of minutes for every single diff I wanted (from the log, not local diff).

It just so happened it was related to Prototype, a popular Javascript library, which is hosted on GitHub. I took a look on that end as well. I cloned a local repository - simple, fast, and instantaneous SCM operations.

I'm still a Git / Mercurial newbie... but it's obvious that if you're a remote user, centralized vs distributed source control isn't even a fair comparison. It's that much better.

Saturday, November 6, 2010

News and Links Nov 6 2010

Marco Arment had a great post about technology - Developers don’t rush to new platforms. Everyone considering getting new smartphones or tablets should definitely read this. It's short and to the point.

I've been looking at our database performance at work recently, so I've been digging around a lot of MySQL and related database info this week and found this blog - EXPLAIN EXTENDED. In particular, this week's post:
10 things in MySQL (that won’t work as expected) - I'll be subscribing to this one, and maybe you should too if you use MySQL.

iOS 4.2 went to GM seed this week. That should mean 4.2 will release for iPads next week if no criticals problems are found. I can't wait.

Seven Languages in Seven Weeks: A Pragmatic Guide to Learning Programming Languages by Bruce Tate is now out. I can't wait to read it! I better make some progress on "Release It!"...

Friday, November 5, 2010

Browser Benchmarks November 5 2010

It's been a few months since I last benchmarked web browsers, so I figured it was time for an update. There's just something innately fun about running benchmarks. These are first and foremost for my curiosity and amusement, not because I think it matters if Browser A is 0.3% faster at Sunspider than Browser B. However, at least last time there were very measurable gaps in performance and results of each browser - more than I would have thought.

This time I'm going to separate the results of official stable browser releases and beta releases.

Browser releases continue to be frequent, and I don't think it is going to slow down. Chrome in particular appears to now plan on major releases every 6 weeks. Last benchmark was Chrome 5 - this time it's Chrome 7. Opera has some modest improvements with 10.63, Firefox 4 is on beta 6 now, up from beta 1. IE 9 Platform Preview has also gone through some more iterations (though it is hard to find)

System specs are the same as last time, except for new video card drivers, which may affect 3d accelerated HTML5 tests.

Environment:

  • Intel Core i5 750 @ 3.36GHz (Turbo Disabled)
  • 4GB RAM
  • 80GB Intel SSD (G1)
  • ATI Radeon HD 4850 (Catalyst 10.10 drivers)
  • Windows 7 64-bit Home Premium

Fresh boot. No other apps or system tray programs running aside from Microsoft Security Essentials.
Each browser was run by itself, with only one tab for the benchmark itself.

I'll start with Sunspider again. Only this time with Sunspider 0.9.1 (I didn't realize that was available last time):
 Separately, beta browsers:
No real surprises - Chrome continues to lead, but IE9 and Firefox 4 betas are catching up to the 3 leaders. There is much less spread than last time.

I also decided to run The Kraken, a new benchmark the Mozilla team released in September.This will be the only benchmark Firefox 4 beta will overtake the others in. I am curious how accurate of a representation this benchmark will be of the future.

  • Opera 10.63 - 10515.7ms +/- 0.5% [Full Result]
  • Chrome 7.0.517.41 -12046.8ms +/- 0.4% [Full Result]
  • Firefox 3.6.12 - 14467.1ms +/- 0.1% [Full Result]
  • Safari 5.02 - 14589.5ms +/- 0.1% [Full Result]
  • IE8 - I did not wait for this to finish.
Separately, beta browsers:

  • Firefox 4 Beta 6 - 9768.9ms +/- 0.1% [Full Result] 
  • IE9 Platform Preview 6 - 21015.6ms +/- 0.2% [Full Result]
Firefox 4 beta 6 leads Opera 10.63 by a slight margin. Chrome trails by a bit more, followed by Safari and Firefox 3.

Peacekeeper:




















Firefox 3 appears twice because I didn't realize 3.6.12 was out at first. All browsers except Opera see gains from last time. This could be due to my updated graphics driver.

ACID3:
  • Chrome 7.0.517.41 - 100/100
  • Safari 5.0.2 - 100/100
  • Opera 10.63 - 100/100
  • Firefox 3.6.12 - 94/100
  • IE8 - 20/100
Beta Browsers:
  • Firefox 4 Beta 6 - 97/100
  • IE9 Platform Preview 6 - 95/100 (noticeable improvement from preview 3)

CSS3 Selectors Test:
  • Chrome 7.0.517.41 - Passes 574/574 tests
  • Safari 5.0.2 - Passes 574/574 tests
  • Opera 10.63 - Passes 574/574 tests
  • Firefox 3.6.12 - Passes 574/574 tests
  • IE8 - Passes 345/574 tests
Beta Browsers:
  • Firefox 4 Beta 6 - Passes 574/574 tests
  • IE9 Platform Preview 6 - Passes 574/574 tests

I must say, the IE9 team seems to be taking web standards pretty seriously. I recommend taking a look at their test center. This will be good for everyone. I'm not a web developer currently, so I can't say if they are truly implementing everything that's important, or just a higher amount of obscure features, but in the end it is a net win. One of the reasons I've always liked Opera is that they strive to adopt web standards.


I noticed something weird in Firefox 4 and Firefox 3.6.12 (it must be a recent thing). By default, when I type into the search box after a fresh install - nothing happens. The browser appears to now require search providers, a la IE, except it doesn't come with any by default.





UPDATE: This is why beta browsers are listed separately. I installed Firefox 3.6.12 on my work PC and it does not have this issue - neither does Firefox 4 beta 6, once it is installed The above must be a fluke. My guess is that one of the Firefox 4 betas somehow corrupted or cleared out the search engine extensions, and this also affected Firefox 3.6.12 on the same machine.

Overall the browser situation is getting better and better. When IE9 comes out, IE8 can finally start going away - it is really the only browser that I can't recommend. Most of the rest come down to personal choice. 

Do you want the absolute fastest browser, but with a few less features? Chrome.
Do you want the ultimate in customization, if you want to download some extensions? Firefox.
Do you want more features built in, and almost as fast as Chrome? Opera.
I'm not sure if there is a compelling reason to use Safari 5 on Windows, but it also isn't a bad choice.

Until next time.

Thursday, November 4, 2010

Java Roadmap Disappointment

Am I the only one disappointed with the new Java 7 road map? It seems both late and lackluster.

First, let's look back at past Java releases (courtesy of the first google result I saw with actual release dates)
J2SE 1.3 2000-05-08 Kestrel
J2SE 1.4.0 2002-02-13 Merlin
J2SE 1.5.0 (5.0 to salesmen) 2004-09-29 Tiger
J2SE 6.0 (1.6.0) 2006-12-12 Mustang
What has been happening the last 4 years? Apparently a few things I didn't know about (politics, JCP, Apache Harmony, etc). Most of which I'd need to read up on a lot more before I could write about it...so I'll stick to two things. 1) Apple OS X Java thing, 2) The updated Java 7 release timeframe and scope.

On the Apple deprecating the shipping of Java with OS X - I think Ted Neward summed it up best. What is potentially most interesting is depending on how Apple handles phasing out maintaining Java on OS X, and if Oracle picks up writing a JRE for OS X. If so, will it impact the Java 7 release date? I think he has a point though - is there even a large demand for Java on the Mac? (And I say this recalling having compiled landon fuller's openjdk6 port on my Mac prior to Java6 shipping on my MBP almost 3 years ago...)

On the updated timeframe and scope given by Mark Reinhold...

I was really hoping Lamba expressions, often referred to as closures, would make it into Java 7. A mid-2011 release (another delay) without them is pretty disappointing. Java feels stagnant. The primary strength of Java for me is the tooling, not the language...but it would still be nice if the language was developing faster. Maybe it's time I started checking out some other languages that run on the JVM.

There should still be a few neat things though...looking at the list:
  • invokeDynamic bytecode - should be great for all the dynamic language people running on the JVM
  • related to the above...method handles. First I've heard...this requires more reading. 
  • Strings in switch statements - at last
  • NIO.2
Ending my rant on a positive note...I suppose there are still some cool new things. I'd install an openjdk7 build, but it would just make waiting harder :)

Wednesday, November 3, 2010

iPad Thoughts, Part II

There are a couple of topics I forgot to mention in my first iPad thoughts post.

More favorites apps

The new Twitter app for iPad is awesome. There are so many great UI concepts happening, it is hard to describe. Pulling and sliding and locking important things in place. Kick. Ass.


Another app in my favorites for iPad is iSSH. It is a very solid SSH client - I can SSH into critical servers from anywhere using my iPad. While also for iPhone, the iPad's onscreen keyboard is a lot more usable (and iSSH has extra keys available). It's possible to get meaningful work done when SSHing from the iPad. And that is cool.

More games:
  • Angry Birds. 'Nuff said.
  • Solipskier - very simple, entertaining game where you draw slopes to ski on. 
Upcoming games:
  • Epic Citadel - I can't wait until Epic releases the actual game
  • Ditto for id Software and their Mutant Bash TV 



The iOS Notification System Is Lame


My only other gripe with the iPad, and this is iOS in general, is notifications. I haven't historically been a heavy enough user, so they didn't bother me much in the past. With both iPad and the iPhone 4, Apple's notification system is showing its age. It's annoying even without multitasking (e.g. current iPad - to be remedied later this month) as it will just stop whatever you are doing when they pop up. On iPhone 4 it is even more noticeable - oooh yes, you thought you could multitask away from this app...except I just froze the app you are using to show you this nice notification dialog! Foiled!


Notifications need to be fixed. Pretty please, Apple?

At this point we're at GM seed of iOS 4.2 for iPad, so iOS 4 on iPad should be a reality in the next few weeks as planned. Any day now...

Tuesday, November 2, 2010

Bogus file corruption issues with TortoiseSVN on Windows 7 64-bit

Last Thursday I encountered a strange and frustrating issue. There are a wealth of blog entries out there about this, for anyone who bothers to search, but I am going to summarize it regardless. I myself didn't google it until after it happened to a coworker as well - at that point I knew something was up.

I've used Windows 7 64-bit with Microsoft Security Essentials at work for over a year now. For the last 4 months, I've had an Intel SSD in my workstation at work as well, and did not hit this issue until last week, when it hit hard.

I could not successfully checkout a new Subversion working copy to my SSD - period. Every attempt gave me the following message, in my case after 5-10 minutes time. Repeat attempts (update to attempt to resume the checkout) would cause it to happen again until finally the workspace could not be updated or cleaned.

Each time I would see the following error:

Error Can't move
Error '...\path\to\.svn\tmp\entries' to
Error '...\path\to\.svn\entries': The file or directory is corrupted and unreadable

Following this, the next reboot windows would schedule a CHKDSK on my SSD drive. Despite it not finding any issues, I still got a sinking feeling. Checkouts to my regular hard disk worked fine, aside from crawling in comparison. Hmm... As it turns out - my SSD did not have corruption problems. It also isn't TortoiseSVN's fault. It's a bug in Windows 7.


Fortunately, there is a secret agent style hotfix (email registration, download link with password that expires in a few days) that came out in June. It will apparently be included in Service Pack 1 when it is released.

Symptoms listed from the hotfix described exactly the behavior I was seeing:
For example, you run an application that uses the MoveFileEx() function to replace files. If you use this function more than one time in a short time, you may receive an "ERROR_FILE_CORRUPT" error message. Additionally, you may encounter one of the following issues:A warning message is displayed in the notification area. This warning message indicates that you should run the Chkdsk.exe utility to check the disk.
A disk check is scheduled for the next time that you start the computer.
Subversion uses the MoveFileEx() method for replacing files in place. The reason this didn't happen on my regular HDD, is that the issue is specifically when MoveFileEx() is called in fast succession. SSDs perform the actions must faster. They are apparently so fast, they uncover obscure filesystem implementation bugs in NTFS. Have I mentioned SSDs rock for development?

For the curious - file indexing and anti-virus could also apparently make this problem worse / more apparent, but disabling Antivirus did not help in my case. I didn't try disabling indexing, but I did not have whole-drive indexing enabled anyway. The hotfix completely resolved the behavior on my machine.

Here are some other reference links I found helpful. Hurrah for ServerFault, which had the first useful result in Google.

http://serverfault.com/questions/72561/64-bit-tortoisesvn-on-windows-7-says-file-or-directory-is-corrupted-and-unreadab

http://tinyurl.com/w7corrupt

It both amazes me, and ceases to surprise me that bugs like this shipped in a production OS. I mean...think of the madness one could go through thinking your HDD was corrupt, or software faulty, if you just believed the messages and didn't search. It is due to this that I post this entry, hopefully it will save at least one person a few wasted minutes.

This is also the second hard drive related issue I have encountered with Windows 7 so far. The other had to do with my 1TB hard drive disappearing after resuming from standby - it was something along the lines of Windows 7 not waiting long enough for drives to respond on wakeup, and larger drives can take longer to wake up and respond. I forget if I had to apply a hotfix, or update a driver or registry setting to fix that problem.

This isn't a rant about Microsoft, this is just another good example that writing software is HARD.

Monday, November 1, 2010

It's November again...

Last year I did my own take on http://www.nanowrimo.org/ by writing in this blog every day for a month. I plan on doing it again this year. Hopefully the writing habit will stick.

I intended to post this last week, but as it is already November 1st - I guess I am already behind.

I have quite a backlog of miscellaneous, semi-completed blog entries in the past month alone, so the first week may be completely random. I would like to come up with some topics that I can focus on in the weeks following - we'll see how it plays out.

There is a lot to talk about right now in the Java world.
- Where is Java headed? Feelings on the Java 7/8 roadmap
- Is Oracle scaring off developers, and what will happen to Android with Oracle vs Google?
- What is the future of Java on the Mac?

The web also continues to be full of interesting advancements, especially due to the iPad and mobile devices.
- Some very impressive things can be done with HTML5 + CSS3. What are some examples?
- Fierce web browser competition - it's hard to go wrong nowadays.
- Smart phone competition (Android, iOS, WebOS, Windows Phone 7, etc)

In addition to (hopefully) talking a bit about the above, and more, I'd like to lay out some other goals for the month:

- Start and finish reading Release It!, by Michael T. Nygard

I'll add more goals and topics as I think of them. Time to start writing Tuesday's post...