Thursday, January 31, 2008

nuvifone

It looks incredibly cool!
Get the first look here. There are no details yet, but if it runs Android, I WANT ONE!!!!!!!!!!

Found about it here.

Wednesday, January 16, 2008

Timelines

My friend Sam called my attention to an article in LifeHacker about Timeline.
It is very cool, you just need to get your hands dirty on XML to create the data... it is a great project to integrate this on my PDA... when will I have the time to do it??

PS: Sam, you reminded me I already had ScribeFire installed... what i don't like about it is this last line it puts...


Powered by ScribeFire.

GROUP BY and just another column

We all love to create nice queries with GROUP BY to get spectacular data. Then, there is always someone who ask to put there another column... and all comes crashing down...
In Oracle, you usually have to rewrite your query.
Today, helping out a colleague, I found a neat sollution, introduced in 9i (yes, i'm not up to date...)
 
 A typical request from a customer...

"Show me lowest salary for each department..."

for which we can trivially code:

SQL> select deptno, min(sal)   2  from emp   3  group by deptno; 

then the customer adds "...and I need to see employee number as well"

(...)

In the past, this means sub-selects / inline views. But with some new analytic options in 9i, this becomes a trivial

SQL> select deptno, min(sal), min(empno)    2    KEEP ( dense_rank FIRST order by sal) empno   3  from emp   4  group by deptno   5  / 

Read it complete here.
 
 
Here are the 2 options to write the same query:
 
  • pre 9i
    • SELECT ASSIGNMENT, MAX(EMPLOYEE) KEEP (DENSE_RANK LAST ORDER BY EFFECTIVE) EMPLOYEE, MAX(EFFECTIVE) AS_OF
      FROM ASSIGNMENTS
      GROUP BY ASSIGNMENT;
  • post 9i
    • SELECT a.assignment, a.employee, a.effective
      FROM assignments a, 
      (SELECT assignment, MAX(effective) as_of FROM assignments GROUP BY assignments) a1
      WHERE a.assignment = a1.assignment
      AND a.effective = a1.as_of ;

Neat.

Thursday, January 10, 2008

Why I hate Microsoft Word

Yesterday I used Microsoft Word to post to this blog. I formated the layout of the post and published it. But when I opened my browser and pointed it at here, the layout was awful... so I copied the post from word to a gmail message and send it...

The result was ok, for a moment... when I saw the source, I couldn't believe my eyes...
It was full of things like these:

<div class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US" > In the past few days, I've been researching what is the best structure for a project.</span></div>

From this little example, I have a feeling that folks at the Word development team don't have a clue about CSS...

Tuesday, January 8, 2008

Labels

Does anyone knows of a good solution to label my posts, when I'm using mail-to-blogger?