« October 2006 | Main | December 2006 »

November 11, 2006

Resolution Independence

It's not just for icons. :)

There is some talk of resolution-independence these days, and for good reason. Them pixels is getting smaller.

Those of us who like to cheat and use 2D impostors for 3D objects get to be a little more careful these days as well. Luckily, thanks largely to information I got at the Big Nerd Ranch OpenGL class, one can easily make the 3D equivalent of vector graphics in something like (say) maya or wings3D and wrap them up in a display list in openGL for speed of rendering.

This makes one's visualization happily zoomable and resolution-independent without much of a performance hit. Just load your model in your initialization and wrap the drawing in a display list.

My pet project at a normal zoom level:

graphModels.jpg

and zoomed waaaaay in:

zoooom.jpg

Can you tell which part of the graph is still a stretched image + simple texture?

Graphviz rocks

I needed to come up with an innovative (pun intended, for those who get the joke) way of tracking time by task for one of my clients recently. I considered dusting off DIA or perhaps omnigraffle, but I realized that the tedium involved in laying out the hierarchical structure I wanted to see would probably kill me. So, I thought I would give Graphviz a shot.

The nice thing here is that it will lay out a hierarchy for you and flow your chart in an efficient manner. I would have gone slowly mad doing this by hand.

Click on the image below to see a larger version.


GraphvizLG.jpg

You can see the markup I gave graphviz in the extended portion of the post.

