Excel: Highlight current row and column

Original code @ http://msdn.microsoft.com/en-us/library/office/ff820716%28v=office.14%29.aspx

I had to add code to handle the error that occurred when you clicked on headers or corner button.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

   On Error Resume Next
   If Target.Cells.Count > 1 _
   Then
      Exit Sub
   End If
   If Err.Number > 0 _
   Then
      Exit Sub
   End If
   Application.ScreenUpdating = False
   ' Clear the color of all the cells
   Cells.Interior.ColorIndex = 0
   With Target
      ' Highlight the entire row and column that contain the active cell
      .EntireRow.Interior.ColorIndex = 8
      .EntireColumn.Interior.ColorIndex = 8
   End With
   ActiveCell.Interior.ColorIndex = 6
   Application.ScreenUpdating = True

End Sub

Fedora Linux 17 64 bit: How to install libraries to compile a c++ CLI program to 32 bit executable

Fedora 17 64 bit: Como instalar librerias para compilar un programa c++ de linea de comando como un ejecutable de 32 bit

In Netbeans, go to Run -> Set project configuration -> Customize -> C++ compiler -> Architecture -> 32 bits

But I was getting this error when trying to compile to a 32 bit executable in my 64 bit Fedora system:

g++ -m32 -c -O2 -MMD -MP -MF build/Release/GNU-Linux-x86/main.o.d -o build/Release/GNU-Linux-x86/main.o main.cpp
In file included from /usr/include/features.h:386:0,
from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/../../../../include/c++/4.7.0/x86_64-redhat-linux/32/bits/os_defines.h:40,
from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/../../../../include/c++/4.7.0/x86_64-redhat-linux/32/bits/c++config.h:414,
from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/../../../../include/c++/4.7.0/cstdlib:43,
from main.cpp:8:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory

Then I found this: http://ask.fedoraproject.org/question/365/how-do-i-install-32bit-libraries-on-a-64-bit

I installed the required packages:

sudo yum install glibc.i686 libgcc.i686 libstdc++.i686 glibc-devel.i686

Thanks to Jim Blandy!

Gnome 3: How to turn off showing all the windows when the mouse moves to the hot spot in the top left corner of the screen

Gnome 3: Como apagar que se vean todas las ventanas abiertas al mover el ratón a la esquina superior izquierda de la pantalla

http://forums.fedoraforum.org/showthread.php?t=276970

Edit the file /usr/share/gnome-shell/js/ui/layout.js

Find this code:

this._corner = new Clutter.Rectangle({ name: ‘hot-corner’,
width: 1,
height: 1,
opacity: 0,
reactive: true });

Change reactive: true to reactive: false and it will disable the hot corner but still allow to activate the overview screen by clicking the Activities button or by pressing the Super (Windows) key.

Adding Windows TrueType fonts to Fedora 16

http://www.howtoforge.com/the-perfect-desktop-fedora-16-i686-gnome-p4

To install Windows TrueType fonts, open a terminal and become root again:

su

Then run:

yum -y install rpm-build cabextract ttmkfdir

rpm -ivh http://easylinux.info/uploads/msttcorefonts-1.3-4.noarch.rpm –nodeps

To check if the TrueType fonts have been installed correctly, open a word processor like LibreOffice. You should now find your new Windows fonts there:

Cannot move dialog windows on Gnome 3

http://ruionwriting.net/2011/06/cannot-move-dialog-windows-on-gnome-3/

here are those who hate, other who love and others that really don’t care why dialog windows have strange borders and don’t allow you to move them grabbing the title bar, oh wait :P , where is the title bar?

The solution is simple: gconf-editor to the rescue. Just open gconf-editor and untick /desktop/gnome/shell/windows/attach_modal_dialogs. Press Alt + F2, type r and press Enter (reloads gnome shell). Now you have the normal behavior back.

In case of using Arch, my home distro in this case, you need to install gconf-editor. Very easy with pacman:

$ sudo pacman -S gconf-editor

or

# pacman -S gconf-editor

Myself, with Fedora, used

# sudo yum install gconf-editor

And followed the rest of the instructions…

Vim: Global replace switching order of words

I had a bunch of lines containing selects:

select isnull(max(len(Marca)),0) from Subasta20042005.dbo.CotizMat
select isnull(max(len(Marca)),0) from Subasta20042005.dbo.CotizMatNue
select isnull(max(len(Marca)),0) from Subasta20052006.dbo.CotizMat
select isnull(max(len(Marca)),0) from Subasta20052006.dbo.CotizMatNue
select isnull(max(len(Marca)),0) from Subasta20062007.dbo.CotizMat
select isnull(max(len(Marca)),0) from Subasta20062007.dbo.CotizMatNue

But of course, in the results the name of the database didn’t show:

———–
34

(1 row(s) affected)

So I used this VIM command:
%s/\( from \)\(Subasta……..\)/ \2\1\2/

And got:

select isnull(max(len(Marca)),0) Subasta20042005 from Subasta20042005.dbo.CotizMat
select isnull(max(len(Marca)),0) Subasta20042005 from Subasta20042005.dbo.CotizMatNue
select isnull(max(len(Marca)),0) Subasta20052006 from Subasta20052006.dbo.CotizMat
select isnull(max(len(Marca)),0) Subasta20052006 from Subasta20052006.dbo.CotizMatNue

That prints a header for each select:

Subasta20042005
—————
34

(1 row(s) affected)

Even better: Try this one

%s/\( from \)\(Subasta……..\)\(\.dbo\.\)\(Cotiz.*$\)/ \2_\4\1\2\3\4/

Windows 7 Samsung laptop – No hibernate option

Crap, I’ve been looking all over internet for this, and today I discovered the reason while looking for other thing:

My Samsung laptop with Windows 7 Professional didn’t have a “hibernation” option. There was no way to enable it in the advanced power options of the control panel, and none of the tricks that I “googled” worked. The only available option was “sleep”, that was quite fast to wake up from, but heavily drained the battery (and I guess that shortened its life too).

Turns out that the culprit was a Samsung program, called Fast Start (All programs -> Samsung -> Fast Start). By default, the fast start function was on, and that disabled completely the hibernate option.

As soon as I changed the “Fast Start Function” to “Off” in the program, the hibernate option appeared in the shut down menu.