Archive for May, 2008

Commanding someone using “sana”

Thursday, May 15th, 2008 by Agro Rachmatullah

In bahasa Indonesia, “sana” literally means “there” like this sentence shows:

(1) Nanti malem aku bakal ke sana.
- I will go there tonight.

However, another of its important use is to make a casual yet strong command. Some example sentences:

(1) Kerjain PR sana!
- Go do your homework!

(2) Sana main di luar!
- Go play outside!

(3) Mandi dulu sana!
- Go take a bath first!

As can be seen, “sana” can be put either at the front or the end of the sentence. It has a sense of urgency, e.g. “do it immediately”. It also implies anger or annoyance on the speaker’s part, and the speaker won’t really accept a “no”. If you want to associate “sana” with its literal meaning “there”, you can remember it as having the connotation “go there and do what I told”.

It’s used when there is a very close relationship between the speaker and the one commanded, where such strong words are acceptable. Examples include a parent telling their child and a boy being angry towards his older sister.

- Jangan ngenet mulu, belajar sana!

A unique Japanese captcha

Friday, May 9th, 2008 by Agro Rachmatullah

Everybody knows captcha, the verification image we meet everytime we register something to help keep spammers off the board. It usually involves retyping a badly distorted or other visually-abnormal text. Boring, because What You See Is What You Type (WYSIWYT).

Every once in a while someone came up with a clever CAPTCHA, like those simple arithmetic CAPTCHAs where you are asked to do an addition.

Recently, I registered on a Japanese site FC2. It has this never-before-seen (by me) CAPTCHA:

Japanese kana captcha

You, got it right! They spell a series of numbers in kana and we need to retype it using the all-too-familiar 1 2 3. Of course, the image is still littered with those bacteria we’ve been accustomed to.

If you’re studying Japanese, please try to answer in the comments. I’ll give you… a nice reply comment :).

PS: CAPTCHA is actually an acronym so it is written in capitals. However I very much prefer it to write it like: “captcha”.

The ASP.NET Bin and App_Code folder misconception

Monday, May 5th, 2008 by Agro Rachmatullah

This might very well be my misconception only.

From what I inferred by reading books and articles, when developing an ASP.NET application you have two special folders at your disposal, the Bin and App_Code folder. You can place assemblies in the Bin folder (e.g., MysteryOfLifeSolver.dll) and automagically you can use the classes inside the assembly from your ASP.NET pages. App_Code is for putting C# source code files (e.g., ComplexNumber.cs) and ASP.NET will compile the files for you so that the classes inside can be used on your ASP.NET app.

Except it didn’t work.

Well, since in IIS the directory C:\inetpub\wwwroot corresponds to http://localhost, naturally I put my applications inside there. For example, I might have three ASP.NET applications:

C:\inetput\wwwroot\app1
C:\inetput\wwwroot\app2
C:\inetput\wwwroot\app3

I thought I could easily have a separate Bin and App_Code for each application. For example, for app1 I created:

C:\inetput\wwwroot\app1\Bin
C:\inetput\wwwroot\app1\App_Code

But ASP.NET refused to use those 2 folders! What worked is that I put Bin and App_Code in the wwwroot folder, like:

C:\inetput\wwwroot\Bin
C:\inetput\wwwroot\App_Code

It worked, but obviously created a massive mess because now all my ASP.NET application must share the same Bin and App_Code folder.

The problem is simply because those three applications I made were imaginary. Yes, for IIS/ASP.NET, there was only one ASP.NET application, the one with wwwroot as its root folder. The folder I named app1 etc. was part of that wwwroot application as far as IIS is concerned.

To tell IIS that “Hey! This app1 folder is an application in its own right!”, you need to configure it as a “virtual directory”. Go to the IIS snap in (C:\WINDOWS\system32\inetsrv\iis.msc), keep opening the tree on the left until you meet Default Web Site, right click it, and choose New -> Virtual Directory....

Enter any name for the alias (e.g., newapp), which will determine the URI (e.g., http://localhost/newapp). Next, browse for the directory in the file sytem which contains the files of your application (e.g., C:\inetput\wwwroot\app1). Note that you can even name the alias just like the directory name in the filesystem (e.g., app1 for the previous example). For the permissions, you can leave the default but you might need Write in case your application needs to write into the file system.

After that it’s bliss. You can have Bin and App_Code in each of your application’s root folder.