« May 2005 | Main | July 2005 »

June 20, 2005

.NET spelling

It could be confusing, but the correct spelling of .NET is with all upper case. Not .Net, dotNet or .net.

However the logo is actually .net with all lower case:

So what does this mean? Well use .NET unless you're using the Microsoft's logo.

Posted by vhadiant at 08:10 PM | Comments (0) | TrackBack

June 19, 2005

Piracy is Good

[Via Frank Arrigo]

A well written two part article by Mark Pesce:

Part 1: How Battlestar Galactica Killed Broadcast TV
Part 2: The New Laws of Television

This is interesting as the Australian FTA is still have no f'ing idea about it: Seven's desperate ploy looks lost on viewers

Even the "analyst" (Peter Cox, of Peter J. Cox and Associates) quoted in that article haven't got a clue what he's talking about, check this out: "Anyone can spoil it for themselves by looking at the internet but it's a bit like reading the last page of a book before you've finished it."

Either that's a misquote or one of the dumbest statements ever made it to the newspaper. What do you mean spoiled, of course people is not going to be spoiled. You don't download the last episode, you download it in order buddy. Take BSG for example, the entire first season is available for download, would you download the last episode? Of course not! And this is coming for the err ... "expert". If these are the "experts" that the Australian FTA are using then they're really screwed.

Forget FTA, use channel BT exclusively and you'll never turn back. Commercial FTA (excluding SBS and ABC of course, I'm talking about 7, 9, and 10 here) are only good for the live sports broadcast, TV news, aussie soapies/reality TV if that's your thing and that's about it.

Do it or die!

Posted by vhadiant at 01:07 PM | Comments (0) | TrackBack

June 18, 2005

DataRow deletion

Often you need to loop through the rows in a DataTable, pick up the invalid ones and delete them. This can be tciky because the Rows property in a DataTable is a collection and Delete() method actually removes the row from the collection, and this isn't good when you’re enumerating in a collection.


foreach (DataRow row in dataTable.Rows)
{
if (row.Id < 0)
row.Delete(); // Whoops not good, deleting the content of collection while enumerating it
}

This way also will cause problem:


for (int i = 0; i < dataTable.Rows.Count; i++)
{
if (dataTable.Rows[i].Id < 0)
dataTable.Rows[i].Delete();
}


This is because as soon as you call delete dataTable.Rows.Count will go down 1 as well since Rows is a collection. So how to do this? Well you can add all the rows that you want to delete into an ArrayList and delete it from there, but there's a better and more elegant solution for this problem. The key is the Select() method in the DataTable. The Select() method is very powerful and you can do pretty much almost any SQL constraints here and even some basic functions such as Trim().


DataRow[] rows = dataTable.Select("Id < 0");
foreach (DataRow row in rows)
{
row.Delete();
}

Posted by vhadiant at 12:13 PM | Comments (2)

June 14, 2005

How to add your own template on Visual Studio .NET

I've been wondering how to do this for a while, I know there's got to a be a way to add your own template in the "Add New Item" menu on Visual Studio .NET.

This CodeProject's article shows you how to do it:

http://www.codeproject.com/dotnet/Add_New_Item_Installer.asp

Posted by vhadiant at 09:31 PM | Comments (0) | TrackBack

June 11, 2005

Indonesian government pays $1 per unlicensed Windows XP

Nathan forwarded me this link. BSA reckons that 87% of all software in Indonesia are pirated. This is absolutely rubbish, crap, and utter nonsense. Once again BSA has proven that they really have no clue what they're talking about.

99% of all software in Indonesia are pirated.

Posted by vhadiant at 02:50 PM | Comments (0)

June 06, 2005

Accessing DataRow after it has been deleted

Normally when you tried to access the Item property of a DataRow after it has been deleted it will throw a DeletedRowInaccessibleException. For example:


DataRow row = dataTable.Rows[0];
row.Delete();
// This will throw DeletedRowInaccessibleException
long id = row["Id"];

However what the documentation does not say is that if you use the DataRowVersion.Original when accessing the Item property it'll work. For example:


DataRow row = dataTable.Rows[0];
row.Delete();
// This is OK
long id = row["Id", DataRowVersion.Original];

