The Even-more Complete List of Hex Words

December 24th, 2009
Comments Off on The Even-more Complete List of Hex Words

I realized that I was being insufficiently lee7, so I added S, T, and Z, converting into 5, 7, and 2. This produced a much longer list, of course.

Read more…

Computers, Software

The Complete List of Hex Words

December 18th, 2009
Comments Off on The Complete List of Hex Words

While converting some code to 64-bit on Snow Leopard, I discovered that character literals are ints, so I couldn’t use them for 8-byte longs. The alternative is readable hex constants.

Read more…

Computers, Software

2D Matrix Decomposition

July 10th, 2009
Comments Off on 2D Matrix Decomposition

This demonstrates the polar decomposition of 2D matrices into their angle, scale, and shear components. The polarDecomp algorithm is taken from Shoemake & Duff “Matrix Animation and Polar Decomposition“, 1992.

Read more…

Computer Graphics, Mathematica

Mirroring git respositories to DreamHost

June 11th, 2009
Comments Off on Mirroring git respositories to DreamHost

Casper Fabricius has a nice shell script for creating new git repositories on DreamHost. Unfortunately, this works only for creating new repositories.

Read more…

Software , , , , ,

Defining new format wrappers in Mathematica

June 3rd, 2009
Comments Off on Defining new format wrappers in Mathematica

One problem I had with the expression-to-C converter is that CForm converts negations of terms into a negation of parenthesized terms.

Read more…

Languages, Mathematica, Software

Converting symbolic Mathematica expressions to C code

June 2nd, 2009
Comments Off on Converting symbolic Mathematica expressions to C code

I frequently use Mathematica to rearrange or solve symbolic equations to use in C++ programs. While Mathematica is quite powerful for that, it has no facility to hoist common subexpressions into variables.

Read more…

Languages, Mathematica, Software

Adding a keyboard shortcut to Mathematica V7

December 29th, 2008
Comments Off on Adding a keyboard shortcut to Mathematica V7

(updated 2009-03-23 to add the backslashes that disappeared between my blog editor and WordPress)

In Mathematica, typing index brackets is clumsy, as one has to type esc-[[-esc then esc-]]-esc. I found a way to modify the Edit menu to add a shortcut for this. Read more…

Languages, Mathematica, Software

Pixel-perfect Graphics, Revisited

November 25th, 2008
Comments Off on Pixel-perfect Graphics, Revisited

Mathematica 7 introduces a new Image function that eliminates all the hassle previously necessary to create and export pixel-perfect raster images.

Read more…

Computer Graphics, Languages, Mathematica, Software

What is a sampling test image?

September 8th, 2008
Comments Off on What is a sampling test image?

I was asked what the purpose is of the test image in my previous post, and why the alpha was set to 0.01 rather than 0 in alternating pixels.
Read more…

Computer Graphics, Computers, Software

Exporting Pixel-Perfect Graphics in Mathematica

September 2nd, 2008
Comments Off on Exporting Pixel-Perfect Graphics in Mathematica

I keep having to figure out how to export pixel-perfect raster images from Mathematica, which I use for test images with my software. I found that it’s simpler to use ArrayPlot than Raster now, so I’m documenting this for my future use (and any one else’s).
Read more…

Computer Graphics, Languages, Mathematica, Software