Font Size: A A A   Layout: Left | Right

58bits - Tech

Six bits short of sixty four...

# Friday, June 27, 2008
Friday, June 27, 2008 10:42:20 AM (SE Asia Standard Time, UTC+07:00) (Other Tech)

During my recent trip to Hong Kong - I popped into a mobile device shop and took a quick look at the HTC Touch Diamond. touchdiamond The phone looks pretty good - and I was impressed (and I'd really really like to see something that can just about compete with the Apple iPhone). However for me at least, there has been a missing feature in the Windows Mobile dialer from the early versions to the present.

I travel a lot - and in many of the places I travel, there are special calling codes you can use to get a discount on your outbound international calls. So for example - instead of using an international calling code like; 
+1 212 1111 1111 (notice the +1 for North America, 212 for New York) - you swap the + sign for the discount calling code. From here in Thailand - if I use 009 1 212 1111 1111 with the 009 prefix - I get a whopping 30% discount with no strings attached. I seem to remember similar schemes in the states using Sprint and AT&T calling codes as well.

Here's the problem. On every Nokia mobile phone I've ever owned, there has always been an option to 'Use Number'. Which means that when you've looked up the contact you want to call - instead of dialing - you choose 'use number' and it loads the number into the dialer, where you can then make ad-hoc changes to the number before you dial. As far as I can tell, and after experimenting with the Touch Diamond, this feature still doesn't exist in the Windows Mobile dialer. There is no way to load the number into the dialer, and then edit the number before you dial. It would be time consuming to edit the contact first - add the calling code prefix, save the contact and then dial - only to have to change the contact details again the next time I want to use a different discount calling code, or revert to the standard international dialing prefix. There may be more than one discount code I'd like to choose from as well - so this isn't a global setting - what I really need is a way to edit the number before I dial without having to change the contact details.

Windows Mobile if you're out there - I want to love you, I want to use you - but I just can't until this is fixed.


Comments [4] | | #  
# Wednesday, June 25, 2008
Wednesday, June 25, 2008 5:56:33 PM (SE Asia Standard Time, UTC+07:00) (Enterprise)

I learn something new nearly every time I write code - whether in a small project or large.

I recently updated my online gallery component at http://www.58bits.com/otherblog/photos/home.aspx. One of my TODO: items was a rewrite of a VCR style pager I've used previously. What I wanted was a style like the one shown in the screen shot...pager similar to that used on many sites. I also wanted user friendly(ish), hackable URLs, with each URL truly representing a resource; resources that may have more than one representation. For example, what you see visually as a user visiting the site - is a page with either thumbnails or a preview on it. However if you're an RSS reader, or a slide-show plug-in, you'll be given an RSS/XML representation of the same resource.

So what did I inadvertently create by moving to the new pager style? A  RESTFul pager. By asking for pages using the HTTP GET verb (as opposed to my old VCR pager that relied on forms and POST - ok a bad move I know) - I now have URLs that look like this...

http://www.58bits.com/otherblog/photos/5cgg96ab3e6g/thumbnails/2/2x3/view.aspx

And I now have a good separation from the server implementation, and the client's perception of a resource via a cool URL, and one that won't change.

As an aside, I can also now do something intelligent with caching, telling the client whether the resource has been updated or not via ETags, last modified dates and HTTP 304 response codes, saving a ton of bandwidth while at the same time ensure that changes propagate.

I'm a newbie to REST as an architectural style and am currently reading a lot on the topic - but what I've found from my initial exploration is that if you've been programming the Web for a little while, you've been close to REST by default. Embracing the style to include other verbs (other than the ubiquitous GET) is not such a big step, and I'm looking forward to experimenting further.

Here's a link to an author that's produced a great presentation on RESTFul Web Services


Comments [0] | | #  
# Monday, June 23, 2008
Monday, June 23, 2008 3:58:33 PM (SE Asia Standard Time, UTC+07:00) (General)

Hong Kong airport is now officially my favorite airport in the world. The Airport Express train in and out of town is a breeze. The food court in departures is large and comfortable.

And best of all free airport-wide WiFi that really works. Bangkok and London could to take a page from HK's book of good service. With an airport like this - going to the airport is fun - you can shop, get some work done, relax and then be on your way.

Just me and my ThinkPad T61p after a great weekend in Hong Kong.

IMG_2135


Comments [0] | | #  
# Thursday, June 19, 2008
Thursday, June 19, 2008 6:38:50 AM (SE Asia Standard Time, UTC+07:00) ()

UPDATE: Sun Tests Social Networking Toolkit

If I could design the future of social networking it would look like this...

I'd have a platform... some kind of service or software platform, from within which I could blog, twitter, chat and link to the people I know. I'd be able to choose exactly what information I wished to publish and when, and whether that information was published to just my friends, or to the world.

I'd be able to host the platform anywhere I choose. I could pay for it, or it might be free. If I paid for it - I'd want total control over where and how any advertising was allowed from within or outside the platform.

Imagine taking the best of LinkedIn, a decent blogging engine, something twitterish, a good chat client, a good media sharing platform for photos and videos. Add a pinch of social bookmarking - and wrapping all of that up into a very cool platform that I can use to represent me and those I choose to interact with in the online world. A sort of Bittorrent-ish, Groove-ish application for society. Goodbye MSN Messenger, Yahoo Messenger and Skype, goodbye to all of the walled garden social networking sites - and hello to my own little neighborhood in cyberspace.

The end of walled gardens like Facebook and other social networking sites is actively being discussed. What's missing is the glue in standards and software to bring together an alternative. The big guys like Google, Microsoft, and Yahoo want to try and grab on to this and hold on to it for its obvious potential in targeted marketing and advertising revenue.

I hope that doesn't happen. I hope we're each able to grab on to it, to control it and to use it to build new communities and socially meaningful ways of communicating with the world.


Comments [0] | | #  
# Saturday, June 14, 2008
Saturday, June 14, 2008 9:16:05 PM (SE Asia Standard Time, UTC+07:00) (C# | Utilities)

I know Jeff Atwood is a fan of this, and I'm surprised it's not made it on to Scott Hanselman's 2007 Ultimate Developer and Power Users Tool List for Windows tools list yet.

RegexBuddy is a brilliant tool and a great way to learn regular expressions. The documentation and introduction to regex is worth the price of admission alone.

regexbuddy
  (click to enlarge)

The expression tree view in the lower window practically talks to you as you build up and test your expressions. The expression to the right will match any incoming Url to myabsolutepath/subdir that begins and ends with either:

myabsolutepath/subdir
myabsolutepath/subdir/

or

myabsolutepath/subdir/*.aspx
myabsolutepath/subdir/*.ashx

I love this application.


Comments [0] | | #  
Saturday, June 14, 2008 8:58:47 PM (SE Asia Standard Time, UTC+07:00) (Other Tech)

I like Windows Vista - it's a cool and stable OS. But it's taken me a while to get it to boot fast, and stop thrashing my disks to death. Windows Search, automatically scheduled items like Disk Defragmenter and Windows Defender and the biggest culprit - Superfetch, all put a heavy load on boot time and run time disk activity.

I tend to keep things pretty well organised and never really needed a desktop search engine and so I disabled Windows Search (the search feature on the start menu will still find program menu items - which is incredibly useful). I don't mind waiting a second or two for an app to load either and usually leave my frequently used apps running anyway - and so don't really want SuperFetch creating the 300,000 plus I/O events it records at system startup (watch it using Process Monitor from SysInternals). I also keep all my data on a separate volume from the OS - and so will manual defrag the OS disk once every couple of months. And I use the Complete PC Back up feature of Vista Busines/Ultimate to image the OS volume - giving me my own restore points - so I turn off restore points as well (Acronis True Image would be another good choice).

Here's a great article that just about covers it all on how to tune-down your Vista setup so that boot times and disk activity return to normal - Beginners Guides: Stopping Vista From Thrashing Hard Disks to Death.

Lone blogger 1 - Windows Vista 0


Comments [0] | | #  
Saturday, June 14, 2008 8:09:49 PM (SE Asia Standard Time, UTC+07:00) (ASP.Net | CSS/XHTML)

I have a lot of respect for experienced CSS/XHTML designers having lived through two medium size projects that both had accessibility and XHTML Strict requirements - it was tough going. We survived the Peekaboo Bug, the Guillotine Bug, and the Duplicate Characters Bug to name a few.

I recently updated the design of my blog and my photo gallery component. Trying to keep the site IE6 compatible brought back painful memories. Thanks to this kind blogger at 456 Berea St - I managed to squash the last CSS bug in the layout - a problem I was having with space appearing between <li> items in a list that contains block level elements. I was kind of surprised to see this in IE7. The block element in this case was an <a> tag - and needed to have a width or height set in order to close up the gap between the containing <li>s; a very common layout for creating hover effects on menu items in <ul> lists. Sigh.

Lone blogger 1 - IE6/IE7 0


Comments [0] | | #  
# Sunday, June 08, 2008
Sunday, June 08, 2008 12:35:26 AM (SE Asia Standard Time, UTC+07:00) (C#)

I needed an undo stack today - but wanted it to behave like a queue when it was full, dropping the oldest items in the collection to make room for new ones. Found two posts - Undo Functionality with a Limited Stack, and also a reference to an identically named collection called LimitedStack here. 

Was initially thinking of simply writing a wrapper over an array of objects, shifting items along as new ones were added, but using a linked list is a clever solution, as it provides the queue like behavior needed without out any extra code via RemoveFirst() and RemoveLast().

using System;
using System.Collections.Generic;

namespace DotBits.Gallery.Builder.Objects
{
    [Serializable()]
    public class UndoStack<T> : LinkedList<T>
    {
        private int _maxItems;

        public int MaxItems
        {
            get 
            {
               return _maxItems; 
            }
            set
            {
                while (this.Count > value)
                {
                    this.RemoveFirst();
                }
                
                _maxItems = value;
            }
        }

        public UndoStack(int max)
        {
            _maxItems = max;
        }

        public T Peek()
        {
            return this.Last.Value;
        }

        public T Pop()
        {
            LinkedListNode<T> node = this.Last;
            this.RemoveLast();
            return node.Value;
        }

        public void Push(T value)
        {
            LinkedListNode<T> node = new LinkedListNode<T>(value);
            this.AddLast(node);

            if (this.Count > _maxItems)
            {
                this.RemoveFirst();
            }
        }
    }
}


Comments [0] | | #