free hit counter

Thursday, March 30, 2006

rhymes with orange

Orange is a tough color to represent in RGB color space.

Who knew? I was surprised that QT didn't have a Qt::orange define, so went looking for some raw hex for it.

None are great, but my favorite is #ffa000

linkage

update:
Wikipedia has a great page on web colors, which shows that CSS 2.1 defines orange as
#ffa500
linkage

inline constants to improve readability

Everyone talks about using constants in your code to improve readability, but sometimes I think it can obscure readability when a single use constant is stuck away in some header file with 100 other of them, and I'm more tempted to use a magic number ("aw, just this one time...") if I have to go fish around and open the file that has all the constants.

I think constants should follow the same rules as variables: use the least expansive scope possible, and declare as close to first usage as possible. I can't recall see this documented formally in any books, but I'm a firm beleiver. Here's an example:


const int top_row= 0;
const int span_to_bottom_row= -1;
const int second_column= 1;
const int no_col_span_for_thermo= 1;
loMainGrid->addWidget(thermo, top_row, second_column, span_to_bottom_row, no_col_span_for_thermo);

const int second_row= 1;
const int first_col= 0;
loMainGrid->addWidget(compass, second_row, first_col);

This makes it much easier to see the difference between the less used overload for spanning grid cells and the more standard single cell, two argument form.

loMainGrid->addWidget(thermo, 0,1,-1,);
loMainGrid->addWidget(compass, 2,1);

So, did you catch the semantic error in the no constants example? If you're being more explicit it's easier to remember that the second row is actually index 1, and the first column is index 1.

Also notice the usage of non caps for constants. I still beleive MAGIC_NUMBER_USED_ALL_OVER should be capitalized, but heavy usage of these throwaway constants can REALY MAKE IT LOOK LIKE YOUR CODE IS SHOUTING.

Tuesday, March 28, 2006

Loading 3d Models into an openGL canvas

It's not so straight forward to load 3d models into an openGl canvas.

here are some links:

(most promising)
GLEW:
The OpenGL Extension Wrangler Library


(monolithic and ugly)
http://www.thermoanalytics.com/products/eclectic/download.html

(file converter)
http://www.quick3d.com/guide/guidea.html


(discussion w/ links)
http://cboard.cprogramming.com/archive/index.php/t-37127.html

(a library of models)
http://www.the3darchive.com/archive_bellrang.shtml

Propper wrist stretching

Since starting my new job I've had my first case of RSI. Something was weird about the desk setup, but it is much better since getting a new chair and a keyboard tray. I'm better than I was, but still must switch out my mousing wrist.

Here's some good wrist stretches:

howtostretch.com/wrist

Ripping CDs

Such a PITA to download the LAME encoder. Even though I have the tools to compile the source, I don't care to set it up. So here's a safe download for LAME.exe:

Lame Compiles - Hydrogenaudio Knowledgebase

This will get driven by the incredible EAC ripping software, which has successfully decoded even my most scratched CDs, even if sometimes takes many hours.
http://www.exactaudiocopy.de/

Friday, March 24, 2006

repetative and redundant writing

Here's a fabulously redundant expression by Walter Royce in his book
    Software Project Management



"Requirements artifacts are evaluated, assessed, and measured through a combination of the following..."


Is it just me, or is Mr. Royce in need of an editor? To ensure I had a grasp on these words I looked them up in a dictionary, and sure enough they all are descriptive verbs for ascertaing or fixing the value or worth of an entity.

subversion: keyword substitution registry entries

To get automatic keyword substitution set for files as you add them you have to setup your client machine. I figured this out a while back, but as I setup TortoiseSvn on a new machine I forgot all about it.

Here's the registry hive you need:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org]

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion]
"Version"="1.2.3"
"Revision"="15833"

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config]

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config\auto-props]
"*.doc"="svn:mime-type=application/msword"
"*.xls"="svn:mime-type=application/msexcel"
"*.ppt"="svn:mime-type=application/mspowerpoint"
"*.pdf"="svn:mime-type=application/pdf"
"*.png"="svn:mime-type=image/png"
"*.jpg"="svn:mime-type=image/jpeg"
"*.c"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"*.h"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"*.cpp"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"*.hpp"="svn:keywords=ID URL LastChangedRevision LastChangedBy"


[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config\Miscellany]
"enable-auto-props"="yes"

Labels:

Wednesday, March 22, 2006

making your C API C++ safe

There's no better instructor than a well built API.

Here's a thoughtfull feature of the Python/C API that I would like to take into account when designing the upcoming Sensor Platforms API:


"C++ users should note that though the API is defined entirely using C, the header files do properly declare the entry points to be extern "C", so there is no need to do anything special to use the API from C++."



linkage

Bug Isolation Project

Interesting body of research about statisticly figuring out what bugs look like, then applying the results to scanning your program for bugs.

Ben Liblit

Tuesday, March 21, 2006

freeconference alternative

freeconference.com is easy to use, but the quality can be really awfull at times.

I'd like to try this one out:

High Speed Conferencing by Vapps

The Long Tail: The Long Tail of software

GCC-XML

This seems like a great tool for bringing in more standard Java Eclipse functionality into Eclipse CDT.

GCC-XML

Getting Things Done (tm)

Funny circular reference- I'm interested in this book about how to be more productive and manage all the todos in your life, but I can't find the time to read it right now because of all the crap I have todo!


43F Recap: Best of Getting Things Done | 43 Folders

building boost::python

boost::python has some pretty good documentation, but it's not exactly easy to get up and running.

I started by building the provided examples, and ran into a bit of trouble.
http://www.boost.org/more/getting_started.html#Configuring has the list of supported toosets, and MSVC 2006 Express (aka VC8) has the toolset name vc-8_0

So I built the getting started examples like this:
bjam -sTOOLS=vc-8_0 test

Sunday, March 19, 2006

charitable noncash donations guide

Thursday, March 16, 2006

online book: Dive Into Python

I'm really interested in checking out Python. To me it seems like a readable Perl. I have big plans on making apps scriptable with boost::python.

From what I've seen so far this book is a good intro:
Dive Into Python

Monday, March 06, 2006

unix find command

I don't have complicated uses for find all that often, but when I do I invariably forget the syntax. Here's one that removes all makefiles from the directory structure:


find . -name Makefile.* -exec rm -f '{}' \;


Note the single qoutes and backslash to protect the shell from interpreting.

static code analysis

I wish I had the time to really integrate static code analysis tools into my daily workflow. Here are a couple of candidates:

PMD - Java
Coverity - c/c++

Friday, March 03, 2006

SVNManager Homepage

Thursday, March 02, 2006

why look for an external i2c, your PC already has one!

It might be hard to find on my thinkpad, (and I'm not too keen on soldering wires to an EEPROM on a DIMM) but is definitly a better option for a desktop PC.

the LM_sensors

free rtos for 8051 micros

program the flash in SiLabs C80501F019

This will be usefull for creating a utility for programming PID/Serial# which will also load the flash.

Mixed-Signal ICs - Flash Programming

Labels: ,

MSI error with MSVC 8

great summary of the problem and how to install MSI without doing a complete update

Windows installer service too old to install 1.3.0 | TortoiseSVN

Great electronics book

Joe recommended this electronics text to me. From what I've read of it so far it's a bit deeper than I like to go, but is definitly readable.

Amazon.com: The Art of Electronics: Books: Paul Horowitz,Winfield Hill