Archive for the ‘Microsoft’ Category

h1

Putting the Galaxy to rights #6 – Today Screen Android-style

December 20, 2010

Vista busy cursor Windows Mobile is on its way out and few will mourn it, but to be fair it was not all bad. It was designed as a business tool and pretty well thought out from that perspective. One handy feature is the “Today Screen”. This is the WM “home page” which can be configured to display your next few appointments, recent call log, recent SMS messages, etc to get you oriented quickly.  WM phones do not have an automatic lock screen (although you can manually put them in lock mode), so your appointments are right there when you hit the “on” key to wake the phone from stand-by mode.

Android (and for that matter the iPhone) work differently. You always get a lock screen when you wake your phone up from stand-by, have to do a touch-swipe to get past that, then to access your appointments you need to open your calendar app. I wasn’t so worried about texts and the call log, because those are well enough handled by notifications, but on moving to Android I missed not having my upcoming appointments automatically on view.

Calendar widgets do help. I use the Gemini II Calendar which keeps my next three appointments on display via a widget on home screen #1. But it is still hidden by the confounded lock screen so they are not immediately “glanceable” (to use the Windows Phone 7 jargon).

I looked at apps that could put useful information such as appointments directly on the lock screen itself, for example Executive Assistant from Appventive. This does actually work but seemed to affect the overall performance of my phone to the point I ended up uninstalling it. There is a similar app called Flyscreen but I didn’t even bother to try it, having been put off the idea.

But Executive Assistant did get me thinking. I noticed it had the ability to override the use of a swipe action to dismiss the lock screen. For example, you could set it so that hitting the back key would do the same job. I looked for other apps that could override the standard lock screen functionality and found No Lock. The No Lock app lets you put a widget on your home screen that enables one touch disabling or re-enabling of the lock screen.  It makes locking an easy manual operation, much like with WM.

With the lock screen disabled, on hitting the home key from stand-by you go straight to whichever home screen you last had opened. Two presses of the home key are guaranteed to get you to screen #1, where appointments are displayed. In effect, I have recreated the features I liked in the WM Today Screen. That is, from stand-by usually one key press (occasionally two) gets me to a screen where my appointments are on display. And as a by-product, I get the option to activate a lock screen manually with one touch.

In practice, I rarely need to lock my screen. The idea of the lock screen is to stop my phone being activated by accident in my pocket, but the home button is recessed and the other physical buttons too well protected by the Krusell cover for this to be an issue.

Advertisements
h1

Dot Comma Boom

November 26, 2010

Vista busy cursor In continental Europe they don’t use a decimal point, they have a decimal comma instead. And conversely (if not perversely), they use full stops, not commas, to split large numbers into groups of three digits. So in a set of accounts instead of say 10,287,671.45 you would see 10.287.671,45.

I recently had occasion to use figures from a European report in a Word document for UK consumption so wanted the commas and dots switched round. Maybe Word has an automatic facility for doing this. If so I haven’t found it but reckoned it would be easy enough to write a quick VBA macro.

As ever, I try to save time by using the built in macro recorder. First problem is that in Word once the macro recorder is running you cannot select any text on the document. Now that is a bit of a problem because you want to be able to select just the table or column of numbers which need commas/dots switching, otherwise all the full stops in the main part of the text end up as commas which would not be good.

I gave up on the macro recorder and found some VBA code snippets on the web which I thought I could adapt to do the job. And indeed it is easy enough to find something like this:

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
     .Text = "."
     .Replacement.Text = ","
     .Forward = True
     .Wrap = wdFindStop
     .Format = False
     .MatchCase = False
     .MatchWholeWord = False
     .MatchWildcards = False
     .MatchSoundsLike = False
     .MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

Put this in a VBA subroutine and it will replace all full stops in the selected text with commas. But of course, you want to swap commas and dots which actually takes three steps. You need to replace full stops with commas but you can’t do that immediately because if you did then you could not distinguish them from the commas which were already in the text which need to be converted to full stops! Instead, you replace the full stops with a “third” character (I used a question mark) so that you can then replace all commas with full stops without confusion. Finally, you convert the question marks to commas and the job is done.

The code looks like this:

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
     .Text = "."
     .Replacement.Text = "?"
     .Forward = True
     .Wrap = wdFindStop
     .Format = False
     .MatchCase = False
     .MatchWholeWord = False
     .MatchWildcards = False
     .MatchSoundsLike = False
     .MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
     .Text = ","
     .Replacement.Text = "."
     .Forward = True
     .Wrap = wdFindStop
     .Format = False
     .MatchCase = False
     .MatchWholeWord = False
     .MatchWildcards = False
     .MatchSoundsLike = False
     .MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
     .Text = "?"
     .Replacement.Text = ","
     .Forward = True
     .Wrap = wdFindStop
     .Format = False
     .MatchCase = False
     .MatchWholeWord = False
     .MatchWildcards = False
     .MatchSoundsLike = False
     .MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

