SQL Server Recovery Models

Illustration

There are three recovery models in SQL Server 2008 (and previous ones). Each of them has its purpose. Before we describe models, lets shortly describe how SQL Server deals with incoming data:

When data change is about to occur, data is first written to transaction log. Once transaction is completed, all changes are written to data file (not necessary on a hard drive at this point) and that transaction is marked as committed. At one point in time or another, data is really written to disk and transaction is then marked as “really done”.

Full

Until you perform backup, all that transaction log stuff is kept around. Only once you make a backup, transaction log is overwritten. This gives you possibility of data recovery at any time (in-between any transaction). Cost is size of transaction log (space is only reclaimed after backup) and need to backup transaction log in order to be able to recover from disaster.

Simple

Once data is really written to hard drive, transaction log is freed to be reused. This keeps transaction log quite small (compared to full recovery model). Bad thing is that recovery is possible only at backup times (not at any point in time) and there is no incremental backup. This can bite you in the ass if you have huge database.

Bulk-logged

As always, there is need for compromise. This one gives you small log of simple recovery model and incremental backups of full recovery model. However, you get semi-large transaction log and you will not be able to recovery at any point in time.

Which one?

I tend to use simple recovery model. It “steels” just a small amount of your disk space for transaction log and gives perfectly good solution for humble developer.

But, if you have big database, full recovery will ease burden on your server.

You make the choice.

Detecting 64-Bit Environment

Let start by saying that in .NET there is strict definition of Integer’s size. It is always four bytes. You can run program on 64-bit system and you will still have only 32 bits in Integer. I do like it. No matter which system I run it on, it’s range does not change.

Real way to see whether you have 64-bit environment (64-bit framework on 64-bit OS on 64-bit hardware) is to check type whose size does change. That is IntPtr (a.k.a. integer pointer). Although people usually think of integer pointer as something based on Integer, there is slight difference. IntPtr has size of environment’s pointer. On 32-bit system it will be same length as Integer, but in 64-bit environment IntPtr grows to 64 bits.

Notice that if your program is executing on 64-bit system, but someone set it’s target CPU to x86, this detection will say it is 32-bit (since 32-bit framework is used). Idea behind it is that if you are running in 32-bit, there is no need for you to know whether system is capable of 64-bit. You cannot call that 64-bit code anyhow.

Here is small C# example.

MobiReg - Beta 2

Illustration

Here is second beta of MobiReg.

This small registry editor for Windows Mobile 6 (probably works on 5 also, but I haven’t checked). It works on both Standard (Smartphone) and Professional (Pocket PC).

Following changes were made for second beta:

  • slightly changed behavior of backspace
  • removed left/right movement
  • both import and export use same folder
  • enhanced screen rotation support

Feel free to download new version.

[2009-04-21: final version is out]

If you need it, .NET Compact Framework 2.0 is here.

HTC S740 and XT9

Illustration

If you own Smartphone with dual keyboard (phone-like and QUERTY one), live in country that is not supported with T9 input, you may be annoyed that it cannot be disabled in threaded SMS view. Every other text box remembers whether it is disabled or enabled, but this one will not.

One thing that worked for me is Creating DWORD value named CarrierDefaultTextMode under HKEY_LOCAL_MACHINE\Software\Tegic\eT9\IME and giving it value of 0. This forces phone to ignore language settings and default to multi-press entry.

Also notice that, since we haven’t destroyed anything, you can switch to XT9 on per-message basic.

For editing you can use any registry editor out there, but do be careful.

Đuka

Illustration

More than 10 years ago, I “obtained” Duke Nukem 3D. Graphics were better than Doom, everything was in 3D (ok, it was 2.5D) and dirty humor was all around. Since it’s graphic engine cheated a little, game was very playable even on slow systems (a.k.a. those that couldn’t run Quake).

First time I played it in multiplayer was over serial cable. And I fell in love. Game that was good, just became great. When we got network in our classroom (I was at school at that time), first game we played was Duke Nukem 3D. You could have as much as eight players at once on levels that had so much entries and exits that stalking just wasn’t a strategy. You needed to move, and to move a lot.

Some things that were semi-useful during single player game, became great tactical elements in multiplayer. Jetpack gave you possibility to make RPG air-strikes to your enemy, steroids helped you to escape (you were faster than RPG). Hologram was useful for distracting your enemy. While they shoot at hologram, you just shoot at them from your hiding place. You were only limited by your imagination.

Weapons started with your own foot (great if you are on steroids) followed with standard arsenal (pistols and guns). What was unknown before that time was pipe bomb. It worked on a trigger and while it wasn’t that useful against experienced players, it gave great joy of shaming your enemy with it. Real shame came with shrink ray. Once you shrink your enemy, you step on it - “That’s gotta hurt”.

Greatest weapon of them all was mighty RPG. Once you got used to it, you were killing machine. It was slow, it had only small amounts of ammo, but it’s power was undeniable. Tactic that I used with it was not to aim at person at all. Just point it somewhere near person and fire few shots more. Blast from a wall will kill that person without problems. If you are little bit further, it had semi-self-guidance so if your enemy stood still, he was a history. Combining that with steroids was sometimes suicidal since you could end up shooting your self with your own RPG (on steroids you run faster than RPG flies), but master that and there is no force that can stop you. Except another guy with RPG.

From that time, I even had a song dedicated to fifth level (one with a lot of RPGs). It is sung to the tune of Somewhere over the rainbow:

Somewhere over the rainbow,
RPGs fly...
Somewhere someone will kill me
and kill someone will I...

Song may be lousy, but at no time before or after, I sang during game. It was that good.

Today

Illustration

First step for playing game would be to obtain it. You can try it with shareware version and when you see the light buy it at GOG.com.

In order to enjoy it more, you may want to check EDuke32. This program will not only give you greater resolution than original Duke, but it also allows using higher quality graphics with some graphical goodies (interpolation, glow-maps, hi-res character models…). It works on all Windows versions without any problems.

Duke Nukem 3D multiplayer relied on IPX/SPX protocol for communication. That protocol is pretty much dead and TCP/IP took it’s place. Dukester X gives new life to multiplayer by providing TCP/IP connectivity. Your IP network can be useful once more. ;)

Full guide for setting your multiplayer DukeNukem 3D machine can be found at Duke3.net.