Archive for the 'Programming' Category
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 […]
Posted in General, Programming, HTML | 1 Comment »
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 […]
Posted in General, PHP, Fun, Personal | 1 Comment »
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, […]
Posted in General, OpenSource Softwares, PHP, Tunisia | 5 Comments »
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 […]
Posted in General, PHP, WordPress, History, Vim | 7 Comments »
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 […]
Posted in General, WordPress, Personal | No 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 […]
Posted in General, WordPress, Personal, Apache | No Comments »
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 - […]
Posted in General, WordPress, Vim, W3C, XHTML, Nvu | 1 Comment »
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.
Posted in General, PHP, WordPress | 3 Comments »
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 […]
Posted in General, PHP, Network, Web Server | 1 Comment »
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, […]
Posted in General, Shell, Fun, UNIX | No Comments »
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.
Posted in Programming, Perl, Graphics, W3C, HTML | No Comments »
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
Posted in General, Programming, Shell | 1 Comment »
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
Posted in PHP, Network, XML, Databases, SQLite | No Comments »
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;}’
Posted in General, Programming, Perl, Shell | 1 Comment »
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; […]
Posted in General, Programming, C, UNIX | 2 Comments »