Home

Dive into the archives.


I thought it would be helpful to share this piece of simple code

In VB.NET, it is pretty easy to convert a decimal number (say, 12345.6789) to currency format ($12,345.679)

Just convert the number using the lines of code as shown below:

Dim value_int As Integer = 12345.6789 ' original decimal number
Dim digit As Integer = 3 ' to format it to 3 decimal places
Dim value_str As String = value_int.ToString("C" & digit, Globalization.CultureInfo.CreateSpecificCulture("en-US"))

Also check out other cultures available here.

One of the most important element in SEO (Search Engine Optimisation) is to have your site indexed properly (and regularly) by popular search engines.

As of today, Google has a significantly huge market share of 84.96% (resource) and is definitely hard for website owners to ignore.

I’m going to walk you through on how I generated XML Sitemaps for adorr.net (powered by WordPress) and submit the sitemap to Google for in-depth crawling.

(more…)

I was doing some SEO for my site the other day when I came across some inconsistencies in my website URL. Some appears to be adorr.net while the rest are www.adorr.net.

Do note that this only applies to Linux hosting accounts.

This can be annoying for search engines listings, and even cause mismatching paths when using Google Webmaster Tools to submit sitemap.

This issue however can be easily fixed by modifying .htaccess, and I decided to go with shorter version of adorr.net without www

Below is how the first part of my .htaccess

* Remember to replace adorr.net with your own domain!

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.adorr.net$ [NC]
RewriteRule ^(.*)$ http://adorr.net/$1 [L,R=301]

Do note that the code above is to rewrite all requests of www.adorr.net to adorr.net.

If you want it to be the other way round, use the following .htaccess instead

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^adorr.net$ [NC]
RewriteRule ^(.*)$ http://www.adorr.net/$1 [L,R=301]

Cheers!

float

People have been asking me about how to make a footer stick to the bottom of the screen regardless of which vertical position the browser screen is at. In other words, how to create a footer just like how Facebook does it.

First of all, there are two different types of footer which I’d like to classify them as Floating Header Footer and Sticky Header Footer.

(more…)

With Apple’s iPhone and iPod Touch, Google’s Android smartphones and other portable devices gradually dominating the market, it is getting more important to optimize websites to look better in these relatively-smaller-screen portable devices.

If you have been in CSS game for quite a while, you may think that defining media=handheld will do the trick

@media handheld {
  .navigation {
    display: none;
  }
}

Unfortunately Apple defined it in such that iPhones will look for “screen” media type instead of the limited “handheld” media which deem to be outdated.

The solution to this is to specify CSS rule that looks at the device screen resolution.

There are some sayings that Internet Explorer has issues ignoring the CSS rule, but that can be easily fixed with Internet Explorer’s “conditional comments” feature.

Conceptually, you can define a separate set of CSS for iPhone (or devices with width less than 480px) as follow:

<!--[if !IE]>-->
<link media="only screen and (max-device-width: 480px)" rel="stylesheet" type="text/css" href="iphone.css"/>
<!--<![endif]-->

And the iphone.css can be any CSS definitions that will overwrites the original CSS definitions.

Hopefully this basic and simple trick can help you to kick start your website revamp to cater for different sizes of portable devices.

Related Posts with Thumbnails

*Web Development

This is the archive for Web Development.

Sideblog


  • [01/28/2010]

    Apple has just announced their latest product - iPad (a new product category in between iPod Touch and Mac computer), starting at USD$499 - http://www.apple.com/ipad/

  • [12/09/2009]

    New SG iPhone plans released, from 2 carriers - http://bit.ly/5xzZ0I (M1) http://bit.ly/7f41zc (Starhub) - apparently M1 has the better deal, with 10GB & unlimited data bundle! woot!

  • [06/11/2009]

    WordPress "Baker" 2.8 released. Faster, redesigned theme management, new widget interface, and new Screen Options on every page. Find out more

  • My Wall


    Latest on Wed, 12:04

    d0rr: wth, my listing styles are not appearing, anyone can help to spot where the problem is??

    d0rr: larger font size, wider content area - does little changes make difference?

    d0rr: hey yuan, nice to see u here before u sleep :P

    TCY: hor hor hor Is time to sleep ~~~~~~~

    real rape footage: mm.. strange :)

    » Say something!



    *Who, adorr?

    I am a self-taught photographer who earns a living as web developer. I am a Technology Engineer, in which am professionally concerned with developing economical and safe solutions to practical problems. And if you are expecting the magical mixture between science and arts, you found me.



    • ??? ? ????
    • USA Road Trip 2009/10
    • W3 Silver Awards
    • Red Lanterns
    • Blossom
    • Cheng Ho Marine
    • Flight @ Dawn
    • Full Moon
    • Arial, 17px
    • Home-cooked, With Love
    • Pepper Lunch
    • Happy Birthday, Singapore
    • Lilo the Steeeetch
    • Hunny the Pooooooh