November 2009 Entries

And I don’t mean data persistence here. More than two years ago I was a member of Imagine Cup team. We were competing in an embedded category, and our subject was IdeoGraph (IdeoGraph Imagine Cup report).  Main part of this system was an IdeoPen, 3D pointing device that was a size of and looked like a real pen. It’s main part were 3 3-axis accelerometers so we were able to collect any data consisting it’s location in 3D space. The idea was great, possibilities were infinite, “sky was a limit”. We made it to the Polish finals, and well, that was all. We were thinking about making it a more mature product, but an overwhelming amount of mundane things took all of our free time and in the end IdeoGraph was forgotten.

ideograph

Then about two years later Sony has shown their new controller. And yes, it’s basically the same idea, I think that even the same technology, but their product was finished, polished and was shown to public. Who knows what would have happened if we were more persistent ? I guess that lesson was learned.

 

When using custom Distinct operator on SQL data source you are going to see “Unsupported overload used for query operator 'Distinct'” exception. Basically it’s because Linq to SQL doesn’t support custom operators. One way to overcome this problem is forcing immediate query evaluation by using for example ToList() method.

Ex. before:

db.SomeTable.Distinct(new CustomComparer())

After:

db.SomeTable.ToList().Distinct(new CustomComparer())

I’m a proud member of PG.NET (Poznan .NET Group). It’s small (usually about 20-30 people per meeting), but very friendly group of smart people, who just want one thing - “to know” :-) Yesterday’s one was rather unusual because it was joined (from SQL point of view it was rather a UNION) with PLSSUG (Polish SQL Server User Group) Poznan user group, or maybe I should say – it was dominated by them, but it turned out to be really interesting (from .NET developer perspective).

First speech was by Gerard Frankowski from PSNC (Poznan Supercomputing and Networking Center) Security Team. It was about Secure usage of MS SQL Server 2008. I must say that I was impressed by knowledge and professionalism of this person. Among rather regular topics like attack types, password strength, Gerard shown us a bug in MS SQL Server 2008. In a shortcut it is possible to read a part of memory occupied by MS SQL process and to see users unencrypted passwords, however you will need administrator privileges to do that. More about this problem here. Gerard has shown us on live demonstration how to take an advantage of this vulnerability, by simply attaching to MS SQL process and reading it’s memory blocks. That actually made my quite nostalgic, every time I see something like this, I’ve a memory recall of me being a kid and hacking through a save files of various games. I guess it was after I’ve just made my gold counter to 999999 in Heroes Of Might And Magic when I had one of this “I’m god of this machine” feelings :-) Who knows, maybe it was that feeling that pushed me to become a software developer ?

Second speech was by Daniel Dudek and it was about SQL Compact Edition and Sync Services. Well, title says it all, Daniel’s presentation was very interesting and quite entertaining. There were little problem’s with live presentation, but as you know, Murphy’s laws are there waiting :-) I’m not going to replicate information about this subjects because you can find everything on Daniel’s blog.

Tags:

There are times when you are about to complete task that is seemingly easy, but somehow you know that you are not doing it right. It’s a feeling that you can get when trying to saw through a wooden beam with a handsaw, while there is a brand new, shiny chainsaw laying nearby. There is only one problem, you have no idea how to use it. And here comes a dilemma, whether to take some time and learn how chainsaw works, or maybe to let it go, and just do it with familiar tool. Learning new equipment is going to take you a lot more time and effort than just quick usage of simpler tool - and there are ominous deadlines. Of course gained knowledge can benefit in a future, when similar task will appear – you chainsaw skill will be ready.

So what to do ? As always there is no good answer… but wait, maybe there is – it depends. But that is a topic for a whole new big article, and we have got some XML waiting.

XSLT – it’s like a giant sawmill for XML, yet it’s light and elegant as handsaw. To understand it deeply you have got to learn your lesson, but fortunately there are useful XSLT snippets flying by, and they might be exactly what you are looking for. And here is my brick in this google an answer move, easy way to copy your XML file, but with sort a node option. So basically we provide an XML file, this XSLT snippet, and as a result we have got same XML file but sorted accordingly to our needs.

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 

<xsl:template match="node()|@*"> 
    <xsl:copy> 
        <xsl:apply-templates select="node()|@*"> 
            <xsl:sort select="author"/> 
        </xsl:apply-templates> 
    </xsl:copy> 
</xsl:template> 

</xsl:stylesheet>

Where author is a node by which we want it sorted.

I hope that someone is going to find it useful.

Tags: ,

Few comments on Subtext installation.

First of all, if you want to use multiple blogs, you should check this site. There is a little problem with configuration of an 404 page, and you should consider solution presented at mycodetrip.com website.

Another problem (or maybe I should write - challenge) was setting a redirection on my Host Domain (dkowalski.com). Subtext is able to create two or more blogs with the same Host Domain, but they should have different (and not empty) Subfolders. My intention was to set a redirection from http://dkowalski.com to http://dkowalski.com/blog/ (I'm going to create another website on my Host Domain in a future). However my solution was working correctly, until I found out that I have a "Sys is undefined" error while using AJAX objects. That error can have 1001 roots, but that one is rather peculiar. A simple fix with an old (and obfuscated) 'meta http-equiv="Refresh"' made the trick.

Site still looks ugly, but I'm working on it :-)

Tags:

Well, it looks like I've made a little false start here, I've just noticed that AJAX is not working correctly on my weblog. Strangely same script is running correctly on my local machine – I guess it’s something about IIS7, because it’s working like charm on IIS6. Luckily I think I don’t have too much audience yet so none is going to be disappointed :-)

After a few fights with css, subtext and overwhelming amount of other tasks to do, dkowalski.com is up.

If you are looking for a weblog about trip to China - here it is (sorry, Polish only).

"We'll see how long it lasts" :-)