Posts

Showing posts from 2008

What firewall do I need to install under Linux? - they ask

This has been asked by a friend of mine some time ago. In short, you have the needed links over here: http://en.wikipedia.org/wiki/Netfilter

As it was a phone call, I started the conversation by telling him that you don't necessarily need a firewall, or at least it's not a problem if you will only have time to configure the system in a week or so. "Really?" - he gasped. In short, I told him, you can trust an Ubuntu system (okay, not the best example of this but that's what he had at hand :->) much more than what you had before. You see he was accustomed to seeing malware taking over his w. system in a matter of minutes and having a need for re-installation many times despite taking precaution (firewall, virus scanners, etc.) _and_ having an I.T. background.

He asked me how this could be true. I said it's simple. There exist many layers of protection that improve your security.

You can install software packages that are signed by a trusted third party (the dis…

I have been infected by a virus!

Of course it was only a Wirus soiling my flash keydrive, so no sweat! ;) I had transferred the pdf document that I wanted to print out at the copier to the drive beforehand. I took it for printing, and everything went fine - up until I wanted to use it next time a week later. I usually keep only two directories on it for easier navigation: one called "_" that stores my data, and one called "print" that I put the single file I want to print in. When I next mounted the drive I almost bursted into laughter after seeing the directory listing!

./_
./print
./Start.exe
./autorun.inf
./ufo.exe
./recycler/Lcass.exe

Anyway, we all need to be cautious.

http://www.youtube.com/watch?v=k-GaRKDsz-Y Weird Al Yankovic - Virus Alert

Optimization and making responsive human-computer user interfaces?

A few words about responsiveness. I admit that one can't cast magic on programs. If an elementary task needs a certain amount of memory and time to complete, you can't do unlimited optimization on it. However, sometimes the big picture - the architecture - can use some rework for huge benefits. You don't always need to complete the whole task at once or the precise task at first. Sometimes more appropriate algorithms or data structures can be chosen, or solutions can be specialized for a given task. Sometimes you could complement your implementation with a few common special cases with superior runtime. One could also apply additional refactorings to reveal other design defects.

The last, but most important aspect is the user interface. The reaction time that is considered instant by humans for practical purposes is in the range of 100-300ms. Every human action must be followed by a user friendly response of the computer in the reaction time. This is a simple rule to keep i…

What is the difficulty in porting between Unix-like OSes?

I would like to map the difficulty in porting most, if not all packages from Debian between UNIX-like operating systems for example. One could clean the source of said packages to programming language standards and use platform independent libraries (POSIX and the like). Perhaps it would be beneficial to insert some abstraction layers to aid in achieving our goal. What else is needed? I would need to find out how the OpenBSD, Minix and Debian/kFreeBSD guys have been doing it until now. Wouldn't it be nice if you wrote a new kenel and every one of the applications that you are used to just got "magically" ported almost right away?

My dreams coming true: OS kernels and security today

I have received response concerning my (complicated) grammar. Consequently, I try to compose simpler structures. :)

I started using computers at a young age, so I mostly played games at first. I didn't play much, though. One of my favourite games at the time was a real time strategy game (Dune2). I was amazed of the program. I always wondered how it works. That was the motivation behind my programming career.

It happens to me often that I want to improve things I dislike. I first wished Dune2 had a better interface and more intelligent units with a gameplay requiring less micro-management. A friend of mine demonstrated Total Annihilation for me some years later. It pretty much covered most improvements I wanted to make at that time.

I wanted to create a better operating system almost from day one. I always wished I had a more powerful OS shell than the one I had then (command.com at first, later DOS Navigator). I needed to design and compile my own small applications even for the mos…

PDA in Chicane - Don't Give Up?

Is it a Psion Revo that the rebel girl is using (with screen animated) in that video?! Sorry, but I can't give you a working link as the original one has been deleted by request of the copyright holder.
http://www.youtube.com/watch?v=upBwes8WApo

Merry X-mas, Hanukkah, Grav-mass, whatever...

Image
[ unwords [ "I wish", who, what ]
| who <- [ "you", "your loved ones" ]
, what <- [ "Happy Holidays", "a Happy & prosperous new year" ] ]

