-
The product manager for OS X Automator talked about this site in his Google Tech Talk
Archive for the ‘Uncategorized’ Category
links for 2009-10-25
October 26, 2009links for 2009-10-11
October 12, 2009-
Site for Quicksilver and Nocturne
links for 2009-09-28
September 29, 2009Time Machine Restore – A Pleasant Experience
September 19, 2009I recently had a disk go bad in my iMac. The disk would often boot if the computer was cold but then would start having errors as it warmed up and … corrupting files.
I have never had to test any of my Time Machine backups for a real purpose. I was concerned that I would find that not all the files I needed would be restored or I would find I only really had partial backups. I have had many bad experiences over the years with untested backups, including backups done by sys admins. So I doubted that Apple’s magic backup would be complete.
So I stuck a blank hard disk in the machine and booted the 10.5 install CD. At this point you have two options, install a fresh copy of Mac OS X and restore your files and settings, or just restore everything from Time Machine. I chose to restore everything from Time Machine, started it and went to bed.
I was pleasantly surprised to find a complete restore. I had to resync my dot mac data and a couple little things. The worst one was the ~/Library/Caches directory was not created with permissions for me to write to it. But overall, I was very happy.
links for 2009-09-10
September 11, 2009-
A good set of hubble pictures.
links for 2009-08-24
August 25, 2009-
A free reputation based spam RBL.
-
A site where you can interactively construct complicated mathematical equations and generate bitmaps and latex source.
An easy way to build equation bitmaps
August 23, 2009Here is a site that provides an easy way to generate equation bitmaps online.
http://www.codecogs.com/components/equationeditor/equationeditor.php
In HTML and actually many environments there is no good way to write complex mathematical equations. Many people fall back to latex to generate bitmaps. This site lets you interactively click on the parts of the equation and generates both the latex and corresponding bitmaps.
So for example, I was trying to save some of my Kalman filter notes. I click edited the Predictor equation and it generated this bitmap:
X^{*}_{n+1,n} = \phi X^{*}_{n,n}
Pretty nice.
Simple OpenGL Texture Example
August 20, 2009Here is a simple example of code to use an OpenGL Texture.
// Apple gcc program0.c -framework opengl -framework glut
// A simple OpenGL and glut program
#include /* Header File For The GLut Library*/
#include
//
// You need to generate the texture data that you are going to
// use. GIMP will convert a bitmap, jpg, etc. to a "C" structure
// that you can use almost directly.
//
// GIMP RGBA C-Source image dump (f35_schem_02_edit_4.c)
static const struct {
uint32_t width;
uint32_t height;
uint32_t bytes_per_pixel; /* 3:RGB, 4:RGBA */
uint8_t pixel_data[128 * 128 * 4 + 1];
} planform = {
128, 128, 4,
"\377\377\377\377\377\377\377"
"\377\377\377\377\377\377\377"
"\377\377\377\377\377\377\377"
"\377\377\377\377\377\377\377\377"
// ... much of the texture deleted
"\377\377\377\377\377\377\377"
"\377\377\377\377\377\377",
};
// The routine to draw the screen
void display() {
// A value to hold our texture handle
static uint32_t texture = 0;
static int32_t firstTimeDone = 0;
// Clear the display
glClear(GL_COLOR_BUFFER_BIT);
// Set the color to white
glColor3f(1.0, 1.0, 1.0);
// Setup the coordinates to what I am used to
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
// Get a texture number if we dont have one
if (!firstTimeDone)
{
// Get a texture number
glGenTextures(1, &texture);
// Tell OpenGL that we want to use that texture
glBindTexture(GL_TEXTURE_2D, texture);
// You have to tell OpenGL how to take the raw bitmap data
// in the structure above to put it into a texture. We
// do this with a glTexImage2D() call. We will describe the
// structure above and how we want it stored internally in
// OpenGl.
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, planform.width, planform.height,
0, GL_RGBA, GL_UNSIGNED_BYTE, planform.pixel_data);
// OpenGl lets you describe how you want to scale the
// texture data when the destination is bigger or smaller
// than the original texture data. In this case, we want
// simple linear scaling.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// First Time is done
firstTimeDone = 1;
}
else
{
// Tell OpenGL that we want to use that texture
glBindTexture(GL_TEXTURE_2D, texture);
}
// We are going to put the texture on a 2D surface, much
// like we would apply a decal.
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
// Normally you leave GL_TEXTURE_2D turned off unless
// you are applying a decal to a surface. Since we are
// doing that, we turn it on here.
glEnable(GL_TEXTURE_2D);
// Draw the square
glBegin(GL_POLYGON);
// Here we want to associate a point in the texture with the
// vertex we are drawing on the screen. So these are paired up.
glTexCoord2f(0.0f, 1.0f); glVertex2f(-0.5, -0.5);
glTexCoord2f(0.0f, 0.0f); glVertex2f(-0.5, 0.5);
glTexCoord2f(1.0f, 0.0f); glVertex2f(0.5, 0.5);
glTexCoord2f(1.0f, 1.0f); glVertex2f(0.5, -0.5);
// End of the list of verticies
glEnd();
// Turn texture drawing back off, normally we leave if off.
glDisable(GL_TEXTURE_2D);
// Flush the data. In many drivers, this causes the
// actual draw to the Frame Buffer.
glFlush();
}
int main(int argc, char **argv) {
// A minimal GLUT setup to get GLUT up and going.
// If you use EGL or some other windowing system
// other than GLUT, you need to replace this.
glutInit(&argc, argv);
glutInitWindowSize(512,512);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutCreateWindow("The glut hello world program");
glutDisplayFunc(display);
glClearColor(0.0, 0.0, 0.0, 1.0);
glutMainLoop(); // Infinite event loop
return 0;
}
Logging Serial Data with CKermit
August 18, 2009To log binary serial data from an RS-232 stream using CKermit, these are the settings I use:
- set port /dev/ttyS0
- set baud 115200
- set terminal bytesize 8
- set command bytesize 8
- set parity none
- set session-log binary
- set flow-control none
Then when you are ready:
- log session
- connect
links for 2009-08-14
August 15, 2009-
Cadillac stuff