Archive for September, 2010

Why CSS gets confusing and why you should use SASS

Posted on the September 30th, 2010 under HTML, CSS,Internet by

Take the following HTML file with CSS. How will div2 look?

<html lang="en">
<head>

<title>SASS Test</title>

<style type="text/css">
    div.div1 div {
        border: 4px solid yellow;
        background: yellow;
    }
    div.div1 {
        background: red;
        border: 4px solid blue;
    }
    div.div1 div.div2 {
        background: green;
    }
    div.div2 {
        border: 10px solid orange;
        padding: 10px;
    }
</style>
</head>
<body>
    <div class="div1">
        Div 1
        <div class="div2">
           Div 2
        </div>
    </div>
</body>
</html>

Based on the last definitions, you will expect div2 to have:

  • a green background color
  • a 10 pixel solid orange border
  • a padding of 10 pixels between the border and the text

Actually it will appear like this:

It does NOT have a 10 pixel solid orange border, but instead a four pixel solid yellow border. Even though CSS is cascading, it cascades by CSS rules, not by definitions. Even though an alternate definition is last, if it doesn’t cascade over an existing rule, it will not be applied.

Wireshark Filters – Ajax Example

Posted on the September 30th, 2010 under Internet,Linux,Software and Technology by

I’ve blogged about Wireshark before, and how to use it for Ajax. Next is a quick tip on how to use Wireshark’s filters feature to only watch for AJAX requests. In the filter tab, enter:

http.request.uri contains "php" ||  http.content_type == "text/html"

This effectively reads, only log items where:

  1. The HTTP request contains PHP, OR
  2. The HTTP response is “text/html”

Wireshark Filters

Useful, dont have to wade through whats an Ajax response, bypass images, etc. One thing that would be nice would be if the area that shows the filter expression was longer!

Preparing For Hajj – Some tips for techno hajjis

Posted on the September 27th, 2010 under Internet,Islam and Muslims,Reflections/Thoughts,South Africa by

Going on Hajj nowadays is so much different from years ago. As someone that was fortunate to be there in 1995 and last year (2009), the differences were stark. No longer did we have queue for prepaid phones, we could video chat (skype) with our family back home. No longer did people have to wait for photos to be developed. We shared them immediately on Facebook. And yes, we took photos of ourselves inside the Haram and MMS’d it home!

Opting to take our gadgets also came with its own preparation. Having learnt from the advice of well-wishers, as well as mistakes from previous trips, here are some tips we can offer.

Electricity – Get a Travel Plug Converter

Saudi Arabia uses the Type F plug, South Africa the Type M. One Hajji noted that his hotel also had the Type G plug (as used in the UK), but this is very rare.

I found a travel plug converter at Diskem, but its generally available at stores like Cape Union Mart. Also try places that sell suitcases. Type G to Type M is easier to find and available at Clicks for instance, but rather take the Type F. This also makes a handy gift to Hujaaj!

We also took with a multiplug allowing us to comfortably power the laptop as well as charge our cellphones, camera battery, electric tooth brushes, electric shavers.

Saudi Arabia also uses 220V so there’s no need to change the voltage on your equipment.

Type F Plug

Type F Plug

Type M Plug

Type M Plug

Type G Plug

Type G Plug

WiFi and Internet

Even if Wifi is advertised  free in your hotel, it may only be available on a certain floor. Check with your travel agent whether the hotels you are staying in offer WiFi and whether WiFi is offered on all floors or just some. I found WiFi more available in Medina than in Makka. It may be because of the construction work, but speculation on my side.

Internet on your Cellphone

Have a habit of quickly checking Facebook on your cell phone, I was shocked to see how expensive this is with airtime just running away. My guess is that it costs something in the region of Rs2 (Saudi Riyals) a megabyte which would be more expensive than South Africa.

Tip: Keep this is mind that their billing rate may be different. Also check your airtime balance regularly, and modify the settings of programs that connect to the Internet. In my case, one of them was one that downloads the daily weather.

3G Internet for Your Laptop

It is possible to take your 3G card with and purchase a one 30 day data bundle from a service provider in Saudi Arabia. There are two advantages to doing this:

  • If your hotel does not offer WiFi on your floor, you can comfortably Skype and video chat with your family in the comfort of your hotel room.
  • If your package involves moving to Azizia, you’ll have Internet access there! Azizia is nice, but WiFi is not standard there 😉

