Skip to main content

Blog

Ubuntu 12.04 - Frozen Touchpad

Ubuntu 12.04 is the latest and long term support (LTS) Ubuntu release.

It works really great (although with some issues), and I use it for business purpose as well as on home laptop/netbook. Occasionally, I experience a problem with touchpad on my netbook. Namelly, touchpad stops responding and mouse cursor can't be moved on screen.

I'm not sure what causes the issue with touchpad freezing, but the solution that works in my case is very simple - disable and re-enable touchpad support.

1) Press Fn (function key) + F7 in order to disable frozen touchpad

Ubuntu - Delete Apt Cache

Ubuntu is based on Debian GNU/Linux distribution, thus it uses Apt package manager.

Default behavior is to keep downloaded software packages on the file system during installation process. During time the packages can use a lot of disk space and we suggest occasionall cache cleaning.

How to clear Apt cache

1) Run file manager (e.g. Nautilus) as root user

2) Navitage to /var/cache/apt/archives

3) Delete all .deb installation package files

Note: Be sure not to delete folder partial and file lock.

SQL Server - Enable / Disable Identity Insert

Default behavior in the SQL Server for adding new row with identity column set to autoincrement is that you are not able to insert new row with specified id column. 

For example, you're not allowed to execute query:

INSERT INTO Students(Id, Name) VALUES(1, 'John')

but only

INSERT INTO Students(Name) VALUES('John')

Id value will be autogenerated for you instead.

The only way to avoid this behaviour is to to set IDENTITY_INSERT for the table that you want to insert new row into.

Entity Framework - Collection Modified Issue

If you try to change collection (add or remove element) while you looping through it, the following error message could appear:

InvalidOperatioException was unhandled

C# - Wrap Label Text

One of the issues with label in windows forms programming is if you set the label to AutoSize, it will automatically grow with whatever text you put in it.

If you want to make it word wrap at a particular width, you can set the MaximumSize propery.

label.MaximumSize = new Size(50, 0);

label.AutoSize = true;

If you have the label snap into it's container, you can switch off AutoSize, leave the max size property as it is, and it will word-wrap exactly as we want.