My New Blog

August 26, 2014

I’m working on a project to develop my own blog application to use it as my own blogging software for this blog specifically. It’s still under construction, but as soon as it gets done, I’ll post about it here.

The reason why I’m going forward with this is mostly so I have some real world project to practice web development using the Laravel framework. The blogging idea was my first in mind and I went with it. Now I already have many other ideas to follow on, but I’ll finish the blog.

This started Aug 19, 2014, and now, a week later, I already have read some stuff on Laravel, created users and post management features and have a layout going on. Things are going well, and I’m impressed how much a framework can help in productivity.

The project is open source and it’s already available on github. For now, you can visit the new blog, under construction, in here.

I intend to write tutorials on how one could clone that github project and use my own blogging software to support his/her own blog, but for now, I’m concerned with getting other features in place.

Paul Romero playing some HOMM songs on the piano

July 3, 2014

If you’ve ever played Heroes of Might and Magic, you know how wonderful the soundtracks are. I personally have played only HOMM3 and 6. They both do have amazing songs.

The people responsible for composing these [wonderful] songs seem to be Paul Romero and Rob King.

There is a Youtube video in which Paul Romero plays some of those songs on the piano. It’s amazing.

Some Thoughts on Meanings of Words

May 12, 2014

It happened several times to me (enough to catch my attention) that looking up the meaning of a word considerably helped me in understanding it. Not just in a dictionary however, but also in a thesaurus, encyclopedia or even in an etymology dictionary.

As a reader, I imagine you’d be surprised I’m saying such a thing. After all, isn’t it obvious? Dictionaries will tell you the meaning of words, so if you want to understand what a particular word means, look it up. And yes, it is, in that sense, obvious. However, there is another aspect to this issue.

Back when you learned procedural or object-oriented programming, did you look up in some programmer dictionary what “procedure” or “object” means? It’s very unlikely that you did. You probably just learned the concepts behind these topics by explanations in your textbook, but not precise definitions. It’s more than that though. What about the words I’m using in this text right now? How many of then have you actually looked up before?

The point I’m trying to make is that the way I generally learn meanings of words is through some other mechanism other than looking them up in some sort of reference material. And, as it seems to me, this is also true for most other people. In general, for learning meanings, we don’t look up in authoritative sources. We do something else, like learning from examples of use.

Just to be clear, there is nothing wrong with this “doing something else”. However, it leads to some issues. In scientific papers, books, other blog posts, speech and so forth, people use some words whose precise meaning aren’t that simple to be picked up informally.

Do you really know precisely what the following mean?

  • System
  • Model
  • Structure
  • Pattern
  • Object
  • Process
  • Procedure
  • Function
  • Number
  • Integer
  • Abstraction
  • Relationship
  • Predicate
  • Proposition
  • Set
  • Algorithm
  • Program
  • Schedule
  • Dynamic
  • Static

I could list a lot more, by the way.

These are all words I’ve seen enough people not quite getting them right. Some of these words, it was myself who didn’t get precisely right at first, and some up to today. The importance of these terms, for us software people, is that we seem to use them to describe what our software should do, how our algorithms work, how our software is designed, the requirements on our software, and so forth. And, as such, we should know extremely well what they mean.

Now you should get into the habit of looking things up (=D). Writing about them also helps. Making use of multiple sources is highly important too. The various dictionaries, thesaurus, encyclopedias and so forth out there help with this.

Edsger Dijkstra Turing Award Speech

May 4, 2014

For those who find it interesting, I’ve just came across these videos with Dijkstra Turing Award Speech.

Syntax and Semantics

March 14, 2014

It’s interesting that, in software development, we often can look at something as syntax, but at the same time also as something with semantics. We derive meaning from form.

There are examples of this everywhere. For humans, it shouldn’t be a surprise because we only we see form, we can’t really see meaning. Meaning is something we have inside our heads only, somehow. We conclude it; we think it ourselves. However, it’s curious that significance, meaning, function, purpose and so forth follows form – seemingly everywhere.

By form, I don’t mean anything deep. It’s what you’d expect. It has to do with arrangement of pieces, the pieces themselves, their internal arrangement, their materials, their pieces, and so forth.

In programming, form is commonly associated with a programming language syntax, and other static aspects. However, there are also dynamic aspects of form: state of memory, state of the processor, bits in disk, and so forth. These forms dictate pretty much everything in the computer. And also, as impressive, what runs our programs, the CPU, also has its function based on its form.

