Thursday, December 2, 2010

Another update on my XT701

I have been using my Android phone for a while. I am pretty happy with it.

I am working around my battery issues with nightly recharging.  I also charge the phone at my desk, thanks to the mini USB charging facility.

Some of the apps that I have been using are KeyRing, EverNote, Twitter, SugarSync and GroceryIQ. The maps application is also excellent.

I find that the phone seems to lock up about once a week, requiring me to remove and reinstall the battery. I hope that the frequency of this will diminish as time passes.

Tuesday, November 9, 2010

An Update to My Impressions of the Motorola XT701

I have been using my new Android phone for a couple of weeks and I am generally happy with it.

From my perspective, the pros are:

  • There is a large amount of software available, it seems to be of generally good quality and it is easy to install.
  • The phone feels very responsive to my newbish fingerings, even though my phone does not seem to have a processor that is fast by current standards.
The cons are:
  • The battery life is easily the largest complaint that I have with the phone. Even with background sync disabled, GPS and WiFi and Bluetooth turned off, the screen backlight turned down to zero and curtailed web browsing, I can about 1 day of life out of the battery. (I do leave the HSDPA turned on, rather than falling back to just 2G. There no quick way to toggle the 3G on and off, like there is for the WiFi, GPS and background sync, and surfing on 2G is painful.) I can easily run the battery down with an hour or two of web browsing. I easily could get several days of battery life from my E71, including perhaps six to eight hours of web browsing with a battery that was nearly two years old. That meant that I never really had to worry about power management or where I could recharge the phone during a workday. I have seen some people claim that battery life improves a bit after going through a few charge/discharge cycles, but I haven't seen that yet. Judging from the battery management applet, the screen is the biggest power hog. Being able to charge the phone with a mini-USB cable is very helpful, but I feel like I am constantly plugging and unplugging the phone. A desktop cradle might help, but I don't seem to be able to find anything that supports my XT701. Everything I can find on Amazon is aimed at Droids.
  • I am still getting used to the soft-keyboard. I keep kicking it into Chinese mode, which takes a moment to recover from. I've been lead to be believe that this keyboard is a little clunkier than some others. I know that there are other soft-keyboards available from the Android app store. I presume that I should try them out, particularly the one that understands Palms' Graffiti. (I was very proficient in Graffiti in 1999, and I still miss my Palm IIIX.) To be fair, I was never very good with the real keyboard on my E71, only passable.
  • I would like to have Froyo rather than Eclair. From what I have read, this is scheduled to happen on the XT701 in late 2010 or sometime in the first half of 2011, depending on what part of the planet we are talking about. I am a little unsure of how the normal Android update process works. Since I am in North America and using a phone that isn't officially supported here, I am guessing that I will have to perform the installation myself at some point.
I haven't fiddled with the camera very much, but I have started experimenting with EverNote.

Friday, October 29, 2010

Phones: First Impressions of My New Android Phone

First off, this was an open box purchase of a Motorola XT701 from Newegg. As far as purchasing open-box and refurbished gear (Thinkpads and iPods, mainly) goes, I've always had good experiences. This is the first open-box item that I have purchased from Newegg, but I've always had good experiences with them.

There wasn't much in the box: the phone, a wall charger and adapter for US outlets, a USB to mini-USB cable, the battery, the battery cover and a couple of small pamphlets/manuals. There was a 8 GB SD card already in the phone. Removing it to insert my own 8 GB SD card seemed more trouble than it was worth, so I'll be transferring my old files over via USB. The box seemed like it had been tossed around a little bit, but nothing seemed to be damaged in any way.

The phones' screen is easily bigger and has better image quality than my old Nokia E71.

Initially, I had problems getting the phone to take my Gmail and GAFYD credentials. I was chalking this up to being an "open box purchase" issue, but this seems to be a fairly common problem. Googling found that the issue is generally solved by doing a "hard-reset" of the phone, which wipes all of your data and returns the phone to its' factory defaults.

Resetting the phone lead me to my biggest "uh-oh" moment. It happened when I powered the phone up after the hard reset. Everything was in Chinese! (I believe that the main market for this phone is in China, so this makes some sense.) After some blind poking around by using the "Settings" page, I found that lower right button on the initial, power-up "home" page allows for changing the phone to other languages, including US English.

