Saturday, October 27, 2012

Reversi to HTML5

I still have not found any time to continue work on my reversi app. I'm not planning on changing the development language of the game logic due to lack of time, but for the interface it might be a good exercise to try jquery mobile and html5. @Rockncoder has some slides on beginning HTML5 mobile game programming. I would like to make a sprite map to animate disc turnovers during a reversi turn.

As described in the slides, a sprite is a two dimensional image that gets placed into a scene. The map part means that there is a single file composed of several individual sprites. From what I've read, having a single file makes the transfer from server to browser more efficient. Perhaps this is because there are fewer transfers to setup.

On the other hand, I was originally planning on using an animated gif to animate the disc turnovers. A timer would start at the start of the animation and then swap out the animated gif with a regular image at the end of the turnover sequence. This method has a chance of getting the animation out of sync with the image swapping, so the sprite method seems better.

A Github repository has the demonstration code associated with the slides. I also need to look for images to make the sprite map for reversi. To animate the turning, I plan on scaling the images of the black and white disc and saving out the different scaled images with sumo paint online. A different github repository by Christian Cantrell has some images I can try to do this with. They have a transparent background so hopefully all I will need to do is scale the png files.

I don't have much experience with the sumo paint web site, but I assume scaling the images shouldn't be that hard. There should be a way to upload the images and then apply an image resize tool to them. Hopefully it will remember the background is transparent. Also, the newly sized image will need to be recentered and the image background size preserved to keep the sprite sizes the same. Also, since the goal is a collection of images in a sprite map, some of the images may need to be separated out and then put back together. That way, the original images will not get scaled along with the images of the discs turning. Recentering is important so that the disc does not shift during the turnover animation. One way would be to calculate the difference between the new image size and the original image size, divide by 2, and then shift by that amount.

So my next steps for the reversi project are to scale some disc images, collect them into a sprite map, reuse parts of the sprite engine from @rockncoder, and make a test html5 and javascript page that animates disc turning.

Sunday, October 14, 2012

Reversi Blog Posts

I still haven't worked on my Reversi program since the last post. Instead, I did some web browsing and found a blog post by some one who wrote an Othello program in C#. He has several posts on the topic that look like they could be educational. I only had time to look over a couple of them. The Othello program part 2 post had an interesting trick on how to encode a position on the board. Instead of a coordinate pair such as 0,0 or 7,7, he transformed the location into a single offset 0-63 and then started the offset that from a letter to turn the description into an alphanumeric. Since it is text it could now be transmitted as part of a hyperlink.

My current system is not as simple. To turn the coordinate into text I used base64 encoding of a byte array. Each byte I separated into a low and high 4 bit number to get a board coordinate. Base64 uses 6 bits instead of all 8 bits. However it still needs to end on a byte boundary and is an extra call. The minimal amount of bits to describe a coordinate is 6 bits, so it could map to Base64 encoding. However, it seems like it would get complicated aligning a series of 6 bits numbers to byte boundaries so I didn't go to the trouble of doing so.

A calculation can describe a rough estimate of the savings. For a maximum of 60 moves that could be played the single offset method would simply describe it with 60 bytes. If encoding with 6 bits instead of 8 bits, that would result in 360 bits or 45 bytes. So a potential savings of 15 bytes at the end. It seems like a lot of complication for 15 bytes so I haven't done it yet, but there is a difference that could add up if this operation is done a lot. However, if one decides to just send back one move at a time the base64 encoding would actually take up more bytes than the single character encoding method.

This seems like a change of detail that I might have enough time to do over a weekend. However, I would still need tools to quantify the benefit of making a change to 6 bits, while the change from a pair of numbers to a single character is clearly simpler to work with and may be the way to go. Hopefully, reading his other Othello blog posts will encourage me to work on my project again.



Saturday, October 06, 2012

Ruby Reversi

My progress on a reversi program has stalled. To help revive my interest in the project, I looked around for Ruby implementations. There are a couple from Japan on github. The one called Ruby Reversi looked like it would be easier to understand since it looks like a console application rather than an entire Rails app.

So far I've tried to get a grasp of the overall organization. It looks pretty logical. There are divisions based on the user interface, AI, game rules, board data, and some kind of dynamic controller. Of these divisions, two differences from my project that stand out. One is the separation of the game logic from the board's 2-d array data structure. I'm guessing that separating the 2-d array data structure from the game logic enables the 2-d array to be more reusable while isolating the specific problem domain code in the rule files. Perhaps this also helps readability because once one reads the file name "array2d" the behavior of that file is understood, and one can pretty much skip reading that code.

The other major difference is the method of program flow control. I'm not that familiar with Ruby, but it looks like his or her design is event based. When the user interacts with the program their actions raise events and are not causing a method to be called directly. Instead, it looks like an action method routes the event to the appropriate behavior. Benefits of this design may be those of using the command pattern: undo and macro operations. However I don't see those in the design. I'm not sure whether I like this way of organizing the behavior as it seems to complicate the initial reading, but it could have benefits in terms of centralizing and organizing how a program behaves.

