HTC Magic - WiFi connection hanging - solved

HTC MAGIC , smart phones 2 Comments »

Since the cupcake 1.5 android update on my phone I started getting problems connecting to my wireless network.

It would see the network and connect quite happily and the first 1 or 2 requests (say a web page or a update from a application) would work fine as well.ᅠ After that the next request would hang and eventually timeout.

If you disconnected and reconnected you could start the same cycle again.ᅠ

Searching forums and the like I found I was not alone, but no real solutions offered.

I have solved it thanks to an app in the android market place called wifi fixer by Zanshin-g1

Once this little app is running the problem has dissappeared.ᅠ I have not found out yet how it works but it does and I'm happy again :-)

If I get a chance I will try and post on some of the forums I found that ended in no solution.

Many thanks to the developer of this app.

Here is the QRCode for the app website or will take you to the android market on your phone!

HTC Magic locked out by too many pattern attempts, how to factory reset

HTC MAGIC , smart phones 60 Comments »

While we were on holiday my son accidentally locked my HTC Magic phone (aka G2) by getting the unlocking pattern on the touch screen wrong too many times.

It then asks for your google account credentials. No problem I thought, but it would not accept them. I thought maybe it just because I was roaming and did not have full data facilities, however even once home it simply would not accept my google account details even though I could now double check them on another machine.

Took me a while to find the factory reset option so thought I would blog it here.

  1. Turn phone off
  2. Hold home key and press power on key - after a short wait (quicker than normal startup) you will see a screen with a Warning triangle and a phone picture
  3. Press Home key and Power on key together- you will see three options
    • reboot
    • apply sdcard:update.zip
    • factory reset
  4. Select with track ball and click as required

Hope that helps someone.

coldfusion admin mappings and expandpath

3 Comments »

A very simple thing but we only just introduced this in our systems. To help with portability between servers which could be configured with different drive letters or possibly different directory structures, we have removed all the direct references to file paths and now refer to a CF mapping within the expandPath() function.

So while developing on our local machines we may have c:\output\stuff, on staging this becomes e:\systema\output\stuff.

So now these are cfadmin mappings to /output and we can set a variable as

<cfset outPath = expandPath("/output")/>

No change from dev to production and if we migrate to a server where the drive letter changes it can just be changed at the mapping level in one place.

You are probably already doing this but made me happy :-)

htc magic -G2 - the new Google phone

smart phones 10 Comments »

I have now had the new G2 google phone or HTC Magic for about 6 weeks so here are a few observations for anyone interested.

I chose this phone for two reasons - i didn't want to follow the herd and get an iphone. Not that the iphone is not a great phone, but I did not want to be tied in to Apple and itunes.ᅠ I like Google, I have had a gmail account since gmail was first available and also use docs and calendar, so something that integrates tightly with these is good from my point of view.

Second reason was that I had seen the G1 phone of a colleague and when compared to a iphone 3G - it was noticably faster browsing the web. The G1 was however a bit ugly (sorry PB!).ᅠ If you want a physical keyboard then the G1 is great but it is fairly fat because of that.

The G2 is better looking and a nice size - not as wide as an iphone but still with a good size screen measuring 45mm * 67mm. It has a slight raised profile top and bottom which while spoiling the looks a bit means that the screen does not get scratched so easily if it gets put down face first.

There are 6 buttons and a track ball at the base of the screen and a volume control on the side - everything else is on screen - in fact most things can be done without the physical keys if you prefer e.g. scrolling and clicking works with the track ball, but also with 'swipes' of your finger up or down or by touching links to click.

The track ball is translucent and glows white when texts arrive or when a call is incomming - rather cute!

The virtual screen is actually three times as big as the physical screen, so you start on the middle section and have space left and right (accessed by a finger swipe) for storing more icons or widgets.

Widgets are 'active icons'. The widgets I have currently are the google search panel giving direct access to google searchs, the clock, a calendar widget showing your next few appointments and a weather widget showing todays forcast.

All is cutomisable and the UI is very slick and responsive. I really like the notification bar at the top of the screen that lets you know if you have texts, new emails, reminders, updates to applications etc. When I see a notification I swipe down from the top bar and 'pull' down the notifaction screen - this gives me one click access to whatever it is , email, text etc.

At the base of the screen is a tab that can be 'pulled up' to show all the applications you have built in and added.

Almost every application can be viewed landscape by holding the phone that way round and the trackball adjusts so that what was right is now up etc.

Camera is good but not exceptional by todays demanding standards - 3.2mp and no zoom. Nice gallery to view pictures and easy share options via SMS, email or uploading to picasa or via other applications to facebook, twitter etc. You can also take video and upload direct to youtube if you are so inclined.

The G2 already has the fast HSDPA access that the lastest iphone 3Gs has just caught up with (snigger) and also has the 'amazing new feature' ..... 'cut and paste' (more sniggering) that the new iphone boasts.

