Archive for August 2008

Custom Excel Dates

Microsoft Excel provides a way to create our own date format.

The date format could be customize using these codes.

Date codes:

  • d - the day number (1, 2, 3, …, 31)
  • dd - the day number in two digits (01, 02, 03, …, 31)
  • ddd - the abbreviated day (Mon, Tue, …, Sun)
  • dddd - the day of the week (Monday, Tuesday, … Sunday)

Continue reading ‘Custom Excel Dates’ »


Learn Calculus in 20 minutes

Two videos by Professor Edward Burger of Williams College teaching Calculus in 20 minutes.

The bottom line is, Calculus is not that hard, even though based on my experience, many students dislike it.

Calculus in 20 Minutes Part 1

Calculus in 20 Minutes Part 1
Continue reading ‘Learn Calculus in 20 minutes’ »


Find max or min in Python dictionary

Suppose that mydict is a dictionary defined by

1
mydict = {'a': 2, 'c': 5, 'b': 1, 'd': 4}

How to find the key for the max or min value in the items?

Continue reading ‘Find max or min in Python dictionary’ »


Sort Python dictionary

Suppose that mydict is a dictionary defined by

1
mydict = {'a': 2, 'c': 5, 'b': 1, 'd': 4}

Remember that dictionary has no function sort, since it is unordered, not like a list, or tuple.

However, the key function, introduced in version 2.4, is helpful in sorting a dictionary.

Continue reading ‘Sort Python dictionary’ »


9 ways to hide affiliate links

These codes are useful for hiding the affiliate links. However, please read the affiliate program terms of service, so that you won’t go against it.

Continue reading ‘9 ways to hide affiliate links’ »


Product of a single digit number with 9

This algorithm is useful for kids that are lazy enough to memorize the multiplication table of 9.

Continue reading ‘Product of a single digit number with 9’ »


Evaluate Ankermann Function using Python


Don’t defrag flash drive

Should you defrag your flash drive? The answer is no. This article will gives you two reason why you shouldn’t do so.

Continue reading ‘Don’t defrag flash drive’ »


Drag file to print

This is a quick way to print a file without opening it yourself. What you need is a shortcut to the printer icon on your desktop. In order to print a file, just drag the file to the printer icon, and get your print.

Continue reading ‘Drag file to print’ »


Even-valued Fibonacci terms summation

Problem #2 of Project Euler

Find the sum of all the even-valued terms in the Fibonacci sequence which do not exceed four million.

Analysis
The first 10 terms of Fibonacci sequence are
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, …

We need to add the even numbers terms
2 + 8 + 34, …

Continue reading ‘Even-valued Fibonacci terms summation’ »