Posts

SQL Server 2008 Express Edition with tools bootstrapper and .Net Framework 3.5 SP1

Since we shifted our focus on a desktop application, I've started maintaining a .Net desktop client that depends on a SQL Server Express 2008 installed. As we need to start giving away a trial of the product it was necessary to develop a installer. It was not so nice to discover that adding SQL Server Exress 2008 as a requirement wasn't so immediate in VS 2008. (Actually, installing SQL Server in itself wasn't so easy as I had Windows 7 64bit RC1). Thanks to a blog I've managed to add the requirement Bootstrapper for SQL Server 2008 Express Edition with Tools but it would seem that the package itself depends on .Net 3.5SP1 that is also not included with VS 2008. This bootstrapper can be added as well if you follow the instructions found here under the chapter 2.3.1.1 (Enable Samesite for the .NET Framework 3.5 SP1 bootstrapper package). In the end of the day, installer is ready and the application can be given away with reasonable expectation that it'll just work...

Nexus One

Image
I just saw on engadget the exclusive photos of the Nexus One and I must say it seems rather sweet. The interface seems very clean and the screen also. What are the internal specs however, CPU, GPU, who knows? We'll just have to wait to find out. Hmm.... I know what I want for New Year's :)))

Search and Replace in ODT using AODL

Recently I needed to create a way to search and replace a word in a OpenOffice OpenDocument ODT. It would seem the project itself already has a library AODL (take care, at least two other project pages but with older code) that exposes the format model but I didn't find any utility methods like search and replace functionality. I've created two versions of the method, one a old-style, imperative approach, and the other, a LINQ version. As I'm still new to LINQ it would seem that the classical approach produces a more efficient code. Anyone care to chip in and make a faster algorithm? In this particular version I'm just going for simple string equality, I didn't want to go with other StringComparison methods (just look at the Equals overload method). public static void SearchAndReplaceString(TextDocument document, string searchText, string replaceText) { var content = document.Content; foreach (var item in content) ...

Relaxing SSL validation for JaxWS

I've recently had the need to access a web service developed in .Net and signed with a self signed certificate. I've decided to use the JaxWS and the Metro stack to develop the client and run it on Java6. As a plus, the service was protected with username and password. The service was exposed on an IP address and I repetedly had problems in establishing a connection. In the end, thanks to this article, it was obvious that the certificate was not created with the alternative name attribute but it was not an option to change the certificate as the web service was already used by other consumers (.net clients don't suffer by this issue). So, on my quest to relax the validation, I've found out this article and code snippet, which did not compile at first (I guess package names were changed in JDK6) so I've did some trivial refactoring and now, after invoking the static methods in the client code, the SSL connection gets validated with no problems. Hope it helps and th...

GWT SuggestBoxReloaded

This article will present how to implement a GWT 1.6 (RC2) SuggestBox with backing hidden fields, RPC calls and not query the server on every character event. While integrating GWT on work, I needed to implement a SuggestBox with a backend RPC service but I had some requirements that the default SuggestBox didn't fulfill. Namely, I needed that the suggestion sets hidden fields (ex. displaying a human readable name for the user and setting a hidden id field). The solution presented in GWT SuggestBox backed by DTO Model and the Using the GWT SuggestBox with RPC were very helpful in creating this example project. I advise you to read/implement them before reading further in order to understand the issues. The first article hit the sweet point on how to pass hidden values using the DTO pattern, you can either wrap your hidden fields (Hidden.wrap) or as in this example we'll instantiate them using GWT and add them to the panel. The next issues were following, 1. You need to be abl...

No row with the given identifier exists

I've recently gotten this infamous Exception while doing a HQL query. org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [it.linksystem.csai.model.Operator#3] This was rather strange as the system worked quite well and it successfully retrieved selects on that entity using the Criteria API. Looking on the net, most suggestions and FAQ's point to a different direction. My issue was rather simple mapping error. The entity on which I was doing selects, was referencing an Operator. In my (java) model, Admin inherits from Operator, and both inherit from User. In fact persisting the entities was no problem no matter if the entity persisted was referencing an Admin or Operator. If however there was an instance that referenced an Admin hibernate would launch the Exception if one executed a HQL query (I guess Criteria queries follow a different path to create the select and are immune to this issue). My mistake was that I didn't know you can nest a subcl...

Turning off Asus M50S light sensor

As I've recently gotten this nice laptop, I've found that the light sensor really makes more problems then it solves so I'm shutting it down in both Windows (Fn+A) and in Linux. Under linux all you need to do is: echo 0 > /sys/devices/platform/asus-laptop/ls_switch This fix is valid only for the current session, to persist the settings just install sysfsutils and then in /etc/sysfs.conf put devices/platform/asus-laptop/ls_switch=0