Posts

Showing posts from October, 2008

Simple container fitting checker for a fridge in Psion OPL

I have finally uploaded my nice OPL program that I used with the fridge mentioned.
It can be found at my scripts, in the repo!
Direct link: >>fridge.opl<<

It might happen that some more small programs of mine will follow.

Haskell is not the Holy Grail of programming languages

Well, actually it is, but never mind. :)

At first, I thought one had no choice but to migrate to Haskell or Clean if in a need for programming in an elegant manner. Fortunately, I since then have found some languages that would also do the trick. I plan to review most of these based on some criteria, preferably through a real-life problem set. Maybe I will initially base my research on the ready-made solutions found at the great language shoot-out game.

As you probably already know, Haskell (and Clean) allow the expression of deep thoughts with very conscious syntax (and semantics) for most domains. Erlang is also nice, though a bit LISP-like on the syntax side (read: crude). I still need to learn a few more languages that are said to be pretty interesting. As I've heard OCaml (ML) and maybe Python could be good candidates.

Now, before you come up with the valid argument that powerful language-extending features and Turing-completeness make this a non-issue, I am not sure if I would …

NEWS: Updated graphics, refactored quotes, fixed links

I still need to get used to blogging. I have added some new creations to my ASCII art section last week.

I have also done some major refactoring of the quotes - I added some more while at it.

I have updated or removed a few broken links from my archive. I try to finish updating them in a month (or a few?), but progress is slow. The ones below the asterisks are left. I know how frustrating broken links can be, so I handle this with top priority.

My previous experience with operating systems

The first OS I have installed was probably some DOS for a friend or classmate in primary school, I can't remember which. You understand if normal people can't install and configure that properly, as it is considered pretty difficult. I then did winblows a few times, though that's a harder treat. How do you expect a normal user to feel at home with his computer if he can't even install it for himself? It's supposed to be user friendly or so.

Also note, that after removing the installer disk and placing it on the shelf does not end your responsibilities. If you install new hardware, software, or just simply switch some setting that change a major part of the system, you will need to get used to handling setup dialogs and wizards. And by the way, if the installation process is usually done by a semi-professional anyway - either in the shop before you buy, or if you ask help from a friend - then that voids the major part of the very common argument against using any unu…

Testing Lenny: installation with debootstrap under Etch

I'm not specialized in doing that, but I had to commence many operating system installs to this day. I plan to write a bit on that next time. Here's how I've installed Debian 5.0 Lenny (qualified as testing as of September of 2008).

I did it two times in a row to be exact, because of an unfortunately hardware fault after two days of usage (okay, maybe it was partially mine). The second one should have taken much less time, but I goofed with the settings of apt-move. You see I got it right with Etch before, but I forgot to write it down (I found it in the file anyway). I have been writing down what I customize from the start just because of that. Thankfully, that's a good habit of mine.

Some words about the instructions in the file ("almost" a shell script). I tried to be self-explanatory, and have written a little preface to help place things in context. NO WARRANTY OF ANY KIND: I am not held liable for anything you do wrong with the text given below, not even …

A logo for my T-shirt?

Planning to construct a logo for a T-shirt has been on my mind for some time now. It should look neat, but be practical at the same time. What I am certain of at the moment, is that the design ought to include program source code or ASCII art of some sort. License will be GPL of course ;->

In both cases, the number of characters should be minimal. I'm thinking along the lines of a few hundred bytes or so, and about six or seven lines of code. Readability is at paramount: a well educated person if mathematics, information technology or engineering ought to understand it in a minute.

Simple artificial intelligence for board games with functional programming

This is nearly a trivial project, really. However, I do plan to achieve the most general implementation feasible. What needs to be done are the following.

* Internal representation of the game state (board, turn);
* Presentation to the user (only coordinates at first);
* Input from the human player (coordinates);
* Generating valid steps for the AI (simple enumeration at first);
* Heuristic function for the AI (something wired-in at first);
* AI core: minimax at first, alpha-beta with some simple ordering and pruning later on;
* Simple interface that enables a GUI at a later date.

Church bells and synthesis using computers

I am interested in simulating the generation of the sound of bells. My ultimate objective is to synthesise a bicycle bell. I had done some web research on the topic, but it is not easy to find concrete implementation details. I had to resort to a bell manufacturer's site that included a lot of details on the sound generation modes of church bells in general.