Overall it was interesting to look over some one else's design and see some differences, such as in the language and the organization. It was not entirely obvious what the benefits and drawbacks are to the various differences, but by working on this post, I hope some of them were revealed. I also hope this post encourages me to finish the project.

Sunday, August 19, 2012

git

While rewriting a reversi project from a game programming book to help myself learn python, I ran into difficulty reorganizing the code to extract out a new class. I'm not exactly sure why it took so long and still isn't readable. I believe if I had made the change on a parallel set of files I might now be able to go back and attempt to redo what went wrong. As a result, I'm installing git as a version control system even though I am the only one working on this project. I found a beginner tutorial on getting started with git and also found a git extensions project that has visual studio integration. Now I will need to remember to commit before each set of changes to the project. I had already installed git on a laptop, but lately I've started to develop on my old desktop where I had not done much work on as far as I can recall.

Sunday, July 29, 2012

I continued my attempt at improving at Python by checking with others who are willing to look over code and suggest improvements. They provided most of the code below.

One change  in their updated solution is to use lazy evaluation with yield and itemgetter. A nice change to the list comprehension allowed the removal of the len and range and just iterated over each player in the player list to make tuples. The names were clarified to playerRolls and playerGroups instead of referencing a data structure.  The flag to repeat rolls for ties with a while loop has been cleaned out in favor of recursion down each branch.

I modified the previous code by putting it in a function and adding a roll parameter to let me test their code. The pattern of ordering of player's rolling has been changed. It is like a depth first tree traversal now rather than breadth first.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from itertools import groupby
from operator import itemgetter
from random import randint
from collections import deque
 
def rank_players(playerList, roll):
    playerRolls = [(player, roll()) for player in playerList]
    playerGroups = groupby(
        sorted(playerRolls, key=itemgetter(1), reverse=True),
        itemgetter(1))
    for key, group in playerGroups:
        grouped_players = list(group)
        if len(grouped_players) > 1:
            print('tied, need to reroll',grouped_players)
            for player in rank_players(zip(*grouped_players)[0], roll):
                yield player
        else:
            print('rolled ',grouped_players[0])
            yield grouped_players[0]
 
rollData = deque([ 6, 4, 4, 4, 3, 3, 3, 2, 2, 2, 3, 3, 3, 4, 5, 6 ])
order = rank_players(['one','two','three','four'], lambda: rollData.popleft())
print(list(order))
 

Saturday, July 14, 2012

Python review

I'm starting to forget some python. I've also wanted to work on an old problem encountered at school. So, tonight I'm going to work on it with python.

This particular roadblock to completing the old assignment wasn't that difficult, but for some reason we weren't able to write a solution I felt comfortable with. In the end, the simplest thing to do would've been to randomly pick a permutation of a list. Python provides a shuffle function to do this.

from random import shuffle
x = ['player t', 'player u', 'player v', 'player w', 'player x', 'player y', 'player z']
shuffle(x)
print(x)

Some how we ended up wanting to do a more complicated system to order a list of players. It was about 5 years ago, but I believe the reason was to more faithfully simulate our interpretation of how the game assigned for homework was to be played.The decision was made to go through this sequence:
  1. Each player would roll a die. 
  2. Ties result in another set of rolls to break the tie. But any higher values still count towards ranking ahead of lower values.
  3. For players who did not tie, their relative position would be determined by how high their roll was.
For example, we could have three players, X, Y, Z. If X and Y both rolled a 6 and Z rolled a 1, Z would be assigned the last spot and X and Y would roll again. If X got 5 and Y got 4 for their second rolls, the final order would be X, Y, Z. The follow diagram illustrates that example:

Looking back at it now, it seems to be like a tree expansion. Tree nodes would represent groups of players. For example, the root would be all unsorted players. Visiting the node would generate children by having each player roll their die. A child node of the root could be the players who tied the first round of rolls. Leaves would be players who did not tie. After all the nodes are expanded into leaves, an inorder traversal of the tree would result in the ranking.


from random import randint
from itertools import groupby
 
tree = [['player t', 'player u', 'player v', 'player w', 'player x', 'player y', 'player z']] 
nextGeneration = []
keepPlaying = True
while keepPlaying:
    keepPlaying = False
    for node in tree:
        if len(node) == 1:
            nextGeneration.append(node)
        else:
            keepPlaying  = True
            rolls = [randint(1,6) for i in range(len(node))]
            turn = sorted(zip(rolls,node), reverse=True)
            print 'players roll:', turn
            for key, group in groupby(turn, lambda x: x[0]):
                nextGeneration.append(list(i[1] for i in group))
    tree = nextGeneration
    nextGeneration = []
print([item for sublist in tree for item in sublist])


