TV Recommendation – Lie to Me

"Lie to me" title screen

If you like Bones, here’s a TV show I’d recommend you checking out – "Lie to Me".

"Lie to Me" presents a fictional story of a crime-fighting psychologist (Dr. Cal Lightman) and his team. The structure of the episode is similar to that of Bones’ where they get a case at the beginning, and solves it in the end. The interesting part, for me, is to see how important clues that affects the outcome of a case, can be extracted accurately from the subtle expressions / body language of suspects during interrogations.


FTP script example

A while back, I was uploading a bunch of stuff via FTP and needed a FTP script to automate things. However, I couldn’t find a clear example script out there and this simple script ended up taking quite a bit longer to write.

Anyway, for anyone who’s searching out there for a FTP script example, here’s something you may appreciate:

# (Other commands in script)
# ...
ftpCmd="open 21
user aUser aPassword
cd uploads
mput *
echo "$ftpCmd"|ftp -niv

The tricked as you can see is to store the FTP commands into a variable, then echo that to the "ftp" command.

Have fun FTP-ing, lol.

ASP.NET’s equivalent of doGet() and doPost()

Another day at work, another thing learnt about ASP.NET – I was trying to code up a login control today and I needed a method that only accepts post requests, but found nothing obvious that is equivalent to the doGet() and doPost() methods in Java servlets (well… alright, I guess you could use SupportClass.ServletSupport class as described here…).

Anyway, the solution for getting the form parameters in different requests turned out to be rather simple:
get – Request.QueryString
post – Request.Form

And to determine the current submission method – Request.HttpMethod.

TV Recommendation – Being Erica

Being Erica title screen

Here’s a show I’d recommend you checking out – Being Erica.

The story is about a smart 32 year old fictional woman (Erica Strange) whose life is full of regrets. After meeting a mysterious therapist (Dr. Tom), she was given a chance to go back in time with foresight and revisit those events she will come to regret, in the hope of understanding and coming to terms with her choices.

2 episodes had been aired so far and I will be looking forward to the rest of season 1!

It is an interesting question – What would you have done differently if you are given a chance to go back in time with foresight? Would you even want to change the past knowing full well what it will lead to?

For me, there are certainly things I would like to have done differently, and those actions may have lead me to live a completely different life, or, may turn out to not change things significantly at all. But the more I think about it, in a strange way, I’d rather not change my past as a whole, even knowing full well where it will lead me along with the unanswerable questions I now have. But I guess the main reason why I wouldn’t want to change the past significantly is because all the major events and experiences all combined to lead me to know God in a way that I never thought would be possible.

Anyway, sorry about turning this into a little story of my life – but do check the show out!

ASP.NET error – Attempted to read or write protected memory

Right, first post of 2009, let’s start off with a shot one.

As part of my job, I am now learning and using ASP.NET with C#. The other day I was firing off some queries to an ODBC data source when I came across this exception message:

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Turns out the problem was caused by the number of parameters I added to the prepared ODBC command – what I am saying is, check you OdbcCommand’s parameter count against the expected parameter count, make sure nothing is missing.