O Tempora

Illustration

Some time ago I had need for NTP server of my own. It was just quick and dirty solution for problem that probably affects only me.

I selected this small project as my venture into open source world. Project is hosted at GitHub. If you need it, you got it.

[2015-04-25: Project is moved to GitHub]

Error Validating the Default for Column...

Illustration

For one project of mine I needed to use GUID for column identification inside SQL Server 2008 R2. As usually, I expected everything to go fine. I just add new column (Id in my case) and set it’s data type to “uniqueidentifier”. After that just set that field’s default to whichever function generates new GUID. Since I am running SQL Server 2008 R2 I opted to use NEWSEQUENTIALID (I will explain why in some other post).

As I am programmer first and database administrator only when needed, my natural environment when dealing with database is right-clicking Design and doing changes in more visual way.

As soon as I changed “Default Value or Binding” property to “(NEWSEQUENTIALID())” I was greeted with “Error validating the default for column ‘id’. Do you want to cancel your changes?” After checking all documentation and rechecking it again, I just answered to this question “NO”.

After other fields were adjusted and I tried to save changes, I was greeted with another message: “Warnings were encountered during pre-save validation process, and might result in failure during save. Do you want to continue attempting to save?”. Correct answer here is “YES”.

Save went without hitch. After additional Internet searches I found that this is simple error in validation procedure. And it is in SQL Server since version 2005. Two versions after, it is still alive and kicking.

Until Microsoft fixes this in SQL Server 2020, just remember to hit first “NO” and second “YES”.

Keeping Screen on

When Android developer wants to keep screen on while application is running, it often ends up with him managing wake locks. Quite often this is not needed.

If only thing you want to do is to keep screen on while your application is running (e.g. video player) and you do not need more advanced power management control, you should just add another flag to existing window.

@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 
    setContentView(...); 
    ...2
}

System itself will now ensure that screen is kept turned on while your application is visible. As soon as your application is in background, everything returns back to normal. Added benefit of this approach is that no additional permissions are required.

Icons

Illustration

As a programmer I do need a lot of icons. And since I am cheap bastard, I usually try to get free ones.

Company from which I got most freebie offers is definitely IconShock. Guys just can’t stop producing free icon sets. Latest is their Social icon set. It has image for any social site there is (both raster and vector). And best of all - these icons are FREE for COMMERCIAL use also.

Yes, they may not earn much money that way, but they will always have my eternal love for this. Who knows, maybe I will even stop being cheap and buy something from them finally.

In any case I do love these guys.

P.S. They do not sponsor me. This is spontaneous outburst of pure love.

Color of My Eyes

Illustration

As I went to subscribe to EETimes Europe, one form question did give me huge surprise. They were interested in color of my eyes.

I am not sure what surprises me more - their question or explanation for it. They say: “Normally you are asked to sign a registration card to validate your free subscription, but this is not possible on a web page. Instead we ask a qualifying question that must be answered:”.

At what time did naming of color became substitute for signature? Have I overslept that moment?

P.S. If someone is interested, they are brown. :)

P.P.S. Don’t steal my identity now!