Add all the natural numbers below 1000 that are multiples of 3 or 5

Problem #1 of Project Euler

Add all the natural numbers below 1000 that are multiples of 3 or 5.

Continue reading

Posted in Python | Tagged , , , , , , , | 2 Comments

How to embed source code in a blog

code

To embed source code inside blogger blog, like in the picture above, I use a css box like below:

Continue reading

Posted in Blog Tips | Tagged , , , , , , , | Leave a comment

Password protect Word 2007

This is a simple technique on how to protect a Microsoft Word 2007 file with a password.

Continue reading

Posted in Microsoft Office, Office Tips | Tagged , , , , , | 5 Comments

Python: Conditional Statement with lambda

Suppose that we have a conditional statement:

In Python, we can write it in three ways:

Continue reading

Posted in Python | Tagged , , | Leave a comment

Python: Parse Apache log to sqlite database

This Python script was written for a friend in Australia, as part of his Ph.D project. The script will parse the Apache server log into sqlite3 database.

Continue reading

Posted in Python | Tagged , , , , , , | Leave a comment