As programmers, we have syntax as a major form we have to deal with. So it’d be nice if that form represented well the meaning that follows from it. Dijkstra, with structured programming, attempted and succeeded in making that form closer to the function of the program. One of the things he wanted is to look at the form of the program and be able to easily derive its run-time behavior. So, instead of a clever arrangements of jumps, he would rather look at a well named repetition statement coupled together with some (also well named) selection statements for example.

Maybe “form follows function” is a clue for language designers, which I’m pretty sure they already know. In any case, what I see is that programmers seem to like languages with which they can convey high degrees of semantics without having to specify unreasonable syntactical formations.

I think syntactical extensions (with macros for example) are interesting because of this above point. They allow you to invent the appropriated form for the function you’ll deliver with the extension’s implementation. Giving it an appropriated form is important for us, people, because it helps us in understanding what is going on. And, as mentioned in SICP, “programs must be written for people to read, and only incidentally for machines to execute.”

Models – 01 – Models, Definitions, Analysis and Design

December 24, 2013

Introduction

This is the kind of text I write to help myself understand something better. I will also write a little bit about the driving reasons which led me to write about models, which were analysis and design.

It’s generally accepted that a model for something material resembles it. If I tell you I have a model of a plane, you’d usually think of a miniature plane, or some 3D interactive software which simulates the plane performing various movements. Maybe something else. The point is that you usually don’t think about the plane, but about something else which somehow looks like it.

More generally, a model is about something. We should always talk about models mentioning what they’re about. These things are of extreme importance because they form a context for the model.

For something as abstract and general as a model, it’s no surprise that there are many ways for defining one. Back when you were learning, say addition and subtraction, you probably had the “follow the model” kind of exercise. It goes as the following:

Follow the model
1 ? 4 = 5 (+)
7 ? 2 = 5 (-)
1 ? 1 = 2 ( )
9 ? 2 = 7 ( )
5 ? 3 = 8 ( )
2 ? 1 = 1 ( )

To perform the exercise, you’d have to fill in the blanks with the right operator symbols as in the first two cases.

There is a model definition in this exercise. However, as I said before, a model is about something. In this case, what is “the something”? It doesn’t seem obvious, but, in a sense, the model is about how you should solve each item in the exercise. It was defined by two examples of its application. Given the examples, your mind then filled in the blanks and “got it” somehow. It begs the question: which are “the blanks” your mind filled?

A model doesn’t always have to be material (in the sense that it exists outside one’s mind). There are mental models, and those are only thought of. So if you want to communicate them with other people, you must find ways to represent them. That is, you should find a way to communicate something (the representation) that, for your particular purposes, is as good as the actual thing you want to communicate (the model). Representations can be tricky things to understand, but we use them all the time. For example, an angle is different from its measurement, and almost all the time we can talk about one through the other. We can do so because for our purposes, most of the time, an angle is as good as its measurement.

Your professor, then, was expecting you’d interpret the representation of the model (the two examples) and realize the model yourself.

Now I think I can go back to the question I’ve asked before. What are the blanks your mind filled? The answer is the model itself. When you interpreted the representation of the model, you conceived it in your mind.

Definition

What is a model? A model is a set of properties about something.

A property of something is a statement which is always true for that thing. For example, “in my game, blood is always drawn with red like colors”. The statement “blood is always drawn with red like colors” is true about “my game”, which means this statement is a property of my game.

Some models are mathematical: their statements are always true, regardless of what (they’re exactly true). For example, part of the model for real numbers is that if you have three of them a,b,c and you have that a=b, then it’s also true that a+c=b+c.

Models Go Mental

You could now be wondering how is a miniature plane a model for a real plane? Is a metal miniature plane a set of properties? It surely doesn’t look like so. One way of looking at this is that models are always mental and “material models” are always representation of (mental) models. Which means that if you think of a model for a plane and construct a miniature plane which looks just like what you’ve thought, then that miniature plane represents the model you have in mind.

The distinction I will make, then, is that a model is restricted to what you think of, but its representation can material (it exists in the real world, outside one’s mind), but not necessarily.

In this sense, it’s more useful to look at a miniature plane as a representation of a model and not as the model itself. In practice, the definition of a model is wide open and includes cases like these too. For now, throughout this article, I am going to use that models are intrinsically mental because I believe that is a more useful way of looking at things (it’s kind of a useful lie for doing thinking on my own).

