Wednesday, December 3, 2008

Visual Sudio Encodings

UTF-8 is great. I like anything that takes the hassle out of thinking in regional characters and stuff.

But older software doesn't know about UTF-8... particularly Oracle SQLPlus.

When I added a sql script to my project, if I call sqlplus with it I receive a nice error:
"SP2-0734: comando desconhecido comeτado por "∩╗┐set ser..." - o resto da linha foi ignorado."

Even if you don't know portuguese, you can guess the error (not even the error message is printed right...)

The problem is the first 3 bytes of an UTF-8 file are EF BB BF, and SQLPlus doesn't like it...

For now, I don't have a solution, just a work-around: in Visual Studio, open the file with an external program (notepad to the rescue) and save it as ANSI.

Does anyone know how can I tell Visual Studio to save that particular file with a different encoding?

Wednesday, November 12, 2008

OLPC G1G1 coming to Europe Nov. 17

OLPC News: Breaking News: G1G1 coming to Europe Nov. 17

To buy or not to buy?

Can I convince my wife? That is the real question...

Monday, November 3, 2008

IDictionary options - performance test - SortedList vs. SortedDictionary vs. Dictionary vs. Hashtable

Long time no writing...

Well, just for reference, here is a nice benchmark about these types.

Monday, September 8, 2008

Dazed and Confused

Sometimes things just make you wonder if anything is worth it...


Sleep well Alex, I'll miss you...

Tuesday, August 26, 2008

Photo Tourism / Photosynth

Photo Tourism is a project from some brilliant guys at University of Washington and from Microsoft Research. Microsoft showcased some videos a while ago and finally some days ago released Photosynth.
In a word: incredible.

Finally the guys at CSI can say they use an incredible piece of software that really exists.

If you are a Windows guy, go to photosynth.com. If you use Linux, go here. If you are agnostic(Java), here.

Be patient... its worth it.

Friday, August 22, 2008

dateTime deserialization in .Net

The problem:
We created a webservice in .Net to implement a contract with a supplier. Among other things, we receive dateTimes. These dateTimes represent a point in time in another country (for instance, an accident occurred at 15:00 in Spain).

What happens:
when we receive the message, the deserialization engine converts the dateTime to a DateTime, assuming local time. So, we get 14:00. All information about the original timezone is lost.

The solution(s):

  1. Change the WSDL to receive another parameter (timezone) -> NOT AN OPTION. We don't own the contract.
  2. Add a new table and code on our side so we can compute the timezone ourselves, according to the original country.
  3. Guess the correct timezone
  4. Implement the webservice in another platform, like Java (deserializes dataTime to java.util.Calendar).

If you have other solutions, please give me a note...

Tuesday, June 17, 2008

My experience with WM6

After a month using a windows mobile device, here are my first impressions:

Pros:
  • Good screen, very bright, can read it even in sunlight
  • New applications I didn't have in palm
  • HTC interface, you can dial your favorite contacts very fast
  • All in one: GSM, GPS, WIFI, 3G
  • small and lightweight


Cons:
  • Slow, very slow interface compared to my T5
  • When I disconnect the device, the app that was running goes to the background
  • Clumsy windows interface - to lauch an aplication I have to tap on the screen lots of times
  • Some itches - calls dropping frequently, system freezes sometimes
  • Missing some apps I had in palm
  • To send an SMS, I have to tap 4 times on the screen, just to start writing... and this is because I have the SMS app to launch on pressing the GPS button... the guys at HTC forgot this is still a mobile phone, and sometimes you want to text someone...

Overall, I'm happy with my Touch Cruise. As soon as I install VS2008, I'll try to do some useful things, like porting some apps I really got used to. And yes, you still have more useful apps in PalmOS than Windows Mobile.
Here is a little table with the apps I used in PalmOS and the apps that I'm using in WM6:
PalmOSWM6Comment
HandyShopperHandyShopperThat was easy. Someone had the excellent work of porting it to WM
Aqua Dive Log
-
Still couldn't find an app to replace it :-(
pFuel
- (excel)
Still couldn't find an app... I'll probably have to create an Excel sheet
PunchClockPro
-
This one I REALLY miss... does anyone know a decent timekeeping app?
cotoGPS
-
Still need something to trace my routes...
Progect
ADBIdea
It is not a great replacement, but does the job
Keyring
KeePassPPC
Great Upgrade
FreeCoins
Pocket Finance Diary Lite
Looks promising
Filez
Total Commander
very decent