But there’s still a problem. Very annoyingly, after the first block of code (dot to question mark) is completed the text selection is lost. You can see this if you put a breakpoint in the code and look at the Word document. What then happens is that the second block of code does not stop at the end of the original selection and proceeds to convert commas to dots throughout the rest of the document.

It took me a while to figure that one out. I reckoned that if I could find a way to remember the original selection in a variable, I could keep reselecting the same block of text before the next replacement operation thereby getting round the problem. How exactly to do that was the hard bit but I eventually discovered how to do it with a variable of type “range”. I had been trying a variable of type “Selection” which seemed more obvious but actually led nowhere.

This is the final complete code for the comma dot exchange subroutine.

Sub DotCommaBoom()

Dim myRng As Range

Set myRng = Selection.Range.Duplicate

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
     .Text = "."
     .Replacement.Text = "?"
     .Forward = True
     .Wrap = wdFindStop
     .Format = False
     .MatchCase = False
     .MatchWholeWord = False
     .MatchWildcards = False
     .MatchSoundsLike = False
     .MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

myRng.Select

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
     .Text = ","
     .Replacement.Text = "."
     .Forward = True
     .Wrap = wdFindStop
     .Format = False
     .MatchCase = False
     .MatchWholeWord = False
     .MatchWildcards = False
     .MatchSoundsLike = False
     .MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

myRng.Select

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
     .Text = "?"
     .Replacement.Text = ","
     .Forward = True
     .Wrap = wdFindStop
     .Format = False
     .MatchCase = False
     .MatchWholeWord = False
     .MatchWildcards = False
     .MatchSoundsLike = False
     .MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

End Sub
h1

This iPhoneless Life #11 – iTunes’ Secret Agent

August 27, 2010

iPod To describe my life as iPhoneless is a slight exaggeration. There is definitely an iPhone in my life, my wife’s iPhone 4, and it robs me of sleep.

My wife is addicted to Angry Birds.  It has not quite taken over completely from reading in bed at night (I can thank the late Stieg Larsson for that) but there seems to be an unwritten rule that we have to get through at least 2 or 3 levels of the aforementioned smash hit game before calling it a night.  I am often called in to help out clearing a level if my wife is stuck on it and wants a break to read another chapter of The Girl with the Dragon Tattoo. I am expected to keep going until every last grunting green pig has been blown to bits.


So I know all about the iPhone 4, it’s beautiful “retina” screen and gorgeous build quality. But for my own use I still have my old, battered Windows Mobile phone – an HTC Tytn II (in O2 “Stellar” livery).  It has done a job for me but now enough is enough and I want a modern phone.

Largely out of sheer bedevilment, I am determined not to become an iPhone user like everyone else in my family. And I’m wary of being a Windows Phone early adopter, much as I believe that platform holds out great promise. How could I forget what it was like to be an early adopter of Vista, when the pain of it is still faithfully documented in this blog? So I will go Android, at least for the foreseeable future, and currently favour the Samsung Galaxy S.

It was while I was checking out what the podcast client options look like in the Android world that I came across a free open source application called iTunes Agent. The idea is very simple. It makes your random non-Apple music device look, to iTunes, like an iPod. That means you can use iTunes directly and seamlessly to synchronise music and podcasts with any mp3 player or phone.  iTunes Agent has been around for quite a while and I can’t think how I missed it, particularly when I was casting around for a podcast solution for my HTC WM6 phone. As explained in an earlier post, I have a more than workable solution using iTunes for podcast capture and WMP for synchronisation, but iTunes Agent looked like a neater fix and I thought I should try it out.

I had no trouble installing and running iTunes Agent on my Windows 7 PC, and it hooked up immediately with iTunes. The difficulty I had was getting iTunes Agent to link up to my phone when the latter was connected to the PC via USB.

The way it is supposed to work is that you specify the folder on your music device where you want your synchronised music to live, in my case a folder on the HTC phone’s micro SD storage card. When you connect your phone, iTunes Agent is supposed to detect that this folder  is available on the Windows file system and therefore knows your phone is ready for synchronisation.  The limitation is that iTunes Agent requires your phone or music player to have been allocated a drive letter by Windows, but Windows was just listing my phone under “Portable Devices”. I could easily navigate through the phone’s folders and files using Windows Explorer but no way could I persuade Windows to allocate a drive letter.  And without a drive letter, iTunes Agent refused to accept any folder on the storage card as synchronisation target.

This stumped me for a while until, by dint of frantic Googling, I discovered the difference between the MTP and UMS protocols for connecting storage devices over USB. My phone naturally connects to my PC using MTP (Media Transfer Protocol) – a technology which is reckoned to offer the widest device compatibility with media players – as opposed to UMS (USB Mass Storage) which is targeted more at USB keys and SD card readers. Unfortunately Windows only allocates a drive letter with UMS devices, not with MTP.

