Wednesday, May 25, 2011
Python Houdini Tool Post
Jasonfugh.com has a post of some video of a Python based special effects tool he made that works with Houdini. It is his first tool that he has made for Houdini. The software lives in a separate window to help change a rain effect in the main window.
Sunday, May 22, 2011
Monday, May 16, 2011
Historic computers on the web
The visual6502.org project is an interesting idea. The founders of the group take an image of a processor such as the 6502 and then simulate its operation based on software that interprets the transistors in the picture. There is a javascript simulation that will run in a web browser if one wishes to try it out.
Sunday, May 15, 2011
Computer Graphics, Fractals, Demoscene
A friend found a site by IƱigo Quilez about computer graphics, fractals, and the demoscene. The math section looked interesting. I didn't have time to go over it much right now, but I hope to visit it again later.
Sunday, May 08, 2011
Application in Python Using a Trie
I found a blog entry that describes using a Python implementation of a trie to calculate Levenshtein distance quickly but have yet to find the time to the sample code out. His implementation looks very readable and the concepts familiar. It seems like trying his software out could be a nice continuation of the concepts of the last project.
Wednesday, February 16, 2011
Programming Contest 43
I submitted some code for a programming contest at a C/C++/C# blog. The first-place entry was more than an order of magnitude faster and had a higher score, but at least I learned something about software development.
The contest involved searching for words in a grid of letters, as in the game of Boggle. Once a word in the given dictionary file was found, information about it needed to be stored in a output file. This information included things like the word's first letter coordinate in the grid, the line number of the word in the file, the score, and the direction to read the letters. The direction was given as a series of numbers starting with 1 as North, 3 as East, 4 as SouthEast, etc. A word would still be valid even if it needed to be read right to left instead of left to right. The dictionary was limited to about 14,084 words that contained between 2 and 5 letters. This letter count limitation simplified things, as the game board itself was 5x5. So words would always line up in a horizontal, vertical, or diagonal manner. No bent lines needed to be figured. Scoring was kept relatively straightforward as a count of the number of letters in the dictionary word.
The letter Q presented a complication. In the Boggle game, the Q die always has a U. So even though a given series of letters might just be QA, In the contest, QUA needed to be logged since it was in the dictionary of valid words, and the U included in the score, for a total of 3. One more case had to be considered involving Q. If a U die followed the Q, then the pair was accepted as QU. In other words, a U was sometimes ignored.
Unfortunately for my entry's ranking, my code didn't report a case where a valid word had a Q that wasn't followed by a U; so it didn't get to tie with the higher ranked entries based on score. During development, I believed this wasn't a valid case, but after seeing the results, I believe it was, although I haven't gone through the output of the other entries to verify this. I posted a comment about this problem, but sometimes it is difficult to get feedback on every software requirement, and one has to make reasonable assumptions.
The input and output involved text files. No graphical programming was needed for this code. The input file consisted of 100 lines of 25 character strings that represented 100 grids of letters.
Optimization was very important because in the event that applications reported the same score for their grids, the faster solution was ranked higher. Multithreading was used by some entries since each of the 100 grids could be scored as a game independently of the other grids. In one case, the OpenMP api was used. The use of this api looked interesting because the syntax needed to parallelize loops was minimal. However, parallel programming can still be prone to bugs, and OpenMP apparently leaves things like race conditions up to the developer to design out. Also, I'm not sure if there is a profiling tool that would work properly when parallelism is used. The only thing I've found on Google is ompP. I haven't heard of it before, but then OpenMP is new to me as well. It is built into Visual C++ 2010 Professional, but isn't in the express edition. It needs compiler support to work. I may need to use gnu c++ to try it out sometime but am reluctant to leave C#.
I placed the code in a Github account for later. Perhaps I will be able to incorporate some of the ideas from the other entries into later revisions and see if the application runs faster.
The contest involved searching for words in a grid of letters, as in the game of Boggle. Once a word in the given dictionary file was found, information about it needed to be stored in a output file. This information included things like the word's first letter coordinate in the grid, the line number of the word in the file, the score, and the direction to read the letters. The direction was given as a series of numbers starting with 1 as North, 3 as East, 4 as SouthEast, etc. A word would still be valid even if it needed to be read right to left instead of left to right. The dictionary was limited to about 14,084 words that contained between 2 and 5 letters. This letter count limitation simplified things, as the game board itself was 5x5. So words would always line up in a horizontal, vertical, or diagonal manner. No bent lines needed to be figured. Scoring was kept relatively straightforward as a count of the number of letters in the dictionary word.
The letter Q presented a complication. In the Boggle game, the Q die always has a U. So even though a given series of letters might just be QA, In the contest, QUA needed to be logged since it was in the dictionary of valid words, and the U included in the score, for a total of 3. One more case had to be considered involving Q. If a U die followed the Q, then the pair was accepted as QU. In other words, a U was sometimes ignored.
Unfortunately for my entry's ranking, my code didn't report a case where a valid word had a Q that wasn't followed by a U; so it didn't get to tie with the higher ranked entries based on score. During development, I believed this wasn't a valid case, but after seeing the results, I believe it was, although I haven't gone through the output of the other entries to verify this. I posted a comment about this problem, but sometimes it is difficult to get feedback on every software requirement, and one has to make reasonable assumptions.
The input and output involved text files. No graphical programming was needed for this code. The input file consisted of 100 lines of 25 character strings that represented 100 grids of letters.
Optimization was very important because in the event that applications reported the same score for their grids, the faster solution was ranked higher. Multithreading was used by some entries since each of the 100 grids could be scored as a game independently of the other grids. In one case, the OpenMP api was used. The use of this api looked interesting because the syntax needed to parallelize loops was minimal. However, parallel programming can still be prone to bugs, and OpenMP apparently leaves things like race conditions up to the developer to design out. Also, I'm not sure if there is a profiling tool that would work properly when parallelism is used. The only thing I've found on Google is ompP. I haven't heard of it before, but then OpenMP is new to me as well. It is built into Visual C++ 2010 Professional, but isn't in the express edition. It needs compiler support to work. I may need to use gnu c++ to try it out sometime but am reluctant to leave C#.
I placed the code in a Github account for later. Perhaps I will be able to incorporate some of the ideas from the other entries into later revisions and see if the application runs faster.
Wednesday, January 26, 2011
Tries
I learned a little about tries, or prefix tries, this month. I checked out the Wikipedia article, a Top Coder article, and saw a forum post about Patricia tries. There is a basic C# implementation of a trie at my Github account. In that case, each node has a lookup array for 26 letters that leads to a subtrees or leaf. Adding to the tree involves traversing each node's array for each character in a word until the last letter is reached. A flag in the node marks the end of a word. When a string needs testing as to whether it is in the trie, the test can possibly stop after only traversing a small number of the leading characters of the word. However, keeping 26 references on each node could use up a lot of space, depending on the data. There is a lot more for me to learn about the subject, such as how it relates to edit distance and spell-checking.
However, I'm currently checking out hash tables as an alternative. I also read some people use suffix arrays as another choice.
However, I'm currently checking out hash tables as an alternative. I also read some people use suffix arrays as another choice.
Thursday, January 20, 2011
Thursday, October 21, 2010
Pulverize Effect
There is a video tutorial on creating a pulverize effect with Side Effect's Houdini 11. Sample .hip files are available for downloading.
Friday, July 23, 2010
GPU Ray Tracing
Just a note that it looks like there will be a GPU ray tracing birds-of-a-feather session at this year's SIGGRAPH. This year the convention is being held in L.A. I'm not planning on going to the convention, but it looks interesting.
Monday, July 12, 2010
3-D with Javascript
Sunday, July 11, 2010
Mac OS X OpenCV
Tonight I tried out the Mac OS X OpenCV port, version 2.0.1. An installation walkthrough specifically for Macs is available at http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port. I deviated from their instructions by downloading the tar directly from Sourceforge. I didn't have Mac Ports so I downloaded it next. Then I used the port command to retrieve cmake and built OpenCV by following the settings at the site above. Building it with cmake rather than the easier path they mentioned seemed like the path to enable the use of a webcam I'd like to try it on. However, the sample FaceTracker app chose the iSight camera.
To get the FaceTracker sample to compile, I needed to make some changes to the include files in the FaceTracker.cpp file. I changed #include<OpenCV/OpenCV.h> to #include <cv.h> and added #include <highgui.h> for the window calls. The Willow Garage site already had the instructions on setting the header search path so that these new header files could be found.
Also, I needed to update the OpenCV frameworks group in the given X-code project to include libcv.dylib, libcvaux.dylib, etc. This again was covered at Willow Garage under the section titled Using OpenCV libraries in an X Code project.
So in the end, OpenCV worked. I'd like to cross compile for the iPhone next. Some places on the web with more information about this topic include Yoshimasa Niwa's site and Info dan's site.
To get the FaceTracker sample to compile, I needed to make some changes to the include files in the FaceTracker.cpp file. I changed #include<OpenCV/OpenCV.h> to #include <cv.h> and added #include <highgui.h> for the window calls. The Willow Garage site already had the instructions on setting the header search path so that these new header files could be found.
Also, I needed to update the OpenCV frameworks group in the given X-code project to include libcv.dylib, libcvaux.dylib, etc. This again was covered at Willow Garage under the section titled Using OpenCV libraries in an X Code project.
So in the end, OpenCV worked. I'd like to cross compile for the iPhone next. Some places on the web with more information about this topic include Yoshimasa Niwa's site and Info dan's site.
Template change
The template for this blog was updated today. This is the first template update since the start of it. The new template has some features I didn't notice in the previous blog, but I didn't really look much before now. For instance, it has a gadget manager.
Tuesday, June 15, 2010
A Technical Director's personal website
I looked over a personal website of a fx td named Hosuk today. He has posted many pictures and some videos of some of his projects. He has examples that were created with Houdini and python as well as other software.
Monday, June 14, 2010
Scott Squires Bio
Some biographical information about the creator of the iphone Squiggles paint app.
Tuesday, May 04, 2010
Another post at real-time rendering
More interesting links posted at the real-time rendering blog.
The OpenGL 3.2 and GLSL 1.5 tutorial programs he mentions sound like they could be useful. I started to investigate the shader language part of OpenGL recently but didn't get very far. Using a gpu to speed up the drawing of computer graphics sounds like it could be useful thing to know. It seems the new features of OpenGL are encouraging that direction. At the least, I'm planning on reading the code for a phong shaded sphere at the tutorial site to compare with some the code of a toy ray tracer in Python.
The OpenGL 3.2 and GLSL 1.5 tutorial programs he mentions sound like they could be useful. I started to investigate the shader language part of OpenGL recently but didn't get very far. Using a gpu to speed up the drawing of computer graphics sounds like it could be useful thing to know. It seems the new features of OpenGL are encouraging that direction. At the least, I'm planning on reading the code for a phong shaded sphere at the tutorial site to compare with some the code of a toy ray tracer in Python.
Sunday, May 02, 2010
Image Convolution
A tutorial on image convolution is available on a page at Arizona State University.
Thursday, April 29, 2010
introduction to ray tracing
Eric Haines descibes on his blog a book called Another Introduction to Ray Tracing. It is a collection of articles about different aspects of ray tracing. The different articles describe a variety of topics and have reference links like wikipedia.
Subscribe to:
Posts (Atom)