Okay, so it’s almost 3AM in the morning and you’re about to launch a brand new shiny site.

You’ve tested in on Safari, Mozilla Firefox, Google Chrome, and the scourge of all-browsers: Microsoft Internet Explorer 6, Microsoft Internet Explorer 7 and Microsoft Internet Explorer 8. If you’re wondering why I’ve listed IE 3-times, it’s because each version comes with its own fixes for stuff – yet it breaks other stuff among those fixes. Effectively, you have to test it on EACH version to make sure it stays consistent on Internet Explorer – much unlike it’s counterparts.

You’re snuggling on your bed, and then you decide to give your site a spin on your Apple iPhone – and that works fine, because the WebKit-based engine is very much like Safari’s. And then you take out your old Android phone, but hey, Android’s supposed to be much “better supported” than those i-devices, right?

WRONG.

First look: Transparent-background PNG’s are broken, initial page-viewing panel is messed up and jQuery scripts aren’t loading upon page load.

Problem #1:
Weird Backgrounds with Transparent 24-bit .PNG’s

Yep, there's the black background - weird, as we didn't specify anything!

Hey, doesn’t transparent PNG’s break only in Internet Explorer 6? (yes, that antique, crappy, browser) Apparently not. Seems like it breaks in Android’s Browser too. But a quick Google search reveals that Android has full Transparent PNG support, so how is that possible?

Well, looks like Android’s Browser doesn’t like 24-bit .PNG’s used as overlays – well, 24-bit’s the one with the super sexy colour range, and can do shadows and all kinds of funky effects. In short, it’s not a topic for tonight’s post. 8-bit’s the one that has a limited colour palette – like you know, .GIF files back in the good ol’ days.

Solution #1:
Use 8-bit .PNG’s, with clever “transparency” – especially if you have different coloured backgrounds

Yes, 24-bit is a little cranky in *some* Android phones after a little bit of research. 8-bit works flawlessly though.

Well, in my case, some of the objects I needed to be transparent were spanning multiple background colours, and were overlaying text. How do we solve such a scenario then?


Yep, we “fake” some parts of the transparency by filling the background in – and leave the “real” transparency to only the parts who needed it to be a functional design. Notice that since I only needed the bottom left to be “partially” transparent, I left the rest of the image “background-ed”.

Okay, quick and dirty fix done. Let’s move on.

Problem #2:
Default View when Page Loaded isn’t “Nice”

Ideally, when we design pages, we expect it to look just right the very moment the user steps in to the page. We don’t want to have a user zoom in/out, resize, or change some settings – because the first impression really counts.

So, what happens when the placeholder-view of the page (is that what it’s called?) looks all messed up, like this?:

In case you haven’t noticed it by now (oh yes, please ignore that ugly overlay for “Media Volume” – my hand accidentally pressed the volume bottom when I was doing the screenshot) – the “ribbon” on the left is partially chopped off, and the whole page is actually SO “closely cropped” towards the frame of the browser, and some text (below) are almost cut away:

Notice the words start at the very first few pixels of the browser frames, and it’s really ugly when viewed inside a real phone – because a user has to take the extra step of resizing it to get to the desired viewing point.

Why this occurs is because Android’s browser automatically finds the “largest” or rather, widest, block object (such as DIV’s, etc) and sizes the maximum viewing area according to that, so things actually might get cut away if positioned using relative or absolute positions.

A very quick fix for this is to actually add some padding OUTSIDE of the viewing area, say, maybe 40px per side or so? (I just added padding-left and padding-right to both sides), and well, see the significant difference:

Ta-dah, magically fixed. Now we can see the whole “ribbon” on the left! Okay, now for the more significant part, the rest of the stuff in the body:


Notice how the whole page looks much more presentable upon first-entry to the site now!

..and we’re done! Two quick fixes for the night. I’ll touch on jQuery another day – because it’s too heavy for an uber early-morning post!

{ 0 comments }

Ever wondered how to use the same domain name for both a normal website, say – hosted on some cheap hosting account with loads of features and scripts, but yet have it work as an Active Directory Controller too?

Well, I did – and I’m sure at one point or another of your time messing with Windows 2003/2008 servers and stuff you probably thought something like: “Hey, what’s the difference between those $9.99/year domain names and my Active Directory domain? Can they work together?

