Life perspective

Preamble To The Constitution of South Africa (or the best thing I’ve read in a while)

We, the people of South Africa, Recognize the injustices of our past; Honour those who suffered for justice and freedom in our land;
Respect those who have worked to build and develop our country; and Believe that South Africa belongs to all who live in it, united in our diversity We therefore, through our freely elected representatives, adopt this Constitution as the supreme law of the Republic so as to

* Heal the divisions of the past and establish a society based on democratic values, social justice and fundamental human rights;
* Lay the foundations for a democratic and open society in which government is based on the will of the people and every citizen is equally protected by law;
* Improve the quality of life of all citizens and free the potential of each person
* Build a united and democratic South Africa able to take its rightful place as a sovereign state in the family of nations.

May God protect our people.

Nkosi Sikelel’ iAfrika. Morena boloka setjhaba sa heso. God seen Suid-Afrika. God bless South Africa. Mudzimu fhatushedza Afurika. Hosi katekisa Afrika.

There’s more to that over here


EPIRB, A Personal Emergency Beacon

GPS utilities for your phone are becoming pretty useful (and popular) so I’ve added my app into the mix- I hope you find it useful too. More than that, my wish is that it one day saves a life. Other than that, my hope is that it gives you peace of mind in a not-so-safe scenario.

I’m putting this here because even though it may be obvious, it’s not. EPIRB (your phone) can quite possibly fail you in your hour of need. Don’t think that this ONE single application (or your phone) is all the safety and security you need. It’s not. Even when you climb mountains with brand new equipment, you never just use ONE rope. That’s just asking for trouble. ALWAYS have a PlanB and ALWAYS let somebody know in the real world where you are, what you up to and where you going.

If you know all about EPIRB already and just looking to download it, you can go straight here.
The basic idea is this:
Before you set out on a journey, make sure you have some emergency contact numbers listed in the application. You can also optionally set an Estimated Time of Arrival (ETA).

And then off you go.

Now the part comes in your journey when you get into trouble. There’s roughly three kinds of trouble you can get into:

1. A bad situation but you are still able to self-rescue.
2. A pressing situation where you still have the ability to call for help (make a call, send an SMS, push a panic button) but your interaction is quite limited.
3. And then there’s the really bad situation where you’re completely incapacitated (or separated) from any form of help whatsoever. This is also why you need a real-world-contract in place and tell people around you what, where and how you doing your journey.

Given those situations, how do you get help?
1. In the case where you self-resuce, it’s all good. No need to panic. You usually contact people AFTER the event to let them know what’s going on. You might want to alert them that you’re in potential trouble and to be on standby.
2. You’re limited in your ability to call for help, but you can at least press a button. With EPIRB, all you need do is press MAYDAY. This will immediately start sending off an SMS to each emergency numbers listed with your last known GPS location. Once you’ve pressed MAYDAY, you could try phoning (if you are able to) or just focus on getting yourself out of the situation. Keep in mind, your emergency folk will usually try to phone you to find out what’s going on!
3. You’re completely unable to call for help. This is usually quite bad. However, if you fail to inform the application that you’re OK (i.e. you have exceeded your ETA) it will start sending out WARNING SMS to each of your emergency contacts. EPIRB will call for help when you can’t.

Of course, this does not cover 100% of all situations, or 100% of one. It should hopefully cover what you need and assist. It’s just a tool to cover a gap that can be covered.

Of course, after a MAYDAY situation, it is also important to let everyone know that you’re OK. This is easily achieved by deactivating the MAYDAY and all your emergency contacts are notified by a once-off SMS that you are OK. And then another feature of EPIRB is not accidentally pushing the panic button (how many times have you done that before?). EPIRB has a simple safety pin designed to avoid accidentally setting off your emergency peeps into a high state of alert and panic.

So, with a simple and effective application like EPIRB, and a little planning, you could make sure someone’s got your back **just in case**.

1. Does EPIRB use any data? No. Not this version.

2. Will EPIRB cost anything to download? No. I’m making this available for free for a lot of personal reasons.

3. Will EPIRB cost anything to run? Only in emergencies will it start sending out SMSs. You control just how many though (number and frequency). Considering your life’s at risk, the last thing you need to worry about is a couple extra bucks in SMS.