Here's a drawing I've made from a tiny photo. I needed to retouch almost every part of the original after quantization. I also did great effort to make it tile. I have first tried experimenting with gimp-resythesizer to no luck, so I had to do it by hand. I've cut&pasted the top 100 rows and the leftmost 100 columns to the other side of the image to a temporary black stripe, have made the modifications and put it back afterwards. As the last phase, I have also vectorized it using potrace. Sadly, Blogger does not allow uploads in any vector format at all.

Groovy looking recursive clothing :)

Lazy evaluation in LISP

A friend of mine has developed a new LISP-like language to assist in constructing lazy algorithms and the like. He also gives some examples like Peano axiomatic integers. Here's the link:
http://gergo.erdi.hu/elte/2008-1-haskell/clazy/

Nifty Haskell and LISP projects (updated)

I find people who are fluent in specialized and high level languages to have written interesting articles and done nice projects with a much higher probability than the average. :)

Anyway, my current interest is in how you can define GUIs with functional languages. I have done a web search recently on the topic but have to sadly acknowledge that the ones of the highest abstraction level are not currently of production quality. Maybe it would be best to hack some functions of my own fulfilling my needs and opt for wxHaskell. Does it worth it? I need to give it a try.


http://web.cs.wpi.edu/~cs4536/c06/Assignments/hwk2.html nice functional programming assignments
http://www.lassila.org/blog/archive/2006/05/fun_with_lazy_e_1.html working on LISP laziness
http://common-lisp.net/project/clazy/ LISP laziness project
http://www.haskell.org/haskellwiki/Stack_overflow laziness is not always a bliss
http://web.cecs.pdx.edu/~mpj/cs557/week07.pdf Mark P. Jones: "Lazy Evaluation: Strict Evaluation: …

NEWS: fixed typos, horner, si, fizzbuzz, updated links, hsh, sequent_prover, x86_asm_generation

Site update in keywords: fixed some typos in site_back and about_me, minor alteration to horner.hs, updated links with hsh and sequent_prover, added a fizzbuzz, major update to si.erl (0.2).

On another note, I came across a nice fellow recently who has some nifty things tagged 'Haskell', like:
http://porg.es/blog/generating-x86-assembly-with-haskell
http://porg.es/blog/simple-socket-programming-with-haskell


While browsing the blog, I have also found these indirectly:
http://software.complete.org/software/wiki/hsh Haskell, bash, integration, very handy
http://okmij.org/ftp/Computation/monadic-shell.html UNIX shell vs. Haskell Monadic IO (I've noticed that before too! :->)


By the way, anyone for a tiny sequent calculus prover base?
http://www.polyomino.f2s.com/david/haskell/gentzen.html sequent calculus prover in Haskell


And last, but not least: :-D
main = putStr$ unlines [ n_or_label n | n<-[1..100] ] where
n_or_label n = if ""/=label n then label n else show n
labe…

Don't try this at home, folks!

bkil@work /home/bkil/1 $ tar --remove-files -cvzf 1.tar.gz .
./
./1.sh
./cp_ln.sh
./cp_ln.sh.
./format.mysql.txt
(...)
./test2.sh
./things_for_my_blog.tar.bz2
./wc-c
./wgetd.sh
./very_important_files.tar.bz2
./1.tar.gz
tar: ./1.tar.gz: file changed as we read it
tar: .: Cannot rmdir: Invalid argument
tar: Error exit delayed from previous errors

bkil@work /home/bkil/1 $ ls
bkil@work /home/bkil/1 $ ls -a
. ..
bkil@work /home/bkil/1 $

Thankfully, I could reconstruct every import file from my backups except for some uninteresting logs. I have compressed "." before, and I have also used the "--remove-files" switch many times, but it looks like I rarely combine the two. Now I remember why! :) I should have written either "cd ..&&tar --remove-files -cvzf 1.tar.gz 1" or "tar --remove-files -cvzf 1.tar.gz * .[^.]* ..?*"

Riding your bike compared to using local public transport