Some tips on purchasing a data bundle

1) Saudi Arabia has two main operators: STC and Mobily. STC is the equivalent of Telkom, advertises everything but has nothing and unlikely to help you if they sense you are going to make them THINK or do some real work. The service from Mobily on the hand was wonderful. They knew their products, no queues.

2) Purchase the data bundle in Medina

Makka is full. Since it is also winter there, there is a shorter time between the Waqts and also to get to the Haram on time. By the time you get to the front of the queue, its time for Salaah. However, try and purchase it closer to the end of your stay in Medina, but with enough time to go back to them if any issues arise (about three days before you leave). A data bundle lasts for 30 days. The later you purchase your data bundle, the later for your stay in Makka you can use it. Otherwise you run in the dillemma of wanting to purchase a data bundle just a few days before Haj and risk losing the balance of data/airtime.

3) Requirements

I purchased the data bundle at the Mobily Store in Central Medina (opposite the Hilton hotel). They required a photocopy of my passport (which I did not have) but accepted my Al Anwar card. Best to take a photocopy of your passport with.

4) The connection settings for Mobiliy is built into Ubuntu, just setup a Mobile connection. For Windows users, they are:

Number: *99#
APN: web2

However, the pamphlet given is quite handy. The salesman will also tell you that you can bring your laptop to them and they will help you set it up!

AIR Time

Recharge Card

Recharge Card

Airtime is sold in various denominations. However, if you buy a larger, you stand to gain extra airtime. For example, a Rs100 airtime card gives your Rs150 airtime (cant recall exactly, but it was in this region).

Best of all, the cards have two scratch areas, so even if it is a single card, the airtime can go on to two phones. As they say in Cape Town, “Klap together”.

This also offers the opportunity for the budding entrepreneurs in Makka and Medina. Check that you are not paying the extra Rs50 when you dont have to. Also, some of them will sell you half the card for Rs75. There are so many of them, just walk away and move to the next guy.

Internet Banking

The number one rule: Update your profile to receive your One Time Password (OTP) via email. By default, most people receive their OTP via SMS. Unless you have international roaming activated and WORKING, you may not receive this, which may stop you from performing any transactions via the Internet.

Standard Bank users can only opt to receive their OTP via SMS or email. FNB users have the option of receiving the OTP via email in addition to SMS.

However, for both of them, you need to setup the OTP via email before leaving your hometown. Usually someone from the branch has to phone you, ask you to verify your details, etc. before they set this.

For Standard Bank, if you set up a recipient, you will not need to enter a OTP when doing a transfer to them.

ATMs, Banking in General

Please check that your card does not expire whilst you are on Haj. Banks usually have your new card a month before they expire, and you can request them to send you one earlier as well.

You are able to do cash withdrawals at Al Rajhi bank. In Makka, they are situated in front of the Hilton hotel. In Medina, there’s an ATM on the first floor of the Hilton Hotel. In most of the more modern malls, they do accept cards. Some of the smaller shops usually share one machine that services a group of them, so you may have to walk to another point to have your card swiped.

Wires

Make a checklist of all the wires and cables you need to take with. Its annoying to be on the other side of the world only to discover you dont have a cable you need.

Back Home Preparation

Apart from checking that you are hooked up, ensure that your family is likewise. Are they able to connect to the Internet, start skype, etc.? Does their webcam give a grainy or feed, etc.? Run a few checks before you leave, and also put them in contact with someone thats knowledgeable. If they are going to use someone else’s Internet connection, ensure that you have budgeted for this as well.

Lastly,

Where possible, assist your fellow Hujaaj if you can. The Holy Prophet Muhammad (PBUH) said that the best of people are those who assist others, and how much greater is this in the Holy Cities. If you find any of these tips handy, please make Duah that the Almighty grants the author to apply these tips himself in the Holy Lands, Insha Allah

[Video] Shaykh Sadullah Khan’s Khutbah at Claremont Main Road Masjid

Posted on the September 4th, 2010 under Internet,Reflections/Thoughts by

The khutbah is available online, but sometimes it’s just easier to watch it online.