Usage, Analysis and Design

Curiously, you can have:

  • a geometric model of a plane;
  • a mechanical configuration model of a plane;
  • models for its electric configuration; and
  • many others.

In general, you could conceive several models for the various aspects of a plane. The same goes for laptop computers, software systems, and whatever else you can think of. You can take something S, look at a part P of it, ignore everything else, and build a model for S by only looking at P.
Being able to do such a think helps in analysis. You can, for example, analyze a plane by first looking at its geometry, then at its mechanics, and then at its electronics. Maybe you decide you’ll do this for each individual material part of the plane (whatever you choose those to be). Therefore, from analyzing the parts, you analyze the plane as a whole.

This activity of building a model requires you to think about something so to extract relevant properties out of it.

In general, the process of analyzing something and the process of building a model are connected. In both cases, you accumulate properties about something. For example, when you get the representation of a model, you have to look at it and extract relevant properties so you can build the model you’re expected to. It seems, then, that through analysis, one builds models. This leads us to a better definition of analysis.

Analysis is the process by which given S, you build a model for S. And some times, we talk about the analysis as being the model constructed from the analysis. The distinction should be clear from the context.

Analysis is being thought of extracting properties of something existing. But what about extracting properties of something which doesn’t exist? You can do so by analyzing how this non-existing entity would be. After that, you can derive a model of how to realize that non-existing entity so to make it real. And as it turns out, you can analyze existing things too (how nice!) in order to build models of how they could be realized.

The model of how you could realize/create something is called design. Designing is the process by which you construct a design. So it follows that designing is a creative process.

A good example of analysis and design is in engineering. Engineering is about problem solving as many other activities are. A team of engineers is given a problem. They’ll, then, analyze the problem to build a models (of requirements on the solution, of the environment in which the solution will be inserted in, and so forth). At some point, they have to design the solution or parts of it. Engineering teams are expected to do these analysis and design activities so to solve the problem. For them, analysis and design are major tools which they use to solve problems.

The design is just another model, which means that, by our definition of model, it’s mental. So a design needs representation(s) if you want to communicate it, store it somewhere, etc. In designing, engineers tend to build diagrams, texts, and all sorts of documents representing the design and/or its parts. The same goes for analysis by the way . And there are actually special tools for representing analysis and design models.

Representing models is often useful, but that is another topic. However, it’d be useful if there were documents representing all the produced analysis and designs so that others (and the original engineers themselves) can use those to learn about and/or remember what happened during the project development.

Final Thoughts

In my experience, and belief, it’s often the case that analysis form a cause for design, which means it’s very common to see analysis and designing as two connected activities. I believe it’s common, in the case there are problems in need of solutions, that there is also a need for good solutions design, which are usually expected to be well founded in good analysis.

To summarize, analysis has the idea of taking things apart because you extract properties of something, while design has the idea of combining things together because you model how to realize something.

Modeling is not just important for analysis and design, you could think, but these two concepts were the reason I decided to write about modeling.

If you can, please share your thoughts. Comment! =)

Yet on the Space Invaders Game TSpace

August 27, 2012

In my last post, I “released” a space invaders game written in TCL/TK. It has its own scheduler and task queue, which it uses to find out which thing on the screen has to be updated. It turns out that these things are done by the TCL implementation too, and it’s likely that they’re more efficient than the one I wrote.

So I modified the code to be a much simpler (without save/load, sounds and speeding up or down features) version of the game using the after command instead of implementing my own scheduler/tasks queue.

Just to be clear, I still could have the save/load, sounds and speeding up/down features if I wanted, with as much ease as in the other versions. I removed them simply because I wanted this stripped version of the game. Using the after command doesn’t imply in not being able to have these features, or in having a harder time in having these features. I could have kept them just as easily.

I actually liked TSpace, and I am likely to keep playing it. And I don’t care about sounds, save, load or messing up with the game speed. That’s why I took these out. I wrote them in the first place because I saw that I could, as a direct result of the different designs that I tried.

The interesting thing about this version is that it doesn’t try to re-invent the wheel, but uses what is already built-in in TCL. And it turns out that it ran much faster (notice that the other version may get slower later in the game, when you get lots of points, but it’s mostly because of the amount of sounds that are played with that many enemies missiles being shot at you — if you take the sounds off [not just turning the sound off in your computer, but actually changing the source code], the slowdown is not so much noticeable).

Here is the code: http://pastie.org/pastes/4598169/text.