If I recall correctly,this is what we wanted to do about 5 years ago in school. I don't see much use for it now though other than as an exercise in python. I need to think about how to test it more and make it more testable. A gui might help debug it and make what is happening clearer. At least I learned a little bit about groupby, sorted, zip, and list comprehensions. 

Friday, June 29, 2012

Roku Whiteboard Drawing App

A video on youtube demonstrates a Roku whiteboard drawing app. The author draws on an Android tablet and the tv syncs with a server to show the changes. He has posted the code on github. I hope to browse the source code in the future.

Tuesday, June 05, 2012

8x8x8 LED Cube

I'm looking into building a box with an LED array. An example of one in action is a video on youtube that demonstrates an Asteroids game on an 8x8x8 cube. Right now I need to determine what kind of power supply to get to attach to a driver board, like a rainbowduino. It looks like 9V is recommended for that particular LED driver platform, but it accepts a range of voltages. Also I will need a shield with buttons to control the lights and an Arduino uno to connect the shield with the LED driver.

Saturday, May 26, 2012

Rovio Battery Issue

I had some time to play with a WowWee Rovio robot recently. It is having a battery charge issue where it runs out of charge quickly. A guy posted a fix for his Rovio battery issue online where he found a diode was installed improperly. However, in my case it appears the diodes match the silkscreen direction.

Sunday, May 13, 2012

Machine Learning Class

I'm struggling through a machine learning class in LA. It is difficult to find the time for it and it is a very specialized topic.

On the other hand, seeing how math can be applied to solve problems with a computer is interesting. It seems that using a dedicated tool is a better start than coding up something in C#. For example, I've seen Roborealm applied to machine vision. Presumably using its gui is easier than using opencv. In class there was a demo of  R and Jags. I've played a little bit with R in the past to plot some data and run a linear regression on it, but I feel like I'm just barely scratching the surface of this topic. 

Saturday, May 12, 2012

Software Requirements

A professor in the UK has the "No Silver Bullet" paper online.

This point from the paper is something I'm trying to remember and maybe follow up on later by reading about how Agile software development attempts to address this.

Requirements refinement and rapid prototyping. The hardest single part of building a software system is deciding precisely what to build. No other part of the conceptual work is as difficult as establishing the detailed technical requirements, including all the interfaces to people, to machines, and to other software systems. No other part of the work so cripples the resulting system if done wrong. No other part is more difficult to rectify later.



Sunday, May 06, 2012

Roku development

From the site:
Developing on Roku

Roku introduced the first streaming video player in 2008, in partnership with Netflix. In the first two years nearly a million units have been sold in the US, and there are now over 100 channels available in the Roku Channel Store. Roku is the most affordable product for consumers looking to stream video over the Internet to their TV, and the most open for developers and content owners looking to reach new audiences.

For content owners or distributors, Roku represents a very cost-effective means to deliver their content to a rapidly increasing number of households. Roku has relationships with leading Online Video Platforms and development partners to further simplify bringing your content to Roku.

An open platform, Roku’s Streaming Player enables content owners to bypass traditional distribution routes and reach views and consumers directly. Roku’s platform allows a wide variety of channels and monetization options.

Wednesday, April 04, 2012

Kivy

A github project named Kivy sounds like an interesting chance to try using python for mobile apps.

From the official site:
Kivy - Open source library for rapid development of applications
that make use of innovative user interfaces, such as multi-touch apps.

Cross platform
Kivy is running on Linux, Windows, MacOSX, Android and IOS. You can run the same code on all supported platforms.

It can use natively most inputs protocols and devices like WM_Touch, WM_Pen, Mac OS X Trackpad and Magic Mouse, Mtdev, Linux Kernel HID, TUIO. A multi-touch mouse simulator is included.

Business Friendly
Kivy is 100% free to use, under LGPL 3 licence. The toolkit is professionnally developed, backed and used. You can use it in a product and sell your product.
The framework is stable and has a documented API, plus a programming guide to help for in the first step.

GPU Accelerated
The graphics engine is built over OpenGL ES 2, using modern and fast way of doing graphics.
The toolkit is coming with more than 20 widgets designed to be extensible. Many parts are written in C using Cython, tested with regression tests.

Friday, February 03, 2012

Go Language for Python programmers

I came across a blog about visual effects and scripting. The author, Justin, has a post about learning Go for Python programmers that looked interesting so I'm logging it here. Before reading about Go, I knew only that it was developed in-house by Google. Thanks to the article I now learned that a reason to use it is to get C++ performance with Python syntax. I've been trying to learn more Python lately so I don't think I'll be switching to Go, but it was nice to learn a bit about Go's community and goals.

A Swarm of Nano Quadrotors

Experiments performed with a team of nano quadrotors at the GRASP Lab, University of Pennsylvania. Vehicles developed by KMel Robotics.

A Swarm of Nano Quadrotors

Monday, January 09, 2012

Project Possibility

From the website - About Project Possibility