digraph aGraph {
    graph [rankdir=LR nodesep=0.1]
    
    activities [label = "Activities"];
    activities -> phase_wiring;
    activities -> phase_wireTesting;
    activities -> phase_install;
    activities -> phase_calibration;
    activities -> phase_testing;
    activities -> misc;
    
    //Wiring Phase
    phase_wiring [label = "Wiring"];
        wiring_outside [label = "To/Fr. outside\nservice"];
        wiring_mainSystem [label = "To/Fr. Main Sys."];
        wiring_room [label = "To/Fr. room"];
        wiring_withinRoom [label = "Within room"];
    phase_wiring -> wiring_outside -> wire;
    phase_wiring -> wiring_mainSystem -> wire;
    phase_wiring -> wiring_room -> wire;
    phase_wiring -> wiring_withinRoom -> wire;
    
    //Wire Testing Phase
    phase_wireTesting [label = "Wire Test"];
        wireTesting_us [label = "Run by us"];
        wireTesting_EC [label = "Run by others"];
        EC_labeled [label = "Labeled"];
        EC_unlabeled [label = "Unlabeled"];
    phase_wireTesting -> wireTesting_us -> wire;
    phase_wireTesting -> wireTesting_EC;
    wireTesting_EC -> EC_labeled -> wire;
    wireTesting_EC -> EC_unlabeled -> wire;
    

//Installation Phase
phase_install [label = "Installation"];
install_assemble [label = "Assembly"];
install_furniture [label = "Component Layout"];
install_inWall [label = "In/On Wall"];
install_dress [label = "Dress Wires"];
phase_install -> install_assemble;
phase_install -> install_furniture;
phase_install -> install_inWall;
phase_install -> install_dress;

install_assemble -> materusls;
install_furniture -> materusls;
install_inWall -> materusls;
install_dress -> materusls;

//Callibration Phase
phase_calibration [label = "Calibration"];
calibration_audio [label = "Audio"];
calibration_video [label = "Video"];
phase_calibration -> calibration_audio;
phase_calibration -> calibration_video;
calibration_audio -> materusls;
calibration_video -> materusls;

//Callibration Phase
phase_testing [label = "Test and Tune"];
testing_audio [label = "Audio"];
testing_video [label = "Video"];
testing_control [label = "Sys. Control"];
phase_testing -> testing_audio;
phase_testing -> testing_video;
phase_testing -> testing_control;

testing_audio -> materusls;
testing_video -> materusls;
testing_control -> materusls;

//misc. stuf
misc [label = "Misc."];
misc_setup [label = "Setup to work"];
misc_teardown [label = "Clean Up Site"];
misc_unpack [label = "Unpack Equipment, etc."];
misc_unproductive [label = "Unproductive"];
unproductive_us [label = "us @ fault"];
unproductive_others [label = "Others @ fault"];
unproductive_notes [label = "Notes______________________\n\
______________________\n\
______________________\n\
______________________\n"];
misc -> misc_setup;
misc -> misc_teardown;
misc -> misc_unpack;
misc -> misc_unproductive;
misc_unproductive -> unproductive_us;
unproductive_us -> unproductive_notes;
misc_unproductive -> unproductive_others;
unproductive_others -> unproductive_notes;
misc_unpack -> materusls;

//Materusls///////////////////////////////////////////////////////////////
materusls [label = "Equipment /\nMaterusls"];
materusls -> wire;
materusls -> speaker;
materusls -> tv;
materusls -> component;
materusls -> tvMount;
materusls -> rack;

//Wire Types

wire [label = "Wire"];
wiringType_inWall [label = "In Wall"];
wiringType_outWall [label = "Not In Wall"];
wiringType_CATVSat [label = "CATV/Sat"];
wiringType_speaker [label = "Speaker"];
wiringType_telephone [label = "Telephone"];
wiringType_network [label = "Network"];
wiringType_antenna [label = "Antenna"];
wiringType_sysControl [label = "Control Sys."];
wiringType_termination [label = "Termination"];
wiringType_video [label = "Video"];
wiringType_interconnect [label = "Interconnect"];
wiringType_other [label = "Other______________"];
wire -> wiringType_inWall;
wire -> wiringType_outWall;
wiringType_inWall -> wiringType_CATVSat;
wiringType_inWall -> wiringType_speaker;
wiringType_inWall -> wiringType_telephone;
wiringType_inWall -> wiringType_network;
wiringType_inWall -> wiringType_antenna;
wiringType_inWall -> wiringType_sysControl;
wiringType_inWall -> wiringType_termination;
wiringType_inWall -> wiringType_video;
wiringType_inWall -> wiringType_interconnect;
wiringType_inWall -> wiringType_other;
wiringType_outWall -> wiringType_CATVSat;
wiringType_outWall -> wiringType_speaker;
wiringType_outWall -> wiringType_telephone;
wiringType_outWall -> wiringType_network;
wiringType_outWall -> wiringType_antenna;
wiringType_outWall -> wiringType_sysControl;
wiringType_outWall -> wiringType_termination;
wiringType_outWall -> wiringType_video;
wiringType_outWall -> wiringType_interconnect;
wiringType_outWall -> wiringType_other;
//speaker types
speaker [label = "Speaker"];
speakerType_inwall [label = "Inwall"];
speakerType_bookshelf [label = "Bookshelf"];
speakerType_floorStand [label = "Floor standing"];
speakerType_other [label = "Other______________"];
speakerSize_small [label = "Small"];
speakerSize_medium [label = "Medium"];
speakerSize_large [label = "Large"];
speaker -> speakerSize_small;
speakerSize_small -> speakerType_inwall
speakerSize_small -> speakerType_bookshelf
speakerSize_small -> speakerType_floorStand
speakerSize_small -> speakerType_other
speaker -> speakerSize_medium;
speakerSize_medium -> speakerType_inwall
speakerSize_medium -> speakerType_bookshelf
speakerSize_medium -> speakerType_floorStand
speakerSize_medium -> speakerType_other
speaker -> speakerSize_large;
speakerSize_large -> speakerType_inwall
speakerSize_large -> speakerType_bookshelf
speakerSize_large -> speakerType_floorStand
speakerSize_large -> speakerType_other
//TV Types
tv [label = "TV"];
tvType_large [label = "Large"];
tvType_small [label = "Small"];
tvType_plasma [label = "Plasma"];
tvType_LCD [label = "LCD"];
tvType_projector [label = "Projector"];
tyType_other [label = "Other______________"];
tv -> tvType_projector;
tv -> tvType_large;
tvType_large -> tvType_LCD;
tvType_large -> tvType_plasma;
tvType_large -> tyType_other;
tv -> tvType_small;
tvType_small -> tvType_LCD;
tvType_small -> tvType_plasma;
tvType_small -> tyType_other;

//TV mounts
tvMount [label = "Tv Mount"];
tvMount_table [label = "Table"];
tvMount_wall [label = "Wall"];
tvMount_flat [label = "Flat/Plain"];
tvMount_swivel [label = "Swivel/Articulating"];
tvMount_other [label = "Other______________"];
tvMount -> tvMount_table;
tvMount_table -> tvMount_flat;
tvMount_table -> tvMount_swivel;
tvMount_table -> tvMount_other;

tvMount -> tvMount_wall;
tvMount_wall -> tvMount_flat;
tvMount_wall -> tvMount_swivel;
tvMount_wall -> tvMount_other;


//Components
component [label = "Component"];
component_DVD [label = "DVD"];
component_CD [label = "CD"];
component_cableBox [label = "Cable Box"];
component_keypad [label = "Keypad or\npanel"];
component_sysControl [label = "Control Sys."];
component_processor [label = "Processor"];
component_VCR [label = "VCR"];
component_computer [label = "Computer"];
component_amplifier [label = "Amplifier"];
component_other [label = "Other______________"];
component -> component_DVD;
component -> component_CD;
component -> component_cableBox;
component -> component_keypad;
component -> component_sysControl;
component -> component_processor;
component -> component_VCR;
component -> component_computer;
component -> component_amplifier;
component -> component_other;
//Furniture
rack [label = "Rack"];
rack_plain [label = "Plain"];
rack_custom [label = "Custom Cabinetry"];
rack_RU [label = "Closet (mid-atl\nstyle)"];
rack_freeStanding [label = "Free Standing"];
rack_other [label = "Other______________"];
rack -> rack_plain;
rack -> rack_custom;
rack -> rack_RU;
rack -> rack_freeStanding;
rack -> rack_other;
}

