Tuesday, February 23, 2010

Java Quiz: Array Initialization Answer

Its a difficult answer if you come from a Pascal (Delphi), C or C++ back ground where you had to initialize the array first with default values like 0 before using.

Java automatically initialize all elements in an array to default values, object references become null and primitive integers become 0.

This is in my SCJP exam studies, tricky since I come from a Pascal and C++ back ground.

In C/C++ you get some random data (whatever is in memory at that pointer address). So for them you need to initialize the array before use.

Monday, February 22, 2010

Java Quiz: Array Initialization

Is the following correct? What will the output be?
And PS: Try to figure it out before actually running the code :-)
public class BirthDays
{
static int [] year = new int[100];
public static void main(String [] args)
{
for(int i=0;i<100;i++)
System.out.println("year[" + i + "] = " + year[i]);
}
}

Please give your answer in the comments.

Thursday, February 11, 2010

Microsoft vs Apple War Continue: The iPad

After reading an artical about Bill Gates being unimpressed with the iPad, I see that the whole Microsoft is against anything that comes from Apple - the iPhone for example, they all focus only on there Windows Mobile phones (which got there own problems - more about that in later blog) , no iPod only there Zune device.

The war between Microsoft and Apple (or let me rather say Bill Gates and Steve Jobs) started in the 1980s, all the geeks know the story but let me repeat... Microsoft was doing DOS for IBM and Apple there Apple II etc machines (before the Mac) so it was Apple vs IBM, Apple then released the Mac - first operating system that got a graphics user interface (GUI) - they stole this idea from the Smalltalk system... Microsoft then wrote software (spreadsheets etc) for the Mac, later on Microsoft released Windows and that stole the market. So yeah, Steve jobs wasn't happy with Microsoft (Bill Gates) for steeling there GUI OS idea even if they stole it from the Smalltalk system... actually if you look at this story both of them are wrong.

Over years there was no love between them... Currently for example you need a Mac to write software for the iPhone/iPod Touch/iPad (known forth as the i-Devices) can't do it on a MS Windows machine.

Personally I see this as wrong... We are customers, we don't care about fights, bad feelings etc that companies got against each other... This if for example why Steve Jobs is wrong - his feelings is always in the way of his business judgement... customers are asking for Flash support on the i-Devices but no his got a thing against Adobe.

Give us what we ask for! Give us what we want! If you give us what we ask for / want without all this other crap (that is the only way of expressing it) then your product will grow and you will become more successful then the company X that you got a thing against.

Sunday, February 7, 2010

Blackberry True Push Email

With push email you get email delivered immediately on your phone just like an SMS, most phones say that they support push email but its not actually true push email... just like MS Outlook where all that they do is to check your mailbox every x minutes (like 5/10 minutes) so every time it does a simple send & receive.

The Blackberry support true push email using BIS (Blackberry Internet Services) you can setup email accounts (like your Gmail account) and it get pushed to your Blackberry - there is a lot of detail on how this works but I will not explain it here.

As in previous blog entry you can pay R59 per month (30 days) from your Vodacom airtime which give you unlimited internet access on your Blackberry meaning that you don't pay R2 per 1 MB for internet (3G/GPRS/EDGE) - push email, Facebook and browsing is free.

There are limits, you can't for example download huge emails, emails got a limit size as well etc. I suggest you check with your service provider (Vodacom, MTN) onthese limitations.

Also at work my phone is always on silent, the Blackberry got it nice where if there's a email a little red light flickers - very nice visible notification.

Thursday, February 4, 2010

My Blackberry Experience

Over last weekend I bought myself the Blackberry Curve 8520 smartphone, I always wanted to have a Blackberry since I heard its very good especially with email taken that I spend a lot of time on emails.

I didn't got the device on a contract but as a prepaid package, so I bought it cash together with a Vodacom prepaid SIM card.

With Vodacom you can signup for the Blackberry Internet Service by using your airtime, R59 for 30 days (subtracted from your airtime) gives you unlimited Internet access e.g. browsing, Facebook, Twitter and push email. Note that Skype (VOIP) or any form of streaming will cost you extra since that isn't part of the unlimited Internet package.

For push email you just register your email addresses on the Vodacom portal and get pure push email (I will blog about push email in the future).

For Facebook a little blue envelope will appear if someone sent you a message etc.