Project:Possibility is a nonprofit organization dedicated to creating groundbreaking open source software for persons with disabilities. We inspire students through university coding competitions that introduce them to the possibilities unlocked by accessibility and open source assistive technology. Then we connect these students to our community of persons with disabilities and software developers, a collaborative community that creates access to experiences previously impossible to achieve.

Join us in our mission to make the vision of universal accessibility a reality!

Sunday, January 08, 2012

Processing

From the Processing.js web site:

Processing.js is the sister project of the popular Processing visual programming language, designed for the web. Processing.js makes your data visualizations, digital art, interactive animations, educational graphs, video games, etc. work using web standards and without any plug-ins. You write code using the Processing language, include it in your web page, and Processing.js does the rest. It's not magic, but almost.

I heard about this some weeks ago and need to check it out some time.

Saturday, January 07, 2012

Chinese Character For Next Page - #3

下页 (Xià yè) - Next Page

Google translate has a feature to click on a word for alternate translations. Upon trying out this feature, I learned today's character can mean either "next" or "next page".





Friday, December 30, 2011

Chinese Character For Previous - #2

上页 (Shàng yè) - Previous


上一页 (Shàng yī yè) - Previous


Google translate has a text to speech feature that works for Chinese now:

According to the wikipedia article on Google translate, this feature's support for Mandarin launched on December 2010 and the open source project eSpeak was used. From its home page on Sourceforge, eSpeak uses something called a "formant synthesis" method. On eSpeak's languages page is a request for help from native speakers. A list of "provisional" languages indicates the ones that need help. Currently Welsh, Ancient Greek, Hindi, Armenian, Indonesian, Icelandic, Lojban, Georgian, Latin, Macedonian, Norwegian, Russian, Albanian, Vietnamese, Cantonese Chinese are listed.


Tuesday, December 27, 2011

New Year's resolution

一般
Yībān

I'm planning on doing a series of posts on Chinese characters for the New Year. Hopefully I will learn a little bit and have a chance to use some of the knowledge gained by taking an online a.i. class.

Today I did a Google search for a character meaning, and the engine figured out Google translate would be helpful.



Friday, October 21, 2011

Another whiteboard

Codeproject.com has some whiteboard projects to look at. An html5 canvas based whiteboard looked interesting. Besides the code, the author also helped by documenting a bit about how it works. Screenshots were included. They show the drawing board and a chat message box for text conversations. Drawing functionality included making a line, erasing, and clearing the entire space. The writeup also describes that he decided against polling to update the server due to scalability and user experience issues. He mentions the terms HTTP Push or Comet as alternatives, but he picked the WebSocket feature of HTML 5 for ease of implementation. However, his code still needed to "chunk" the message data into pieces small enough to transfer via the socket.

Thursday, October 06, 2011

Bournemouth University

YouTube has some videos of students in the Master of Digital Effects at the National Centre for Computer Animation.

From their page:

Using digital tools to create visual effects for film and television. Visual effects are typically shots or sequences of images that cannot be created live in front of the camera, but have to be created using production and post production processes.

The core of digital effects is the combination of captured live action with synthetic images, though sequences that are created could be all CG or all live action. The digital tools can take a variety of forms, including 3D softwares and compositing softwares. The main softwares taught and used by the students are: Houdini,Nuke, PFTrack.

Objective of the programme

Creating future industry leaders. People who, with time and experience, will become the next generation of visual effects supervisors and designers.

Saturday, September 24, 2011

Dabbleboard

From the Dabbleboard web site:

Dabbleboard is an online collaboration application that’s centered around the whiteboard. With a new type of drawing interface that's actually easy and fun to use, Dabbleboard gets out of your way and just lets you draw. Finally the whiteboard enters the digital age!

It seems to have some object recognition software that helps clean up rough lines, squares, and circles into cleaner geometric shapes.

Also, since the board is web based, naturally the video demonstrates online collaboration on a whiteboard.

Friday, September 23, 2011

Shell scripting

I would like to learn more about shell scripting but am uncertain whether to learn something like Bash-scripting or find and read Python shell scripts.

One advantage to Bash-scripting is mentioned at reddit:

Python uses more memory and requires more disk space to be installed. This is might be important in small resource constraints environments such as embedded systems or small VMs.

Also the shell is always running and so shell scripts should start up faster than Python scripts.

Perhaps on a low cost embedded device Bash-scripting is the way to go. I will try to follow up on this later. As far as I can tell, one must have a shell on the system to work with, but having python is optional if one is willing to give up a lot of software. Therefore, for a system with limited hardware, in a sense you get bash scripting for free.

Prusa Mendel

From the Prusa Mendel web site:

Prusa Mendel is the Ford Model T of 3D printers.

Like the Model T, the Prusa Mendel improves on a previous design by being more streamlined for manufacture. The Prusa Mendel is a simpler remix of the original Mendel. By default, it uses printed bushings instead of regular bearings, though options to substitute inexpensive lm8uu linear bearings or other types of bearings or bushings are available. The current version uses three 608 bearings in total, one for the X axis and two for the Y axis. The 624 bearings are gone altogether.