To run it, you should use the image files from the TSpace game posted in the previous post.

(Much) Improved Space Invaders Game [in TCL/TK] – TSpace

August 27, 2012

In my last post, I sort of showed that it was very simple to put a space ship image on a black background with some asteroids floating around. Also having the space ship being controlled by the arrow keys and being able to shoot the asteroids.

Well, I decided to evolve that little game. The result was still a little game, but much better. There are screen shots in the end of this post.

The game went through some phases. The first one was that of the last post, which was pretty much a “can I do this?” thing. The second one was using the coroutines feature of TCL 8.6, which made the game much easier to extend. However, this second version only was a re-write of the first one. Then a third one was an evolution of this second one. I took the extendable version using the coroutines feature and started adding things to it.

This third version was a major breakthrough. It allowed pausing the game easily, also increasing its speed, or decreasing (you could use the plus and minus keys to make the stuff move faster or slower on the screen). Adding stuff was also much easier.

The basic idea was to dynamically generate coroutines, each to control an item on the screen. There was a scheduler function, which would go round robin on these coroutines. Pausing the game just meant telling the scheduler to stop looping through the coroutines queue. Messing up with the game speed was basically changing the milliseconds interval between each iteration in the scheduler.

Also, items on the screen were pretty independent, because they each had its own coroutine. So it was quite a nice thing.

However, it was generating a lot (really tons) of coroutines. And I wondered if I could do differently, just to see with what I’d end up with.

Then I had the idea of having a few controller functions which knew how to deal with different types of items on the screen. For example, the ship controller, the enemy controller, the missile controller. These functions would see the current situation of some item it can control, update it and produce its new current situation. This was the fourth, and current phase.

Each situation is actually called a task, because they replace the coroutines. A task has a procedure, which can perform it, and a bunch of other data (such as x,y position, image type, etc.). The scheduler, which used to run coroutines, now deals with a queue of tasks, and at each iteration, it takes a bunch of tasks, and run their controllers (which would be stored in the task’s procedure field) on the task by getting tha task controller and calling it on the task.

The advantage of this, now, is that the data needed to continue the game, from a given point, is more accessible. Which means that saving and loading game is trivial. And so, I wrote the save game and load game procedures. They pretty much saved this tasks queue, along with some other things, but the tasks queue is the major thing. And the load game function pretty much reads the saved data, and re-draw the canvas accordingly. Each task also has a load function associated with it, which could re-draw an item given its current situation, reflected in the task.

An important feature of TCL played a major role here. And it’s the feature that “everything is a string”. Since that’s true, to save the task queue, all I have to do is print it (there is no code for serialization, or any sort of conversion). And to load it back, I just read it (there is no code for parsing). That’s it. I mentioned some posts ago that  things are a little different from “everything is a string”, however, the language gives you that illusion, and you can program as if that was true. A more, it seems, accurate thing to say is that everything has a string representation. Being able to get the variable value by having its name stored in another variable also helped because it allowed for “the list of variables to save and load”. Currently, if I wanna add some more state to the game, then the code that causes that state to be saved/loaded is close to nothing; I just have to add the variables names to that list of things to save and load.

In an OO style, you could have a task interface, which has a load and iterate methods. And each screen item would have its controller, which would be classes implementing this interface. The task queue would then be a queue of tasks, and the call to iterate and load would perform dynamic dispatches. Obviously, you don’t need classes to do this, so a non-classic OO system also would allow this. And, in TCL, since you can use the value of a variable as the name of a function to call, you can just generate the name dynamically and call that (getting dynamic dispatch in effect). So, it may be that, in TCL, doing the OO actually complicated the program. Anyway, I didn’t do it this way also because idk how to yet. I still haven’t learned how to use OO systems in TCL.

That being said, if you wanna take a look at the game. I uploaded it on 4shared.

http://www.4shared.com/rar/HQHHcoAg/tspace.html

Here is how you play the game:

  • The arrows move around.
  • S saves the game.
  • L loads the game.
  • + and – and 0 deal with game speed.
  • P pauses the game.
  • F is the simple shot.
  • D is the triple shot.

