interactive visualization of genetic algorithm

Recently, Palacky University Open Day happened to take place (20. 11. 2015). Together with colleagues, we decided to create small projects to promote the Computer Science Department in a way to attract high school students. Projects from colleagues included: LEGO-based Turing Machine (performing addition), OpenGL shading methods, Voxel graphics and reimplementation of Worms game among others. I had an idea to visualize the process of learning of solving of the Travelling Salesman Problem (TSP) using simple genetic algorithm (GA).

The developed application is an interactive tool for exploration of behavior of GA for TSP (see video). The left area shows the current state of genes in the population, the right panel consists of interactive control and performance plot.

Continue reading “interactive visualization of genetic algorithm”

deep map of curried function application over selectors

During experimentation with macro programming in Common Lisp, there emerged a need to transform a deep list into a deep list of its selectors. Recently, I realized that this selector transformation could be a fun way to show some aspects of functional programming. As such, I have decided to include it in the section of “fun” of fplib and will introduce this small example here.

I am often interested in composing together multiple higher-order functions, which—in such composition—do not to do anything at all (they are extensionally equivalent to identity).
Continue reading “deep map of curried function application over selectors”

kmischeme

During the first few lessons of functional programming, I have observed that students sometimes struggle with the definition of evaluation of element. Given the fact that it is core concept, it is quite important to understand it completely in the beginning of the course. I realized that it would be nice for them to have additional set of examples of step-by-step detailed evaluation of elements (in environment).

To stress the fact that it is completely mechanistic procedure, I have decided to construct a minimalistic interpret of Scheme (in python). This interpret outputs directly a beamer presentation of detailed evaluation of examples.

The set of evaluated examples could be possibly useful to anyone, so the set of presentations is here:

  1. primitive procedures
  2. define
  3. if + define
  4. lambda.

mouseless

The time needed to 1) grab a mouse; 2) move it; 3) click; and 4) go back to keyboard could be often spent more productively. From personal experience, the ability to use keyboard shortcuts could save decent amount of time. Sometimes, however, it seems that there is no other way other than to perform the mouse movement and click. This happens mainly because there is no keyboard shortcut to fulfill the desired behavior.

mouseless is a small python script, which enables fast movement of mouse cursor by successive division of screen. In effect, one can reach every pixel in small number of steps (logarithmic in size of screen) by using adequate keys on numeric keypad. An example of process of division is shown on the following video.

The video shows an use case, when one wants to close an interpret (e.g., after crash). In spyder (very nice interactive python development environment) does not seem to be shortcut to do so.
Continue reading “mouseless”