4. But what if EPIRB never switches off after being set in an emergency (lost/stolen phone)? Tricky. At the moment, it will just keep sending SMSs until you run out of battery life. Not ideal. If you have some suggestions, let me know.

4.1 Does this integrate with my BBM? Not yet. Working on some memory issues and ensuring some robustness around the BBM integration for OS6+.

5. Why does the UI look so .. erm.. plain? I prefer simpler UIs because they draw less resources, have fewer code (read: “latent bugs”) and they’re less likely to “date”. In addition, for EPIRB in particular, the light-yellow/orange contrast has been used so you can easily spot the difference in glaring sunlight when you only have but the wink of the eye to make sure your MAYDAY is ON.

6. Is there an online-tracking version? You bet. That version is, I’m happy to say, very stable and just about ready to hit the wide wide world. Watch this space…

7. I like what you’re doing- how can I get involved? Easy. Just contact me.

8. EPIRB rescued me- how can I repay you? Pay it forward. Do good and help a stranger. If you don’t know where to start, get in your car right now and go buy somebody who really needs some food, a nice meal.

9. I used EPIRB wrongly and now it cost me a couple bucks in SMSs- how are you going to reimburse me? I’m not. Sorry. The app has been given to you for free in good faith. If it didn’t work for you, it didn’t work for you. It works just sweetly for me (and mine) is all I can add.

Yeah… eye candy; although, not a lot of candy! 🙂
When starting EPIRB, this is what you’re going to see:

Once you have a GPS signal and we’ve managed to get a fix on where you are, the screen will continuously update with that information. It might look geeky, but it’s amazing what your mind will remember in a heightened state of anxiety- and what you can do with that information so there’s no hiding that from you:

With the settings, you can set a pseudonym (or your real name- or a race number if you’re racing) which is used when an SMS is sent out. You can choose numbers from your phone book or just type in numbers to add (like a race organizer’s number, your local community police station, traveling buddy…). You can also set how frequently you want the MAYDAY flare to be sent out.

Then of course, the main screen- MAYDAY. Once you’ve clicked MAYDAY (and released the safety pin to prevent false alarms) you can let your phone get on with updating emergency folk about where you are and get on with rescuing yourself (if you can).

You can explore the other features, ETA and a little “Where am I?” menu option which will open BlackBerry Maps with your last known location. From there, you can send it by email, BBM, MMS and so on… So EPIRB is more than just a simple panic button- but it does try to be as simple as possible. Oh, and to download, point your BlackBerry here


XSD minOccurs Specified And The XmlSerializer

In your XSD schema definitions, the minOccurs has a subtle nuance through a leaky abstraction. Getting right to the point:

Let’s take an element definition such as:

<xs:element name="OptString" type="xs:string" minOccurs="0"/>

Now when you create your default classes using the xsd.exe tool, you will end up with a class having a property OptString. Neat, since in code, you can just set that property (or not) and it will appear in the XML (or not). It’s optional.

Now what about:

<xs:element name="OptBool" type="xs:boolean" minOccurs="0"/>

Again, there will be a property named OptBool for you to set (or not). Only this time, it won’t appear in the serialized XML. There’s an additional property named OptBoolSpecified which you need to set. If false (which it is by default) then it won’t serialize.

Now, let’s look at:

<xs:element name="OptValueString" type="ValueString" minOccurs="1"/>

where ValueString is defined as:

<xs:simpleType name="ValueString">
    <xs:restriction base="xs:string">
      <xs:minLength value="3" />
      <xs:maxLength value="10" />

This has the same effect as a regular string. If it’s set (or not), it will serialize (or not).

Then we have a custom type (an enumeration) such as:

<xs:element name="OptStrongString" type="TypedString" minOccurs="0"/>

where TypedString is defined as:

<xs:simpleType name="TypedString">
    <xs:restriction base="xs:string">
      <xs:enumeration id="ValueA" value="A" />
      <xs:enumeration id="ValueB" value="B" />

It has it’s base in type String, but it’s an enumeration, so how will it behave?

Well, it needs it’s related Specified property to be set. Without that, it’s not going to serialize. And the same goes for type int.

In fact, experiment with the different types and understand the subtleties of minOccurs better. And you could question the existential “why” it is so or you could also just accept the way it is and move swiftly along 🙂

I’ve attached some code here to jumpstart your experimentation.

Download project XSDMinOccursSandbox