After getting through that, I could enter credentials for both my personal and corporate (GAFYD) accounts without any further problem.

I've been toying with the phone for a couple of hours. I've never even tried an Android for a significant period of time before now and I'm still feeling my way around. It is like going from Windows to MacOS or Ubuntu. I know what I want to do, but I'm not quite sure how to do it, or if I am doing it in the best or most efficient way. I'm not sure what options are open to me; I need to check out some articles for newbs and maybe subscribe to some Android blogs.

I don't think that functions are as discoverable on Android as I would like. Some items are touchable/clickable, others are simply display-only items. I don’t know which is which until I finger them, and even then I might not get a response because my fingers are too fat. I can't say that iOS, WP7 or WebOS are any better or worse in this, but I do have a new respect for the ability to hover a cursor over a control on my Windows laptop and get a ToolTip-style hint.

My open questions/issues are:
  • My calendar items have a few Chinese characters in the header. I don't know why.
  • I have Android version 2.1 on the phone. I don't know if 2.2 is available (or even appropriate) for my phone. Since I have an unlocked phone, I presume that ATTs' network isn't going to prompt me to update the OS.
  • I haven't even tried the camera yet. The phone has linked up with my stuff on Picasa, though.
  • I like to use my wifi network when I am at home, even though I have decent 3G coverage there. I don't know how to tell if the XT701 is sending data over the wifi or 3G networks. My old E71 made this very easy.
  • I still need to identify apps would be useful to me. Other than calendaring and email, which seem to be adequately covered with what is shipped in the phone, I'm primarily interested in to-do lists, punch lists, and grocery lists, which are often scribbled on scraps of paper. Everyone seems to love Evernote, but I don't want to have to learn a new product if I can make do with what I have. It is also possible that something specific (a grocery list management app) might be better than something more free form (like Evernote, or even just a Word or gDoc file) would be.
  • I would like a countdown/timer app. Which one is best for me?
  • I need to choose better alarm and ring tones. Waking up this morning was a little too exciting, with the default alarm noise.
  • I need to decide if I want to add Evernote to my repertoire and what I would do about OneNote in that case.
  • I'm disappointed that I can't directly edit Google Docs files (yet). I had hoped to upload the few tiny Word files that I update with any frequency to gDocs and edit them there, via the phone or via any web browser. Since the phone can't edit gDocs yet, I will need to stick my Word files on the SD card and use QuickOffice, or migrate the data to something else, like Evernote.

Phones: What Drove My Selection

OK, so I needed a new phone. What drove me to choose the phone I did choose?

Primarily, I use a phone as an internet device/PDA and not so much as a phone. I'm not a talker, and it irks me when I have to burn two minutes to retrieve a voicemail. I'm not worried about call quality or anything like that.

I do love email.

I am not interested in playing games, so processor speed isn't a big worry as long as it lets me type as fast as I can. I am not interested in streaming HD movies over 3G, or anything similarly bandwidth-intensive. I have 35/35 FIOS at home, two laptops and a HTPC for anything 'heavy'.

My main consideration for hardware was whether I should get a phone with a physical keyboard or not. I have mixed emotions about physical keyboards. They make the phone thicker, and I'm not always keen on the keyboard layout. I've never used a virtual keyboard long enough to get used to it. I have had a few people with Droids tell me that they use the virtual keyboard, even though they have a physical keyboard. In the end, I decided that I would go with a phone without a physical keyboard.

As far as OS goes, we have Symbian, WebOS, iOS, Windows Phone 7 and Android.
It seems obvious that Symbian has been totally outmaneuvered by iOS and Android and they are now trying to play catch-up with more modern OS designs. I suspect that Windows Phone 7 will also gain share mainly at the expense of Symbian. Nokia seems to have lost their way with smartphones, and my last two Nokia phones didn't stand up to my use very well, so I didn't even look at Nokia hardware.

