Showing posts with label development. Show all posts
Showing posts with label development. Show all posts

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?

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.

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.