But what I really don't like is Windows Mobile interface... why the hell the guys at Redmond still think a Windows-like interface is good in an hand-held device??? IT IS NOT!!!
If I want to run any application, I have to click Start, then Programs, then scroll searching for the app... and why the heck is copy/paste dependent on the application? We should have it everywhere... It is a pain inputing some text that you want to copy, just to find out you can't... and I have to find some software to use strokes, something they also forgot... and if I'm using an app, if the devices disconects after a minute or whatever you configure, when you connect it again you want the same display, get it?
I hope they finally abandon the stupid windows interface and create a new one in WM7. HTC Cube helps, but it is not enough.

Feel free to give me pointers to other useful software.

WinSaaS

My good friend Miguel Ribeiro has decided to became an entrepreneur. After a year of hard work, his baby has seen the light.

Meet WinSaaS. And HotelASP. And SaasLight.

WinSaaS is a software-as-a-service host.

HotelASP is an Hotel management and reservation application running on WinSaaS.

SaasLight is a CRM application running on WinSaaS



Feel free to register and mess around. Try it out. It looks very promising.

If you want to contact Miguel you can drop me a message or use the contact options on WinSaaS.


Thursday, May 8, 2008

The big step

This week I gave a big step. It a was a big change in my life, a new starting point:


I bought my first PocketPC! (and got married, but that is not important right now...)


After years of being faithful to Palm, I changed... because Palm didn't.

I choose the HTC Touch Cruise. It has everything: GPS, 3G, Wifi, etc.
As an added bonus, I bought one edition bundled with NDrive.

Guess I'll make a review of both in a few weeks.

Tuesday, April 8, 2008

Google App Engine

The guys at Redmond must be very upset... Yahoo keeps saying no, Google keeps sending jabs to the lower torso...

the plan to conquer the world is getting bigger...
Official Google Blog: Developers, start your engines

Monday, March 24, 2008

Rip Palm T5

My palm T5 is no more.

It has ceased to be, bereft of life, it rests in peace, it has kicked the bucket, hopped the twig, bit the dust, snuffed it, it has expired and gone to meet its maker, it has shuffled off its mortal coil.

It is an ex-palm.

I have an history of almost 9 years using palm devices. From IIIx to Zire 71 and from there to Tungsten T5.
The IIIx endured a lot, I used it for 4 years, before an unfortunate accident between the screen and my fist ended its life.
The Zire was the replacement, and it worked great, util another unfortunate accident, this time completely accidental, between my elbow and the screen (again the screen). Lessons learned: don't have you PDA laying around in the middle of papers; buy a hard case)
I bought my refurbished T5 on ebay in 2005, and I've been using it until now, allways having a mediocre battery life.

Last week, my palm refused to leave the logo screen, with a dreaded line blinking on top of the screen. I've even tried the peculiar way of doing a cold reset; there are two ways, one is easy, the other is good for aliens with 12 fingers and 3 hands. But nothing worked. A quick search and I found that I was not alone, and there were no hope.

So now I have a dilema... what to do?

As for palm platform, I think I got to the end of the line. The OS is outdated, the divices all have keyboards, the applications are getting expensive. Time to move on.
As for pocket pc, there are more options in terms of hardware. The compact framework makes it simpler to develop applications, but the core OS is still windows...
As for symbian, I know very little about it... and the little I know, I don't like... I want to develop what I want in my mobile, and don't want anyone to sign it for me...
As for android, it doesn't exists yet...

So, do you have any recomendations?

Monday, March 3, 2008

Google Maps vs Live Search Maps vs Yahoo Maps

Microsoft finally became an option on mapping solutions in your browser, for people living in Portugal. And it came to business with a bang, giving you Bird's eye view for all of Lisbon and surroundings! It is very cool!!!
For that it deserves a peek. Go search your house, and see it in different angles!

but if you want to calculate routes, search for things, Google is still the king. But they have the most outdated route info!!! THEY ARE STILL MISSING MY ROAD!!! GO GET SOME DECENT DATA!!!! GET NAVTEQ!!!

And what about Yahoo? To me, it looks like it is getting behind... let's see what the future brings.

Thursday, February 7, 2008

Clarifying things about CI Factory

For the first time I annoyed someone in my blog. And for starters, such an high profile person as Jay Flowers.
He was a little annoyed about my last post.

Just to clarify things, because I don't want to annoy anyone, here is a little more explanation into the problems I found:
  • before the installation:
    • We don't use Subversion. We are a Microsoft shop, so we are still using Visual Source Safe. I hate it, but that's how it is. CI Factory supports VSS, but it assumes you have a database per project. That is not our case, we have a central database with all the projects. I resolved this problem with a simple hacking into a couple of files. Problem resolved.
    • CI Factory relies on Winrar to create packages to deploy to the project folder. We don't have a license of Winrar. I didn't want to use it, so I wanted to replace it with a free alternative. Enter 7Zip. This took a lot more work, because 7Zip has less options than Winrar and has a curious way of creating SFX, but eventually i managed to do it. Problem resolved.
Edit: None of these are CI Factory problems. They were my problems, and I adapted CI Factory to work the way I wanted. Long live Open Source.


  • after the installation:
    • Trash on the source control - before I even put my source files under source control, I already had 32.498.777 bytes in 507 files under 282 folders. This looks like a lot. In my humble opinion, most of this should not be under source control. Only build scripts, config files and similar things should be there.
    • Project Structure messy - this is tied to the previous item. CI Factory creates the following structure:
      • /<Project name>
        • /Current
          • /Build
            • /lots of folders
          • /Product
            • /Install
            • /Production
            • /Unit Test
          • /Third Party
  • Your code should go under /<project name>/Current/Product/Production. It's just my opinion, but it looks a little hidden. With time you get used to it, but for starters looks like you are digging for your source. And under /<project name>/Current/Build is where I think things get messy. Under this folder are the executables to several programs (CCNet, nAnt, Simian, etc), temporary folders, log files, reports, etc. I know everything is related to build, but it is not organized. If it is not organized, it is messy. And I think support tools should be in Third Party, or something similar.
    • One CCNet server for every project - if you have 30 projects under Cruise Control (as we have), having a CCNet for every project makes it a little hard to maintain everything, if you want to upgrade your server the task is going to take longer and is more prone to error. I know there is upgrade.bat, but I have to run it for every project I have...
    • Replication - taking the example of our 30+ projects, you get several hundred megabytes of replicated stuff across projects. I know hard disk is cheap, but I personally don't like to have things replicated in that manner (and it is a burden to maintain).
In conclusion, if you are starting a new project, you don't have old projects to maintain and you are creating a new structure, give CI Factory a try.
If you already have lots of projects to maintain, CI Factory is not for you.

And that is my opinion.
I think now it is clearly explained.



PS: this reminded me that I forgot to add info about me. Now you can know my face.


Powered by ScribeFire.

Wednesday, February 6, 2008

CI Factory

I tried to get CI Factory to work on my project, but I found some problems...

To help setup me project, I followed this very nice show on dnrTV by Scott Hanselman and Jay Flowers.

Problems encountered:
  • Using VSS and not having my project on the root of the source control
  • Not using WinRAR
For the first problem, I had to hack into Properties.xml and SourceControl.Target.xml under Packages/VisualSourceSafe folder to add a new properties with the full path under VSS.

For the second problem, I hacked into a lot of files to replace WinRAR with 7Zip. As 7Zip has a peculiar way to create SFX files, I had to create 3 batch files to help 7Zip do the task.

After a lot of testing, the project finally build!

But when I say "the project", I should have said "the project skeleton". Without my source code, I'm already worth almost 30MB on disk... no code, only build scripts and support tools. And only Simian!

Problems:
  • you get lots of trash on your source control (build scripts is one thing but the binaries of nAnt, Simian, etc, is a bit overkill)
  • the project structure looks a little messy
  • you have one CCNet server for every project
  • you have lots os replicated things across projects
I decided to quit CI Factory. I think it is too complicated to maintain. There are loads of third party tools to watch out, and you have to change a lot if you already have some projects going.

In a future post, I'll write about our CCNet.

PS: if you want to see the changes I made to CI Factory, drop me a line.


Powered by ScribeFire.

Project Structure (re-revisited)

In the past few weeks, I've been researching what is the best structure for a project.

I found these aproaches:
  • SubVersion
    • /myproject
      • /trunk
      • /tags
      • /branches

Your development is done in “trunk”. When you want to do a release, you create a branch, for example “myproject/branches/release2.0”.
The development is still done in “trunk”. In “branches”, you only do maintenance.
If you want to label a particular development stage, you create a tag: “myproject/tags/RTM”
An advantage of SVN is that it stores only the deltas, so you don’t have everything replicated.

  • Microsoft Team Foundation Server
    • /MyTeamProject1
      • /Development
        • /FeatureBranch1
          • /Source
            • /MyApp
        • /FeatureBranch2
          • /Source
            • /MyApp
    • /Main -Can contain solution (.sln) files
      • /Source
        • /MyApp1 - Contains MyApp1.sln file
          • /Source - Contain folder for all source
            • /ClassLibrary1 - Contains ClassLibrary1.csproj
            • /MyApp1Web - Contains Default.aspx
          • /UnitTests - Container folder for unit tests
            • /ClassLibrary1Tests - Contains test project and code
            • /MyApp1WebTests - Contains test project and code
        • /SharedBinaries - Shared binaries e.g. libraries
        • /SharedSource - Shared source code
      • /Docs - Contains product documentation
      • /Tests - Container for tests
        • /FunctionalTests
        • /PerformanceTests
        • /SecurityTests
    • /Releases
      • /Release1 – Maintenance
        • /Source
          • /MyApp
      • /Release2 – Maintenance
        • /Source
          • /MyApp
      • /Release3 – Current release lockdown
        • /Source
          • /MyApp

I think this was inspired by SVN. All your development is done in “Main”. When you want a release, you branch it to “Releases”.
If you want to develop a special feature, or test another approach to your code, you branch it to “Development”, but your main development branch is in “Main”.

  • Tree Surgeon
    • /TestProject
      • /lib
      • /src
        • /Core
        • /TestProjectConsole
        • /UnitTests
      • /tools
        • /nant
        • /NCover
        • /nunit

This is an approach started long time ago. It doesn’t account for project releases, or other branches.

I think I’ll adopt TFS. But using VSS:
  • $MyTeamProject
    • /Development
      • /TestingIdea1
        • /Source
          • /MyApp
      • /TestingIdea2
        • /Source
          • /MyApp
    • /Main
      • /Source
        • /MyApp
          • /Source
            • /ClassLibrary1
            • /ClassLibrary2
            • /ClassLibrary1Tests
            • /ClassLibrary2Tests
        • /SharedBinaries
        • /SharedSource
      • /Docs
      • /Tests
        • /FunctionalTests
        • /PerformanceTests
        • /SecurityTests
    • /Releases
      • /Release1 – Maintenance
        • /Source
          • /MyApp
      • /Release2 – Maintenance
        • /Source
          • /MyApp
      • /Release3 – Current
        • /Source
          • /MyApp

The problem is that everything is replicated when you do a branch… oh well, as they say, hard-disks are cheap…

I’m still trying to get CI Factory to work. More of that in another post…



PS: This is a re-repost. Only ScribFire didn't messed the layout... and mine doesn't have the option the remove this irritating line...
PS2: Broken again... ARGGGHHHHH

Powered by ScribeFire.

Why I hate SAP

SAP is a kind of dinosaur, except for being extinct... unfortunately, if I may add.

I cannot conceive of a corporation, in 2008, that still uses a licensing method of the XX century...
And to use an idiotic piece of software that requires Visual Studio 2003...

And in 2006, their official response was:

"SAP currently has no plan to release a .NET connector version that will support Visual Studio 2005. A road-map regarding .NET connectivity to SAP systems will be published soon."

ARGGHHHHHH!!!!

Friday, February 1, 2008

Microsoft after Yahoo

It's official, Microsoft wants Yahoo under its belt.

Microsoft offers $44.6 Billion for Yahoo - Engadget

Powered by ScribeFire.

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?