browse by category or date

My car had a breakdown yesterday. My wife was driving the car alone when suddenly the engine lost its power. Luckily my wife was able to manoeuvre the car to the roadside. Safely parked the car, she then realized that she didn’t bring her phone.

After managed to borrow a phone from a female passerby, she called her own phone hoping that I will pick it up. Sadly, I was taking a nap at home and her phone was on silent mode. After calling more than four times, my wife gives up. Seeing this, the kind lady asked my wife where does my wife lives. Since our house is quite near, the kind lady offered my wife a ride home.

Reaching home, my wife woke me up then explain what has happened. It was late afternoon, so we thought that no workshops are still open except Shop&Drive. Since we didn’t know their contact number, my wife asked one of her friends who is a regular customer there. Too bad, my wife’s friend also didn’t know Shop&Drive’s phone.

So the three of us rode my motorbike going to the nearest Shop&Drive. After telling them the situation, the mechanic suggested that the car’s battery is flat and need replacement. At first we objected, because the battery’s age is just slightly over one year. Then the mechanic argued that we might be just unlucky, to have a battery with a short life. I guess we had no other choice but to replace the battery.

So the four of us rode motorbikes to the roadside where my wife parked the car. The mechanic brought with him a new battery. A million rupiah later, my car alive with the new battery.
Only then the mechanic told us that our car didn’t charge the battery properly. Ouch!

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

One of my favorite band on planet earth, Muse, has just released their latest single in YouTube.

Within less than 24 hours, the video is already garnered almost 1 million views.

I found the music is very similar to Muse’s earlier works (Showbiz, Origin of Symmetry). It’s refreshing, considering their recent experiments with electronics and orchestra. As expected, the single resulted in polarized sides between fans of Muse’s older works, and fans of recent works. Just look at this video’s YouTube comments, people are calling each other idiots there 😀

Personally, I like it. Anything with good guitar riffs is acceptable in my ears.

One thing that I slightly regret is the usage of F-word. I can’t remember of Muse using F-word other than in “Panic Station”. It means this song will be excluded from my car’s playlist. Other thing that I found weird is the voice of the soldier, screaming to answer the Sergeant’s abusive words. Is that Dominic Howard’s voice? Only from his screaming-voice I almost can visualize how skinny he is 😀

What do you think of Muse’s latest single?

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

At the beginning of every month, my Ops executive colleague always send me email, asking for a report on jobs carried out last month. I would then open up my Oracle Developer window, run query, export the result to Excel, then mail it back to him.

The query look something like this:

select *
from TBL_Job
where CreateDate >= to_date('01 Feb 2015', 'DD MON YYYY')
and CreateDate < to_date('01 Mar 2015', 'DD MON YYYY')

I've been thinking of moving this report to our Jasper Server. This way I can schedule the report to run, then automatically mail the result in Excel format. In order to do that, I need to change the query. And that's where the TRUNC function comes to shine.

Trunc (short for truncate), will strip any extra value from a DateTime type. You can think of it as Floor (round-down) function for a DateTime type.

E.g. If you just apply Trunc to a DateTime, it will strip away the Time value.

select Trunc(sysdate) from dual; 
--Output: 13-MAR-2015 00:00:00

You can also specify how far the truncation will go

select Trunc(sysdate, 'MONTH') from dual; 
--Output: 01-MAR-2015 00:00:00

Other useful examples of Trunc:

-- First day of this year
select trunc(sysdate, 'YEAR') from dual; 
-- Output: 01-JAN-2015 00:00:00

-- First day of this quarter
select trunc(sysdate, 'Q') from dual; 
-- Output: 01-JAN-2015 00:00:00

-- First day in the quarter of 18 Aug 2015
select trunc(to_date('18 AUG 2015','DD MON YYYY'), 'Q') from dual; 
-- Output: 01-JUL-2015 00:00:00

-- First day of this week
select trunc(sysdate, 'W') from dual; 
-- Output: 08-MAR-2015 00:00:00

With this information, we can replace the original query

select *
from TBL_Job
where CreateDate >= trunc(trunc(sysdate, 'MONTH')-1, 'MONTH')
and CreateDate < trunc(sysdate, 'MONTH')

This way, at any time we run the query, it will always return last month data.

I hope it helps,
Cheers

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant: