Hans Roslings unveils stunning visualizations on HIV

Hans Rosling unveils new data visuals that untangle the complex risk factors of one of the world’s deadliest (and most misunderstood) diseases: HIV. He argues that preventing transmissions — not drug treatments — is the key to ending the epidemic.

How to fix missing MSVCR71.dll problem in Windows

I am using Windows 7, and I’m lacking MSVCR71.dll which is Microsoft Visual C Runtime library when using sendmail, the PostgreSQL PHP connector and curl. The MSVCR71.dll is probably bundled with .NET Framework 1.1 or something, but I couldn’t get those to install successfuly.
The program can't start because MSVCR71.dll is missing from your computer. Try reinstalling the program to fix this program.

The program can’t start because MSVCR71.dll is missing from your computer. Try reinstalling the program to fix this program.

[ad#simple]

So how do I solve it:

  1. Download MSVCR71.dll from dll-files.com. (It is free.)
  2. Unzip…
  3. Place MSVCR71.dll into C:WindowsSystem32 or C:WindowsSysWOW64 if you using a 64-bit Windows.

And sendmail now works for me already in Windows 7.

By the way, I only tested this in Windows 7 64-bit. I assumed it would work for other versions of Windows. I would appreciate it if you could feedback to me if it works on your version of Windows. 🙂

Additions

It is reported working for Windows 7 32-bit as well.

The misconceptions of evolution

Addressing some misconceptions and explaining some of the basics.

Evolution

I tried so hard to explain to a friend what evolution is last time. This video explains a lot better than I did. Makes me feel like starting a conversation on evolution again. Evolution is perhaps one of the most misunderstood concepts. It was never about religion. It’s happening all the time in bacteria and in humans too. It upsets me when people link evolution to something anti-religious.

How to use sendmail in XAMPP for Windows using AOL Mail

The easiest way to start developing in PHP is to get XAMPP, the whole package can even be placed in a flash drive. Using the free AOL Mail account also allows you to sign in to the SMTP server without TLS which allows XAMPP sendmail to work.

0. Objective

To get your PHP scripts to send an email out. This guide assumes you have XAMPP or XAMPP Lite. My environment is Windows Vista. (I use XAMPP Lite by the way.)

My XAMPP is placed in C:xampplite, so your configuration may be a little different. The files to be modified are sendmail.ini and php.ini. Continue reading “How to use sendmail in XAMPP for Windows using AOL Mail”

How to import and export MySQL database into an SQL file

Or Gzip for the matter. Here’s the command to run in your UNIX-based server to import or export via an SQL file, this is useful for performing backup and restoring of a MySQL database. (I wrote a similar import and export guide for PostgreSQL.) The mysqldump utility performs just that:

Exporting using mysqldump:

[code lang=”bash”]mysqldump -u[Username] -p[Password] [Database] > output.sql[/code]

For example, my username is ‘kahwee’, my password being ‘secret’ and database being ‘justrealized_db’, I would run the following to export my database to a SQL file:

[code lang=”bash”]mysqldump -ukahwee -psecret justrealized_db > output.sql[/code]

And to Gzip:

[code lang=”bash”]mysqldump -u[Username] -p[Password] [Database] | gzip > output.sql.gz[/code]

Importing using mysql:

To import back, we can use the mysql utility in a similar fashion, note that the > (greater than) has change to a < (lesser than).

[code lang=”bash”]mysql -u[Username] -p[Password] [Database] < output.sql[/code]

For example, my username is ‘kahwee’, my password being ‘secret’ and database being ‘justrealized_db’, I would run the following to import my database:

[code lang=”bash”]mysql -ukahwee -psecret justrealized_db < output.sql[/code]

And to Ungzip:

[code lang=”bash”]gunzip < output.sql.gz | mysql -u[Username] -p[Password] [Database][/code]

[ad#simple]

Backing up and restoring MySQL databases in Windows

Unfortunately, you can’t use gzip here. So all those commands above with gzip can’t work. The rest, however, still works. However, mysqldump and mysql may not be set in your system environment variables. These are instructions on how to add them for Windows Vista:

Editing system environment variables in Windows Vista.

Click on ‘Edit the system environment variables’, a dialog box will pop up. Click on ‘Environment Variables…’, you should be greeted with the following dialog box:

Editing the path for environment variables

My path looks like this before I add anything:

[code lang=”bash”]%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem[/code]

Append your MySQL bin directory at the back of what is already there. I use XAMPP (XAMPP lite to be specific) which has its MySQL bin folder located here ‘;C:xampplitemysqlbin’, so I would be appending this:

[code lang=”bash”];C:xampplitemysqlbin[/code]

That’s all I guess, hope it is helpful for you.

It’s exam time

I haven’t been blogging for a while as it’s exam period. It’s also been busy busy at 24seven. The new product which name you will never guess right.

Today’s paper is on programming, it’s (so-call) advanced concepts. Honestly the whole course’s been a mess but never mind that. I did 3 questions on Java, 2 question on SML and 1 question on Prolog. The Java questions are quite easy. Most of what I studied came out. I planned to do 3 questions out of the 5 Java questions and it went well.

What caught me in a surprise is Prolog which is quite hard, especially the last question which was basically some professor wanting to read some opinion. If I were a computing journalist, I probably choose that question.

SML isn’t that hard. What I studied came out, what I didn’t study I chose not to do. And I quickly went home and I try to see if the average function I wrote work in SML. And it did:

[code lang=”ocaml”]fun average x =
let
fun sum [] = 0.0
| sum (h::t) = h + sum t;
fun count [] = 0.0
| count (h::t) = 1.0 + count t;
in
sum x / count x
end;[/code]

I wrote this function very neatly on the paper. I never had so much sense of achievement writing an SML function.

An alternate way of writing would be probably:

[code lang=”ocaml”]fun average x = foldl op+ 0.0 x / real (length x);[/code]

You gotta love foldl sometimes.

Tomorrow’s paper is database. I probably won’t do too well for that. Lots of memorizing to do and my memory’s failing me.

Did you know there’s an ISO for sex?

Turns out that there is an ISO standard for sex. Man is 1 and woman is 2. But why man precedes woman? The standard explicitly states that no significance is to be placed on the fact that male is encoded as 1 and female as 2. The encoding merely reflects existing practice in the countries that initiated this standard.

More information at ISO.

International standard ISO 5218 defines a representation of human sexes through a language-neutral single-digit code. It can be used in information systems such as database applications. (Source: Wikipedia)

The four codes specified in ISO 5218 are:

  • 0 = not known,
  • 1 = male,
  • 2 = female,
  • 9 = not applicable.