Eeks. I feel corny geeky writing this post already. Never in my life have I ever written a largely technical post publicly on a Google-able page exclusively meant for me (at least for the past 2 years, I think…). Yes, but I contribute alot to forums and stuff, so… I do contribute!

Okay, okay, long story short – yes, it’s perfectly possible!

But as hardcore sysadmins, we always come across the question of “Why” it will work, and whether it will break anything if we do some quickfix which someone like Kelvin here suggested, and also who to blame if it doesn’t work, and whether Kelvin is liable should we breach some Service-Level Agreement (SLA) with our clients, blah blah.

This being my first technical post, my disclaimer is plain and simple:

Screw you. Do this at your own risk. Hah!

Here, let me introduce what we’re going to solve today. Given this scenario:

Say, I bought this domain, “kelvin.sg”, and I want to use it for my website/blog/place-of-rant hosted with my company (via cPanel), Zension – yet I wish to run my own Active Directory domain called “kelvin.sg” just so all the computers in my (personal) network can be named and access pretty “cool-ly” like, super-cool-server.kelvin.sg, or maybe mediaserver.kelvin.sg.

Traditional (deemed improper by Kelvin) Way of Solving this Problem:

Just call your new domain kelvin.local and get over it. kelvin.sg doesn’t really sound nice anyway.

Nah, Kelvin would never do it this way. Hahaha! Let’s move on…

Let’s throw a few more constraints/assumptions into the mix:

  • You don’t want to touch the nameservers from the domain registry side (i.e, you STILL want to use your cPanel account)
  • You want to be able to join the domain from anywhere, even if you are sitting on top of the Esplanade
  • You *have* access to the DNS zone for your domain on the cPanel server (this is really important! – if you don’t have access, go get it now by asking whoever owns the server!)

So, what do we do now? Here’s the simple, quick workaround…

  1. Setup the Windows 2003 / 2008 server as your AD controller as per usual
  2. Yes, choose to install DNS services on your Windows server too
  3. Now you’ll end up with 2 servers replying for “kelvin.sg” – cPanel’s DNS servers and your AD server.. but you can’t have that as there would be no authoritative response! (and that’s bad, because mismatched DNS records aren’t exactly good…)
  4. Ok, next, go into your Windows AD’s DNS Server management panel, it should look something like:
    Change your zone for your domain to a "Secondary Zone" via the DNS Manager
  5. Now, change the zone of your domain, to a Secondary Domain. We are going to make it “copy” or clone the zone’s contents from your current DNS server with the hosting company.
  6. Of course, specify the nameservers…
    Now, change the Master Servers accordingly, too!
  7. Ask your hosting company (or use whatever tools you have available inside cPanel – which is unlikely, as cPanel doesn’t support editing of NS records, however, WHM does…) to add an NS record for: _msdcs.[yourdomain.com] pointing to your AD nameserver’s hostname. In instance, I would use: _msdcs.kelvin.sg -> my-active-directory-nameserver.kelvin.sg
  8. You’re done!

Okay, now, when you try to use a computer at a remote site/network to join the “kelvin.sg” domain, it magically works!

The trick’s in the “_msdsc” NS record – and apparently, Google only gives little pieces of things which I’ve to put together to figure it out!

{ 23 comments }

Onraet Road.. and 4D Numbers!

February 24, 2010

It all started with Onraet Road, a place, which a client of mine had tried (but failed horribly – due to my part of understanding) to describe to me of it’s location. He said it was somewhere near Upper Thomson Road, after the Old Police Academy, and near some place called “Pek Kio“, which, to […]

Read the full article →

BlackBerry Tour 9630 Simplified Chinese Pinyin Input for OS 5.0

February 5, 2010

Image by Dan_H via Flickr Well, so… the BlackBerry Tour 9630 wasn’t “really” supposed to be used in East Asia, huh. ..or so RIM and/or the huge telco’s in this region (yes, I’m in Singapore, incase you haven’t figured out what .sg stands for) thought so. Actually, yea, there’re quite a few people (like me) […]

Read the full article →

The serious side of Kelvin…

August 21, 2009

Yes, yes – I know what you’re thinking. I can hear the usual barrage of comments coming already, “Oh Kelvin – you already have the *other* blog – you know, the Yandao.com one which you shamelessly spread via Word of Mouth [media] (but hey, since when was WoM a media type?) and which your alma […]

Read the full article →