November 08, 2006

mmm Lighting

Just a quick post to state:
1. OpenGL GL_COLOR_MATERIAL is awesome. Making things shine is easy.

2. OpenGL display lists are wicked-fast.

3. Shark is still my friend.

4. GDB is still my friend.

5. Pass-by-reference is my friend, and my evil foe...


Things is getting prettier and prettier (and the drawing of this animates, too)

mmmLighting.jpg

November 04, 2006

Portfile as howto

I had an interesting Apache gdb session recently wherein I discovered that the Apache Portable Runtime (APR) package on one of my clients' shiny new Debian Linux boxes was.... well ... completely borked, causing a segfault for every apache child process. It's my fault for using the testing distribution, but (hey!) the box isn't all that important and it's an excuse to see what's new in Debian-land. However, as I actually do want to serve a web page from this machine, I figured it best not to further trust the package manager to find me non-broken software. I decided to download APR and friends + apache and compile it myself. The last time I did anything like this, I used MacPorts (then darwinports) to compile and install apache on my mac at home, a very "batteries included" affair as MacPorts selects a good set of default options for me. After some attempts to grok the various configuration options for Apache, I decided that I really just wanted the same options I have installed on the MacPorts+OSX box at home. Enter MacPorts happily human readable portfiles.

In the MacPorts portfile for apache we find the configure.args line.

configure.args --with-apr=${prefix}/bin/apr-1-config --with-apr-util=${prefix}/bin/apu-1-config --libdir=${prefix}/lib --with-expat=${prefix} --with-pcre=${prefix} --mandir=${prefix}/share/man --enable-mods-shared=all --enable-ssl --with-ssl=${prefix} --enable-deflate --enable-proxy --enable-proxy-connect --enable-proxy-http --enable-proxy-ftp


All that was necessary was to make the prefix variable point to where I wanted to install apache, drop in the args above for the ./configure script, and everything compiled without a hitch. I did already have the various other dependencies (ssl, etc.) installed on my system from the aborted attempts at installing the Apache2 package, so there were no surprises from missing libraries. Editing the (happily very clear and atomic) default apache configuration files a little brought me to the necessary service configuration very quickly. Now I have virtual hosting, mod_rewrite (to send all requests on port 80 to the https port), and some other nice features running on the very latest stable Apache2.