Version 2.0

When I started this blog, a page theme was the last thing on my mind and to be honest, I thought a generic one would do. As more time passed, I started noticing things that I really didn’t like. For instance, a search window was a background image and cursor was not centered. Or the fact that the site corrupted in an instant someone had different font size. Thus, as you might have noticed in recent days, the site got a long needing and deserving design and content overhaul. Lord and behold, what you are seeing now is my first ever custom WordPress theme named Lotushints (how original).

Idea was to get rid of that early 2000s rich web site outlook and go for pure simplicity. Also, I wanted to organize articles a bit. Thus, categories were reduced from 20 (!) down to 3:

  • Tech stuff – where all technical and development articles are located;
  • Geekland – where you can find my rants, observations and interesting things from tech world outside software development;
  • Book reviews – for occasional rant or recommendation about books I read and found worthy writing about.

All three categories found place in main navigation as well, which meant I could scratch Categories section from right sidebar. I also decided to put entire blog archive in the main navigation as it is way too long to act as a normal sidebar item. All that sidebar item scrapping meant that I could easily move from two sidebar layout to only one, which leaves more space for articles.

That’s it really. I would really like to hear your opinions though.

Quick tip: Templated controls

If you create a templated server control, import it into your web-site or web application and you want to do:

<my:Control ID="myControl" runat="server">
   <ItemTemplate>
      Some text, html or whatever.
   </ItemTemplate>
</myControl>

and you are allowed to do only:

<my:Control ID="myControl" runat="server" />

you need to modify your ItemTemplate property to look like this:

[TemplateContainer(typeof(MyTemplateControl))]
[Browsable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ITemplate ItemTemplate {
   get { ... }
   set { ... }
}

Generics

For years, I have tried to learn more about generics, but since my work was never in need for such implementation, I never bothered. Finally, an opportunity arose. I cannot go in specific details, but I had to write a Windows service (in C#) that daily obtains vast amount of similar data which must then be written to half a dozen tables of exactly the same structure. At this point, I would like to add, that amount of data obtained and amount of destination database tables are due to change at any point in future.

 

What are Generics?

According to Microsoft MSDN site “Generics allow you to define type-safe classes without compromising type safety, performance, or productivity. You implement the server only once as a generic server, while at the same time you can declare and use it with any type”. In reality this translates to the fact that if you must implement a class or function that needs to do same thing for different types, you can only write it once.

In .NET world, most of us use Generics daily, without knowing it. They are disguised as lists, collections and dictionaries.

[Read the rest of this entry…]

Clean code by Robert C. Martin

There are authors that suit you and there are authors that don’t. Having spent a decent amount of time to get through Clean Code: A Handbook of Agile Software Craftsmanship, I have found out, that Mr. Martin fails to suit me. His self admiration and belief that he is new software messiah (and as such, cannot be mistaken) is intolerable to the extent, when I literally had to convince myself from chapter to chapter to read the book until bitter and inconclusive end.

[Read the rest of this entry…]

.NET Custom validators – perfect tool (almost)

I don’t know about you, but working with .NET validators is always a fiddly job. Sure, they enable you to do quick validations, but I am yet to find an app where each field only needs one validator. And this is where things usually get interesting.

[Read the rest of this entry…]

Happy New Year

This year’s post count is getting a +1.

I wish you all a belated merry Christmas and a really happy, healthy and successful new year 2012.

DB2 Data Provider for .NET – followup

A few months back I wrote this article on DB2 Data Provider for .NET, describing issues with .NET provider and certain DB2 SQL commands e.g. CURRENT DATE function or CASE statement. As this things go, it took several months to communicate things with IBM tech support and I have to say they were very responsive and managed to tilt me only once. So kudos to them.

Good news is that IBM Tech support did acknowledge this issue. Unfortunately, the bad news is, they cannot do nothing about it, as the problem is in SQL parser in Visual Studio, which uses Other parser for DB2 queries and hence finds a problem with non-standard functions.  I was a tad startled by their solution that I should contact Microsoft on this issue. Now, I don’t want to claim that Microsoft doesn’t care about their customer satisfaction, as that would be a lie. However, I sincerely doubt that they care that DB2 Data Provider for .NET, which is IBM’s plug-in for a product that is supposed to be a competition to their MSSQL. works at all.

So, as IBM is not going to talk with Microsoft about this issue, and I am certainly not, it appears that all we can do is wait that one of the big guys comes to their senses and does something about it. Until then, you can use a workaround, which will require you to remove all case statements and CURRENT DATE calls from your typed data-sets at point of creation. You can add them on later and despite reported error, it will work. But beware that data-set will not get generated, if you keep case statements and CURRENT DATE calls.

Firefox – new release cycle observation

So working as I always do with Firefox – you know, several windows, kazillion of tabs – I have lately discovered that my PC was running slow nearing the end of a working day. Now, for first 100 times, I just ignored the fact that my 3,33 GHz Core i5 Workstation with 4GB of RAM running windows XP shouldn’t be running like this. At least it was not a week or two ago. Yesterday however, I had quite enough of it and decided to consult task manager and see what is eating up my RAM. Two processes stood out:
a) Visual studio (three instances of it to be exact) that ate up about 700MB of RAM and
b) Firefox 6 (two instances) eating up a nice sum of 520MB of RAM.

[Read the rest of this entry…]

DB2 Data Provider for .NET

As you might have read, I am lately doing a lot of stuff in .NET with DB2 as a database server. In the past, the only way to connect to a DB2 database from .NET environment was via ODBC. Nowadays, IBM provides us with DB2 data provider for .NET. On top of that, launch of DB2 data provider kind of made ODBC connection unsupported. Fine. Data provider is slicker anyway.

[Read the rest of this entry…]

DB2 transactions in .NET environment

Recently, I have been working on a .NET application that uses DB2 as a database engine. On top of that, I needed transactions as I didn’t want for SQL statements to commit if one of them failed. Needless to say, DB2 uses it’s own principle to handling transactions.

[Read the rest of this entry…]