Advantages
* no waiting time at stops or changes - direct and dedicated connection (see note#1)
* no idling at intermediate stops - rapid transit
* stops are at your doorsteps - no walking that slows you down
* traffic congestion is usually not a problem
* never crowded, you always have a seat
* the air conditioning is always on and works as you will
* fares are fair and mostly constant - doing some inexpensive maintenance once in a few months or twice a year
* about the same journey time overall as on bus or tram - some routes are even faster
* exercise is good for you
* lower top speed - safer

Drawbacks
* you can't read a newspaper and such (except at traffic lights)
* in very bad wet weather you may have a hard time without full fairing
* bikes must face inferior road conditions on the side of the road and on unmaintained bike paths
* more traffic light waiting time on many routes
* lower top speed

Note #1: You may combine bicycle commuting with public transport if you have a portable bike. Thi…

NEWS: Horner oneliner in Haskell

It's fun that evaluating a polynomial using the Horner-scheme takes only a single line of Haskell code. I wish they had thought functional programming as a basic skill! ;)
http://people.inf.elte.hu/bkil/en/pg/horner.hs

They're using standard rail gauge in our capital city

We went to the Function demoparty organized at our capital city a few years ago with a friend of mine. He asked on the way to the party place on a HEV vehicle if they use standard rail gauge. I couldn't come up with a definite answer then, but I was pretty sure in that they use the 1,435 mm, so called 'Normal gauge'. This post has been written now because I have just recently bumped into that article.

Another interesting point is that the HEV is not light rail, but commuter rail instead.

MAV has been doing bridge reconstruction recently. While these works are underway, MAV vehicles use a section of the northern HEV line. See below for a few neat videos about this.
youtube: MAV on BKV HEV
youtube: MAV trains on HEV rails
youtube: Desiro to Margaret bridge
youtube: HEV&MAV trains

By the way, I'm still open to suggestions concerning my grammar and spelling. Please don't hesitate about either posting here or sending me mail! :)

NEWS: added quotes, updated Lenny instructions

I have added a few more insightful quotes. The Debian Lenny instructions got a slightly modified package list. I fixed a few minor bugs in the text while at it (ampersand missing and the like). Also added some sound related instructions.

Design a minimalistic font with grave discrepancy

My plan is to experiment with (monochromatic-) font designs. They would need to have a one-to-one correspondence with the Latin alphabet and Hindu-Arabic numerals. The object is to provide better clarity than the best possible with standard fonts. I will start investigating numerals first. It is a bonus if some symbols would resemble standard ones.

NEWS: summa v0.1, links

I have done minor refactoring on "summa.erl": abstracted seq/2 and reorganized maps into list comprehension.

Added links related to the firearm debate. Fixed some small distro related ones.

NEWS: ASCII v0.1.2, SI v0.1, working on bikes

I put some of my new drawings in the collection, so enjoy!

As I use the SI measure converter regularly, I have enhanced it's interface with the common function "convert". For example si:convert( 40,psi, bar) converts 40 psis into bars, or si:convert( 15,mph, kph) converts from miles per hour into kilometers per hour. si:convert(mph,kph) gives the scalar factor (1.6). Complex measures also work as usual, so you can query si:convert( {u,314,[ft,ft,lb],[s,s]}, {u,1,[n,m],[]} ).

A bicycle related post or two is in the works. They're almost ready to be more exact.

Loud networking with 2-AFSK

I wonder how far one could transmit using only sound waves in open air? I am considering something that would not be intrusive, so it needs to emit below the regulated acceptable ambient sound pressure limits (about 30-40dB here). I only intend to operate it intermittently, maybe for a few seconds in every hour - depending on attainable bandwidth. My ultimate goal is to be able to transfer about an SMS in a run, but I would be more than happy to make trade-offs that could result in quieter operation.

Higher frequency carriers could both provide more bandwidth easily and be inaudible at the same time, but there's a catch. They say, sound waves below about 1kHz usually penetrate air much better than ultrasounds. I need to test this specifically, but about at most 500Hz-1000Hz looks like a hard upper limit for long range transmission according to the graphs. Another drawback of larger wavelengths is the enormous sized dish that would be needed to concentrate the beam of sound. By the …

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.