Sunday, December 27, 2009

Help the user to learn along the way

This article is about user interaction design and how does the application help them not just completing their task but help them learn along the way.

I have been supporting a lot issue from my client. Sometime, user/QA is lack of experience/traning on business process as well as the product they're using. This lead to a lot of question regarding business process instead of solving the real problem (e.g. error testing, bug finding). Questions such as:

1. Where this value/result come from?
2. Why this record have this behaviour/status and changed the next hour?
3. What the application is doing and what does it mean? What this error mean and why it is there?

From the above questions, therefore the application needs to be able to do the following:

1. Teach the user how to use the application. (e.g. step wizard, interaction help, tool tip tutorial)
2. Explain to user what is going on. (e.g. Icon, symbol, picture to inform the user what's currently going on or current status)
3. Program error tracing and logging needs to be meaningful not just for developer but as well for users. Therefore, one error may be used by both user.

In conclusion, this is just a fairy tale. Sorry to disappoint and took your time to read this article. If you don't mind further reading, below is what are the excuses why the above solution will not be implemented. This is what the developer/management will say:

1. Step wizard, interaction help and tool tip took too much time and resources to implement. Our hands are full for project implementation/new programming language/new technology.
2. We don't have graphic/design team for icon, symbol and picture to help user to explain what's going on.
3. Support team will be out of work if user don't need them or know what's the error mean.

Well, this is the real world but hey, at least the support team can secure their job. :P

Tuesday, December 22, 2009

Tweet

Work
I'm in UK now working on a migration project with a team of 5. My intuition tells me that this project is not going to make it on the pilot phase (minor deployment before the full phase) where there are too many issue raised (requirement mismatched, new development added and etc. All except extending the deadline).

Well, today it seems the director himself has decided to extend the testing phase (increased UAT test phase) based on the "obvious" client's and QA respond (I find management staff seems to be slower on catching those feedback) on those issue. Although they are not too many but serious financial calculation flaw and data miss-mapping. This news has really pull some sweat off my face and save my day.

Probably you would be asking why this would happen. Lack of planning (especially on testing phase), roll out new product without internal testing (release a new product straight to client), unconfirmed specification (feature keep changing), data conversion logic was done by the other team and issue reported on data miss-mapping does not fixed soon enough for next load. All these almost driving me crazy and plus Project Manager keep adding more task which are not putting the data mapping in first priority (I was wondering whether I was in conversion team). Therefore, I am happy when I heard the news and obviously my project manager are not.

Play
I'm working on a article about transparency programming. Sort of fantasy tale where development won't bother this sort of stuff. But I think it's worth writing. Anyway, it was delay due to a free MMORPG game I was playing. Very addictive stuff. I need a rehab for pulling myself away from it. I recommend to someone who needs to team building spirit because you can't finish all the quest alone. Everyone needs everybody's help along the way. I have tried recruit a team for a quest, lead the team, become a team support, on the front line and best of all, interacting. (See, that's why it's addictive)

Sunday, November 8, 2009

Passing the first paper

Finally, I have passed the first paper at first attempt. After spending a month on reading the book for preparing the exam, I realized that the book is just enough for passing but not enough for scoring the exam with flying colors. In the exam, I found there many questions that aren't covered in the book but it's the cheapest way to score the paper.

The book cost RM150 and the training cost RM5k. Even I failed and retake the exam again, I still saved some money. Beside, the score will not be printed in the certification. *phew* :D

Now, moving forward to the next paper before I get the OCA (Oracle Certified Associate) Certification, where I can get those books?

Sunday, September 27, 2009

Getting certified

I have been working for more than 8 year in programming position. Finally, I think it's about time to get a certification to officially become a professional.

I believe there are some discussion on whether being certified really bring the value to work and personal growth. Well, I think it's better to have a goal on a certain profession and then move on to the next level. For example, I have been certified on XXX programming language and this means I have sufficient knowledge on that language. However, experience does contribute more than just programming language and perhaps, that can be consider the next level after certification.

So far, getting a lot experience does not have a point, if without certification, because who knows the experience really does apply the skill on the job. Maybe the skill wasn't apply at all time (e.g 20% using skill, 80% in meetings. 5 years of experience is actually 1 year only).

In short, I think having experience is valuable, getting the certification is just to anchor that claim.

(I'm currently doing self study for the exam. Oh well, it feels like I'm going back to college again.)

Wednesday, September 9, 2009

Process large volume of data using mod function and multiple session

The scope of this process is that we only process data on a huge table (> 1 million records) and the CPU is no limitation.

The idea is simple. Organise the data into different part and run them in different sessions. This is done by using the unique numeric field in the table and separate them using mod function.

Example:
Table: Product table with 1 million records.
Table Field: ID (Unique Number ID), Name (varchar), Spec (varchar)
Procedure: ProcessProduct(iModby in number, iModRemainder in number);

Code snipper for ProcessProduct:
Begin
.
.
for r in (Select * from product where mod(id, iModby) = iModremainder)
--should be using bulk collect example
.
.
end;

To run the procedure in 2 session. In the first sqlplus window:
Begin
ProcessProduct(iModby => 2, iModRemainder => 0);
end;

In second sqlplus window:
Begin
ProcessProduct(iModby => 2, iModRemainder => 1);
end;

In conclusion, there are improvement by using this way to process large volume of data (e.g. data migration) and the number of session can be go higher if required. However, it may differ if CPU is fully utilized in just one session.

Friday, August 7, 2009

How answering the mobile phone has changed our life inconveniently.

In the conventional household phone, there is a handle and the number pad body. To answer a call, logically we just pick up the handle.

How we perform the same on mobile phone? Most (not all) of the mobile on the market now requires you to press the green answer key button. If you pass your phone to an old folk and tell them that to answer the phone, they need to press this specific button. They have this confuse looked on the phone because they need to carefully search where the green button is. And sometime, the buttons on the phone are so close, they have to carefully press just to make sure they don't press the wrong one.

That's the word I want to highlight. Searching for the green button and carefully press it just to answer the phone, is making us life inconvienently (for some may not; for me it is).

I used a slide phone by the way. I have changed the answering method by slide the phone up to answer and slide back to close a call. No button search and I don't even have to button color check or carefully press it just to make sure I'm pressing the right one. Although it's not convienent as pick up the handle as in household phone but it's close.

PS: Perhaps the phone manufacture should make mobile phone able to detect when the phone is press againts the ear. This will means answering the call. A phone like that will really amaze me.

Wednesday, August 5, 2009

Huge Volume Migration

This is my second migration project. The first project, I have involved by writing a package to import approximately 100K record for each 8 tables. It took around 6 hours to complete the migration. This includes maintaining the table relation, generate new record id number and data validation. The strategy we (including my colleague) used is bulk collect.

For this current migration project, the volume now reached to 6 milion records for each 19 tables. Using bulk collect here is not going to be efficient anymore. Data needs to be import into the table fast. Furthermore, the system is live (no down time) along with the migration is going on. In the end, we all come down to a solution is by import the data straight in the system table using oracle utilities, sqlldr.

Well, the advantage we gain is speed. Nevertheless, there are couple of points to note.
  1. Data extract must be in perfect integrity - This is because no new sequence will be used or generate any record id. Therefore, this responsible is given to the team who provide the data. Record id start number will have to send to the data extract team for them to organize the data.
  2. Record ID sequence might have a gap - Unfortunately, the system still in live when the migration going on and record id will keep increasing. Therefore, future record id has to be reserved for migration data extract. There are possible risk on hitting duplicate record id where it can bring the migration process down.
  3. Data extract must be in validated and cleaned state - No clean up or validation can be done since the data are pump straight into the database. This will caused garbage in and garbage out if there are any garbage.
Finally, I'll put my finger cross on migration day.

Saturday, July 11, 2009

Cleaning up

I'm doing clean up in my blog on articles that written based on negative emotion or no longer interest on that specific idea. Apogies for any inconvenience. :P

Tuesday, June 16, 2009

Book Review: Oracle PL/SQL Best Practices

Introduction
I started working using PL/SQL 2 years ago. I have been trying to understand the language thru reference book and all those books have been really helpful. However, reference book is just like a dictionary. It gives you words to write an article but never show how to write properly (Area such as format, grammar and style). This book is gives further insight beside just PL/SQL reference.

1. Who should read it?
Beginner and intermediate developer. I have checked amazon review on this book and some said that this book offers nothing much (perhaps they are pro developer). However, for me, I found this book gives me a lot of PL/SQL development insight which I'm lack in my current job.

2. What is it all about?
It offers best practices in very every aspect of PL/SQL development. The book also offer further resources on the intenet with code sample and template that reader can take advantage of. In addition, the author also created some video for his book. They are available in the his website which served like a companion for the book.

3. What so special about it?
There are a lot of PL/SQL reference book out there and this one offers much more broader view on PL/SQL development. Furthermore, the book is easy and fun to read and didn't put me to sleep too quickly.

Conclusion
This book worth a space in my PL/SQL book shelf and I recommend to developer who want to further their development skill to a higher level.

Wednesday, June 3, 2009

Firefox beta 3.5 first look

In point form.

1. Acid3 test scored 93, which means better web page support. Version 3.0 only scored around 70+.

2. Support open video and audio format .ogg. I have tried a sample video and it played smoothly. Quite impressive.

3. Faster startup. I'm not sure whether it just me. I have couple of add-on installed and I think some how it has slow down the startup on firefox 3.0. The new 3.5 seems to be not affected at all.

There are some other improvement but I think the above 3 is the most obvious.

PS: Thanks to the mozilla and open source video/audio development team. This new version is sure has push the browser limit/competition to a new height.

Reference:
Firefox 3.5 beta
Firefox 3.5 beta release note
Acid3 test

Wednesday, May 27, 2009

PL SQL Video

The video tutorial is provided by Steven Feuerstein. I bought his book "Oracle PL/SQL Best Practices" which is a good book and maybe I'll write an review for it.

Practical Best PL/SQL Video Series

Those video are rather concept based. However, those video really make a great companion for the book, plus his website provided a lot of script and template that you can take advantage of.

Friday, May 22, 2009

Google Chrome 2.0 scored 99 on acid3 test

Wow. (Only linktest has failed at the moment of this article)

However, I still prefer firefox due to the xmarks add-on (online bookmark). Actually, I use both browser. If there is an incompatible web page in firefox, I switch to Chrome to get a correct view. Nevertheless, both are great browser.

Reference:

Thursday, May 14, 2009

PLSQL Bind variable should be renamed.

I have something against the so called "Bind Variable" in PLSQL. To show what bind variable means, below is an example.

Slow SQL statement:
Execute immediate 'Delete from employee where id = ' || x;

Bind variable SQL statement which improve performance:
Execute immediate 'Delete from employee where id = :x' using x;

Ok, so far so good. In general sense, Bind Variable means binding a variable in sql statement to a value. In our second example, it shows what I have just stated.

Now the problem. What if i change the statement that it allow multiple table such as example below.

Bind variable for table
Execute immediate 'Delete from :table where id = :x' using tablename, x;

The above statement failed with error table or view not found. :D

In conclusion, the Bind Variable feature only worked in where clause, so it shouldn't called Bind Variable. It should be called Bind Where Clause Variable instead. :P

PS: Solution for the multiple table variable bind.
Execute immediate 'Delete from '|| tablename ||' where id = :x' using x;

Sunday, February 1, 2009

Select column into variable

In pl/sql world, there is one easily prone error, which is the select column into variable. This is how variable is assigned with value from the column result. Example:

Define
myid number; --my variable

begin
select employeeid into myid from employee where name = 'ivan';
end;

A simple example to store a number type employeeid into the myid variable. This is a very common error that programmer make in the development because there always a assumption that there are no more than a row return. Even the above example, the table only store one record and that makes good assumption right? Wrong.

The problem comes when the table grow without the programmer know about it and there are another employee named 'ivan' creep into the table. Well, oracle will throw an error stated that the result return more row than expected.

ORA-01422: exact fetch returns more than requested number of rows

If you're lucky, the error show in your working hour. If you're unlucky, the error show on your weekend while you're enjoying your favorite tv show and your boss suddenly want you to get back to office. Gee...

Perhaps programmer needs to do a little thinking on the table (database type table) before write such line of code. Below is some of the ideas i can think of:
  1. The query where clause is based on primary key or unique index. Since primary and unique index will not have duplicates, therefore this way we can assure there always only a single record return.
  2. Use a for loop to assign variable. 'For loop' is not mean to assign variable but it still do the trick. The variable keep being assign if more than a row returned. However, the value might not be the one we're after.
  3. Use an exception to catch the error. What comes after exception has been catch? Which value is the one we want? Perhaps a default value? This idea will not fully resolve our problem but may get away with it.
In conclusion, stick to the first idea. This will always get a single result for the variable. Else, be prepare to get a earlier wake up call from boss to debug the system. :P

Thursday, January 29, 2009

Missing rows when copy text to excel

I used Excel a lot to generate script. Client wanted a 100 row change, I give them a excel sheet and let them fill up the necessary then I'll write the excel formula to generate the script. Simple.

Then today, when I try to copy a column of text from a text file to excel (this will put the each line of text into the correct row) half of my text missing.

Dude, where's my row?

Try copy the following column of text to excel (version 2003). Expected is 7 rows but somehow it turn out only 3.

EMPP
#END#
@@@@@@
"
?
?
FFF

The problem is the @ and the come after ". Putting the single quote (') in front of the double quote will solve this issue.

The question is why this would happened? Is this a bug? I don't think anyone would bother because nobody is going to copy such a text to excel. :D

Friday, January 16, 2009

Date missing when query with timestamp

The date datatype column in database is rather misleading. This is because it can store 2 types of format. One is without the timestamp (01/01/2009) and the other is with timestamp (01/01/2009 12:00:00 PM). Both format can store in the same column!

The problem is when programmer code their program on the first view of that date column. Let say it currently stored (01/01/2009) and the query will follows as "... where datecolumn = to_date('01/01/2009', 'DD/MM/YYYY' and ....".

Unfortunately, the other programmer thought that seems the column is a date field, he might just store the current date ('01/01/2009 12:34:56 PM') or sysdate which have timestamp. This will leaad to the first programmer's query unable to work because "01/01/2009" represent "01/01/2009 0:00:00 AM".

The solution for this problem is to format all date query to same format (e.g. "DD/MM/YYYY").
Example: "... where to_char(datecolumn, 'DD/MM/YYYY') = '01/01/2009' and ..."

(imagine if you have 1000 date query in a procedure, that will be pain in the butt)

Or just ask the database vendor to make up their mind, that the date datatype should and only should have one format.

Or database vendor create another date datatype. One with datetimestamp, one without.

Therefore, everybody live happily ever after.

Tuesday, January 6, 2009

SQL condition on combined column

I got a strange finding on Oracle SQL today. Just take the example table below.

Column1 Column2
A B
A C
B A
B C
C A
C B

If I want to do a query to remove the third row only (B follows by A). Below is a query I would think of.

Select * from TableAbove where (column1 <> 'B' and column2 <> 'A');

Somehow the query removes all rows with A in column1 and B in column2, which is not I want. The expected result should be only the third row to be removed.

The solution I found so far, which is rather simple is to concatenate both column into one.

Select * from TableAbove where column1 || column2 <> 'BA';

The query is rather ironic because to select only a specific row, we use equal sign (e.g. column1 = 'A' and column2 = 'B'). To remove that specific row, replacing the equal sign (=) into not equal sign (<>) does not reflect the opposite behavior.

Perhaps there are some server setting to allow combined column condition queries. But for now, the concatenated column query at least solve my problem. :P