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.
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 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"
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:
"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:
Example:
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).
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:
This is fun! :)
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.
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.
Posted by: simoncpu in: Thoughts
Modified on June 3, 2005 at 11:18 PM
*poof* This entry is now null and void.
Posted by: simoncpu in: Thoughts
Modified on June 9, 2005 at 11:37 PM
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.
Posted by: simoncpu in: Thoughts
Modified on June 9, 2005 at 11:41 PM
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)..
Posted by: simoncpu in: Thoughts
Modified on June 2, 2005 at 3:49 PM
*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.
Posted by: simoncpu in: Thoughts
Modified on June 9, 2005 at 11:42 PM
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/
Posted by: simoncpu in: With Logic and Chaos
Modified on June 1, 2005 at 9:10 PM