More Googling and I found out about two applications that can be installed on a WM phone to make it emulate a UMS device and thus qualify for a drive letter, W5torage and Softick Card Export.  The former was written by a lone developer and is free whereas Card Export is a commercial product. Both were created so that you can in effect use your WM phone as a card reader.

I tried W5torage first.  It installed fine on my phone and appeared to be running, but in UMS mode my PC was not able to detect my phone at all. A quick uninstall and I tried Card Export, which is free to trial for 21 days. I took an instant dislike to the latter because it automatically added an annoying status display to my Today screen and an icon in the notification tray. It did however work. My phone now appeared as the G: drive and at last I was able to configure my phone in iTunes Agent. My HTC now showed up as a device in iTunes.

This did not though constitute a happy ending. Before going much further I was determined to rid my phone’s Today screen of the unwanted Card Export status display.  I went into the phone settings and unticked the Card Export option from the list of Today items. This resulted in my phone locking up. A reboot later and the Today Screen was free of Card Export status, but now my program icons were missing. There was clearly some clash between Card Export and the application manager software from O2 which came with my phone. Now the O2 software is lot more important to me than use of iTunes Agent – my researches in that direction were more curiosity than need – so it was Card Export that was going to have to go.

It took about 10 reboots before the phone was working normally again, with no trace of Card Export, the Today screen displaying all the right items and no lock-ups when I tried to access the Today settings.  There was a moment when I thought I was going to have to ditch the phone as a write-off, or at least restore factory settings.

That is, unfortunately, one of the most problematical issues with Windows Mobile. Lots of apps but easy access by developers to the deep innards of the operating system, which can readily become unstable as a result. I don’t know why iTunes Agent had remained a secret to me for so long but I could have done with it remaining a secret.

h1

Hasta la vista, ActiveSync

March 15, 2010

Vista busy cursor Or as I prefer to call it, ActiveStynk.  Childish, maybe, but it is far and away the most putrid lump of software ever to come out of Redmond.  I makes even Vista SP0 looks like something Steve Gibson might have lovingly hand-crafted.

At least Microsoft have finally decided to consign ActiveSync to the annals of history, as announced today at the MIX’10 Conference in Vegas.

Good riddance.  May it rot in hell.

AddThis Social Bookmark Button

h1

The Black Screen of Death

December 1, 2009

Vista busy cursor According to the BBC (and doubtless others) Microsoft are investigating a new phenomenon affecting Windows 7 which is being dubbed the “black screen of death”.

Oh ho, methinks! Did I not myself verily encounter a most unwelcome phenomenon with Windows about a month ago which I also chose to describe in those exact terms? Except that it was Vista that was getting stuck at a steadfastly black screen, not Windows 7. I now believe that problem arose because I had a dual-boot arrangement (Vista plus Windows 7) which had not been set up correctly, so that the two OSs did not recognise each other’s presence and therefore felt at liberty to interfere with each other’s file and disk security settings. This had robbed both OSs of permissions to load key system files with the result that Vista’s boot up sequence came to a premature halt with a black screen of death while Windows 7 succumbed to an infinite reboot loop. These problems disappeared completely after I reinstalled Windows 7 from scratch and used NeoSmart Technologies’ EasyBCD to set up the boot options menus correctly for both OSs.

I have no idea whether the black screen of death now being reported has anything at all to do with the problem I had with Vista, but I would not be at all surprised to learn it was connected with some automatic system meddling with file and disk permissions, either in relation to a dual boot setup or otherwise.

AddThis Social Bookmark Button

h1

Dual-boot remote access – it can be done!

November 20, 2009

Vista busy cursor Just imagine that you have a dual-boot system, say at home, and want to access it remotely over the Internet and also want to be able to switch between the two operating systems.

The remote access part is now quite easy, thanks to Microsoft Live Mesh which has similar functionality to commercial product such as Citrix’s GoToMyPC but is helpfully free.  It also works on the Mac.  Live Mesh is still in beta but is rock solid.  From my office I can access my PC at home over the Internet.  It breezes past the enterprise firewall and proxy server setup as if they weren’t there.

But switching between the two operating systems on the home PC, while accessing it remotely, seems rather harder.  After all, while you can easily force a system reboot remotely, by the time the system is going through its boot-up processes your remote connection will have been lost, so you will have no access to the boot menu to choose which operating system you want to launch. Live Mesh will not restart until after the OS has booted up, so you will always get the default operating system back again.

