Too Cool for Internet Explorer


Swobodin's Profile | Swobodin's Blog | Back to Fedora Tunisia

Archive for the 'Programming' Category

Flirting with AJAX

Thursday, April 27th, 2006

I started to find out about AJAX, a fashion Web technology, which stands for Asynchronous JavaScript And XML; Hatem’s blog helped me a lot, and the Internet is a huge source of information.
A “hello world” application is like the following: it requests data from page.php and writes the content between div tag identified by […]

Fixing PHP code

Friday, April 14th, 2006

A         a is an intern whom I am supposed to assist to fix her PHP code. The following case seems obvious; it’s nevertheless tricky.
 
- A         a: I have several checkboxes whose the number depends on the database rows. Once a user submits, checkboxes are displayed again, but the ones already checked must appear checked too.
Initial […]

QCMGen ain’t dead, OpenSource neither!

Monday, March 27th, 2006

Today seems to be Tom’s day in my blog!
Tom asked me some days ago whether I can contribute to the first Tunisian OpenSource project QCM-Gen 0.1, something I cannot refuse; however, I spent my free time watching Jackass the movie and playing chess. Finally I decided yesterday to work on it seriously (well, […]

WordPress Today Events

Saturday, March 18th, 2006

I have released a 0.1 version of a pseudo WordPress plugin which displays events that occured in the same day / month along the history.
Pseudo, becuase it’s doesn’t have plugins features; I can even say it’s independent from WordPress. It consists of 2 MySQL tables: the main (wp_todayevents) and the backup one (wp_todayevents_archive) and […]

Permanent links in WordPress

Friday, March 10th, 2006

I don’t like the way of making permanent links in WordPress blogs; there are mainly 2 methods:

URL indicates date and/or title post, the most popular method, but the problem is funny: I can’t access to my posts through a proxy/firewall stupidly configured, where the words ’sex’, ‘fuck’, ’suck’, … are censored. As I don’t […]

Getting rid of spam comments

Thursday, January 26th, 2006

Porn, viagra, casino, and some words I don’t understand… I got more than 70 within a week! Fortunately, the WordPress keywords filter removed most of them, but it’s not enough, since the database size strangely increased. I am using a new method: denying spam robots with .htaccess file.
According to the WordPress site, you should […]

Writing valid XHTML posts on WordPress

Thursday, January 19th, 2006

WordPress contains a nice WYSIWYG HTML editor, but it doesn’t fit with XHTML specifications.
I found out a cool method to generate valid XHTML code on WordPress; all what you need is Nvu and Vim.
First, use Nvu to edit your HTML text, and set you markup output to XHTML transitional:
Tools - Preferences - Advanced - […]

Running PHP code on WordPress

Thursday, January 12th, 2006

This post is generated using a PHP code!
Thanks to Mr. R’s suggestion, I looked at the WordPress plugins repository and found a script that executes PHP.
Excellent feature, it even deals with forms inside posts and pages, and keeps it valid XHTML.

PHP Happy new year 2006

Tuesday, December 27th, 2005

I released a cool PHP script that generates a wish card.
You can both use it and hack on it.
For users
Point your browser to http://swobodin.fedora-tn.org/wp-content/lab/card/?from=Sender&to=Receiver
&msg=Your_Message&wish=Your_Wish, and change the following parameters:

from: your name
to: receiver name
msg: your message, eg. “Happy_New_Year_2006“
wish: your signature, eg. “Sincerely,“

Note that you should replace whitespaces by underscores ( _ ) and separator […]

The ABC’s of UNIX

Friday, December 23rd, 2005

A is for awk, which runs like a snail, and
B is for biff, which reads all your mail.
 
C is for cc, as hackers recall, while
D is for dd, the command that does all.
 
E is for emacs, which rebinds your keys, and
F is for fsck, which rebuilds your trees.
 
G is for grep, a clever detective, […]

GraphInside

Monday, November 28th, 2005

A Perl script to integrate graphics into a HTML file.
Requires Perl with the following CPAN modules: HTML::TokeParser and MIME::Base64.
Handles HTML and XHTML documents, recognizes GIF, PNG and JPEG graphics, parses full path image files, compatible with standards.
See a live example (the documentation itself) here.
Click here to download the script.

Memory status

Friday, November 25th, 2005

Here’s a little script to display memory status and refresh it each 5 seconds. You need xmessage to run it:
while free -otm|xmessage -buttons “Close”:1,refresh:0 -default “close” -timeout 5 -file -;do :;done

My Feed Reader

Sunday, November 20th, 2005

I have coded a funny and buggy Feed Reader, with PHP and SQLite. So don’t be afraid if you see on the log a user-agent with a strange identity showing my URL: it means that I have added your RSS to my bookmarks

Simple Perl loop script

Friday, November 18th, 2005

The following Perl program loops from 0 to 1 incrementing by 0.1:
perl -e ‘while ($_ < 1.0) { printf(”%.1f\n”,$_); $_+=0.1;}’

Malicious program

Wednesday, November 9th, 2005

Wakegen dropped me that C program that crashes your UNIX machine.
Be careful! It’s dangerous, use it at your own risk
#include <sys/types.h>
#include <unistd.h>
int main() {
pid_t p=fork();
main();
}
It consists of the following: Creating infinte child processus until the buffer gets overloaded; […]


Top Tunisie Blogs