Drive-By Distributed Computing
Mega Super Computer
Programming and Design, 100218


I just put up a page that demonstrates my contribution about how to solve extraordinarily hard computational problems. I am at the moment working with genetic algorthim that uses distributed computing at home and I do JavaScript at work. So I just had to put them together: Drive-By Distributed Computing

- Aramis

Blogg listad på Bloggtoppen.se           Add to Technorati Favorites


Comments









The Dream Machine
Puzzling in Flash
Programming and Design, 091031


So, I spent the evening helping out my dear friend Anders with implementation of a puzzle for a game called The Dream Machine. Always a good thing to refresh and polish the Flash competence. Anders plus some other cool dudes are making this really unconventional and atmospheric game and I think you should check it out here: thedreammachinegame.com.

- Aramis

Read or Post Blog Comments



My first GA
My first attempt at Genetic Algorithm
Programming and Design, 091010


So, I am doing this program where I need a good genetic algorithm (GA) in search for the most optimal intervals. I have programmed a framework, that enables me to easily add new types. All I have to do is to implements the Gene interface and then I get crossing, mutation, serializing-n-deserializing to JSON and reboot of breeding environment and so forth for free. This is really, really awesome because now I can code what ever and then test for the best use of this what ever. I am truly happy.

I have not really tested it in my work yet, just been debugging and stuff, but now I will take it for a spin. Meanwhile I will put on my running gear and go for a run.

- Aramis

Read or Post Blog Comments



Hyper Media
An already realizable technology
Programming and Design, 090909


What it is: Right now it is only an idea of mine and Mike D. The idea is that you could make streaming content (such video, mp3, flash movies and whatever) searchable, taggable, linkable and so forth, just as we do with text.

How it works: It would be simple. Just as we make text clickable on a HTML-page, we could bind links to passages and places in as for an example a movie. This could be realized by binding a JSON file with a media file, the file containing objects with text and link attributes and whatever, by referencing a resource (like a video) by an URI in the JSON file. The JSON-file observing the playback could inform listeners accordingly, serving as an interface between the video and elements tied to the video.

Why not?!: It would be simple. Existing technologies already provide the option for us to do so. People would be able to comment on special part of the videos on communities, other HTML-elements would be able to respond to the video and so forth (changing the content of the page, accordingly to what is shown in the video). Search-engines would be able to index the video through the parsing of the descriptive JSON-file (so that searching for inflation deflation, would take you to a video, five minutes into the video where there is a tag for this purpose) and basically there is no end to the possibilities.

- Aramis

Read or Post Blog Comments



GPS Tag Your Site
What it is, the purpose, how it works and why not?!
Programming and Design, 090809


What it is: Right now it is only an idea of mine. The idea is that most pages on internet are tagged with keywords. My idea is that one of these keywords should be the GPS-coordinate (or perhaps a range) that the publisher of the page would like to associate the page with.

Purpose: Pair pages on internet to geographical places. This would make it easier to search/locate pages you are looking for. Your blog or homepage could as for an example show up as a thumbnail when people scroll around Google Maps. Roaming devices such as Google Android phones could I-feel-lucky-auto-fetch pages on internet associated to the place where you are geographically at. And there is basically no end to the possibilities!!!

How it works: It would be simple. Just add your preferred GPS coordinate on you page in the metadata tag or perhaps we could even have a new HTML tag for this purpose. Since what I am talking about here is actually not an executable routine, but a programming standard this would probably interface quite well with existing search engines. Google Search would as for an example automatically index your GPS coordinate on your page, and thus bump up your page in the search result list if someone entered this (or had the browser automatically enter it for you when it was to your liking). The GPS coordinate would be one one of the search criteria. Searching algorithms are already able to handle pages spamming with keyword, so well I guess we are already good to go.

Why not?!: It would be simple. Existing technologies is already focusing on this kind of solutions. Firefox 3.5, as for an example, is already geographically aware. Some websites on the internet usually customize their pages and data founded on the geographic location of the user or viewer, but what I am suggesting is not customization of the page you are already at, but tagging the page so that people get to it in the first page.

- Aramis

Read or Post Blog Comments



OO Instead of Flags
Why flags should be avoided and objects designed
Programming and Design, 090803


Object oriented design and methodology, indeed a most interesting topic. I used to be teaching this stuff back when was working at the university in Umeå. I still thing about this stuff a lot since I work daily with Java and find design patterns and all that jazz really interesting. This is a little that I have learned about flags.

Some programmers seems to love flags. I do not. This is why: In my opinion flags are locking the programmer into a situation where the code have to evolve and grow around the flags. If new problems and contexts has to be dealt with, new flags has to be inserted in order to handle this new state. But there is a better way to do this...

