Tuesday, April 28, 2009

Type 7 (Mentor)


I took an online JASPER (Job Asset and Strengths Profiler) test and I am a Mentor re. my work personality. It turned out that it is somewhat accurate; I do exhibit a lot of these traits. The results in more detail were (copied verbatim):

Leadership Style: Empowering. You are encouraging and motivating, which likely means that you help others reach their goals and dreams. People probably see you as a good mentor due to your patience and talent for giving direction.

Work Personality: Agreeable. You are more Agreeable than Rousing when it comes to work personality. As someone who goes with the flow, you have the ability to adapt to almost any change that is thrown your way. You tend to be quite accommodating to your colleagues and easy to be around.

Universal Skills: Communication Skills. You likely are an articulate person and you probably have received positive feedback on your writing ability or your skill speaking to groups. Even if you do not regularly use this skill you nevertheless have confidence in your communication ability.

Work Style: Collaborative. You show strength in your ability to be a Collaborative worker. While you are not at a loss when working by yourself, you feel much more productive when you can work with a team and bounce ideas off of other people. You also likely enjoy the camaraderie of group work.


gk. Axiom


If at first you don't succeed, transform your data!

(Not mine but very true for an experimentalist like me.)


Thursday, April 23, 2009

Monster Mosquito?


Today was a great day in Seattle (sunny, warm) and I was outside cleaning the deck where I found this superbug:



















It turns out that this beast is not a mosquito on Dianabol but a fly and it does not even bite! It is called Crane Fly and according to a WSU Website is a known lawn pest in the Pacific NW.

No wonder my lawn is in such a sorry state!

Wednesday, April 22, 2009

Weird MATLAB behavior when using Consolas font


I mentioned earlier that the font Consolas from Microsoft is a great font for programming. I use it for all my programming, including MATLAB. Today I noticed that  the TeX characters do not display properly when using the ylabel function and Consolas and the font size is set to 7 or 8!!

For example:

>> set(0, 'DefaultAxesFontName', 'Consolas');
>> x = 1:10;
>> y = 1:10;
>> plot(x, y, '.-')
>> xlabel('xxxx^2', 'fontsize', 8)
>> ylabel('xxxx^2', 'fontsize', 8)





















Also try:

>> xlabel('xxxxxxxxxxxxx^2', 'fontsize', 8)
>> ylabel('xxxxxxxxxxxxx^2', 'fontsize', 8)





















It is interesting that only the ylabel is affected. It is also interesting that other font sizes (5, 6, 9, 10, 11, 12, 14) work fine with Consolas. Other fonts (e.g. Monospace, SansSerif, Courier New) work fine. So it might be related to ClearType fonts; But why just a specifc font size?

Weird...

I guess if needed I would use:

>> ylabel('xxxxxxxxxxxxx^2', 'fontsize', 8, 'fontName', 'Monospaced')

UPDATE 1: 

I submitted a bug report to The Mathworks and their application support were able to verify the bug (no work around at this time). 

I am wondering what causes such a behavior...

UPDATE 2:

I tested the bug on a Vista machine. Same result. The Calibri font behaves the same way. I guess it is related to ClearType fonts.

Friday, April 17, 2009

Scirocco nostalgia


No, not the wind. The VW Scirocco available in Europe and for now not coming to the US. What a shame...



She is both beatiful and mean looking and it brings back memories of my best friend's car and college adventures. Please bring it across the pond VW!


Thursday, April 16, 2009

MATLAB gem

On March 5, Daniel (I do not know anything else about the person) offered a MATLAB gem as a comment to Loren Shure's MATLAB blog Loren on the Art of MATLAB. In his comment he offered a way to save the state of the editor (i.e. all scripts open in the editor) in a .mat file which can be loaded at a later time and reset the editor with the exact same scripts. Though he suggests caution since it is 'undocumented functionality' I have found that it works well. It is very cool and useful!

Daniel's comment can be found here:


A few words about Loren's blog: It is one of the two The Mathworks blogs that I follow regularly. She is obviously an expert and she offers unique MATLAB insights (my kind of person). Almost every one of her blog entries gives me an opportunity to consider, think, and learn. 

So I used that and wrote my own function:

