Thursday, November 15, 2012

iPhone - Silent but Violent

I saw an interesting thing on a TV show I was watching the other day.  A character's iPhone "rang", while on vibrate.  I recognized the distinctive iPhone vibrate sound right away.  Think about that - the purpose of the vibrate feature is to silence your phone to only alert the owner to an incoming call, yet the sound is audible and distinctive enough that it can be used in a TV show to convey an incoming call without using the Marimba sound like the show Phych goes for.  So, when I saw Apple was doing this, I applauded loudly... on vibrate.

http://appleinsider.com/articles/12/11/15/apple-looks-to-suppress-noise-created-by-iphone-vibrate-function

Monday, November 12, 2012

Social Networking Vanity Plate

I'm surprised it wasn't taken already.  Perhaps database folks don't have enough panache:
http://www.linkedin.com/in/selectstar

Wednesday, October 31, 2012

What's wrong with Windows 8? This.

If you want to know what's wrong with Windows 8, this is it.  Every junk link that any program creates that used to land in some folder you never touched in your start menu is now dumped out on your screen like some awful scrabble game where every tile is a J, Q, K, and X when all you want is a stinkin' vowel.  That's Windows 8 in a nutshell.  And here's how I fixed it.


Sunday, October 21, 2012

Microsoft's Billion Dollar Mistake

Bill Gates has been carrying around a tablet PC for years, but never managed to make it popular. To me they always seemed gaudy, like something you'd carry around on the floor of a manufacturing plant or for getting signatures for delivering a package. They ran Windows, had handwriting recognition, and some had a bulky keyboard or stylus. Some of the nicer ones were essentially laptops where the screen rotated and folded back. A business machine, not something fun and playful.  And they always looked heavy.

Then, 3 years ago, Apple announced a tablet PC called the iPad. The idea wasn't new by any stretch, but the implementation was. The only input method was your finger. Now Windows OS. No keyboard. No stylus. And no handwriting recognition. Not what Microsoft (or anyone) thought of when they thought of a tablet. Except maybe those Star Trek Next Gen producers - they were way ahead of their time in predicting future computer interfaces.  But it already had a market - millions of iPhone users with thousands of iOS developers ready to make software for it.

When I saw the first iPad, I scoffed at it. A novelty, surely. I was still using my Windows Mobile phone with a stylus at the time, and a Dell laptop. My belief was that same as Bill's - a tablet was something that looked and acted very different from what Apple had just made, and I thought its only market was people who worshiped at the alter of Apple. I ignored the sleek size, the thriving app ecosystem, the unprecedented battery life, the well placed price point, and the huge attention to detail in the touch interface.  I focused on the sub par weight and lack of camera and wrote it off.  A year later, I had relented (repented?), and had both an iPhone and an iPad 2 in my possession, and have not looked back.

Fast forward to today, and the iPad is to tablets as Kleenex is to facial tissues. No other single model of tablet comes close to Apple's total iPad sales. Turns out, we didn't need to run Windows after all to have an awesome computing experience. A fact emphasized by the fact that I develop software for the Microsoft platform, and my positive iOS experiences have led me to purchase 2 Macs. (Both refurb - Macs are still horribly overpriced retail!) And this is Microsoft's fears from 1995 come true - when they battled Netscape it was because the web threatened the dominance of Windows. I use FireFox or mobile Safari to browse the web. I'm always within reach of an Apple device. I'm not Windows free due to my profession, but I don't have the attachment I once did. Except, as a .NET developer.  I would love to write more mobile software. Enter Surface...



There are tons of Windows tablets, but Surface is the only one anyone might be able to identify by name, and you can't even buy it yet. It's nice looking. Actually, it's beautiful.  It runs Windows (RT though, not full Windows but they hope you won't notice). And it's coming out with Windows 8, just in time for Christmas shoppers. There's only one problem - how will they get anyone to care? Everything that isn't an iPad is the Kerry/Romney of the tablet world - the only real thing going for it is that it's not the other guy.

Microsoft's been late to the market before, but they've done it better. When C# showed up, Java had a choke-hold on development innovation. When SQL Server showed up, people were still forking over countless millions to Oracle and legions of highly specialized DBAs. The XBox has dethroned Sony for many hardcore gamers. But Microsoft has had it's share of struggles too. The Zune, and Windows Phones the most obvious two examples.

Microsoft is a multi-billion dollar international powerhouse, but their success in the consumer market has been with only two main product lines.  Windows and XBox.  If you insist on counting Office (which I don't as a consumer product), you might graciously give them 3.  Microsoft's success has overwhelming been in the commercial market, and that was largely due to their Windows monopoly.  XBox is really their only product where they've fought their way up from nothing in the consumer space.

And that's the issue that Microsoft has to answer or else it's about to cost them a billion dollars in sales. What about the Surface will compel people to buy it? I'm a Microsoft platform developer and I don't even know. And even if they get a customer base, what will make them love it and evangelize it and upgrade to the next version rather than switching to Apple or Google? The pricing has been announced, and sadly it's no different than the iPad. As pictured, it's $599. At that price, why wouldn't I buy a real iPad?  Or, for less, get an iPad-mini?  Or is this meant to be a commercial product, in which case I have to ask why sell it in powder blue and hot pink?

Windows and Office are no longer the killer apps they once were, but that seems to still be the only strategy Microsoft has for selling this thing. Time will tell, but from what I can tell there are only 4 real contenders for the tablet market - Amazon's Fire, Google's Nexus, Apple's iPad, and Microsoft is hoping its Surface offering will be in the running. I don't like betting against Microsoft, but the deck's stacked against them this time. Did they learn anything from the Zune?  XBox?  Time will tell.

Sunday, October 14, 2012

Apple's Billion Dollar Mistake

While Apple's iPhone 5 announcement was big news to many, I have the iPhone 4S so I have another year until I think about upgrading. So the frame scratching, the rapid battery drain, the purple haze, and a whole host of other issues will surely be perfected with next year's "5S" model, the same way the iPhone 4S was a much better version of the iPhone 4. I have 2 simple hopes for the iPhone 5S - it's time for them to update to 128 GB of memory, and it's time to bring color to the device. Otherwise, there's not much else compelling to talk about.

But actually, this post isn't about the iPhone 5 at all, but about the new iPod. This was supposed to be the iPod I've been waiting for. The enhancement to the prior generation which touched on an amazing market potential. But instead, what we got was a kid's iPhone Jr - a toy with no market. Everyone who wants an iPod already has one. Everyone who is too young for an iPhone, has access to cheap older models. There is no market for iPods anymore. But Apple was on the verge of making a new market with the prior generation iPod and let it slip through their fingers with this latest model.

Here's the new iPod model (aka: iPhone mini?)


And here's the one they let slip through their fingers:

Did you miss it?  Look again.  The prior one is smaller, more like the Shuffle.  And... wearable.


That's not a watch in the center.  It's an iPod.  It's the same iPod pictured above.  The design wasn't revolutionary.  Dick Tracy wore this in 1946.  But no one has ever done a wearable computer that anyone has ever used en masse.  And then last year Apple made this.  The perfect shape.  A tad big and not enough battery power yet, but that was to be expected in a first gen model.  They could have made this next generation one nearly perfect just by building on the prior model, but they let that slip through their fingers.

Perhaps the idea of a wearable computer died with the iPhone.  My wife thinks I'm stuck in the 80's and no one wants to wear a watch or a computer.  Just having a device with you in your pocket or purse is the new "wearable" concept.  But maybe, just maybe, Apple had finally found a way to make a real wearable device happen.  Think about it - GPS, a payment system, a wifi enabled device, and Siri.  Perhaps some iPhone integration features.  Not to mention the health and medical applications.  FitBit is already leading the way in wearable wellness/biometric devices.  Apple had a chance to have all that and still the best portable music player on the market.  Maybe even a Skype app could make it a phone.  But even without being a voice communication device, it's still got loads of potential.  But Apple missed it completely.  Shrinking it a little and increasing the battery and adding some biometric tracking sensors and it would have made a beautiful v2.  Even if they just targeted joggers at first with heart rate and calorie burning tracking, they'd have seen millions of units fly off the shelves.

But Apple didn't even create that watch band for v1.  They didn't see the potential - someone else did.  That was the first clue that it was an accident that this device could be wearable.  And even then Apple didn't carry the design forward which confirms my suspicion.  And that's hugely disappointing.

No one with an iPhone wants or needs an iPod Touch.  And this new iPod is just a Touch Mini, which is completely useless.  But regardless of what tech you have already, there's a huge untapped potential for wearable computing.  Apple could have made a handful of simple enhancements and created a new market again.  Look at the power and popularity of XBox Kinect, and just imagine how they could have tied this in to iOS as a gaming platform!?  Instead, they went with the status quo.  Now that Steve is gone, is this the new conservative Apple?  Afraid to risk their cash cows?  That's exactly how Microsoft lost their throne too.




Monday, April 2, 2012

Glyphs are the bellbottoms of the application world

Microsoft, Google, and even Apple have been working very hard lately to drain the color out of all of their applications in favor of grayscale icons called glyphs. Look at the sidebar in iTunes, or the beta of the next Visual Studio, or Google Reader and you'll see right away what I mean:












The new trend in software is now to look like the undead:
VS 2012, iTunes, Finder, Chrome, Google Reader


Stylistically, software has changed a lot over time. Remember when teal (#009999) was the "in" color for Windows apps?  How about splash screens?  No one uses those anymore.  Now, glyphs are in.  But for how long?  Look at clothing fashion - the gaudy, ugly, or non-functional styles will be eye catching at first, but flame out fast and look dated rapidly.  In fact, Visual Studio 2012 hasn't even been released, but the style already looks horribly dated.  (Sorry MS, you caught the trend on the downswing yet again!)


Software, like fashion and cars, has gotten into this trend of changing its look every year.  Sometimes the new look has functional benefits, but often it's change for the sake of change.  The thing is, we humans are very opinionated about change.  Sometimes we really like the new shiny-shiny, but equally often we reject the discomfort of re-learning what we already know.  Fashion and cars can change because their function remains - the pedals are in the same place, and the sleeves are too.  But software cannot change without directly affecting usability, and that's a problem.

You see, unlike cars and fashion where the desire is to purposely date the product to sell the next new thing, software doesn't work that way.  People will not buy the next version if the only thing different is the look.  Also, often the next version of a software product is given out for free.  See if clothing or cars ever work that way!  But even with Office where Microsoft desperately wants you to buy the next version, their customers won't do that if it just looks different.  It's features that matter.

But even within the world of clothing and cars, there are exceptions to the trendy churn of change.  Look at white socks and blue jeans - a staple in any wardrobe.  Have a look at models of vans on the road - can you really tell the difference between an '01 and an '02 Sienna?  Like jeans and vans, your software might just be more utilitarian than trendy, and that's okay.  Let me repeat that another way - the software you used at the ATM for years and years likely ran on IBM's OS/2 long after anyone else ran OS/2.  Why?  Useful, stable, simple, functional.  A known commodity.  Ever notice how the "save" button in every application known to man is still a 3.5" floppy disk even after 15+ years of not being actively used, and 10+ years of not even being able to even buy them?  A whole generation of people entering high school now have probably never laid hands on a floppy disk, yet they know how to save their files in Word.

For the time being glyphs look really trendy, and there's a push to make all apps match the trend.  Line of business apps included.  But watch out dear friend!  The release schedule for your line of business application is not the same as Microsoft's release schedule, or Google's, or Apple's for its products.  And your customer base isn't the same.  And your design team isn't as big as theirs, nor frankly does your software require a total visual overhaul.  In fact, let's all be honest and admit that this new trend in glyph usage is just a passing fad, and when it goes the way of pink bangles and bellbottoms your app will look dated while the world of software passes it by.  The same way it looks really dated now because you're skipping out on glyph-ing up your UI.

Sunday, March 25, 2012

System.String missing overloads

The .NET string class is pretty light on methods, which is actually a really handy thing.  Most everything you need is there, and if it isn't you can add to it with extension methods.  For anyone who made the transition from VB and its Mid(), Left(), Right(), InStr() methods, this was a welcome change.  Substring, Replace, IndexOf, TrimEnd, Split - these are all very discoverable and easy to use methods that can be built upon to create more advanced functions.  Trouble is, there are some very conspicuous omissions of overloads - in other words, methods that are already on System.String that are missing obvious ways of calling them because Microsoft didn't provide them.  I kept waiting for these to show up in the framework, but after 12 years of .NET development I've given up hope that Microsoft will ever provide these.  So here they are - the missing overloads for methods MS already provided.

Substring - Substring() is the most error prone method on String.  It throws exceptions all the time if you didn't get your math just perfect.  Here's an overload for Substring that offers an extra variable to ensure your Substring() method never fails:

public static string Substring(this string s, int startIndex, int length, bool neverFail) {
   if (neverFail == false) return s.Substring(startIndex, length);
   startIndex = (startIndex < 0 ? 0 : (startIndex > s.Length ? s.Length : startIndex));

   if (length < 0) length = 0;
   if ((startIndex + length) > s.Length) {
      length = s.Length - startIndex;
   }

   return s.Substring(startIndex, length);
}

TrimStart and TrimEnd - There's a nice little zero parameter method called Trim() on string, but TrimStart() and TrimEnd() take an array of characters to trim.  The most common trim is whitespace, and there's no easy way to just trim that at the beginning or end of the string.  It would have been so easy to leave a parameterless TrimStart()/TrimEnd(), but alas.  So here it is:

public static string TrimEnd(this string s) {
   if (s == null) return null;
   var buf = new StringBuilder(s);
   while (buf.Length > 0 && Char.IsWhiteSpace(buf[buf.Length - 1])) {
      buf.Remove(buf.Length - 1, 1);
   }
   return buf.ToString();
}

public static string TrimStart(this string s) {
   if (s == null) return null;
   var buf = new StringBuilder(s);
   while (buf.Length > 0 && Char.IsWhiteSpace(buf[0])) {
      buf.Remove(0, 1);
   }
   return buf.ToString();
}

These next two are a real annoyance. For whatever reason, Microsoft completely forgot case-sensitivity which is a huge concern when dealing with strings.

Contains - Not sure why you can't check whether a string contains another string with a case-insensitive compare. Here's a simple one-liner to resolve that:
public static bool Contains(this string s, string value, StringComparison comparisonType) {
   return (s.IndexOf(value, comparisonType) >= 0);
}

Replace - You have to get into the RegEx libraries to deal with string replaces that are case-insensitive, which is ludicrous. Here's an overload for Replace() that resolves this huge oversight:

public static string Replace(this string s, string oldValue, string newValue, StringComparison comparisonType) {
   if (s == null) return null;
   if (string.IsNullOrEmpty(oldValue) || newValue == null) return s;
   int idxNext = s.IndexOf(oldValue, comparisonType);
   if (idxNext < 0) return s;

   var result = new StringBuilder();
   int lenOldValue = oldValue.Length;
   int curPosition = 0;

   while (idxNext >= 0) {
      result.Append(s, curPosition, idxNext - curPosition);
      result.Append(newValue);
      curPosition = idxNext + lenOldValue;
      idxNext = s.IndexOf(oldValue, curPosition, comparisonType);
   }

   result.Append(s, curPosition, s.Length - curPosition);
   return result.ToString();
}

Every development shop has their own extension method library, and certainly I have plenty of those. But, arguably, those don't belong in the framework itself. These, however, are interesting in that Microsoft already put them in there for us, but they failed to hit a few very common needs served by these simple overloads. Enjoy!

Thursday, March 15, 2012

Introducing WebMatrixColorizer!

I've published a small, but fun open source project on CodePlex called WebMatrixColorizer.  Here's how I describe it:

Project Description
WebMatrix 2.0 supports code color theming but uses a different .XML file than Visual Studio's. This simple app converts a .vssettings file into a color scheme importable by WebMatrix. Export from VS or download from StudioStyl.es, then convert and import. Want a dark theme? Easy!



And here's the FAQ:

What is this project for?
If you are like me, cracking open Visual Studio for simple home projects starts to feel too much like work and not enough like play. WebMatrix is an awesome solution to this. It makes web development feel fresh and fun again for small projects, and less like work. Of course, when using WebMatrix, it's nice to keep your Visual Studio color scheme in tact. With the newest version of WebMatrix (2.0 beta), you can install the ColorThemeManager from the Gallery button on the "Site" view. With this extension, you can change your color theme, import themes, and export your theme. Unfortunately, WebMatrix doesn't know how to import a .vssettings file, which is how Visual Studio stores it's themes. That's where this project comes in. Take your .vssettings file and run it through WebMatrixColorizer and you'll get an XML file that imports nicely into WebMatrix.


How do I use it?
From Visual Studio, export your color settings. Or, head out to http://studiostyl.es and download a new theme. Once you have your .vssettings file, open up WebMatrixColorizer and convert your .vssettings file to a WebMatrix xml file. Then, in WebMatrix, import that xml file and you've got your new theme.


What do you mean "import the xml file"?
Make sure you have WebMatrix 2.0 beta or above, and that you've installed the extension from the Gallery. If you see the "Import" button on your ribbon bar on the site tab, you're all set. If not, Google is your friend.


Will it look exactly the same as my Visual Studio settings?
Not quite. Visual Studio has all sorts of things like code folding, debugging, refactoring highlights, etc. that have no equivalent in WebMatrix. Also, WebMatrix supports PHP and other stylings that aren't in Visual Studio. WebMatrixColorizer takes a best crack at getting the colors the way you probably want them. But, if you have settings that didn't import, you can always manually modify the theme in WebMatrix, modify the source code for WebMatrixColorizer (it is after all, open source), or submit a patch via Codeplex.


Will this ever be integrated into StudioStyl.es so that I can download a WebMatrix theme directly without the conversion?
Could be. I'm not the author of that awesome site, but I have reached out to him to let him know about this project. It's MIT licensed open source code after all - you never know where it'll wind up.   UPDATE: Big thanks to Luke Sampson of StudioStyl.es who integrated it almost immediately! 

After a couple nights of play and tweaking, it's ready for public consumption.  All you WebMatrix junkies out there who like your http://studiostyl.es, have at it!

Wednesday, January 4, 2012

Hacking the DVR again

Man, nothing makes you feel more like a hacker than downloading utilities from Taiwan, creating a new driver .inf file, and then changing hex code in the registry.  But, after hooking up the LCD TV to the DVR via a DVI --> HDMI conversion cable, that's exactly what I had to do.  Apparently, nVidia drivers transmit that audio will come out of the DVI cable, which it doesn't.  So, the TV expects both audio and video from the HDMI input, and thus - issues.  I needed video only from the HDMI, and then audio from an analog 3.5mm headphone jack.  So, Google eventually brought me to this.  Bizarre solution, but it worked.