Prusa's main goal is to be the purest and simplest 3D printer you can build.

I would like to learn more about this printer, but I need to finish some other, easier projects like the pong clock. Some day I would like to find a database of 3d models to print with such a machine. Maybe it could use html5 canvas 3d elements to preview the printable objects.


Saturday, August 27, 2011

Introduction to A.I. class

A web site is offering a free online course:

A bold experiment in distributed education, "Introduction to Artificial Intelligence" will be offered free and online to students worldwide during the fall of 2011. The course will include feedback on progress and a statement of accomplishment. Taught by Sebastian Thrun and Peter Norvig, the curriculum draws from that used in Stanford's introductory Artificial Intelligence course. The instructors will offer similar materials, assignments, and exams.
I have been doing some preparation for that online class lately. I bought a used copy of an older edition of the textbook, Artificial Intelligence: A Modern Approach, and am skimming the early chapters. The site mentions the book is optional though so I doubt it will help much with the work for the course. However, the book has shown some usefulness. Of course, having enough time to continue my studies is next to impossible.

Why take the time to do this course then? Clearly, by taking the course one would learn some of the basics, but what could one hope to accomplish with this knowledge? Many examples exist of what people have already done with a.i. The class site mentions things such as humanoid robots, Google goggles, and self-driving cars. An example closer to every day life would include household electronic devices that have a learner feature to gather information from their environment and then behave differently. Yet, I don't see myself working with cutting edge projects like Google goggles. Those types of projects seem more appropriate for people who could teach this course rather than one who needs to take the course. What kind of application of this learning would be simple enough for me to do but still be of help to some one else or myself? Perhaps applying a rational agent, as the book calls it, to a video project would be something approachable. I've seen a C++ boids example and Blender already has a boids particle system. I'm going to need more time to ruminate on this.

Thursday, August 18, 2011

Robot army video

from the description of the robot army video at youtube:

You could call it Mission Impossible: Robot Library Heist. An army of flying, rolling, and climbing robots have been taught to work together to find and snatch a book from a high shelf.

In a striking display of military-like precision, the robotic team, duhttp://www.blogger.com/img/blank.gifbbed the "Swarmanoid", attacks the problem with flying "eye-bots" and rolling "foot-bots". A "hand-bot" then fires a grappling hook-like device up to the ceiling and scales the bookshelf. Footage of the experiment, conducted by Marco Dorigo at the Free University of Brussels, Belgium, and colleagues, won the video competition at the Conference on Artificial Intelligence in San Francisco earlier this week.

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.

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.

Thursday, January 20, 2011

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

Mr. doob's blog has a library to do 3-d with javascript. I plan on checking it out later.

It is available for download at Github.

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.

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

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.

Sunday, May 02, 2010

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.

Tuesday, April 27, 2010

overview of ray tracing

An overview of ray tracing is available at a siggraph web site. I'm looking into it as a way to learn some 3-d graphics math by applying it in a simple program. Unfortunately I'm expecting the images produced by such a simple program not to be very interesting.

The pictures at this site about terrain generation with ray marching do look interesting though, and the author claims that the code is simple as well. Also, the explanation of the method involves techniques similar to ray tracing.

Saturday, April 03, 2010

First iPhone Application tutorial

With the wifi version of the iPad now available, I decided to try again to make my first iPhone app. Also, fortunately I had some extra time off from work with this being Easter weekend. So, I went over this tutorial for making a Hello World type of iPhone application. It has a bunch of stuff with gui building that seems to make it a worthwhile exercise. That is, it should be more useful than a tutorial that just displays some words on the screen. There are text boxes that take in strings, and a button that responds to tapping by displaying a message in a label control. In other words, it does some basic input and output together with event handling.

Saturday, March 20, 2010

Jansen walking machine animation

An animation of a Jansen walking machine is on sidefx software's website. The artist used Houdini and its support of expressions to create it.

Wednesday, March 10, 2010

Rendering Tips

This blog has a bunch of tips on how to avoid bad renders: Stopping Bad Renders...By Per Andres.

It is a Cinema 4D specific blog, but it looks like some of the tips could apply to Houdini as well.

Curves

This is to record a blog entry with a visual dictionary of special plane curves.

OpenCL blog post

A blog describes possible Blender improvements using OpenCL. It also has some tips on installing it in Ubuntu 9.10, 32 bits, Ati 4770.

Friday, February 26, 2010

Performance Comparison of Houdini and SoftImage

ICE vs VOPs a performance comparison