The flag indicating a state is like the finger pointing at the moon; the flag is telling about a state but is not in itself the actual state. The actual state of the object, are all the actual values of the attributes in the object. These values seen as a whole, is the state of the object. Now, if you want to change the state instead of changing the flag you change the attributes. And since the state of the object is dependent on the context in which the object is used, the state of the object is set from outside the object by the objects using the stateful object.

So what you do when you design your object is to make a bunch of setters and getters for the object attributes. Then you invoke these methods from the context in which the object is existing and voila you are home free.

Instead of methods like this: overrideWithNewConnection(int newPort) you get something like this: close(), open(int newPort). Easier to read API and everything.

Do you understand the difference? Instead of having methods in the object that tries to do "smart things in relation to the context" with the objects state, you do the smart things out in the context and think about the object as nothing more then a data holders. This will also actually be much easier since the context knows stuff about itself that the object will never know. All objects should be stupid in themselves. What should be smart is the way in which different stupid objects are combined. Just like your brain. The separate braincell is not smart, but those little cells working together... amazing! Flags are all about trying to make the objects smart and intelligent and somehow know how to handle stuff and the only way the can ever even come close to this, if you fill the object with tons and tons of code that handles all the different situations.

And yes of course, the objects that are the context of the stateful object, should also be designed in the same way. Thus everything becomes a dance with setters and getters. All objects are stupid in themselves, have only a few lines of code and thus becomes easily adaptable to different circumstances and uses.

So never create a flag. And instead of trying to make the object intelligent, use the object intelligently. And that code that does this smart thing with the attributes (the state of the object remember?!), put that code in the context (in the methods of the other objects using your object) instead.

It is all about keeping stuff generic.

- Aramis

Read or Post Blog Comments



Pool vs Cache
Note to myself
Programming and Design, 090730


Put stateless objects, most likely mutables, which must be acquired and released, in a pool.

Put stateful objects, likely immutables in a cache.

Objects acquired from a pool will have to be released before they can be acquired again, thus only one can have reference to the object. But from the cache everyone can get a reference to the desired object at any time, without any restrictions, thus many can have reference to the same object and a object get from cache does not have to be released.

From a pool it does not matter which object you get. From a cache, which object you gets make all the difference in the world.

- Aramis

Read or Post Blog Comments



GUI Programming
How to program GUI
Programming and Design, 090704


So, I wanted to write down this thing that I have learned about programming GUI. Being really interested in design patterns and so forth, I took a step back and begun thinking of what we actually do, what kind of strategies we have, when we program GUI.

What I have learned is that while OO-programming and modularization usually is a good way of tackling problems, it is not such a good strategy when handling some part of GUI programming. Though the MVC is a nice pattern, the V-part can also be broken down into modules and one part of this module does not, in my experience, lend itself to OO.

Take as for an example this list that I am working on right now. It is the usual infinite list where we got potentially infinite number of elements. To make this possible I have created a paging system that accordingly to the OO way of doing things and populating the list is done via a Binder which is also harmonizes with OO. But when moving, swapping (instead of having an infinite number of graphical elements, there is a finite number which are recycled) and interacting with the finite number of graphical elements the story is a little different. Instead of using taking an OO-strategy, the list is considered a data structure where the x- and y-coordinates of the elements are the keys to accessing the elements. The elements are not put in a linked list and does not even have a static index (the index can easily be calculated on the fly). Think of it like this, instead of using object-references, you have the x- and y-coordinates and the elements are ordered in reference not to each others but by their position on the screen. Thus the element has no knowledge of each others, or even that they are existing in a list. The element manager (the List) knows about all the elements, but does not know that they contain any data really. All it really cares about is the coordinates about the elements and if it should perform any swapping. The binder takes care of setting the data, when it is told to.

So while the data is managed through OO, the element handling are not and the same goes for the rest of the GUI. Perhaps one could even say that stuff like lists have more in common with mathematical expressions, then object oriented problems. Grouping is done for sure and so forth, so there is definitely encapsulation and what not. But a fundamental is to think about GUI elements as the graphical entities they really are, with coordinates and everything, instead of considering them as single referenced objects. This makes everything just so much easier to program. Sure, in the end you will end up with this widjet that you will be handling as an object, but the design up until then will be one with very little entanglements and will be highly mutable and adoptable to just about any type of GUI that I have had experience of.

That was but one example of what I mean and I feel that there are so much more to write about, but I am off to hit the beach so I have to stop writing now.

- Aramis

Read or Post Blog Comments



Brain Computer
Computers that works like brains
Programming and Design, 081223


