simoncpu Random thoughts of simoncpu. You may view my old blog here.
Entries "June 2005":

Friday, June 24, 2005

Dreams

It's been years since I've last remembered my dreams.  I don't know why, but it seems that I have lost my ability to recall them as I grew older.  When I was a 3-year old kid, I often had this dream, which seems very real, about wandering around our neighborhood accompanied by my guardian spirits (I sometimes see Satan, but he can't hurt me nor can my guardian spirits hurt him).  Today, I'll try to bring back that "skill" because I could just imagine the many possibilities I can do in my dreams.  I'm no longer a 3-year old kid, so my motivations *ehem* are no longer innocent. Hehe.

»12:25 AM    »2 comments (0 )     »Send entry    

Posted by: simoncpu    in: Thoughts
Monday, June 20, 2005

Coldfusion's isNumeric(): A different approach


My friend, Aldwin, has a different approach in solving the isNumeric() problem mentioned in my previous post.  Here is his solution for the module that he's working on (I've slightly modified it to remove sensitive information):

<cfset str = "-256.">
<cfset acceptonly  =  "1,2,3,4,5,6,7,8,9,0,.,-">
<cfif listfind(acceptonly, str, ",") gt 0>
    This is not a valid number.
<cfelse>
    This is a valid number.
</cfif>

Please note that this is only applicable for certain (preferrably pre-validated) inputs.  This will not flag an error for inputs such as "8.-.16-" or "...32.256"

»9:22 PM    »1 comments (0 )     »Send entry    

Posted by: simoncpu    in: With Logic and Chaos
Work-around for Coldfusion's isNumeric() function

Problem:  You need to determine whether a given input is a number or not.  Unfortunately, Coldfusion's isNumeric() function only checks whether a number can be treated as a number internally.  Therefore, the following strings (without the quotation marks) would cause the function to return a true value:

"   8  "
"16d"
"128f"
"32e256"

Although this is fine for many applications, this is often not the desired behaviour such as when you need to validate them before passing it to a MySQL query.

Solution:  A solution I've found so far is to use Regular Expressions.  We use REFind to search for the following regex pattern:

^-?[0-9]+(\.?[0-9]+)?$

Example:

<cfif REFind("^-?[0-9]+(\.?[0-9]+)?$", "-256.")>
    This is a vaild number.
<cfelse>
    This is not a valid number.
</cfif>

Please note that this is also applicable to other programming languages that support Regular Expressions (i.e.: either built-in or through a library), although this may no longer be necessary for more elegant languages such as PHP (sorry, I'm biased).

»7:53 PM    »No comments     »Send entry    

Posted by: simoncpu    in: With Logic and Chaos
Friday, June 10, 2005

Generating RTF

I'm making a web-based payroll system right now.  Since we need to generate print-outs of the data, I opted to format it using Microsoft's proprietary (?!) Rich Text Format (RTF).  I didn't choose PDF because it's a bit complicated, and because we are on a tight deadline (was it a correct decision?).  I have no formal training on this whatsoever, so I had to rely on samples to deduce some of the rules that make up this document language.

The text that MSWord generates is so horrible.  I had to examine lengthy sequences such as this:

"... \brdrs\brdrw15\brdrcf1 \cltxlrtb\clftsWidth3\clwWidth1204\clshdrawnil \cellx9748\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf1..."

This is fun! :)

»10:39 PM    »No comments     »Send entry    

Posted by: simoncpu    in: With Logic and Chaos
The Tao of Programming

When I was a kid, I used to find The Tao of Programming rather boring and confusing.  Now that I'm older (but still a kid, nevertheless), I now find it very funny because I can now relate.

Read more about the Tao of Programming here.

»4:52 PM    »2 comments (0 )     »Send entry    

Posted by: simoncpu    in: Thoughts
Friday, June 3, 2005

Wala Lang

Yikes.  This blog is supposed to be a venue where I can discuss problems, solutions, and ideas relating to Computer Science and Information and Communication Technology.  I don't know why I can't bring myself into the mood for serious thinking right now.  I've been waiting for it to come, but it seems that I can only sustain my concentration for a couple of hours each day.

Anyway, this post shall mark the end of my posting inane remarks in this blog.

»11:14 PM    »No comments     »Send entry    

Posted by: simoncpu    in: Thoughts

Modified on June 3, 2005 at 11:18 PM
deleted

*poof*  This entry is now null and void.

»6:13 PM    »No comments     »Send entry    

Posted by: simoncpu    in: Thoughts

Modified on June 9, 2005 at 11:37 PM
Thursday, June 2, 2005

Bayantel-SKY Internet SUCKS BIG TIME.


*Should I also delete this? Nah.*

It's already 3:52PM +8 GMT.  According to http://speed.skyinet.net/, my download speed is 72.6 KBps.  At least this is better than yesterday.  If you're looking for a quality DSL connection, go look somewhere else.  According to http://www.skyinet.net/skydsl/skydsl24hour.htm, their 24 Hour Guaranteed Quick Service only applies to Metro Manila.

»3:54 PM    »No comments     »Send entry    

Posted by: simoncpu    in: Thoughts

Modified on June 9, 2005 at 11:41 PM
Thursday, June 2, 2005

Blogspot

:: soulfury ::

archives


Friday, September 28, 2001

 
Wecome to my site!
posted by Simon Cornelius P. Umacob 8:08 PM

Wow. I didn't know I had an inactive blog at  http://simoncpu.blogspot.com.  I was a bit surprised to discover that I've already created this account 4 years ago.  I guess I'll use Blogger for my personal musings and Digital Filipino for my ideas relating to computers (although I really can't separate the two because my personal musings are usually about computers)..

»12:15 AM    »No comments     »Send entry    

Posted by: simoncpu    in: Thoughts

Modified on June 2, 2005 at 3:49 PM
Bayantel-Sky Internet SUCKS BIG TIME


*And this one too.*

It's 8:15 PM +8 GMT already.  At last, I now feel like I'm surfing via dial-up using our super-fast 1MBps DSL connection.  Without euphemisms whatsoever, I urge you not to use Bayantel-Sky Internet.  Our connection often averages at 19Kbps on peak hours, and it's fuckin' frustrating if we need to do something important.  If you're looking for a quality DSL connection, go look somewhere else.

»8:15 PM    »1 comments (0 )     »Send entry    

Posted by: simoncpu    in: Thoughts

Modified on June 9, 2005 at 11:42 PM
DeCSS - Algorithm for unscrambling DVD content


Lesson No. 1: Filipinos love sachet marketing.
Lesson No. 2: Filipinos, in general, aren't loyal to a particular product or service provider.

I have just changed my webhost.  The first file that I've uploaded is a (supposedly) illegal algorithm for decrypting DVDs.  It's released under the GNU General Public License, so I've uploaded it here.  Most mirrors that host this kind of information has already been taken down by US government authorities.  You may access the DeCSS source code at http://freedom.simoncpu.com/

»8:07 PM    »1 comments (0 )     »Send entry    

Posted by: simoncpu    in: With Logic and Chaos

Modified on June 1, 2005 at 9:10 PM