When it launched, I was very hopeful for WebOS, but I was disappointed. (I've been disappointed by Palm for years and years, but that is a a topic for another blog post.) WebOS was too little, too late. I don't see Palm being purchased by HP as a very positive thing. WebOS might have a bigger future in printers than phones, and phones are where all the action is these days. If HP wants to sell a tablet with no developer support (because the developers are all busy writing for iOS, Android and Windows Phone 7), they can go ahead and try. WebOS will be a niche OS at best.

For me, Windows Phone 7 is too new to rely on. I have been using Microsoft products for over 20 years and the "wait until version 3" strategy is deeply engrained in me. Worse, I was very disappointed to read that OneNote Mobile, which ships with Windows Phone 7, does not fully support OneNote 2010. I use OneNote more than any other piece of software from the Microsoft Office suite. I already have a good deal of OneNote data up on my SkyDrive, and I'm not sure if what I have there is compatible. It is as if Microsoft is telling me to use Evernote.

(I don't want to have to wonder about what OneNote features I can use and what features I can't use. Additionally, this makes me feel like I'm paying Microsoft to use beta software. I can get weird, buggy software for free from lots of folks.)

I do not want to jump on the iPhone bandwagon. I think that Apple is the new Microsoft, or maybe AOL, but they keep pretending that they are not. (Microsoft is the new IBM. That's a topic for another day.) I don't think that Google is as hypocritical as Apple.

Android seems to have a good deal of momentum, as evidenced by Motorola's latest quarterly results. Android seems to have all of the important application categories covered as does iOS, perhaps without the same depth as iOS.

Android has the best integration for any of the data that I have which is hosted on Googles' servers.

I have been on ATT (and before that, Cingular) for many years. I talked to Verizon about switching carriers and I was disappointed with the monthly pricing, and on top of that I'd be paying $200 for a phone. Swapping carriers would have increased my costs by a $200-$300 a year.

Since I'm grandfathered into a reasonable monthly rate, I want to stick with ATT. The Android selection for ATT is anemic, so I went for an unlocked phone rather than locking into a contract in exchange for a mediocre but subsidized phone.

I spent quite a while looking over phones, capabilities, radio frequencies, etc. Eventually, I settled on a Motorola XT701. This is not a cutting-edge phone but, based on comments from Newegg and elsewhere, it should be sufficient for my needs and work well on the ATT 3G network. The XT701 does not have a physical keyboard, so I am making a bit of a leap.

Phones: What I had

For the last 1.5 to 2 years, I have been using an unlocked Nokia E71 as my only phone. I used it heavily, often for two or more hours a day. My primary uses were email, calendaring, contact lists and to-do lists, generally done through Gmail, GAFYD and Exchange servers. I also used it for alarms and Google Maps and Google Reader.

Starting over the summer, the E71 would go through periods where it would reboot itself a dozen times a day. Sometimes the E71 would reboot when I was using it, sometimes when it was in my pocket and sometimes when it was laying on a table. Sometimes I would be at the office, sometimes at home, sometimes in a car. There would be periods of rebooting, and then the phone would be fine for a few days, or a couple of weeks. The battery always had plenty of juice. There seemed to be no reason to the behavior, it just seems like a disease that E71 phones can contract. I presume that I simply dropped the phone one too many times. Back in May, I dropped the phone at a SEPTA station and it landed hard enough to put a small crack the screen.

Looking back, I am slightly disappointed with the E71. I had a simple Nokia "candy bar" WAP phone before the E71. I only used that phone for very infrequent calls (I'm not really a talker), extremely rare WAP sessions (it was just too painful) and a couple of dozen texts (via a T9 predictive keyboard) a month. I carried the phone wherever I went for about five years, but mainly I used the phone as a pocket watch and countdown timer more than anything else. I had plenty of access to web-based email through desktop and laptop computers all day long, and carrying email access in my pocket didn't seem very valuable. I might have stuck with that old phone indefinitely, but rubber covering over the on/off switch disintegrated and I couldn't reliably silence the phone, or turn the phone on or off.

With the E71, I took a leap of faith and went with a smart phone. I graduated to email, calendaring and a more reasonable web experience and better texting software as well as a monthly bill for a data plan. The Google Maps Symbian app was revolutionary. These are clear improvements (except for the higher bill). The amount of time I spent with the new phone was probably two orders of magnitude higher than with the old phone.

Even so, I feel like the E71 never reached its' full potential. Mostly, it's little things, but there were some major annoyances/bugs:

  • The version of Symbian S60 that shipped with the E71 was missing my prized countdown timer, which my several-years-old S40-based phone had.
  • The "chrome plating" on the D pad wore off in spots, and now simply looks shoddy. Most of the body of the phone is made out of metal, but the spot that gets the most frictional wear isn't. That seems a like a poor engineering choice.
  • Finding, downloading and installing 3rd party applications was a hassle. Nokia has since tried to copy Apples' App store.
  • Sometimes, browsing to certain web sites would cause the browser to unexpectedly quit, or reboot the phone.
  • The mail program didn't support threaded, Gmail-style conversations or support Gmail-style archive/delete. There is a Gmail for Symbian app, but it feels cramped on the small screen of the E71.
  • QuickOffice was OK for quick notes, but you couldn't really write with it due to the screen and keyboard size.
  • It is widely known that the camera on the E71 is poor. Whatever megapixels it might have, the pictures are frequently blurry and/or have an odd tint to them. This was supposedly fixed on the E72. In two years, I have taken only three dozen or so still pictures and a few videos, mostly for kicks. I suspect that I would have taken more pictures if I had a better camera.
  • The Nokia firmware was only updated once the entire time I used the phone. Another firmware update, allegedly improving the camera situation, seems to only be available for certain European versions of the phone.
  • The 2.5 mm headphone jack only makes things difficult when it comes to headsets and headphones.
  • I experimented with other uses for the phone, trying out YouTube, Twitter, music and podcatcher apps. I never spent very much time with them, and they quickly fell into disuse.
  • I had hoped that I could stop carrying around my iPod, but the podcast experience on the E71 was much worse and the iPod simply sounds better when playing music. 

Wednesday, March 3, 2010

Using Powershell in a SQL Server 2008 job step


I have been using Powershell since I first got wind of the beta and realized that all of my Windows Scripting Host skills would become obsolete. 

However, I've never had the opportunity to try out the Powershell job step type for SQL Agent jobs until today. I know that the Powershell that "comes with SQL Server" isn't the same as the regular Powershell but, other than some fiddling around with the SQL Server file system provider, I've bumped up against those differences before. It's just different enough to be frustrating, so I'm blogging about it. It's a bit of a rant, but maybe it will save someone some time or someone can point out something that I've overlooked.


My goal is to have a simple script that I can use in a SQL Agent job that can automatically discover and backup any SSAS database that exists on the same computer that as the SQL Agent. (This is an improvement over my old method, which used hard-coded XMLA queries to backup specific databases. This is OK if you aren't adding SSAS databases very often, and will remain my default method on SQL Server 2005 servers because SQL Server 2005 doesn't support Powershell in job steps. I suppose that I might be able to code up something using VBScript and COM, but it's boring and I don't have much call for it.)


Hunting around the web, I found an interesting script authored by Idera. Idera's script isn't exactly what I wanted and it is designed to be called from a Powershell shell/console, so I learned how they did it by reading their script and writing my own custom script. It's not rocket science. In the process of getting my script working, I ran into a few quirks of how the Powershell job steps work, and I figured that it was worth a blog entry.


Issue #1:

The first interesting thing is that you can't just use write-host "Hello, World". This is because the SQL Agent doesn't implement a console. There are details on that here. For simple text output to the job step output log, use something like write-output "Hello, World" or write-output $host.


I like to use a liberal sprinkling of write-verbose in my scripts. It provides a good troubleshooting tool and, if I provide enough write-verbose statements in my script, I find that I rarely have to resort to write-debug or a real debugger with breakpoints when I have problems with a script.


The thing is that write-verbose doesn't work in a job step. In other words, this won't work:

$verbose = $true

write-verbose "this is verbose"


This won't work, either:

$verbose = $true

write-verbose "this is verbose" -verbose:$verbose


So, to sum up, write-host, write-verbose, write-debug and their ilk are out. Those commands want to write to a console, and there is no console when running under a job step.


Issue #2:

The next thing was that the assemblies that I wanted to use are not pre-loaded by the environment. That doesn't seem like such a bad thing.


A job step received an error at line 5 in a PowerShell script. The corresponding line is '[Microsoft.AnalysisServices.Server] $server = New-Object ([Microsoft.AnalysisServices.Server]) '. Correct the script and reschedule the job. The error information returned by PowerShell is: 'Unable to find type [Microsoft.AnalysisServices.Server]: make sure that the assembly containing this type is loaded.


My solution for that LoadWithPartialName().

Issue #3:

Inside of a job step, Powershell seems fussier about pointing to enumerations. For example, this doesn't work in a job step but it does run in regular Powershell 2.0:

foreach ($d in $server.Databases) { Do-Stuff }

But this does work:

$databases = $server.Databases

foreach ($d in $databases) { Do-Stuff }

Issue #4:

There is no developer support for developing Powershell scripts inside of SSMS. Basically, you just get a simple edit control to type or paste your script into. You can't set break points or watch variables, you don't get IntelliSense or even syntax highlighting. There is no "Parse" to check your syntax. This matches what you get with the "ActiveX" scripting step. 

The lack of debugging support lead me to many iterations of what we old-timers used to call "debug by printf" or "debug by lprint", now resurrected as "debug by write-output" and cycles of edit-save-run-fail-look.at.output.log. 

I could have developed the script in notepad++ and then copy-and-pasted it into the job step, but then the syntax quirks would pop up. It is a lot easier to fix one syntax quirk if you add one line at a time than if you try to add a whole 30 line script at one go, particularly if the syntax rules are not quite what you are used to.

Issue #5:

The "syntax error" messages can be misleading. The little editor window that SSMS provides does not show line numbers. If you copy-and-paste the code into an editor, it seems that the line numbers given for errors do not correspond to the location of problematic lines within the script.

Issue #6:

An innocent-looking thing like the following line causes a syntax error:

# $($causeAnError)

I think that the SQL Agent things that there is some sort of an embedded job variable in there, even though the line is commented out. If you remove the first $ and the parenthesis, the syntax error disappears.

Issue #7:

It seems that it is harder to concatenate ad-hoc strings together in code. So, instead of this:

foreach ($d in $databases ) {

write-output "$($d.Name)"
}

I find myself doing things like this:

foreach ($d in $databases ) {

$msg = "{0}" -f $d.Name
write-output $msg
}

Issue #8:

I could not call Get-Date or [Datetime]::Now. I don't know why; they are two different things that would do the same thing: get me the current time, which is nice to have in auditing/logging output.


FWIW, my final script looks like the following. There are no national secrets here, but there are two caveats:

  • Watch out for any word-wrap
  • I'm still testing this, so I wouldn't rely on it for a production system without vetting and testing it first.

Here is the script:

$msg = "Starting "

write-output $msg


# The SSAS assembly isn't loaded for you

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices") | Out-Null


# create an instance of the backup object

[Microsoft.AnalysisServices.BackupInfo] $serverBackup = New-Object ([Microsoft.AnalysisServices.BackupInfo])


# create an instance of the Server object and connect to the local, default SSAS instance

[Microsoft.AnalysisServices.Server] $server = New-Object ([Microsoft.AnalysisServices.Server])

$server.Connect(".")


# dump out some stuff to show that we are actually connected

write-output $server


# where do the backups go?

$BackupDestination = $server.ServerProperties.Item("BackupDir").Value

if (-not $backupDestination.EndsWith("\")) {

$backupDestination += "\"
}

write-output "The backup destination folder is '$BackupDestination'."


# Set the standard attributes of our backups.

$serverBackup.AllowOverwrite = 1

$serverBackup.ApplyCompression = 1

$serverBackup.BackupRemotePartitions = 1


$databases = $server.Databases

$msg = "There are {0} databases to back up." -f $databases.Count

write-output $msg

foreach ($d in $databases) {

$serverBackup.file = "{0}{1}.abf" -f $backupDestination, $d.name
$msg = "Backing up '{0}' to '{1}'" -f $d.Name, $serverBackup.file
write-output $msg
$d.Backup($serverBackup)
}

$server.Disconnect()


$msg = "Ending "

write-output $msg


 

Tuesday, February 16, 2010

Patience and Persistence is often worth more than brilliance...

After some bureaucracy, I finally have access to software. I still don't know why it took MS longer to allow me to use my subscription than it did for NewEgg to ship me the physical media, but some mysteries aren't worth knowing.

The next odd thing was getting Microsoft's file transfer client installed. It took a few minutes work to find a download site, download and install the client and then allow IE to use the client.

Now, I need to download and configure Windows XP, VB 6 and Office 2003, all in a VHD. I've got all of the required ISOs, so I'll be installing up a storm on the train.

Thursday, February 11, 2010

x64 Drivers for Common file formats are coming...

...probably.

I've been meaning to mention this for a while.

If you've read my blog at all, you've probably seen my rages against the lack of 64 bit drivers for common Office data formats.


I don't see anything about Fox, dBase or Clipper files, even with some googling.

Wednesday, February 10, 2010

Instant Gratification

I've been gigging as a SQL Server DBA for a long, long time -- more than twice as long than I've held any other job. Everyone knows about the economic situation, which certainly seems to have cut back positions, compared to 2007 or so. As others have noticed, it does seem that power is devolving away from DBAs running boutique databases. The "No SQL movement" is one aspect of this, and the marketing push for SQL 2008 R2 leans toward Business Intelligence (BI) features, such as the "self-service" BI features and the older SSRS and SSIS features. Improvements to the data engine, my bread and butter, are minimal and frankly not very exciting.

With that in mind, it seems prudent to find a way to not be so much of a one-trick pony. I did a lot of development earlier in my career. Code from that era seems to qualify as "legacy" now, so migration projects might be forthcoming, perhaps there might even be a mini-boom in such work, along the lines of the COBOL work in the late nineties.

At the moment, I'm primarily interested in small projects, web development, legacy VB and Access applications, Sharepoint, SQL Azure. I do need to knock some of the rust off of the languages I used 10 or 15 years ago. This means that I would want access to new and old software, and might want to run my own servers as VHDs. Plus, there are new versions of Visual Studio, SQL Server and Office coming.

With all of that in mind, the sensible thing to do seems to be to go with an MSDN subscription. This gives me access to a wide variety of software, including old versions of things.

I think that the last time I spent for my own MSDN "stuff" was before the annual licensing scheme started, when you could still get pretty much everything on a single CD for $200 or so. At that time, a CD-ROM drive was a rare option and set you back another $200. Since then, I've avoided the subscriptions, even after I started out as a freelancer. I was only focused on SQL Server, and didn't spend very much time in Visual Studio. Most of my clients have had various kinds of volume/enterprise licencing and they would discourage the connection of foreign laptops to their corporate networks. I only needed QA or SSMS and my favorite text editor (currently notepad++, previously it was Textpad) and I was set. Lastly, I would tell myself that I would rather spend the money on SQLPASS.

Times have changed. Smaller companies seem to have more things to do, and those things tend to be development and not administration. I haven't gone to SQLPASS in several years. Relying on give-away versions of Microsoft's products from Microsoft's dog-and-pony shows just isn't cutting it anymore.

Being the "Dar" in Ashdar, I'm fully empowered to spend a little money, I placed an order with NewEgg for a copy of VS Pro with a MSDN subscription on a Friday and then waited patiently through the weekend. The package arrived on Tuesday. Tuesday night was taken up with hurriedly running errands before the snowstorm hit.

On Wednesday, I ripped the package open and dutifully entered various information on the MSDN subscriptions web site. I've never actually had to activate an MSDN subscription before, and I was expecting instant gratification. Once the web site pronounced me as activated, I tried to login to the MSDN subscription management site and found that it had no idea who I was.

Hm.

So I waited for a while, and checked my email. Nothing.

While waiting, I put a couple of books up for sale on Amazon. I received prompt confirmation of this, direct from Amazon, but I still had nothing from Microsoft.

So, I waited some more. And then I started with the thinking...
Should I be getting an email?
Maybe I missed something on the web site.
Did I mistype my email address?
I must have done something wrong.
Ugh.

So, I found the email address for support and sent them an email. I received a very prompt reply, explaining that my request would answered in a few days. This really isn't the answer I want to get for something that cost twice as much as my Thinkpad.

OK, this is just the universe testing my patience. I tried logging into the subscription site again, using various numbers from my retail package and my activation confirmation code. No dice. At this point, it's been about three hours and still no email from Microsoft. That doesn't seem right at all. It's been three hours!

Expecting a long wait in a phone queue, which is pretty much my definition of hell, I broke down and called support. I must say that I got to a human pretty quickly and he explained the situation to me in short order.

It turns out that it takes 2 or 3 days for activations to be processed, after which I will receive an email. Details in the email will allow me to login as I expect.

It just seems odd that something like this would take very long at all.

I'm guessing that they are doing nightly batch processing of new activations. Can anyone enlighten me?