For Windows users, the solution is a very simple utility called iReboot from NeoSmart Technologies.  It was designed with dual-boot systems in mind, to cut out the effort involved when switching between systems.  Once running, it lives in the notification area of the Windows taskbar.  Using that icon you can force a reboot into the OS of your choice, rather than having to make the OS choice from a boot menu at restart time.  That means you can choose the OS to boot up in when accessing the PC remotely.  I don’t think NeoSmart created iReboot specifically to help remote users of dual-boot systems, but it certainly can be used for that purpose, in combination with Live Mesh, GoToMyPC or similar.

Of course, Live Mesh will still lose contact with the PC while it goes through its reboot process, but you can connect again once the chosen OS has booted up, provided you had installed Live Mesh (with saved password) on both operating systems.  Provided both systems are Windows based, and you have iReboot installed on both, you can switch back and forth to your heart’s delight however many thousands of miles away you are.

The one complication is with Mac/Windows dual-boot systems, because iReboot is Windows only and there is no equivalent of iReboot on the Mac.  Having said that, if you make Windows your default OS and force a straight reboot from the Mac side of the system it will still boot back into Windows, and from the Windows side you can use iReboot to get to the Mac.

AddThis Social Bookmark Button

h1

Hasta la vista, Windows 7

October 30, 2009

Vista busy cursor For the second time in a matter of weeks I found myself unable to boot into Vista on my home desktop due to a file permissions problem. The tell-tale signs are becoming familiar. Boot-up starts as normal with the screen that has the pulsating green progress bar.

When that disappears we get a black screen and after a few seconds the mouse cursor appears in the centre. The disk continues to thrash for a few more seconds then settles, but we remain stuck looking at the mouse cursor on a black field. The black screen of death.

I believe the problem is that Windows has reached the point where it wants to write to the disk but is unable to because the file it is trying to access has been made read-only or otherwise had its permissions stripped away. You’d think that a booting OS would always have access rights but apparently not.

I wasted hours with Spinrite, thinking it must be due to a damaged sector. The only way out of this, short of a reinstall of the OS, is to boot up in a different OS, maybe on a different disk or from a CD, and then manually change the permissions on the files in the drive that won’t boot.

Ironically, it is the use of different OS’s on different disks on the PC that seems to be implicated in giving rise to the problem in the first place. Particularly if one of the OS’s is Windows 7, or at least the Release Candidate.

I have had two disks on my desktop for years. The larger one (250GB) is the Vista drive that came with the PC. I later added a 40GB drive salvaged from an older computer and for a long time had XP on it. I found I could switch between the two without problem. The BIOS allows you to choose which disk to boot from.

More recently, I used the 40GB disk to try out Windows 7 64-bit – first the Beta then the RC. All went well until my first “black screen of death” crisis. That sorry tale is recounted here. I blamed myself because I had meddled with the permissions on the Vista disk, but that was only to add permissions which seemed to have been “taken away” somehow without my intervention, making files inaccessible over the local network. I am starting to wonder whether Windows 7 was responsible in some way for messing with permissions on the Vista drive.

To my mind, an OS should not be making automatic file permission changes on other drives on the system. I’m not sure why but I suspect Windows 7 does this. The first black screen crisis was resolved when I booted in Windows 7 and could see that the Vista disk had been stripped of permissions. I added them back manually from within Windows 7 and was then able to boot back into Vista.

A second black screen crisis happened a couple of days ago. I had (as on the previous occasion) booted in Windows 7 to play around with a few 64-bit apps. I tried to uninstall an older 64-bit app but Windows 7 refused, claiming it could not locate the original MSI file. I then tried to return to Vista only to find I was back to my black screen of death. Worse, I could not get back into Windows 7 either. That would start to boot then spontaneously restart, causing a never ending loop.

I was forced to do a clean install of XP on the 40GB drive. I had no important data on that drive so it wasn’t an issue.  I could then see all the files on the Vista drive, so as a precaution copied around 200GB of data to my 1TB external drive. I did notice all the files came across with the read-only flag set, which seemed odd. As Vista continued to prove unbootable, even in safe mode, despite hours of Spinrite and other attempted solutions, I decided I would use XP as my main working system for the time being so I started installing apps and device drivers. I also wanted my data available on the network so turned on file sharing. I noticed that when I shared the Vista drive it took a very long time and gave me a message about writing permissions. That got me wondering. I tried booting in Vista and of course it came right up as if nothing had happened.

As I was coming to realise, it was a variant on the permissions problem which had stopped Vista from booting, and the act of sharing the drive had restored the required permissions.  It is though very worrying to think that Windows can so easily get itself locked into an unbootable state like this, with no easy way for the user to diagnose and no solution that does not involve fixing the unbootable disk via a second OS on another drive.

I am hugely relieved to be up and running again, but extremely suspicious of Windows 7 and whether it has tendencies to make unwelcome interventions in other drives on the system, potentially jamming up other OS’s which may be installed on them. Well, for now at least Windows 7 has gone. Hasta la vista.

AddThis Social Bookmark Button

%d bloggers like this: