04.17.07
The danger of Google Ads
04.16.07
Comment Moderation Guide
- Respect;
- Name Disclosure;
- Valid Email Disclosure;
These are, from now on, the three things I will ask from people commenting on this blog. On a weekly basis I receive several emails which go against the second and the third (which I allowed) and several more going against the first (which I deleted) (most of them are Instituto Superior Técnico students, incapable of writing up their own opinion with respect for others).
I will, on an intuitive basis check for the validity of the Name of the commentators and I’ll check for the validity of their email by sending them one email manually which they should reply to see their comment on my blog. Some people, which I already know as respectful, like people from Planeta*, Planet Scheme and some friends, even when commenting on an opinion different than theirs and those will not need confirmation. To the others: I’m sorry but you’ll have to reply to my email confirming yours so that I can post your comment until you get into my whitelist.
Comments deleted by one of these reasons will be recorded on the respective posts and the reason for deletion for the authors record, with a link to this guide.
(Unfortunately, some students heading for higher education in Portugal are lacking even the bare minimum of a good education, and I’ve ran out of patience for these. To all the others, I’m sorry if you’re hit by this inconvenience.)
04.15.07
The Way to Enlightenment [Part III]
As you may remember, more than a month ago I changed from KDE to E16 and posted two parts of this tutorial series. Now, it’s time to end it. Not only because it’s on my stack for too long but also because Catarina, my girlfriend, asked me for them.
In this part I’ll guide you through the configuration of E16 itself and some side-apps that’ll improve your user experience.
E16 Config
Basically, once you start E16 you indeed, have a very basic setting. Let’s get it working. I’ll go through all the options in the configuration windows in E16. Set everything up to your taste.

By clicking on the background with your right mouse button you’ll get which is the basic menu with all the settings. The first option “Enlightenment Settings” is just a window that opens all the others without too much clutter. Anyhow, in this tutorial is simpler for me to go through all the option windows, one by one. Moreover, this first option is quite recent so you may not have it in your E16 version.
Now, I’ll go through the most important options. E16 has a huge number of options. Most of which are better explained if tried. So my opinion is that no matter what I say here, try them yourself.
Focus Settings
The first three options determine how your windows get the focus as you move the mouse pointer along. If you’re a windows user, you’re used to the third one. Windows get focus only when you click them. The other options are very nice and easy to get used to. The first option “Focus follows pointer” means that the focus will change as you move the mouse, i.e. the current focus is on the window where the pointer is. If the pointer is on the desktop background, no window has focus. The following option is like the first except that the focus will not get lost if you move the pointer to the desktop background, basically is the pointer is on the desktop background, the focus is on the last window with focus.The tick box “Clicking in a window always raises it”, when on, means the obvious. What you might ask is: “Why is this option interesting?” Well, simple, guess you have window A over window B and you click on B. Do you want B to come on top of A just because you clicked it? Your choice regarding this option depends on your answer. The next set of tick boxes might seem confusing but the main idea is when to you want windows to raise, i.e., windows to get on top of others. If you just don’t know… leave them as is and you can then come back if you don’t like the current settings. On to the next settings, the focus list is shown with Alt+Tab if you want it to be displayed, it’s really just a list, nothing fancy. On to some concepts, sticky windows are windows that are on all virtual desktops. You can make a window sticky by clicking with your right mouse button on the window bar and click “Stick/Unstick”. A shaded windows is a window which is not visible except the bar. To shade a window click on its bar with the middle mouse button or click again on the window bar with right mouse button and then “Shade/Unshade”. The next set of options has to do with, how do you want E16 to select the icon which shows up on the focus list, if any. Quite straightforward.
Move & Resize Settings
This sets how do you want windows to be handled while moving or resizing them. The first left set of radio buttons defines how do you want to see the windows while moving them: a snapshot of the window as when you started moving, a technical description of the move (useful for debugging), just the box encircling the window, as a shaded rectangle, as a semi solid rectangle, or translucent? On the resize methods you have mostly the same options. Regarding the geometry info position, usually it’s uninteresting for the user, so you can just select “Don’t show” or you can ask it to be in the screen corner or window center. Now, as two final options you can choose the window to be updated while moving it and you can ask to synch the move/resize with the application (both, I think, CPU intensive, in the sense that more CPU will be used if they are selected).
Window Placement Settings
This dialog is mostly about some eye candy (Slide options) and pratical issues of window placement which I think are self explanatory through the window labels.
Desktop Background Settings
The desktop background settings allow you to setup the background. However, you can only setup a given background if the background file is found in ~/.e16/backgrounds. So, move your background files there and then use this dialog to set it up.
Session SettingsNow, you surely want to start some programs when you enter E16. The best way is to enable the session script here and add the respective session script to its correct folder. The Init scripts which should be put in ~/.e16/Init are ran when E16 initiates (i.e., when it starts up, but not from a restart). The Start scripts which go to ~/.e16/Start are ran when E16 starts up from a restart or not (you can restart E16 by Middle Mouse Button -> Restart Enlightenment). The Stop scripts are to be ran when you stop/exit E16. So, for example, my scripts found in ~/e16/Init/start-apps.sh (and made executable):
$ cat .e16/Init/start-apps.sh
#! /bin/bash
# Program Startup# Starting GKrellm2
gkrellm2 &# Starting adesklets
nice -n 15 adesklets &# Starting Xscreensaver
xscreensaver &# Starting GAIM
gaim &
This bash script starts gkrellm2, adesklets (with low priority), xscreensaver and gaim!
This some of the most important options, you can also configure the iconbox (place where minimized apps go to) and the pager (place where you can see your set of virtual desktops).
System Tray
To add a system tray (this is a FAQ) just do Middle Mouse Button (on desktop) -> Desktop -> Create systray. And that’s it. You can also configure it.
aDesklets and Yab
We already installed adesklets and yab and have registered yab so it must be on your desktop by now, and if you followed the above session settings instructions you’ll have it started with E16 also. Now, how can you configure it? Not that easy but you’ll get used to it. With the right mouse button you can select configure and you’ll get into an editor (probably nano in Gentoo) and directly configure the file. There are some option description there which you should read. By using PageDown you’ll reach the options:
'caption_above': True
Use this if you want the bar to be on the bottom, so that the caption shows up above. The value False, makes the caption appear on the bottom of the menu.
'icon_max_height': 128,
'icon_max_width': 128,
'icon_maximize_threshold': 0.90000000000000002,
'icon_min_height': 48,
'icon_min_width': 48,
'icon_spacing': 5,
I don’t advise you to play with maximize_threshold. I don’t this it’ll be very good. Leave it as is. The max/min width and height should be the same as most icons are usually square. Moreover, the max should not be bigger than 128 if you wish quality icons since there aren’t many SVG icons nowadays (most are bitmaps which look terrible when stretched. Usually you have 24, 48, 64, 96 and 128 icons so use those numbers.
To configure the buttons in the bar use:
'icons': [('skype.png', 'Skype', 'skype'),
('amarok.png', 'AmaroK', 'amarok'),
('rosegarden.png', 'Rosegarden', 'rosegarden'),
('gimp.png', 'Gimp', 'gimp')]}
Just add lines like (‘x’, ‘y’, ‘z’) where x is icon filename, y is caption, and z is the program to start when you click it.
If you use simple file names they are relative to the icons/ subfolder of yab. You can however use absolute paths as noted in the config file:
You may specify here, for each yab instance you use,
what icons should be loaded (stored under `icons/’ by default,
but absolute path names are also valid), what commands they should trigger,
what the captions should be, what font to use, how generating effects,
etc.
Exit the file by doing Ctrl-X (if you’re in nano) and then confirm the save by answering the questions.
04.13.07
Parabéns Sr Primeiro Ministro…
Não, não, o nosso Primeiro Ministro não faz anos (acho eu, nem sei quando os faz, nem me interessa!) mas merece os Parabéns… e porquê?
Bom, não que seja meu costume discutir ou comentar política ou políticos mas penso que neste caso devo abrir uma excepção. Através da RTP Online [wmv, real, mp3] tive oportunidade de ver o debate que decorreu no passado dia 11 relativamente aos 2 anos de mandato (que na verdade mais parecia ser sobre as últimas 2 semanas).
Ora, comecemos pelos comentários particulares passando posteriormente para os generalistas. Quanto a todas as questões relativamente a estas últimas semanas em relação ao ser e não ser Eng. do PM, este sai-se lindamente.
Conseguiu explicar a todos aquilo que se passou e com toda a lógica. Não percebi, no entanto, a implicação dos repórteres relativamente ao facto de este ter escolhido a UnI. O PM explicou e bem… ora se a UnI fica perto do ISEL e se na altura era uma Universidade bem vista (lembremo-nos que nesta encontra-se um dos reconhecidamente mais populares físicos portugueses, o Prof. Carvalho Rodrigues) penso que é razão que chegue para ele decidir candidatar -se à UnI. Foi de facto, a insistência dos repórteres que me aparvalhou, de certeza que estes quereriam encontrar algum buraco para tentar enterrar mais o nosso PM mas não conseguiram. Para que foi aquele pergunta completamente idiota de se ele foi ou não aconselhado por alguém para ir para a UnI? Bom, resumidamente : Parabéns Sr. PM!
Foi impecável ele ter consigo os seus certificados e até as facturas das propinas… [onde é que já devem estar as minhas...] Contra factos não há argumentos. Parabéns Sr. PM!
O PM ia às aulas? Ora, ora, ora… mas que é que isso interessa? Que viria a seguir se ele dissesse que não? “Pois Sr. Primeiro Ministro, lá está, não ia às aulas e conseguiu passar a tudo. Uma façanha dessas deve de ter tido um bocadinho de ajuda, não?” Ai, ai… Parabéns Sr. PM!
Com que então, o Sr. PM colocou o seu Prof. António José Morais num cargo do seu governo. Quem virá a seguir? O seu Prof. de Educação Física? Talvez para Ministro da Agricultura ou dos Transportes ou… Epá! Mas que raio de lógica da batata é esta? OK, calhou um Professor fazer parte do Governo, e então? Durante a vida de uma pessoa temos mais de 100 Professores, calhou um fazer parte do Governo e já se pensa que é uma conspiração! Parabéns Sr. PM!
Quanto ao Eng. na página eu já disse tudo em posts anteriores… a explicação do Sr PM foi perfeita. Parabéns Sr. PM!
O resto da conversa resumiu-se à questão da economia que o Sr. PM explicou e muito bem. Obviamente não se pode agradar a gregos e a troianos. Se se está a impôr uma reforma na função pública, vão existir pessoas prejudicadas, é necessário apesar de tudo de acreditar que será melhor para o país a longo prazo. Por outro lado querem que o Sr. PM resolva os problemas do mundo em meio-dia… ora, o Sr. PM é só um homem. Querem o quê? Parabéns pelas suas respostas e explicações Sr. PM.
Também se falou da Ota, dos impostos e pouco mais… a verdade, é que numa entrevista de 1h27m, 40 foram para as últimas 2 semanas. Os outros 47 para o resto dos 2 anos. Parece-me correcto! Faz todo o sentido!
Ora meus amigos, principalmente a nossa cara Maria Flor Pedroso, onde é que tirou o curso? Ia a todas a aulas? Quantas cadeiras fez? Acho que é melhor investigarmos isto porque pelo mau espectáculo que deu na entrevista ao Sr PM… Se fosse seu Professor ainda a chumbava retroactivamente às cadeiras que fez… Ai, ai…
Parabéns Sr. PM…
(e logo eu que nunca gostei do PS, e não votei nele!)
04.11.07
Why Scheme needs no comments…
(define (select-S-in-F-such-that-S-intersect-U-maximal F U)
…)
– From set–greedy-set-cover.scm in Functional Data Structures Galore 2.1
04.07.07
PLT-Scheme and the stupidity syndrome…
PLT Scheme is huge as compared to the R5RS Scheme standard, on which PLT Scheme builds upon. No matter how much I spend my free time having fun with Scheme, I always get in the end with an “Aha” moment and then I feel deeply stupid.
Check this… I’ve been developing a graph library and I had it ready to upload to Planet, however, I wanted to tweak it some more. To build a sparse graph I had a very simple structure based on lists. The make-sparse-graph should receive two optional arguments, procedures, and return the structure for an empty graph. My version 30 minutes ago was like this:
; Constructor
;; make-sparse-graph : [node=?] [node?] -> empty sparse-graph
(define (make-sparse-graph . fns)
(define (make node=? node?)
(cons (cons node=? node?) '()))
(cond [(= (length fns) 0)
(make eq? (lambda (x) #t))]
[(and (= (length fns) 1)
(procedure? (car fns)))
(make (car fns) (lambda (x) #t))]
[(and (= (length fns) 2)
(procedure? (car fns))
(procedure? (cadr fns)))
(make (car fns) (cadr fns))]
[else
(error "make-sparse-graph: Should receive 0 to 2 optional procedures.")]))
I was not really satisfied with it. Through a discussion on PLT-Scheme mailing list, I got to case-lambda, which seemed very nice so I improved it a little to:
;; Constructor
;; make-fixed-sparse-graph : node=? node? -> empty sparse-graph
(define (make-fixed-sparse-graph node=? node?)
(cons (cons node=? node?) '()))
;; make-sparse-graph : [node=?] [node?] -> empty sparse-graph
(define make-sparse-graph
(case-lambda
[() (make-fixed-sparse-graph eq? (lambda (x) #t))]
[(node=?) (make-fixed-sparse-graph node=? (lambda (x) #t))]
[(node=? node?) (make-fixed-sparse-graph node=? node?)]))
But… hey, again, by searching through the docs on contracts I found yet again a another pearl opt-lambda and here’s the current version:
;; make-sparse-graph : [node=?] [node?] -> empty sparse-graph
(define make-sparse-graph
(opt-lambda ((node=? eq?) (node? (lambda (x) #t)))
(cons (cons node=? node?) '())))
Well, after this… by looking to my first first and to my last one… damn, I feel stupid! Yes, sometimes I have a love-hate relationship with PLT-Scheme… I wonder if I kept searching I would end up with a 10 character function definition. :-)
SATSCheme… A new Project!

SATSCheme is a new project by myself and a colleague of mine to develop 2 SAT Solvers, one in C and other in PLT Scheme. I’ve setup a blog for the project. This way if you’re interested in the developments you just have to subscribe the feed. From the Scheme perspective, it’ll be nice to see how Scheme GC will cope with the constant memory allocation usually performed by a SAT Solver, and how easy it will be to implement it. Moreover, it’ll be nice to compare it to the C version performance-wise and memory-wise. Other than that, the amount of locs will also be an interest analysis. Well, I’m sure there’ll be a huge space for discussion not only about the code itself but also about the SAT algorithms and structures. Hope you keep an eye at the page. Regarding major announcements, I’ll post them around here also.
Upload feature in WP hosted by SF
As part of a new project which is hosted at SF, I decided to create a blog there using WP. Installation was quite simple since you have a lot of information available from SF regarding the shell and mysql server so everything went smoothly but then I couldn’t upload any files to the blog! :-(
“Damn”, I though… So, I remembered that it was obvious there was a permission problem with the
wp-content/uploads
directory. I logged in the shell server and chmoded to 755… didn’t work so I tried 775, still not working …. tried 777 and damn… not working!
The solution is not straightforward, so if you do not want to waste the time I did, here’s the solution.
So, tried several things… but they were not working so after several half hours or searching, giving up, searching, giving up… I posted a support request at sourceforge and they finally I got that:
Greetings,
The project group mounts are done read-only on the webservers, please
read:https://www.sf.net/docs/E07
The fix is to create a directory in /tmp/persistent with your project’s
UNIX name, and then use that directory for any file reading/writing.
So, this seemed the solution but it is not. I created a directory in
/tmp/persistent
for my project but then I needed to tell wordpress that the uploads directory was outside the WP dir which is not possible. After several tries, the solution is to setup the directory to be
wp-content/uploads
and create a symbolic link uploads in wp-content to the directory you created in
/tmp/persistent
. This will work, I don’t think you’ll get there using any other solution, without modifying a WP code itself.
Click
Plot Outline:“Click” focuses on a workaholic architect who finds a universal remote that allows him to fast-forward and rewind to different parts of his life. Complications arise when the remote starts to overrule his choices.
Personal Comments:
I rented this movie last week while in Portugal and it was just because I didn’t want to see a too ’serious’ movie. Adam Sandler is one of those actors which doesn’t seem to be able to do a quite serious movie. Well, I got what I asked. It was an easy going movie with a simple ending. Nothing really special as a movie overall, in my opinion. Tells you, however, that you should not want to fast-forward your life! :-)
I would only tell you to watch it if you don’t have anything else to watch…
High Crimes
Plot Outline: High powered lawyer Claire Kubik finds her world turned upside down when her husband, who she thought was Tom Kubik, is arrested and is revealed to be Ron Chapman. Chapman is on trial for a murder of Latin American villagers while he was in the Marines. Claire soon learns that to navigate the military justice system, she’ll need help from the somewhat unconventional Charlie Grimes; meanwhile, Claire’s sister, Jackie, is falling in love with wet-behind-the-ears Lieutenant Embry assigned as the official defense lawyer. And most of the eyewitnesses have rather too conveniently died.
Personal Comments:
If there are two actors I specially like are Morgan Freeman and Denzel Washington. I saw this movie last week when I stopped in Portugal for a few days and had the time to rent it. The movie is not Morgan Freeman centered but it is very good and Morgan Freeman has a good role. Even though it is not a huge movie, it is definitely worth to see! I always likes movies about lawyers and this is definitely it!