The author of this blog entry describes how SoftImage's new feature called ICE compares with Houdini's VOPs. Both applications now have a node network, and the author shows some examples of them with some screen shots of tests he runs. These five tests are empirical in the sense that they are experiments that measure the time it takes to complete certain tasks. By presenting this timing data, the writer strikes a neutral tone while still encouraging the reader to make a value judgement about SoftImage's performance wins. While the differences in time he presents are in the range of seconds, it seems reasonable that such a performance improvement could build up to hours for renders with a large number of frames and calulcations. I haven't worked with Houdini or SoftImage for several months now, but this comparison still looked interesting.

Tuesday, February 16, 2010

High Speed Robotic Hand

http://www.youtube.com/watch?v=bfdHY26E2jc

from Ishikawa Komuro Lab, University of Tokyo:

Concept

Interactions in the real world (not only physical but also social and psychological interactions) are inherently parallel phenomena. By constructing models and engineering systems that take into account such parallelism, one can expect a better understanding of the real world as well as enhanced performance of systems when dealing with practical applications. These fundamental considerations lead us to concentrate on parallel processing for sensory information. Four main related topics are currently being explored in Ishikawa-Komuro Laboratory:

  1. Sensor Fusion theory and implementation in engineering systems;
  2. Dynamic Image Control Dynamic control of image based on high-speed visual information processing;
  3. Massively parallel image processing through a Vision Chip, which is capable of realizing high-speed real-time vision tasks on the basis of VLSI technology, and
  4. Meta Perception concerns ways of capturing, manipulating and presenting information which is normally inaccessible to humans and machines.
  5. (Past research on Optics in Computing: architectures that combine the advantages of optics and electronics to realize enormous computing throughput)

Saturday, February 13, 2010

Another Demo of Importing Data into Houdini

There is another demo of importing data into Houdini shown on the Houdini Community Blog. It demonstrates an program using OpenCV to send out data that Houdini then uses to change perspective of a camera. I don't have time to pursue this right now, but perhaps some time later it could be useful for something else.

Thursday, January 07, 2010

Pessimistic article about OpenCL

Compilers and More: OpenCL Promises and Potential

from the article:
So let's accept and even celebrate OpenCL for what it is, and not try to make it what it can't be. There's danger is raising expectations too high, or claiming too much (a la Bernie Madoff); OpenCL can be influential and succeed without replacing other parallel languages. To correct Steve Job's quote: "While OpenCL is very similar in many respects to NVIDIA's CUDA, it adds features to take advantage of other targets; and though it's quite complex, it has the potential to deliver very high performance, and is much easier than trying to map your computation into OpenGL or graphics primitives." Hype I can agree with; but then, I'm not the Apple CEO.

Sunday, December 27, 2009

opencl

I'm starting to learn some of what needs to be done to use OpenCL by watching some podcasts here. OpenCL stands for Open Computing Language. It is a software development framework to aid doing general purpose graphics processor computing. So when applied in a program, some work is moved away from the cpu over to the graphics board across a bus. Even though moving data back and forth between the cpu and gpu is slow relative to the number of instructions a cpu could have executed on data had it not been moved, the speed of newer graphics boards with certain operations, like doing many simultaneous floating point calculations, can make the operation result in a net improvement in performance.

The Khronos group defines the OpenCL specifications. They also handle OpenGL. According to web articles both Nvidia and ATI now support OpenCL in many of their graphics boards. However I've seen some people mention problems trying to build and then get samples of the library to work with their graphics cards.

Friday, December 04, 2009

Surface Shader update on Vimeo

PQ Houdini posted an update to the surface shader of a brick. The update corrects some flaws with the previous shader.

Saturday, November 21, 2009

PQ Houdini Tutorial on Vimeo

Some additional video tutorials by PQ Houdini for the 3d application Houdini are available on Vimeo. The brick shader he built in VOPs looked interesting. Many of the operators in the video were new to me, such as filter and color mixer. I haven't made much progress with Houdini since the last post, but perhaps this site will help.

Saturday, October 10, 2009

Houdini and 3DConnexion Devices

A blog entry at geneome.com describes an attempt at using Python to enable 3DConnexion SpaceNavigator support in the Houdini 3D app.

He mentions a complication involving the lack of _ctypes.pyd in the Houdini Python distribution. Houdini 10 includes Python 2.5 and some commonly used modules with its 3d app, but apparently it was not enough for this project. I don't completely understand the post, but it sounds like this prevented the Python comtypes module from working, and that prevented Python from polling of the device driver using COM (Component Object Model). A workaround involved compiling the needed module himself with the Python compileall module in Houdini and then putting the binary code in the lib directory of Houdini. I'd never heard of the compileall module before reading the post and will take quick look at it later.

Another complication involved Houdini freezing during display of data from the 3dConnexion device into a window.

He posted a video of a demo to vimeo.

The post also references an odforce post with some one else's Python code that does the same thing and was apparently was developed simulaneously.

From the post:
The SpaceNavigator seems ideally suited to be able to control not just a camera but any object in 3 dimensions, provided that the application can see and understand the device.

Wednesday, October 07, 2009

more cg roundup podcasts

CG round up podcasts 6 & 7 are now available at www.cgroundup.com.

