Archive for July, 2009

Email server IMAP, POP & SMTP

July 7, 2009, Posted by admin at 1:40 pm
Just finished setting up my old pc to windows xp which i used for the whole duration in university. I want my own mail, ftp, ssh, cvs and web server. I just got mail server installed. After googling around, i saw pegasus, but dismissed it thinking it was only a mail client and Mecury, was only a MTA like sendmail. After googling more, about.com had a comparison on pegagus listing smtp, pop and imap support. pegasus
Read More

Upgraded to Roller 1.0

July 7, 2009, Posted by admin at 1:23 pm
just upgraded to roller 1.0, the site was down quite a while, thought it was a temporary shutdown due to technical issue, and suddenly today, whoa! new roller app :). Cool! (more...)
Read More

J2EE container marking a class as unavailable, good or bad?

July 6, 2009, Posted by admin at 5:32 am

I spent another frustrating 1/2 day trying to fix a ‘problem’ , a NoClassDefFound. Initially was only deploying the class to web directory then decided it need to be in the ejb classpath too, put it there, still to no avail, touched the file so that it will be updated and hope that it works, to no avail. I must have a missed an ibatis misconfiguration done by a new developer in the office but showed when i was running the app, because using oc4j, it will only show once the error and ‘marks’ the class as unavailable. Subsequently running the app, bloody NoClassDefFound error keeps coming up. Looked at log files, seeing the last few lines, it was the reporting the same thing as the error page generated by oracle.
Read the rest of this entry »

Read More

Home renovation [not Java]

July 5, 2009, Posted by admin at 2:49 pm

Been busy last week and this week preparing the house. Removing parquet from the bedroom, it’s quite hot at night, because of the direct sun coming through the windows of the bedrooms and the wood soaking the heat. Started removing parquet on wednesday night, slowly prying it off from the floor. However couldn’t do much because they were quite firmly stuck to the ground. Soaked the floor with water, for a few days, then on saturday from 10am to 2.30 pm managed to remove about 2/3 of the master bedroom parquet. I wanted to get all parquet removed by evening however the progress was too slow, it wouldn’t have finished even by sunday evening with my hand swollen a little. Called my uncle to get a couple of his workers on sunday afternoon, we did the whole removing thing , which finished at 6 in the evening.

Read More

Calling an Oracle procedure function using Ibatis

July 4, 2009, Posted by admin at 2:49 pm

The ibatis documentation provides a sample on how to call a procedure, but how do you call a function in Oracle? The code sample shows it.
<parameterMap id=”getSomeFunction” class=”java.util.Map” >
<parameter property=”question1″ jdbcType=”INTEGER” javaType=”java.lang.String” mode=”OUT”/>
<parameter property=”question2″ jdbcType=”VARCHAR” javaType=”java.lang.String” mode=”IN”/>
<parameter property=”question3″ jdbcType=”INTEGER” javaType=”java.lang.String” mode=”IN”/>
<parameter property=”question54″ jdbcType=”VARCHAR” javaType=”java.lang.String” mode=”IN”/>
<parameter property=”question5″ jdbcType=”VARCHAR” javaType=”java.lang.String” mode=”IN”/>
</parameterMap>
<procedure id=”getSomeFunction” parameterMap=”getSomeFunction”>
{? = call FNC_EXECUTE_SOME_FUNCTION(?, ?, ?, ?)}
</procedure>

Read More

Net8 Connection Manager to connect to Remote Database

July 3, 2009, Posted by admin at 1:44 pm

Finally I managed to connect to the remote database using Oracle Connection Manager, after struggling for almost a week. The requirement requires the Oracle connection and firewalls. A remote Oracle client making a connection to an Oracle database can fail if there is a firewall installed between the client and the server if port redirection is taking place.The firewall will block the connection to the new port when the Oracle client connects to the database  ORA12203 or ORA-12535 or ORA-12564. The client connection failure is due to port redirection from the Database Server‘s operating system. Port redirection requires the client to connect to the database using a different port than originally configured in the configuration files. Actually, it is not difficult if you know but overall took me few days ding dong here and there trial and error where to place the CMAN and wat IP address to use. Many thanks to Prince Amin who show me the Network Structure and advice me to place the CMAN at the Remote Site. I was blur at that time. Two heads is better than One !!!! Prince Amin, I owe you dude…..
Read the rest of this entry »

Read More

Interpreting TKPROF Output

July 3, 2009, Posted by admin at 1:42 pm

Sample TKPROF Out from a sample trace file.

call count cpu elapsed disk query current rows
——- —– —— ——- — ——– ——— - — — — — Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 1.20 1.21 0 86091 4 15
——- —– —— ——- — ——– ——— - — — — — total 4 1.20 1.21 0 86091 4 15

1. A high (near 100%) parse count to execute count ratio when the execute count is greater 1 – if ratio is 1, then the query is parsed each and every time its execute and that needs to be corrected. The ratio should approach zero. The ideal is parse count should be 1 and execute count would be higer. If high parse count this indicate the query performing many soft parse.
Read the rest of this entry »

Read More

Mathematical constants

July 1, 2009, Posted by admin at 6:00 am

Here is an overview of the mathematical constants in PHP

Constant Exact value Description
M_PI                    3.14159265358979323846          The value of (Pi)
M_E                      2.7182818284590452354             E (Euler number)
M_LOG2E           1.4426950408889634074            log2 e
M_LOG10E        0.43429448190325182765          log10 e
M_LN2                0.69314718055994530942          loge 2
M_LN10              2.30258509299404568402        loge 10
M_PI_2               1.57079632679489661923         pi / 2
M_PI_4               0.78539816339744830962        pi / 4
M_1_PI               0.31830988618379067154         1/pi
M_2_PI               0.63661977236758134308        2/pi
M_2_SQRTPI    1.12837916709551257390         2/sqrt (pi)
M_SQRT2           1.41421356237309504880          sqrt (2)
M_SQRT1_2      0.70710678118654752440        1/sqrt (2)

Until M_PI constants are only available from PHP 4.0.

Read More