I had a chat about computers and programming with Per today. Raving about the paradox tied to creating a computer program that can create any other program I had this idea that maybe the good enough approach is indeed good enough. Mulling over the inefficiency of CPU unparallelness a few years ago, I had silently concluded that the power of the brain is that it does not process information sequentially. I am definitively not knowledgeable in electrochemical and how the brain works, but I would guess that one could create an artificial processing unit equal in functionality to that of a braincell, but that could work at a much higher frequency. If this artificial braincells could extend their tendrils and connect to other braincells maybe one could create an artificial brain. I imagine that this artificial brain would, just like the human brain, be able to error. But then again, if it was running at a much higher speed it would theoretically be able to correct these errors faster then a human could. Perhaps such a computer could, given enough time, outperform humans even in tasks such as programming. Thus one would not have to invent a program that can program any other program. One could perhaps just politely ask this artificial brain to program a program that is good enough. Well, well this is just my running along with cool fantasies of mine, but as I learned from doing some searches on the net, there are actually some people out there trying to build computers that works like the brain.



- Aramis

Read or Post Blog Comments



Softcoding and Utilities
Ravings and ramblings about code design
Programming and Design, 081115


Though I consider the lack of multiple-inheritance in Java a boon, it offers some great challenges in terms of system design. In my experience it has taught me to work extensively with interfaces, thus I have trained my modular thinking. Obviously this have influenced my work, where I have now designed a highly abstracted open ended software architecture. Or to put is short: less framework and more utility library thinking.

Where as a framework lends you extension points, is also imprisons you in a predefined library environment and defines the system design of your application. But what if the requirements changes and the framework no longer fits the bill? Yes, what do you do? In best cases you re-design the framework, which of course is only possible if you have access to the source code and a lot of time on your hands. That is probably what you do, or you pick another framework and begin the tedious task of porting your project.

For this reason I prefer to work with frameworks that can be encapsulated, to those that is supposed to do it all for you. Light weight frameworks that targets and solve a well defined problem is the shit, because you can put it in your tool belt and pull it out whenever you feel the need. This approach does not provide you with a solution that does it all for you, what it does is to provide you the means for a swift, rapid and easy development of new applications. Thus would the context change drastically and force you to rewrite the application, you would have the support of your tools that does not lock you in but which enables you to develop the new application quickly.

Another issue that I feel I must have to address when considering which approach one should have, is that of softcode vs hardcode. In my experience frameworks kind enables softcoded solutions, whereas the utility thinking lends itself for hardcoded ones. So while a framework can lock you in, it will probably do so by the lure of softcode. Since solutions that draws on softcode system design, offers more dynamics then utilities one can in my experience rationalize the programming process. Unavoidable couplings and possible entanglements can be encapsulated and managed from inside the selected framework and so forth.

So what I do is to make extensive use of framework architecture, but developing and working with those as modules and utilities in my toolkit. Right now I got applications sharing the same codebase, which is running on both JavaME, JavaSE and Android. Obviously they have platform specific classes and a framework for handling common but platform implementation specific objects. But that framework is merely a module among others in the actual application. In an environment where one has to develop new kinds of applications with ferocious speed, this I believe is the way to go.

- Aramis

Read or Post Blog Comments



Throwaway Apps
A new breed of applications
Programming and Design, 081027


While the throw-away society is often associated with over-consumption and excessive production of short-lived or disposable items, zero and ones are totally recyclable. Therefor it makes total sense to create throw-away applications.

The application I suggest are applications which fulfill a temporary need. The opposite to a throw-away app would be something like Mac OS X, Android, Linux or a spreadsheet program.

An example of a temporary application is perhaps described through a use-case: You buy an airplane ticket and provide them with your phone number. A program is pushed to your phone, installed and then when you start traveling, the application helps you with directions and information about your flight. When you arrive at your destination, the application deletes itself.

Such applications could perhaps be developed using Google Gears, Android or something similar. Or why not a scripts running on a web browser?

- Aramis

Read or Post Blog Comments
Blog Why Not?!
Personal Blog of Aramis

Welcome. Filter: Show all, Personal, Programming & Design, Spirit, Economics.

There is no particular goal to this blog, but to convey what I find interesting and worth writing about. Get blog as RSS or ATOM . I never update my twitter feed.

Drive-By Distributed Computing 100218
The Dream Machine 091031
My first GA 091010
Hyper Media 090909
GPS Tag Your Site 090809
OO Instead of Flags 090803
Pool vs Cache 090730
GUI Programming 090704
Brain Computer 081223
Softcoding and Utilities 081115
Throwaway Apps 081027
HTC Dream 081004
J2ME Extends 080911
123 080730
Collaboration 080719
3H Listener 080711
Agent Scripting 080707
Biological Mechanisms 080609
Transitions and GUI 080531
Semantic GUI 080530
Breathing GUI 080529
Diggin 080525