To run the game, you need a TCL implementation with the snack extension. An easy way to get it is by getting active tcl, and installing snack after done that. Here is how to:

  1. Go to the downloads page, http://www.activestate.com/activetcl/downloads
  2. Get the 8.6 version of active tcl (it cannot be the other older ones). You should also get the 32bit one, because iirc, snack is not available for 64bit. Even if you run a 64bit windows, you can download the 32bit version and it should all work (which I just found out recently).
  3. Install active tcl.
  4. To install snack, go to the command line and type “teacup install snack” and wait.
  5. A friend of mine had the problem of not getting the Img package out of the box, and he had to install it. So you may need to. Do it by typing “teacup install Img”.

That should be it.

To run the game, extract it and double clicking on the tspace.tcl should do fine on windows. On some linux, you probably will run on the command line with tclsh.

And as a side note, I also found out I cannot spell words very well: I’ve been writing ammOnition and missIle (you will find this in the whole source code).

The images and sounds of the game were not created by me. I got them from sources I could use for learning purposes. Here are the credits (which you can also see in the sources.txt file in the .rar file of the game).

If you find bugs or that something is missing, or strange, post as a comment please. I just found out I forgot to put two required files in the rar archive (which is now fixed). So, if anything, write a comment please.

Updage: I found some bugs after I wrote this post. So if you find a bug, maybe re-downloading the package (which I just updated) may help. But comment anyway =).

Here are some screen shots:

Simple Space Ship Game in TCL/TK

August 23, 2012

As I mentioned in my last post, I just started learning TCL and TK.

Well, yesterday I decided I would see if I could put a image of a space ship in a black baground, and make that image be controled by the arrow keys. After one hour or two I did that. And I thought “well, this was really easy; maybe I can get it to shot if I press F too”. Then I went on, got the image of a small missle, and made it move from the ship to the top of the screen if I press F. After that, I found asteroids images and put them rolling and moving in the screen and made a space ship game for shooting asteroids.

I started making (learning how to) the game 7 or 8 pm yesterday and finished 9 am today (yes, over night).

And it was really simple. It’s worth pointing out that the code is pretty much a bunch of stuff on top of eachother: not a well tought design. It works because the space ship game is small and simple.

If you want to play the game, you can get Active TCL from here, and then install it. After installing it, do these things:

  1. Get the game source code here.
  2. Save the game source code in your computer, name it prog.tcl (or anything, but I will assume you named it prog.tcl, and put it in some folder, X).
  3. Save these images in X, with the indicated names:
    1. http://i50.tinypic.com/21mzq07.gif – asts.gif
    2. http://i49.tinypic.com/256e1cw.gif – missle_1_1.gif
    3. http://i45.tinypic.com/2ptc7c0.gif – ship.gif
  4. To run the game, install Active TCL.
  5. Open cmd.exe on your windows machine.
  6. Go to the folder X.
  7. Run from the command line, in folder X, “tclsh prog.tcl”
  8. Have fun.

On linux, install TCL from your package manager, follow step 1 to 3 and run the game by following step 7.

The game is really primitive. There are no sounds, no explosion effets, nothing fancy. But it is very cool =).

Here are some pictures.

Getting into TCL TK

August 20, 2012

I’ve, these days, just started learning TCL and TK. I’ve always heard it’s a simple way to build GUI, and that both the TCL language and TK were easy to learn.

The people who told me that were right.

A part of it which I think many people would have a problem with is its type system.

The language is weakly typed, and before people starting to jump on me for saying such a thing, let me explain what I mean by that.

In TCL, you’re supposed to program by considering that everything is a string. Internally, that’s not how it works for performance reasons, but every value have a string representation, can be converted back and forth to strings, and will be so whenever needed. When you add 1 and 13, you should see these two as two strings which get parsed by the command which performs the addition operation, and then added internally, and then converted back to you as a string. Again, it’s unlikely to happen that way for performance reasons, but it’s given to you the illusion that this is how things are getting done.

The conceptual model of TCL is (together with some other stuff) that everything is a string.

It’s a little bit like in lisp, in which you have the illusion that your program is a lisp list. Which is not true, although the implementation gives you the illusion of that. Internally, many lisp implementations will interpret your code in strange ways, or compile to some other format (C, JVM Byte Code, CLR’s CLI, some internal byte code format the implementation uses, …).

In TCL, part of your code gets “bytecode compiled”, but part also remains interpreted.

Because, conceptually, you have the illusion that everything is a string, that’s how you should program (there is no other way): all your data are strings. That’s your only data type! Which means the string format is what says what “data type” you’re dealing with: “abc 12 d” is a list, also is a text, but not an integer; “1241” is an integer, but “12314121441312415145677872” is not an integer (sizes), and both are lists (of one element). This means that performing list operations on integers are fine because there are no lists or integers. The operations on lists only suppose the string has a list format. Thus, “conversions” (or “looking at the value from another perspective”) happens all the time (of course that, conceptually, there are no conversions; everything is string).

