Mac OS X and Vista and XP x64

February 27, 2008

After my boss using a Mac and me reading Applegeeks a lot I bought a MacBook (2 Ghz, 2GB Ram) last year. I switched my PC to Vista (x64) at the same time. And I must say:

I love my Mac. (Well it still has BootCamp but I’m rarely using it, thx to Wine).

I have been using Linux, XP, Vista and MacOsX Tiger last year and I really enjoyed just sitting in front of my Mac (its looking pretty). Everything I need I can get for it (Vim, D, perl is installed) or emulate. Even .Net development is easy.

Sadly it can’t run Freelancer, but neither can Vista (at least not in Multiplayer, I had avast installed and I won’t reinstall just for games). So I have been switching back to XP a lot. After I switched my Mainboard I had to reinstall Vista (and reactivate) but not XP x64 (not even reactivate).

I still think if it’s Windows you need, Xp x64 is the way to go, It has already the better memory management (I have 4GB RAM) and it’s got not that much trouble with root-kits or similar (they only attack the 32 Bit part). Every game works on it (FarCry looks better too) and it provides full Direct Sound acceleration.

Well I got an X-FI and thanks to ALchemy it works under Vista Direct Sound works under Vista, but any other Soundcard is just lost. The sound is sounding dead. I can make better FX with my mouth.
And Vista got another problem there, it randomly mutes speakers. (ALchemy/OpenAL is not affected). Sometimes my front speakers go off, sometimes the back, sometimes I just hear from the center. I have no idea what that is all about.

Stil Mac OS X is the way to go, it still looks prettier and after 2 days working with exposé you will miss it the rest of your life.

And its cheaper, too.

Advertisements

Sofu – SofuML

February 16, 2008

Got bored (again) and wrote SofuML and binary file support for Sofu.Net.

Don’t get me wrong, but I don’t like XML for saving structured data. XML is fine for doing layout and stuff, but if you don’t use proper indentation (as most exporters do) it looks kinda confusing. If you do indentation with tabs, it looks better, but than there is the whole white-space issue: Try saving a value with a leading whitespace, you can’t difference it from an indentation. Sure, you can use xml:space = “preserve” (20 or 22 more bytes in every element), but than you can’t use indentation again.

Than you will have to write the whole name of the element again in the closing tag, (more space used) Which only serves one purpose: To help the parser (or something). You can’t close any other tag than the last opened. This leads to XML elements getting named very short, which defies the whole readability purpose. (Anyone who has seen a MS-Word XML file will probably agree here)

One the other hand XML is a standard and the whole shebang around it has gotten quite powerful. XSLT (with XPath) is one example, no other data-format can be converted that easily (especially to produce HTML output).

That’s why I thought it would be neat to convert .sofu files to .xml files. and I called it SofuML. So you can transform it easily without having to code a program.

XML already brings a way to reference other element (in the same file) and the rest that is needed. (This will still keep the whole whitespace issue, but you can escape leading and trailing whitespaces. (The whole .sofu file will not be changed after being written and read again, but the final product after converting depends a lot on the parser)

Take this .sofu file for example:

somemap={
somelist=(1 2 3)
somevalue="Hello World"
}

Will be converted to this:

<Sofu>
<Element key="somemap">
<Map>
<Element key="somelist">
<List>
<Value>1</Value>
<Value>2</Value>
<Value>3</Value>
</List>
</Element>
<Element key="somevalue">
<Value>Hello World</Value>
</Element>
</Map>
</Element>
</Sofu>

This is not that nice and small, but you can use XSLT to convert it into HTML or even back to Sofu.

The XSLT to convert it to sofu is not complete, (I have found no way to escape keys and values if needed,) but it is funny anyways.

This is what happens if you put it through a compatible browser (IE or Firefox works great): http://sofu.sf.net/test.xml, also check “View Sourcecode” and you will see its just the XML file.


Sofu – Coding Mania

February 13, 2008

I had a coding attack this week and wrote a lot new stuff for Sofu:

First of all I finally finished (and documented) Data::Sofu and Config::Sofu which are currently processed by CPAN and should be there soon.

And to satisfy my coding needs I implemented the long planned Binary Sofu file format. Which can be streamed over 7-Bit only streams or just written to a file. The reader even autodetects binary files and reads them as if they were normal ones. Maybe later I could implement something like XMLRPC (maybe SofuRPC).

Then I went a coded Sofu.Net in about 2 days, my first “real” C# project. I had used C# only for study so far, but I was quite happy with the language. I think I should test some other languages as well, maybe a JSofu or one for Phyton. Sofu is a nice task to implement, most time was consumed by the documentation anyway.

Both can be downloaded at Sourceforge and http://sofu.sf.net.

By the way: Anyone noticed how hard it is to extract the in-line documentation of .Net Projects to a simple browse-able HTML page?

It took me 3 hours, first I tried NDoc, but that only works for .Net 1.1, then NDoc 2005. which assumed some strange directory structure and always wanted to have its files in my personal folder (Users\Maluku\AppData\Documentor ???) and only says to work on 2.0 (Didn’t work at all for me, even after I ported my project to .Net 2.0).

Next up was Microsoft Sandcastle, which is quite good with the extracting, but someone has to be punished for that User-Interface. So I tried Sandcastle-Builder, which said all went fine but it produced no output. (Or one empty file after some tweaking).

I tried DocProject next, but the web-page was slow as hell and made no sense to me.

Finally I got it to work with Sandcastle Help File Builder (from the same website), which looks like NDoc but works and produced:

One .chm file.

Which I couldn’t use to put on the Internet, so I had to extract that one (with chm2web.) which looks quite nice now.

Suddenly I came to realize why I love Perl so much. You just include your documentation using POD in the file and then run pod2html or pod2latex or pod2wiki or whatever you like on the file and you are done. That’s why the documentation for Data::Sofu only took about 30 Minutes (including building a .css and some frames around the generated .html files).