I still haven't gotten to listening to them yet.

A comment on one of these new podcasts mentions a blog post that does a comparison of ICE vs. VOPs. Looks interesting.

Thursday, September 24, 2009

Houdini books with applied math

Some books recommended for helping learn shader writing and math applied towards graphics are listed here on a Houdini forum.

They include:
Advanced Renderman
Texturing and Modeling, A Procedural Approach
Essential Renderman Fast

Maybe later I will attempt to take a look at a portion of one of them.

Wednesday, September 23, 2009

odforce post

Odforce.net has a blog post about Houdini and the HDK docs. They explain that the HDK is the best way to add extra functionality to Houdini, but VEX and Python fill a need inbetween the GUI and HDK programming. I'll need to investigate this further to understand what this means. There is also steep learning curve mentioned in the entry.

PICAXE microcontrollers

I purchased some PICAXE microcontrollers recently and hope to program them later. Tonight I tried out the programming editor and logic software by writing a simple program that played a note. Also noted forum post that the 12f683 label on the chip is correct even though it doesn't match the PICAXE name for the chip.

Tuesday, September 22, 2009

Blog entry for an HDK project

Here is a blog entry about using the HDK that is about four years old. According to the post, he attempted to get data from a joystick into Houdini. He wrote his own CHOP (Channel operator) to do this. SDL, a game library, was used to get joystick information. The entry contains some steps he took to build and link to the HDK using Visual C++ and Windows. He mentions a plan to use Python and PyGame, but I'm not sure whether that means he got his Python code to connect to C++code because he mentions a C++ compiler.

Actually, a more recent post here describes this project at a finished stage. From the snippet of code it looks like he ended up using the C interface to SDL.

Saturday, September 12, 2009

Houdini HDK

Noted that sidefx on Twitter mentions new Houdini Developer Kit (HDK) documentation is available at http://www.sidefx.com/docs.

Houdini has a Houdini Object Model (HOM) that can be accessed from Python. This link notes that together they may be used for HDK development, network rendering, and animation workflow.

From the site:

The Houdini Developer's Kit [HDK] is a comprehensive set of C++ libraries that give third party developers access tot he same API used by developers at Side Effects Software.

With the HDK, you can create plugins to customize virtually all aspects of Houdini.

Monday, September 07, 2009

Ubuntu Remix

Ubuntu 9.04 Netbook Remix is something I'm trying out. Some issues with certain models are listed here. It is free to download. The site has instructions on using win 32 disk imager to create a bootable USB flash drive. They provide a link to launchpad.net to get it. The instructions explain that a CD image file format extension is .ISO and a flash image file extensions is .IMG. 1 GB or more of space formatted in FAT32 is needed. Also, the image is the only thing allowed on the flash drive. All preexisting files get deleted. The bios settings may need to be changed to attempt to boot from a flash drive before other devices.

Thursday, August 27, 2009

Python ocr and opengl libraries

I plan on looking into Python libraries pytesser and pyopengl later. Pytesser is an ocr library accessible from Python. Pyopengl provides opengl access to Python.

I've downloaded Eclipse and pydev to start with. The web site says it supports Python 2.4, 2.5, 2.6, and 3.0 syntax but that part hasn't worked for me yet.

Thursday, August 20, 2009

cgRoundup

Some Houdini related things to do include checking out http://www.cgroundup.com/ and the SideFX twitter account. The title of the last cg round up post is "cgR - Episode #005 - "Meet Eugene".

Sunday, August 02, 2009

Botanicalls Kits

http://www.botanicalls.com/about/

They did the original prototype with an Arduino and then went to a board that looks like a leaf.

from the web site:

Botanicalls opens a new channel of communication between plants and humans, in an effort to promote successful inter-species understanding.

The Botanicalls project is fundamentally about communication between plants and people. We are empowering both by inventing new avenues of interaction. Plants that might otherwise be neglected are given the ability to call and text message people to request assistance. People who are unsure of their ability to effectively care for growing things are given visual and aural clues using common human methods of communication.

Who are we?

Botanicalls is an ongoing collaboration between Rob Faludi, Kate Hartman, and Kati London.

Saturday, August 01, 2009

Flash player update

An update for the Flash player was just released.

From the site:

Update
: An alpha refresh of 64-bit Adobe Flash Player 10 for Linux operating systems was released on 7/30/09. The release versions of Flash Player 10 for Windows, Macintosh, 32-bit Linux, and Solaris are now available from the Flash Player Download Center. Please download the latest prerelease versions below.

Wednesday, July 01, 2009

2009 Apprentice Challenge

This is rather late, but about a month ago some people participated in a Houdini Apprentice challenge on YouTube:
http://www.youtube.com/group/3dworldchallenge

Monday, June 29, 2009

Google Trends

