Twitter icon.
Random notes on software, programming and languages.
By Adrian Kuhn

Archive for the ‘Uncategorized’ Category

Software by Night


Wednesday, April 21st, 2010

In this post I’ll present an idea from unpublished work that uses light effects to visualize dynamic information in Software Cartography. (If you are unfamiliar with spatial-representation of software please refer to “A Software cartographer’s Vision” previously featured on this blog.)

“Software is not just structural, but behavioral; so the next thing I would like to see is traffic and people walking.” — Rob Deline, in the question session of Frank Steinbrückner’s presentation at MSA 2010

Software visualizations typically convey a static view of software systems. Software maps are no different. On a software map all code of a system is shown—no matter whether it is used at runtime or dead code. This is just the same as with Earth when seen from space: at day you see all land masses but only at night it is revealed where human activity takes place and where not. So my idea is to realize the same for software maps.

  • use static information to group the software artifacts into structural clusters, visualized as land masses.
  • use dynamic information to embellish the visualization with behavior activity, visualized as sources of lights.

Light effects, such as flares and glow, make the execution of software visible. What we actually do is to add more dimensions to a two-dimensional visualization, just as Michele Lanza did with his seminal polymetric views. There seem to be three promising dimensions for light effects

  • brightness of light source,
  • blurriness of surrounding glow,
  • intensity of flares that flash up,

that are possibly best used in combination to visualize one or two behavioral properties.

When modelling animated visualization the notion of change is essential. Ben Fry’s work on organic visualization is a good source of inspiration to model time-dependent values, In his work he proposed intergrators as a new numerical data-type with first-class support for continuously changing values (as eg ease-in and ease-out).

Other than static numericals, integrators continuously change their value over time. Integrator values are in the continuous rather than discrete domain, they grow and decay rather than increment and decrement.

Fry associates each visual component with a set of set of static and changing values, using the data-types Numerical and Integrator. He describes an integrator as “a continuously changing value” and defines the following operations on integrators:

  • set() explicitly set the current value of the Integrator. Normally, this is only used to set an initial value for the Integrator.
  • impulse() adds a specified amount of force to the Integrator. Equivalent to
    incrementing a Numeric value, but executed in the continuous domain,
    i.e. the amount added attenuates over time.
  • decay() the opposite of an impulse. This is a decrease in the continuous domain. Often used to atrophy values over time.
  • attract() apply a force to move the Integrator towards a particular value. Instead of setting the Integrator to a particular value, a target value is set for the Integrator that it will reach over time. Enables smooth
    transitions if the target is changing.
  • repel() the opposite of attract, moves the value of the Integrator away from a particular numeric value. If the value being avoided is greater, the
    Integrator is decreased further. If less, the Integrator is increased.
  • update() this is used internally to update the Integrator’s current value on each time step, after calculating a new velocity based on the forces
    that have been applied to the Integrator by the rules that affect it.
  • reset() after each the current value is updated, the forces are cleared. New forces are added on each time step by re-applying the rules.

To implement software by night integrators are best used in order to add light effects to the still view of a static software map. Currently we formalized two light dimensions, flare and glow. So when a software artifact is used then it flashes up with a sudden impuls to attract the users attention and then decays in a slowly disappearing glow. Calls are visualized by sparks that jump from call-site to call-site. So users can se where current action is taking place, but also where past action has been taking place and how often it has been doing so.

Please note that “Software at Night” is not yet available in the downloadable Codemap plug-in. I am working on an external prototype for an upcoming publication, thought. The missing integration in Eclipse is mainly due to the lack of an easy accessible source of dynamic information within Eclipse.

To learn about new Codemap releases, follow http://twitter.com/codemap

Happy Hacking!

How-to Revert Safari to Version 4.0.2 and Thus Fix Inquisitor


Tuesday, January 5th, 2010

Recent versions of Safari don’t play nice with the Inquisitor search plugin. The only sensible fix seems to revert Safari to an older version.

Inquisitor is supposed to plug into Safari’s search bar to display a list of search engines instead of Google suggestions. However, after installing Safari 4.0.3 (or higher) that won’t work anymore. Google suggestion are being displayed on top of the Inquisitor drop-down!

Here is how to revert Safari back to version 4.0.2 once you’ve installed the latest version by mistake:

  1. Get a copy of the Safari 4.0.2 installer. This ain’t as simple as it sounds. Apple’s website offers the latest version only, and all usual download sites refer to Apple’s website only. You have to search the interwebs for a file called Safari4.0.2Leo.dmg. I was lucky enough to find a copy on an anonymous website, but Rapidshare or friends should do fine as well.
  2. Once you got the file, you should double check it’s SHA-1 digest against the one given in the Apple security announcement APPLE-SA-2009-07-08-1. Execute openssl sha1 Safari4.0.2Leo.dmg an the command line and compare the output to
    SHA1(Safari4.0.2Leo.dmg)= 48676afbb5c5bacac8610ba13f6851d3b266cb69

    If your output is not the same, the file has been tampered and you should not install it!

  3. Next you’ll have to patch the version number of Safari’s current installation. Otherwise the installer will refuse to revert Safari. To do so open the files
    /System/Library/Frameworks/WebKit.framework/Versions/A/Resources/Info.plist
    /Applications/Safari.app/Contents/version.plist

    and replace the version numbers with lower numbers. Anything lower than 5530.19 should do fine. You might have to change access rights to be able to edit these files.

  4. Now, you may eventually run the Safari 4.0.2 installer!

 

PS: As an Inquisitor user you might also be interested in turning off Inquisitor’s Yahoo suggestions. Being tracked by Yahoo instead of Google is “vom Regen in die Traufe geraten” as we’d say in German. To cover up your traces, open /etc/hosts and add the following lines

0.0.0.0 sugg.search.yahoo.net
0.0.0.0 clients1.google.com

this blocks the URL that are used to retrieve both Google and Yahoo suggestions.

Hello, worlds!


Saturday, April 12th, 2008

Welcome to my blog!

Eventually up and running. Setting the whole thing up has taken more time than planned, in particular doing my own Wordpress theme.

The title of this first post follows a programmer’s tradition. When learning a programming language, it has become tradition to write, as a first step, a program that prints the character sequence “Hello, World!” on the screen.

The shortest hello world program, written in the (admittedly rather esoteric) HQ9+ language, consists of a single letter.

H

Whereas the world’s largest hello world program ever, is this 160 by 160 meter semacode below, written in a wheat-field by German artist and programmer Bernd Hopfengärtner (via we make money not art).

Hello world semacode in a wheat-field near Ilmenau, Germany.

The most amazing hello world I’ve ever seen, however, uses curve fitting. A blogger named Poromenos recently presented a function f(x) that returns the ascii ordinal for each of the letters of “Hello world!”.

from math import *

def f(x):
    return int(round(96.75 + -21.98*cos(x*1.118) + 13.29*sin(x*1.118) + -8.387*cos(2*x*1.118)\
               + 17.94*sin(2*x*1.118) + 1.265*cos(3*x*1.118) + 16.58*sin(3*x*1.118)\
               + 3.988*cos(4*x*1.118) + 8.463*sin(4*x*1.118) + 0.3583*cos(5*x*1.118)\
               + 5.878*sin(5*x*1.118)))

print "".join([chr(f(x)) for x in range(12)])

If you are still not bored, you may check out the real cost of hello world by Coding Horror’s Jeff Atwood or this, rather unusual, hello world for startup wannabes by one Jason Brownlee.

cheers,
AA

For.example is Digg proof thanks to caching by WP Super Cache!