Thankfully, it also had a few graphs on the sound spectrum of these, so I had a good starting point. I then started coding some test routines (sadly in C++), and got pretty promising results after some fiddling with constants and the like. I am pleased with the end result, as it closely resembles the real thing. What is still left, is to record and analyze spectrograms of those bells that are used with bicycles. I have previously tried tweaking the constants of the church bell with no luck.

Functional programming in SH and Bash?!

I made a few functional oriented and list processing functions for bash. Nothing serious, and it's very slow for practical use. Profiling tells that the head and tail operators are the bottleneck, so forking them off to a different process would help. Though I don't feel an urge to update it that way, as this was made just for the fun of it! Another upgrade would involve updating the free form recursive data structure to something faster, or doing less and/or faster conversion. A last resort would be writing hard-coded implementation for the core functions like map, foldl and filter. I also have the choice of moving to the very powerful (and speedy) Bash syntax.

These are all viable, but would degrade the elegance of the library as a whole, so I'm hesitant to apply them. And don't forget, that it's a much more sane solution to embed O/S functions, or even a full-blown bash into a fully capable language, instead of the other way around. I've been thinking along t…

Literate programming

I am interested in doing hobby projects in literate Haskell and similar techniques. The main idea is that you shall not need to mark where comments are, but instead to mark where code is. In practice, this can save you quite some time. Just imagine writing your research paper and the demonstration program at the same time! It also sounds pretty powerful for coursework.

And as a side note, it reads much better, because of the proximity of description and the respective code implementing it. I have had missed this property since the first time I've made technical documentation for a program.

Sunlight readability: reflective FSTN vs. transmissive TFT/LCD

Sunlight readability is an interesting difference between computer display technologies. Displays based on the very mature reflective and transflective, (mostly monochromatic and passive matrix) FSTN/DSTN LCD gain readibility with increased exposure to sunlight. In essence, that means you can both read electronic books and take notes outside in nature, be it under a tree, or just seated in the park.

The displays that are dominating the (initially only portable) market for more than a decade now is the transmissive (active matrix) TN TFT/LCD. These displays, on the other hand, loose readability with exposure, and are best viewed indoors, or in deep shade. Naturally, the level of usability varies with both season, and the exact model of display. They also manufacture ones that are equipped with very powerful backlights, but you must keep in mind the possible effects on both your batteries, and on your eyes.

Aid in choosing plastic food containers

I did some experimenting with my handheld computer, the Psion 5MX clone. I wrote a pretty neatly structured program in OPL, that would assist me at shopping. You see I was in a need for some containers that could efficiently fit in our fridge. I made measurements as a hole, and on a shelf basis, and input that as (factored out) constants. The structure of this console application is as follows, almost literally.

The program runs in a loop until interrupted (by nonsense input). The loop first asks for the dimensions of the container in question, then outputs the computed efficiencies for each shelf. The efficiency for a shelf is the maximum of possible packing efficiencies for the shelf. Possible packing methods include a simple fixed set of orientations and some combinations.

This is an almost trivial solution that gives a practically perfect approximation to the three dimensional packing problem with real world constrains (all container boxes facing up, etc.). The most difficult part…

Your own keyboard layout at work or on shared computers?

I have modified the international standard Dvorak keyboard layout few years ago that accommodates national accents by simply correcting the output of "xmodmap -pke".

I have recently created a similar one for winblows. I had to download and install msklc (after validation) first, in order to achieve that. The only problem was that I couldn't install the created layout, as I lacked the needed priviliges at our computer lab! I used it anyway to type in a CV with the help of it's test layout function and regular copy-pasting. Not a very elegant solution, but I think it was a fair way to accomplish the task. I wish I kept my keydrive bootable with DSL.

Bicycles around the world

You could go on very long journeys, if given a recumbent bike that has a good seat, and the following.

http://www.tonystrailers.com/mobileshelter/

http://www.tonystrailers.com/nomad/

Doing multi-seat on multi-user systems is possible!

It would be interesting if environmental friendly, low power and mostly budget solutions like the following were more wide spread in office and computer lab environments. Computer display sharing would also be possible among friends! They say compositing with Wine and/or a virtual machine is also possible.

http://www.linuxtoys.org/multiseat/multiseat.html

What is this all about?

This is a sandbox for random, uncategorized or just "fresh" ideas. Isn't this the motivation behind all blogs? :)

I try to constantly and eventually integrate most content found here into my homepage. You may expect new posts here appearing about weekly, and updates there to be committed about monthly. Note that I plan to relocate the former linked site before about February, 2009, so do check back from time to time.