- the address tags verification.
- the address parsing and elements verification.
- incorporate results to dashboard.
Thursday, January 31, 2008
XML-DB Mapping Project Is Done
Exception:
Wednesday, January 30, 2008
Edwards Ends Second Run for White House
According to NPR: Edwards ends his campaign for the White House.
So depressing... the Dem's horse race is not going to be exciting anymore.
So depressing... the Dem's horse race is not going to be exciting anymore.
Tuesday, January 29, 2008
Monday, January 28, 2008
Back To SoCal
Arriving at ONT at 10AM, show up at the office around 11:30AM.
While finishing the NGS Policy XML - database verification, I uncorked nasty application behavior. Consider:
Normally this XML is transformed into:
But nooooooo, the wise developer did this instead:
Now I have to think about catching the wrench before it hits the wheels.
Anyway, mum bought a big painting on Sunday. Since it didn't fit into Lisa's car, I was volunteered to transport the items.
I managed to get some rest around 10PM.
Long day - it is.
While finishing the NGS Policy XML - database verification, I uncorked nasty application behavior. Consider:
<party>
<name>Acme</name>
<address>Address1</address>
<address>Address2</address>
</party>
Normally this XML is transformed into:
Party table | |
---|---|
PartyID | Name |
1 | Acme |
Address table | ||
---|---|---|
AddressID | PartyID | Address |
1 | 1 | Address1 |
2 | 1 | Address2 |
But nooooooo, the wise developer did this instead:
Party table | |||
---|---|---|---|
PartyID | Name | Addr1 | Addr2 |
1 | Acme | Address1 | Address2 |
Now I have to think about catching the wrench before it hits the wheels.
Anyway, mum bought a big painting on Sunday. Since it didn't fit into Lisa's car, I was volunteered to transport the items.
I managed to get some rest around 10PM.
Long day - it is.
Friday, January 25, 2008
Thursday, January 24, 2008
I Am Swimming Through Haze
It was cold this morning .... I had severe headache from waiting in the platform for only 5 minutes, and napped through the trip.
Work was all about broken logic and fighting viral influences.
Work was all about broken logic and fighting viral influences.
Wednesday, January 23, 2008
Laziness Has It's Virtue
Yesterday, I blogged OCTA's scheduling mishap and boing2 just posted this: Mathematics of waiting for the bus.
Why Convert XML Data To Hash Structure Using XML::SAX?
Instead of using XML::Simple? The structure, generated by XML::Simple, is not consistent since it recognizes an empty tag as empty hash structure, instead of null string.
- Consider this XML data:
<Order>
<Number>01234</Number>
<Status />
</Order> - Using XML::Simple produces:
$VAR1 = {
'Order' => {
'Status' => {},
'Number' => '01234'
}
}; - Utilizing XML::SAX, we could insert a null string instead of an empty hash structure:
$VAR1 = {
'Order' => {
'Status' => '',
'Number' => '01234'
}
};
Tuesday, January 22, 2008
How To Slow Cook A Piglet
This is how the pieces are glued together:
- Consider the original XML data:
<Order>
<Number>01234</Number>
<Status>OPEN</Status>
</Order> - The XML data is translated into Perl data structure, utilizing XML::SAX(why?):
The unordered hash index will not mangle the report anymore since:$VAR1 = {
'Order' => {
'Status' => 'OPEN',
'Number' => '01234'
}
}; - Along the way (of parsing XML data using XML::SAX), a report template is created with references at the right places.
Status Notes <Order> <Number>01234</Number> ${$REPORT[0]}{'RESULT'} ${$REPORT[0]}{'NOTES'} <Status>OPEN</Status> ${$REPORT[1]}{'RESULT'} ${$REPORT[1]}{'NOTES'} </Order> - To the bridge the result of comparison and the report template, another data structure is created (will be called: bridge) and it has an exact hash structure as the XML data, but it is holding references to the report template.
$BRIDGE1 = {
'Order' => {
'Status' => '$REPORT[1]',
'Number' => '$REPORT[0]'
}
}; - Consider the check data for the XML data above:
Readability is the main reason the check/validation is written in XML format.<Order>
<Number><SQL>'SELECT Status FROM Order WHERE ORDER_ID = <value>'</SQL></Number>
<Status><SQL>'SELECT OrdNum FROM Order WHERE ORDER_ID = <value>'</SQL></Status>
</Order> - Converted to Perl data structure using XML::Simple
$CHECK1 = {
'Order' => {
'Status' => { SQL => 'SELECT Status FROM Order WHERE ORDER_ID = <value>'},
'Number' => { SQL => 'SELECT OrdNum FROM Order WHERE ORDER_ID = <value>'},
}
}; - Iterating through the XML hash structure, while maintaining same path of traversal with the bridge and check hash structure:
$XML{'Order'}
-> $BRIDGE1{'Order'}
-> $CHECK1{'Order'}
$XML{'Order'}{'Status'}
-> $BRIDGE1{'Order'}{'Status'}
-> $CHECK1{'Order'}{'Status'} - Find the end of XML hash structure branch to extract the value.
if (ref($XML{'Order'}{'Status'}) eq "") {
$XMLValue = $XML{'Order'}{'Status'};
} - Get the SQL syntax from check hash and get the content from database.
if (exists $CHECK1{'Order'}{'Status'}{'SQL'}) {
$SQL = $CHECK1{'Order'}{'Status'}{'SQL'};
}
else {
# bitch later: no SQL defined.
}
$DBVALUE = getValue($SQL); - Compare the content from XML hash structure and database and write the result out to $REPORT[$index], which provided by bridge hash.
if ($XMLValue eq $DBVALUE) {
eval "\${".$BRIDGE1{'Order'}{'Status'}."}{'RESULT'} = 'PASSED';";
eval "\${".$BRIDGE1{'Order'}{'Status'}."}{'NOTES'} = '$NOTE';";
}
else {
eval "\${".$BRIDGE1{'Order'}{'Status'}."}{'RESULT'} = 'FAILED';";
eval "\${".$BRIDGE1{'Order'}{'Status'}."}{'NOTES'} = '$NOTE';";
} - After traversing all of the branches of XML hash structure, open the report template and evaluate template, producing:
Status Notes <Order> <Number>01234</Number> PASSED <Status>OPEN</Status> PASSED </Order>
Scheduling Mishap
Oh boy...
Stepping out of Metrolink #682 only to find the buses were gone. The train was only 5 minutes late! I was wondering, these buses were supposed to be there for us (the Metrolink riders), if they decided to depart without us, we needed to wait for another 1 hour for the next one.
What were those people thinking?
Luckily, the next OCTA 471 SB arrived early and the driver decided to send us to work immediately, rather than waiting for another 40 minutes. Others were not so lucky: one of our developer decided to walk and the bus passed him. Tried to help, but the bus couldn't make safe stop for boarding. The others (470) were still waiting when we departed.
Stepping out of Metrolink #682 only to find the buses were gone. The train was only 5 minutes late! I was wondering, these buses were supposed to be there for us (the Metrolink riders), if they decided to depart without us, we needed to wait for another 1 hour for the next one.
What were those people thinking?
Luckily, the next OCTA 471 SB arrived early and the driver decided to send us to work immediately, rather than waiting for another 40 minutes. Others were not so lucky: one of our developer decided to walk and the bus passed him. Tried to help, but the bus couldn't make safe stop for boarding. The others (470) were still waiting when we departed.
Monday, January 21, 2008
Need To Glue All of The Pieces Together
These items are created:
- Data - contentRef.conf (PDS)
- Report.Template.html (HTML)
- Bridge - reportRef.conf (PDS)
- Report.html (HTML)
Sunday, January 20, 2008
Weekend In Simi Valley
Saturday, January 19, 2008
Work Work Work
Alright, someone is replacing a network card on production system. Conducting test to see if there is any interruption of service.
Testing is done at 11:30 and the systems is good.
Testing is done at 11:30 and the systems is good.
Subscribe to:
Posts (Atom)