I've been looking for a use for Google trends lately, and today Rackspace showed up in the top 10. Apparently the web site outage affected so many people that search interest in the term jumped noticeably for that hour or so. So, I am thankful for the trends site. I was not web browsing at the time of the outage, and it was rather convenient to go to trends and find out about it. I realize the item showed up on the techcrunch blog. Perhaps that is a better solution to my search for technical news, but Google trends seems like a nice general purpose tool.

Tuesday, November 18, 2008

Adobe prereleases 64-bit version of Flash

I just found this blog post about a new way to install 64-bit Flash on an amd 64 without using nspluginwrapper. I haven't tried it yet though.

Friday, September 19, 2008

closures in functional programming

i ran across this blog posting about the use of a closure to make code maintenance and organization easier. i could use more information, but it seemed useful in terms of getting to know when a function like that would be helpful. i don't really understand very well exactly what a closure is, but i have an idea from the example and from the wikipedia article. it is function that may be used when doing functional programming and may involve anonymous functions accessing variables outside the function's scope.

Sunday, September 07, 2008

Houdini Training Product for Python scripting

A friend sent me this link for a training product called "Python: Creating Tools in Houdini". It sounds interesting because I've wanted to make a graphics related tool for some time now.

Saturday, September 06, 2008

panda 3d

I played a little with Panda 3d on a couple of nights. It has a Python interface and Linux installer that makes trying the initial tutorial pretty easy, but the engine is written in C++ for speed.

Sunday, August 31, 2008

Robot wall climber

An interesting article about a climbing robot is here.

console/window hybrid application

Some message board postings discuss a console/window hybrid application in C#. I'd like to see if adding a console interface during development to a program that is normally a gui might help with debugging.

functional programming

According to this article, closures and anonymous lambda functions are related to functional programming. I'm still gathering information about this. It does not look easy enough to use yet.

Talking Signs

More information about the Talking Signs project may be found here.

closures

This article discusses closures a bit. Perhaps it is one of the reasons for some people switching to Ruby. I heard of anonymous classes before and perhaps they are related to this topic, but I don't use them and am not familiar with when they should be used.

Thursday, August 28, 2008

SanDisk Boosts SD Card Speed by Fifty Percent

SanDisk Boosts SD Card Speed by Fifty Percent.

The New SanDisk Extreme III 30MB/s Edition SDHC Line Easily Supports Continuous Shooting Performance in Nikon's New D90 Digital SLR Camera

Tuesday, August 26, 2008

RIAS

Talking Signs Remote Infrared Audible Signage project:
http://www.geog.ucsb.edu/RIAS/

This technology is designed to substitute for missing visual cues for those with limited or no sight.

Gram-Vaani

How Community Radio Becomes 'Voice of the Village'

Researchers developed a low cost hardware and software platform for doing radio and wish to deploy it in India.

Sunday, August 17, 2008

Houdini Apprentice

Side Effects Software is offering a program called Houdini Apprentice for free. I tried out the 64 bit version for Ubuntu 7.10 on Ubuntu 8.04. Initially it had some GUI problems but a quick search of the forums helped by suggesting a change to the threading for the interface. The windowing still seems a bit unstable with the refreshes sometimes, but it is usable now. My friend and I tried to render an animation on the dual core machine and it did well relative to a pc with a single core processor.

world's biggest 3D display

world's biggest 3D display

Saturday, August 16, 2008

Cellular Automata

A game of life applet on the web is related to cellular automata. This should be looked into later.

Friday, August 15, 2008

Joel article about Hungarian notation

The Joel on software blog had an article on Hungarian notation. I don't use it, but he has some ideas that might help make use of it in a sensible way in the future. It helped me with an assembly language project at school when I had handles and pointers to deal with, but I'm looking into learning higher level languages now. He describes a rebellion against it starting around the initial .Net release time. He also mentions something written by Raymond Chen about exceptions hindering the safety of code. I've read people use exceptions differently in Python versus C#, but I need to actually find some code to see the difference. I'll need to look into this further later.

Tuesday, August 12, 2008

LiMo & android

Some other platforms planned for programming mobile phones are LiMo and Android. An article about them is at arstechnica. Android will be used by an organization called the Open Handset Alliance (OHA).

Monday, August 11, 2008

Chandler 1.0 released

An article noting the release of Chandler 1.0 and describing some of its history is here.

Sunday, August 10, 2008

Python development for Nokia S60

Nokia has a web site for development for the Nokia S60 here. It sounds interesting, but I don't know much about it yet. I've seen stuff mentioned about iphone development as well. I'm leaning toward the Nokia platform currently since it sounds cheaper and this would be done as a hobby project.

Thursday, August 07, 2008

picture of 27 hd monitor computer setup

A picture of a 27 hd monitor computer setup is on the web. The comments note that apparently the picture shown on the monitors is a desktop image with a menu option altered to "you wish".

Friday, August 01, 2008

invisible sphere

A invisible sphere monitoring device is mentioned at this site. It is kind of funny to see it labeled as invisible after seeing it.