Which is why I say it’s weakly typed.

It’s also dynamically typed, because the various “data types” are not attached to any particular variable. A variable that used to hold what is an integer string may hold a list string.

However, notice that since there is only one data type (the string), all your variables are of type string, and that’s never gonna change. So, in that sense you could say that TCL is statically typed. However, it’s a useless categorization in my opinion.

To talk about typing, looking at the function types would be useful (maybe mandatory), but I won’t do that in here.

One of the things that you can do in TCL is use the value of a variable as a procedure to call. And any value can name a procedure: “procedure”, “function”, “abc”, “strip”, “10”, “12.31”, “do times”, “a+1-2″. You can then store the name of a procedure in a variable, and call it later. It’d just work, because to call a procedure, all you do is start a command with a string whose value names the procedure. If my variable v holds the value of “puts”, and “puts” names a procedure, calling the value of v is fine.

This implies that you can decide, very easily, in runtime, which procedure to call. This leads to a lot of dynamicity. For example, a simple Rock-Paper-Scissors game can be implemented by making three procedures: rock, paper, scissors, which takes a string, and put out the right output message based on the value of that string (e.g. if the rock procedure takes the scissors argument, then it’d print “win”). The game now is basically reading a word, then another, then calling the first on the second.

You can define 10 to name a procedure, and still use it as a number because the command to perform arithmetic doesn’t see a procedure or procedure name: it sees a string. You could then call 10, add 10, get the first element of the list 10, get the substring of 10 from the first up to the last, and so forth.

It’s not necessary to mention how fun it is to play around with languages like that. It looks like total disaster, but it doesn’t seem to lead to disastrous situations in practice; on the contrary. Only time will tell though.

TCL has a bunch of useful built ins. And it’d be interesting if I could show you some programs exemplifying that, but I will leave this to TK, which is what I come to now.

I got into TCL because of TK. I wanted to build GUI apps, and heard that TCL with TK formed an easy to use combination. Sounded good to me. After two days of studying TCL, I thought “this language is actually easy to learn and use, it seems, let me go to the TK side, and learn how to build GUI; if something appears that I have to go back, then I will”. So I started learning a little bit of TK.

I never built a GUI before, and I always thought it was a “hard” thing to do because I’ve looked at some GUI code in the past (from some examples written using C and xstep, and some examples from a QT book I started reading, using QT and C++).

It turns out that TK feels a lot declarative. I’d say more than HTML and CSS, because of the wider amount of options in TK. In HTML/CSS it happens a lot that you build a “widget” out other elements (menus out of lists, for example). This happens in TK too, of course, but you have a much broader range of widgets to start with. Also, laying out your widgets on the window is not like a “struggle with floats or positioning”, you actually can tell “sort of” where you want it to go, and it will go there (it’s actually hard to believe how simple it is).

It’s declarative because you don’t so much say what are the steps to build the GUI (although you can surely see it that way), but you say what you want to be true about your GUI with the provided commands. TK then will just take care from there.

This makes building GUI a lot nice.

So, it has been something like 4 or 5 days since I’ve started learning TCL/TK, and I wrote an app for me. A program which filters the contents of directory by a pattern I specify, and shows me the result in a listing. I used to do that using grep and ls, or find but opening the file later is not that “easy” that way (mostly because I usually don’t have a rule for selecting which file to open after filtering; mostly if I filter music or videos, and there is also the case when I filter, but am unsure on how many files the filter will give me back; opening is really easy if the filter gives only one file name back).

So, a 140 lines of TCL/TK code did the job, and it was much better than I expected; although it has its problems.

The code to build the GUI is less than 40 lines long. It’s a simple GUI, but it’s much smaller than what I expected.

Here is the code: http://pastie.org/pastes/4554713/text

Here is a photo of the program.

showing how I use dilter

Dilter in the context menu, also openned on the side.

The program is intended to use as something you open by right clicking a directory in windows explorer (yes, I use windows), and using it from there. The program does the files filtering in real time (each keystroke will update the list, which is nice). It can be made to work on linux by changing one line, which is the one which opens the file for you when you double click its item.


Follow

Get every new post delivered to your Inbox.