Nice trick, I've only found this out today.

Posted by vhadiant at 10:14 PM | Comments (0)

June 05, 2005

System.Type.Missing

If you do a lot of COM interop with .NET, no doubt you'll find lots of methods with parameter that you don't really care. Have you ever come across this situation? Where you ended up reading opening up the doc and trying to set the default value one by one? It's annoying and cumbersome as hell, thank god .NET has System.Type.Missing that will automatically sets the default value for the parameters.

From the doco:

Use the Missing field for invocation through reflection to obtain the default value of a parameter. If the Missing field is passed in for a parameter value and there is no default value for that parameter, an ArgumentException is thrown.

Posted by vhadiant at 05:58 PM | Comments (0) | TrackBack

Is it truly open?

In an article on BetaNews Jean Paoli from Microsoft answers the is it really 'Open' question.

Microsoft to 'Open' Office File Formats

...
When faced with the decision of adopting open standards or remaining proprietary, Microsoft opted to preserve the "full fidelity" of past Office functionality and instead developed its own "open" XML-based format. In saying that the format is "open" Microsoft acquiesces to the state of Massachusetts. Under the state's "Open Standards" policy, a format is open if it is fully documented and anyone can use it.

For comparison's sake, it should be noted that Adobe's PDF format is also designated as being "open" under the state's guidelines.

...

FWIW, to me as long it is properly documented without any hidden features left right and centre it is open.

Posted by vhadiant at 10:09 AM | Comments (0) | TrackBack

June 02, 2005

New Office will use XML as default format

I think we all have been expecting this for a while since Microsoft introduced the XML format in Office 2003. Now they're going full on and going to use XML (with zip compression) as their default Office format. It's certainly very interesting development and it'll make things hell lot easier for other software to be err compatible with MS Office. It'll be even more interesting how the other office suit will react on this news.

Not only portability with other office suites, but even a simple text indexing will now be easier. If you want to index the old MS Office document, you'd have to be able to extract the text first. This has somewhat become an industry by itself with tools costing tens of thousands dollars to do exactly this. With the new XML format it practically render those tools useless, well not straight away maybe but definitely less important.

Also worth noting that they picked the zip format for compression rather than the god-awful cab format. Will this trend to continue? Microsoft opening its own format and using more standard formats? Well I bloody hope so!

Now .. let's hope the PST format is next heh :) I'm dreaming I know, but hey who would have thought Microsoft will use XML format for their Office app 5 years ago?

Posted by vhadiant at 09:47 PM | Comments (0) | TrackBack

June 01, 2005

MovableType, Rebooted!

Well my worst fear has been confirmed. Kymberlie from SixApart support has said that those error messages that I've been seeing are most likely a sign of database corruption. However it couldn't have been that bad because now I can see my entries, although I saw some weird things happening in my MT install. I think I know what's happening here, for some reason my hosting provider is running out a disk space where my MT DB is located, I saw a couple of warning messages saying that the group quota has been exceeded. According to the manual, running out of disk space could result in DB corruption. Anyway it sucks, because I'm no way near my disk space limit on my hosting provider, it's just they're running out of disk space. I've already complained about this to Hostway.

Anyway I was thinking to leave it just as it is, but now I couldn't generate the feeds because there's problem with the ID, so I thought the better of it and decided to reboot my MT installation. Fortunately the database corruption wasn't that bad so I could export all my entries into a text file. The templates are still good too, so I just copy and paste everything to my local file. This time I'm going to use the link to file trick, just in case some disaster happen in the future it'll save me from copy and pasting the file.

So I downloaded the latest MovableType, version 3.16 now, and reinstalled everything from scratch. Fortunately installing MovableType is very easy, also this is my third attempt, so yeah pretty smooth. Importing to MovableType is also a breeze, you only need to create an import directory under the MT installation root, and drop the exported file there. From the MT admin screen select Import/Export and click Import and it's done.

All in all it took me about 2 hours to rebuild my 2 weblogs from scratch.

PS: Backup is very important! Read here for tips and tricks that could save your arse.

Posted by vhadiant at 09:11 PM | Comments (0) | TrackBack