The Blackberry Curve uses GPRS/EDGE and Wifi unfortunately no 3G support but for me that is fine since I'm mostly in a office where there is Wifi and yes I'm one of those that don't use my phone while driving.

For me the most to get used to was the little keyboard, I came from my Samsung Omnia i900 and iPod Touch that got touch screens and all of a sudden need to get used to the little keyboard.

If your a developer, please fill in my poll: Do u want C#/VB.Net for Blackberry?

Wednesday, January 27, 2010

Apple's Unveils The iPad

At a special event last night 20:00 South Africa time, Apple's CEO Steve Jobs unveiled the new iPad. I couldn't watch it online since unfortunately Apple didn't broadcast it but I did listen to an audio feed together with some photos from Engadget, Live Gizmodo all from my iPod Touch (on Wifi) while in bed with a stomach bug.

The iPad got multi-touch, very big screen, fast processor, comes in Wifi only, Wifi/3G models etc. For all the details you can read the references below - I'm not going to repeat here. For me it got some advantages / disadvantages:

Advantages:
  • Bigger then the iPhone/iPod Touch so browser is nicer
  • Comes in Wifi/3G models.. if you don't want to wait for the 3G model you can buy the Wifi only model and use a tool like MyFi that broadcast a Wifi signal from 3G (3G -> Wifi).
  • Very fast processor, most of the reviews are happy about how fast it is.
  • iWork: Office like package (try to compare it with MS Office) for word processing, spreadsheets etc. USD $9.99 from the AppStore.
  • AppStore: Buy all existing applications developed for the iPhone from the AppStore and run it on the iPad without modifications.
  • New SDK: New SDK for development of iPad applications
  • Games: Very good graphics, I love playing games on my iPod Touch / wife's iPhone.
  • Keyboard: A physical keyboard that you can connect to the iPad if your not keen on using the on screen keyboard (like me: I dislike typing on the iPhone/iPod Touch).
  • iBooks: New online store where you can buy e-books and read them the iPad.
  • Price: At USD $499.00 (about R3,773.09 base upon the current exchange rate) for the Wifi only model the pricing is very good.
Disadvantages:
  • Its not a PC, you still would require a Mac OS device to write applications for the iPad.
  • No multi-windows, only one application can run at a time... Just like the iPhone / iPod Touch.
  • Base upon new iPhone OS so got the same disadvantages
  • No GPRS - Not everywhere in South Africa there is Wifi or 3G.
  • No webcam build-in or microphone... doesn't see how applications like Skype/Fring will work if you want to do VOIP.
  • Wait: We're going to wait months before its available in South Africa.
So for me: I will not buy one, its got all the same stuff that the iPhone got already and you can phone with the iPhone (and use Skype/Fring), it got 3G and GPRS. I would like to see iBooks and the keyboard for the iPhone but that is something that I can live without.

References:

Tuesday, January 12, 2010

Happy New Year 2010 & My QBASIC Story

Happy New Year 2010 (that is Twenty-Ten :-)

I hope this year is full of joy, fun in your live. I'm having a full year with alot of work and my Java Certification exam in June 2010.

I reguarly visit reddit to see what is new in the programming world... I notice that there is a QBASIC interpreter written in JavaScript available online. By default it runs the Nibbles game (an old classic snake game).

QBasic was the first programming language that I used at the age of 14.. (I'm 28 now) when I was young, inexperience and programming was fun (yes it currently is still fun!) - writing my own dictionary, book library, help me with homework (especially maths) that is where my love for programming started that later became my career (another story how that started).

My dad bought me a old 386 SX, 40 MHz, 2MB RAM, 1.2 GB hard drive that ran MS DOS 6.22 with MS Windows 3.1. I learnt BASIC since it was the only books avialable in the schools library, taught you the old GW-BASIC in a cartoon style... GW-BASIC had line numbers etc where with QBasic it was the first version that didn't hand line numbers, had a proper IDE (no syntax highlighting or code completion yet), proper debugging in the form of breakpoints etc. In the language there was GOTO and GOSUB but mostly for back-ward compatibility with GW-BASIC where you get proper SUBs and FUNCTIONs in QBasic.

Later on I moved over to Library Basic so that I can compile my applications and not give my source away (yes even at that age I was very protective of my source code!)