function setEditorState( filename, option )
%
%
% This is a neat trick that I picked up from Loren's blog offered by a guy
% named Daniel:
%
% http://blogs.mathworks.com/loren/2009/03/03/whats-in-your-startupm/#comment-30128
%
% The function same the state of the editor (all tabs open) to a file which
% can be reloaded and set the editor to the exact same state. Very cool!
%
% Inputs:
%     filename: String in single quotes without extention.
%     option: Strings 'save' or 'load'
%
% Example:
%     >> setEditorState( 'prova', 'save' )
%
% Note:
%     MAT files with the list of open files are always save in:
%
% <'C:\Documents and Settings\User\My Documents\MATLAB\Editor State Files\'>
%
%

% Error check number of input arguments
if (nargin <>
   error('myApp:argChk', 'Wrong number of input arguments')
end

% I want to save all save 'states' in a specific folder.
dirPath = 'C:\Documents and Settings\User\My Documents\MATLAB\Editor State Files\';

% Save editor state
if strcmpi(option, 'save') == 1
   
   editorServices = com.mathworks.mlservices.MLEditorServices;
   
   editorState = editorServices.builtinGetOpenDocumentNames();
   
   save ( [dirPath filename '.mat'], 'editorState', '-mat' );
   
% Load editor state
elseif strcmpi(option, 'load') == 1
   
   editorServices = com.mathworks.mlservices.MLEditorServices;
   
   load( [[dirPath filename '.mat']] )
   
   for id = 1:length( editorState )
      
      editorServices.openDocument( editorState(id) )
      
   end
   
end


Wednesday, April 15, 2009

Windows XP ClearType Tuner

A very useful tool to improve appearance of fonts on XP systems is available from the Microsoft Typography group at


Can't read display without ClearType!

If you have ClearType enabled then take advantage of the ClearType fonts available, some specifically designed for programming. These fonts are fixed width, they are easy to read, and have a distinct different appearance between braces and parentheses, colons and semicolons, zeros and O, 1 and l and I, etc. 

My favorite font from the collection is Consolas which I use for all programming (Visual Studio 2005, Visual C++ 6, MATLAB, etc), word processing (Word, etc), e-mail (Outlook), and presentations (PowerPoint, etc). I absolutely love Consolas! (I can see!)

The ClearType fonts are available with Vista (my Home PC), Office 2007 (my work desktop). For other systems (my WinXP laptop and other older WinXP PC's I use/own) they need to be downloaded. As far as I remember you can download them if you have Visual Studio installed. (That might have changed in the last year.)

Changing fonts in Visual Studio 2005 is discusse here: 



Monday, April 13, 2009

MATLAB gripe

I just got a brand new PC at work. It is a great machine (Dell Precision T7400) with a Quad Core processor X5472 (3.00 GHz, 2X6M L2, 1600) which according to a CPU benchmark site ranks #10 in the high end CPU's list (as of today - it ranked higher when I ordered it...)

The OS installed is 32bit WinXP SP3 and our IT department does all SW installations except technical computing SW. That means that among other SW packages I install MATLAB (latest version 2008b is available on our SW depot). My problem is that after installation I have to spend an additional 30-45 minutes setting up all the paths and preferences on the new PC so I get the exact same environment I had on the old PC.

Considering that I do that for my laptop, home desktop, sometimes twice a year per The Mathworks (TMW) release schedule (though I am not religious about that) each installation becomes an aggravation.

A simple solution would have been to offer customers the option of exporting all settings to some file that can be imported to another computer with a compatible release (or compatible features). Seems like a no-brainer!

I can only wish...

Friday, April 10, 2009

FIFA World Ranking Top 20: April 2009

Rank Team Points
1 Spain 1729
2 Germany 1362
3 Netherlands 1360
4 Brazil 1275
5 Italy 1271
6 Argentina 1201
7 England 1173
8 Croatia 1151
9 Russia 1117
10 France 1074
11 Portugal 1013
12 Czech Republic 968
13 Greece 927 (Latest: An away draw and a home win - both vs. Israel - for World Cup Qualifiers)
14 Turkey 925
15 USA 919
16 Uruguay 909
17 Paraguay 896
18 Switzerland 883
19 Cameroon 871
20 Bulgaria 840

You can find the latest complete list at the official FIFA website.

Thursday, April 9, 2009

Best (free) on-line C++ and MATLAB books

My favorite MATLAB on-line book was written by Cleve Moler, the founder and chief scientist of The Mathworks. It can be found at:

http://www.mathworks.com/moler/index_ncm.html


My favorite C++ on-line book was written by Herb Schildt, author of a number of books on various programming languages. It can be found at:

http://msdn.microsoft.com/en-us/beginner/cc305129.aspx