Array of Strings

December 3, 2009

Since Matlab treats strings as arrays, to create an array of strings put curly braces around the array index variable:

names{index} = ‘string value here’

Dose

October 8, 2009

dose = 1.6E-5 * fluence * LET = rads(Si)

where fluence is in particles/cm^2 and LET = 0.01 for Z=1

For some reason, the default font for the axes of a figure in Matlab is Helvetica, which is strange since many XP machines don’t have that particular font installed.  To change this behavior use

set(0, 'defaultAxesFontName', '<fontname>');

I added this line to my startup.m file since most of the documents that I write all use the same font.

MatLab follows the IEEE Standard 754 for single and double precision floating-point values. Values of type double are stored using 64 bits and values of type single use 32 bits.

A more exhaustive description of the numeric classes used in MatLab can be found here.

For some reason today, I ran across this little bug in Firefox 3 where the apostrophe key (‘) would only bring up the Quick Find box. This was a real problem when it came to entering text in a WordPress or Gmail window. None of the Firefox configuration options in about:config would let me disable it. The only method I found that worked was to install an add-on which disabled the quick find hotkeys. Here’s a link which worked for me.

I use VirtualBox to have access to a lot of Linux development tools that aren’t readily available in my work environment. Recently, our IT department wrecked my installation somehow and I needed to reinstall. I got stuck when it came time to install the guest additions. I found these links useful for jogging my memory:

http://tombuntu.com/index.php/2008/09/22/install-virtualbox-2-guest-additions-in-ubuntu/

http://moxiefoxtrot.com/2009/01/05/installing-ubuntu-810-in-virtualbox/

Thanks guys.

Export Excel Chart as .PNG

January 26, 2009

I ran across a very useful little add-in for Excel today.  My hatred for Microsoft notwithstanding, I’m forced to use Office for much of what I do at my job.  Several times over the past year, I’ve found myself needing to include charts from Excel in presentations, documents, or even just through email.  Most people send the entire spreadsheet or just copy and paste it as a BMP.  I’ve found that a lot of the time, it’s nearly impossible to read or just a royal pain to deal with.  No longer a problem.

The add-in can also be downloaded as a package here.  Many thanks to Jon Peltier.

I’m trying to move away from using Word for all of my documents and go to LaTeX instead – this will help quite a bit.

Ever since I moved to Intrepid Ibex, I’ve been having problems with screen redrawing.  It was a little bit of a pain to isolate the culprit, but I was pretty sure that it was Compiz-Fusion.  In xterm, emacs, and a few other applications I would have sections of the window or buffer that would be blank until I had clicked or pressed a key.  It went from being a mild annoyance to a real pain in the neck (ie, major blocks of code would vanish in emacs or I wouldn’t be able to read sections of my inbox in mutt).  After a lot of searching, I think I’ve found the bug that I’ve been experiencing.

Apparently, the problem is related to something to the Nvidia “powermizer”, which by default forces the video card into a lower performance mode.  I don’t really care all that much about my framerates.  What I am concerned about is being able to see the text in my windows.  It would appear that the problem has been discussed quite a bit on the forums and the following changes appear to have fixed the problem.  It would also appear that the developers are working on a beta driver that addresses the problem.  Until then, the following seems to have taken care of the problem, which makes me immensely happy.

sudo cat > /etc/modprobe.d/nvidia << "EOF"
options nvidia NVreg_RegistryDwords="PerfLevelSrc=0x2222"
options nvidia NVreg_Mobile=1
EOF

Thanks to pauljohn32 on the Ubuntu bug listing for his solution.

.Xdefaults Configuration

December 26, 2008

Xft.dpi:                96
Xft.antialias:          true
Xft.hinting:            true
Xft.hintstyle:          hintslight

XTerm*faceName:         Liberation Mono
XTerm*faceSize:         11

xterm*saveLines:        10000
xterm*scrollBar:        false
xterm*rightScrollBar:   false
xterm*jumpScroll:       true
xterm*cursorColor:      blue
xterm*colorBDMode:      false
xterm*highlightColor:   darkgray
xterm*activeIcon:       false
xterm*scrollTtyOutput:  false
xterm*scrollKey:        true
xterm*Background:       white
xterm*Foreground:       black

Here’s a section of my .Xdefaults file to make xterm a bit more easy to read and disable some of the defaults that I find more or less annoying.

Hello world!

December 26, 2008

This is a blog for Linux related hacks and solutions, mostly configuration and scripts that I’ve found useful.  It’s always hard for me to remember things that I’ve done, so this is a way for me to keep a better record of how I’ve fixed problems in the past.  Hopefully, some of it will be helpful to others.

Follow

Get every new post delivered to your Inbox.