Instead of iphones 'app store' there is the 'android market'.ᅠ Anything I have thought 'I wonder if there is app for that' - there has been and so far all have been free.ᅠ They download fast, install automatically and mainly work well.

The G2 already has a built in compase and GPS satalite navigation using google maps or other 3rd party apps.

Wireless connection is very good connecting easily to hotspots. There are some good apps that help to find and connect to free hotspots for you.

So any downsides? If GPS is running as well as other stuff the battery life is much reduced so I tend to only turn this on when really needed. Bluetooth is limited to connecting to headsets no file transfer which is very annoying, but hopefully will come in later upgrades.

I have already had a couple of software upgrades which get pushed out and fix bugs and improve things.

My 14 year old son prefers the iphone for its Mac integration its even slicker UI and he says it is more cool and delivers more 'street cred'.ᅠ I would rather not follow the crowd.

Why developers don't need Object Oriented Programming

ColdFusion , Rants 11 Comments »

I'll admit straight away that my background is in procedural code, way back before Object Oriented Programming (OOP) had not been dreamt up, or maybe just no one bothered to tell us humble COBOL programmers!

I started coding with ColdFusion on version 4.5 and the code I wrote was very much like this Form posts to action page that relocates somewhere that displays some links that show more Forms etc.

No framework no structure, spaghetti of the worst sort.

So I looked round and decided to adopt fusebox as a framework and this improved my code a great deal separating out data access, business logic , and display code.

Later versions of fusebox made this even better by forcing the use of XML in the flow of control from request to request, stopping the leak of business logic into the flow control.

Now like every good developer I'm lazy, so if I find myself coding something twice I start to wonder how I can make that code common and call it. The answer of course is to get data access and business logic which is liable to be called from multiple places into cfcs.

I learnt to make my functions as cohesive as possible (focused on as tight a purpose as possible) because that helps to make the API's clean and simple.

I found that making functions only dependant on their arguments, with no other dependencies on variables in shared scopes, made changing code much easier and more predictable. Not like the days of relying on variables passed up from nested custom tags!

So I started to believe that maybe I'm doing OOP already?

Well... NO because I'm still think procedurally.

If someone says to me we need a program that makes a cup of tea, my first thought is not

I'll call the kettle factory and the tea pot factory, inject the tea pot and the kettle into the cup of tea object and then call the makeTea service method which will know how to make a cup of tea by magic.

I expect that's how you guys make your tea, but us 'ol folk work through a process :-)

Kettle must be available

Teapot must available

Ingredients must be available from the 'Tescos' datasource.

Need to 'display' my tea to the user in a 'cup view'.

(work with me here ok?)

So since my system regularly needs to make tea I have Kettle and TeaPot cfc's instantiated in application scope with any init() method already run. But NO injection of other objects.

(gasps of horror already)

So earlier I said I didn't make my functions dependent on any shared scopes; well I lied because they do call other cfc functions by directly referencing functions something like this application.teaPot.openLid().

(more gasps of horror)

I don't have a service layer, data access layer and domain layer as such, but I do have functions grouped logically together in cfcs and by following the principles of cohesion and loose coupling the functions inside those cfcs start to adhere to that pattern automatically as you think through and re-factor code.

There is NO inheritance. So if I see a call to application.kettle.switchOff() I can open the kettle.cfc and find a function called switchOff and see what it does. I don't have to chase up some inheritance tree to find the actual function.

I have NO beans. CF gives us queries as a great way to pass around record sets. Sometimes a structure or an array might be more suitable, but either way CFQUERY and a bit more CF is all you need. If I need to maintain the code that saves an address record to add a new column because of a database change I want to see only a handful of SQL queries and the CF code that works with those record sets. I don't want to see multiple layers of code encapsulating the address record as a bean with bean factories and getter and setter for each column, too many additional lines of code to look at to understand, to go wrong or get wrong.

What about Aspect Oriented Programming (AOP) I here you cry. How do I handle cross-cutting concerns such as logging and security?

You know what? I would rather have the ugly but easily understood

application.utils.log(stuffToLog=stuff)

wherever I need it than the very clever but much more hidden and tricky to understand XML of ColdSpring.

Security can be nicely handled as a plug-in at the application.cfc or fusebox level.

I think much cleverer people than me have taken some very good concepts and developed them to their logical conclusions, but in so doing have lost sight of the wonderful speed and agility that makes CF such a great language in the first place.

Keep the principles foremost but also the KISS principle 'Keep it short and simple' or 'Keep it simple stupid!' And if it makes sense to break a rule once the pros and cons have been considered, then break it!

If this has enraged you mightily please let me know where I have gone wrong :-)

Powered by Mango Blog. Design and Icons by N.Design Studio
RSS Feeds