Tuesday, January 15, 2008

Closing this blog for the time being...

It seems like publishing code on Blogger is still a little bit too time-consuming (I was expecting to find programming language specific formatting akin to CSharpFormat - http://www.manoli.net/csharpformat/ available as a plug-in) so I am closing this blog until I become aware of a significant improvement in this aspect.

In the meantime check out these links about Java Vs C#:

1) http://www.25hoursaday.com/CsharpVsJava.html
2) http://www.javacamp.org/javavscsharp/index.html

Wednesday, December 5, 2007

Scalable Vector Graphics (SVG) or XML graphics for the web

I was looking at SVG (Scalable Vector Graphics) as a format to save vector graphics and I found the results very interesting. The specification seems powerful and versatile so I run a little experiment with an old graphics of a boar taken from the Advanced Dungeons and Dragons 2nd Edition Monstrous Compendium Volume One, run a trace using Adobe Illustrator CS3 from the Adobe Master Collection CS3 (using trace defaults) and looked at the generated XML (a little bit "verbose") and final quality, what do you think?

Original JPG file:



SVG file: (oops, Blogger.com keeps filtering it out, any tips on to how to display it somehow?)

Tuesday, December 4, 2007

NTFS junctions and reparse points + UNIX symbolic links + iPhone sync + laptop use

On Windows XP you can create junctions resembling UNIX symbolic links using junction.exe, a Microsoft Sysinternals utility from Mark Russinovich:
http://www.microsoft.com/technet/sysinternals/FileAndDisk/Junction.mspx

If you wanted to use your fast desktop PC as a "better processing head" for your laptop disk mounted externally you could create a junction to your Firefox profile folder, or any other directory, and work with the same bookmarks without having to worry about directory synchronisation (an artificial example but a simple one to make the point).

Another tip: today iTunes is fairly inflexible in the way it allows you to pick directories to sync your Photos from and no iPhoto is available for Windows yet (although you can install a beta of Safari for Windows) so you could think about using junctions to circumvent the inherent limitations of the program. Think about it as you wait for the next iTunes update! What would be ideal would be "search folders" built directliy into Windows XP à la Windows Vista, without Windows Desktop Search, which in my opinion isn't as good as Copernic Desktop Search yet (for what I use desktop search for anyway).

Friday, November 30, 2007

Hello, world!

C:\Dichotunity>tree /f /a HelloWorld
Folder PATH listing for volume WinXP
Volume serial number is 748B-A612
C:\DICHOTUNITY\HELLOWORLD
+---C#
| \---Source
| HelloWorld.cs
|
\---Java
\---Source
HelloWorld.java


C:\Dichotunity>for %v in (HelloWorld\C#\Source\*.cs) do type %v

C:\Dichotunity>type HelloWorld\C#\Source\HelloWorld.cs
class HelloWorld
{
static void Main()
{
System.Console.WriteLine("Hello, world!");
}
}

C:\Dichotunity>mkdir HelloWorld\C#\Compiled

C:\Dichotunity>csc /nologo /out:HelloWorld\C#\Compiled\HelloWorld.exe /target:exe HelloWorld\C#\Source\*.cs

C:\Dichotunity>dir /b HelloWorld\C#\Compiled
HelloWorld.exe

C:\Dichotunity>HelloWorld\C#\Compiled\HelloWorld.exe
Hello, world!

C:\Dichotunity>for %v in (HelloWorld\Java\Source\*.java) do type %v

C:\Dichotunity>type HelloWorld\Java\Source\HelloWorld.java
class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello, world!");
}
}

C:\Dichotunity>mkdir HelloWorld\Java\Compiled

C:\Dichotunity>javac -d HelloWorld\Java\Compiled HelloWorld\Java\Source\*.java

C:\Dichotunity>dir /b HelloWorld\Java\Compiled
HelloWorld.class

C:\Dichotunity>java -cp HelloWorld\Java\Compiled HelloWorld
Hello, world!



Notable differences:

Java is stringent about the signature of the main method, the blog Rational Pi treats this topic well -> http://rationalpi.wordpress.com/2007/01/29/main-methods-in-java/

In Java, I could not execute the HelloWorld class from the C:\Dichotunity directory and needed to specify a class search path pointing to the Compile directory. I could execute the compiled .NET assembly by calling it from the command line, investigate why to learn about class search paths.

Environment variables

I am using Windows XP, the Microsoft .NET framework 2.0 and the Sun Java Development Kit 1.6 so I am adding the following directories to my PATH enviroment variable:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
C:\Program Files\Java\jdk1.6.0_03\bin

Start by adding the appropriate directories to your PATH environment variable too.

Welcome to Dichotunity!

Welcome to Dichotunity!

This is a blog about computer technology in general, with the occasional reference to .NET and Java put side by side.