Ramblings of a volatile mind

"Doesn't anything solidify in your mind?" ..."No, not really..."

The mind is a complicated thing, and lots of stuff lurk in it. What will you find in mine? A lot of mush, for sure. There are also other things though. Stuff about God, the Bible, Internet technology, Web Scripting, Programming, Music, Piano etc. An eclectic mix. My mind's scratchpad. My life. Wanna have a look?

Thursday, June 02, 2005

Programming: Need help with RegExp?

try this site:

http://www.regular-expressions.info

It has a really good tutorial on regular expressions and there are also some sample regular expressions are quite useful in real world situations.

Wednesday, June 01, 2005

Programming: Generating PDF documents with Java

here's an open source project hosted by SourceForge.net that is developing a FREE set of libraries for generating complex PDF documents from Java. Cool huh!!! check it out here:

http://www.lowagie.com/iText/

now if only someone would come out with something for Java to generate Flashpaper documents...

Thursday, May 19, 2005

Web Scripting: javascript parseInt() quirk in IE6

try running this javascript in IE6:

<script language = "javascript">
    for (i = 1; i < 10; i++) {
       n = "0"+i;
       alert(parseInt(n));
    }
</script>

(or click here to run it...)

what you're supposed to see are 9 separate alerts showing the number from 1 to 9. not sure about you guys out there, but for my browser, 8 and 9 both show up as 0. does that happen to anyone else?

Apologetics: reliability of dating methods

i chanced by another article on the net. it called "The Accuracy of Fossils and Dating methods", written by Michael Benton, PhD. in it, he claims that the current dating methods are accurate. these dating methods include the most famous one of all, Carbon-14 and several other isotope methods like rubidium/strontium, thorium/lead, potassium/argon, argon/argon, or uranium/lead.

firstly, a background. what is radioactive dating? well, take carbon-14. radioactive elements like carbon-14 decay, or break down at a (supposedly) constant rate. by measuring measuring the amount of broken down element with the amount of non-broken down element, together with it's half-life, they estimate the age of whatever they are dating.

sound plausible huh? the problem is, such dating methods have been used to date rocks that have been formed from volcanic eruptions about 20 years ago, and these dating methods gave an estimate of about 200,000 years. riiiiggghhhtttt... in another case, different portions of the same rock were broken down and sent to different labs for testing, but they all gave different answers, varying between 20,000 years to 200 million years. how brilliant.

an argument that they like to use to counter this is that this method is not accurate for something recent but is accurate for something very old. dating something recent would probably mean knowing the age beforehand, like the volcanic rock. dating something old would mean stuff like rock strata, fossils etc., that they do not know the age of. so you mean to say that radioactive dating is accurate for something they don't know but inaccurate for something they know? even if that wasn't the case, why shouldn't it work across the board? what makes them think that just because it gives wrong answers for new rocks it would give right answers for old rocks? that simply smacks of willful ignorance or in other words, deliberately dumb.

in the 2 paragraphs before the conclusion in the article, he says "The first radiometric dates, generated about 1920, showed that the Earth was hundreds of millions, or billions, of years old. Since then, geologists have made many tens of thousands of radiometric age determinations, and they have refined the earlier estimates. A key point is that it is no longer necessary simply to accept one chemical determination of a rock's age. Age estimates can be cross-tested by using different isotope pairs. Results from different techniques, often measured in rival labs, continually confirm each other. "

then he goes on to say that "Every few years, new geologic time scales are published, providing the latest dates for major time lines." effectively, he's saying that every few years, the estimates change, and rival labs all arrive at the same answer every few years. now that sounds even more suspicious. you mean to say that before that they made the same error, then as time goes by they make the same error again (it keeps getting "refined") and they "keep arriving at the same answer every few years"? sounds more like a conspiracy to me.

by the way, one of their assumptions is that the decay rate never vary. if it varies all radiometric dating methods would be thrown out of the window. however, decay rates do change. things like supernova explosions, solar flares (events that give out a heck load of radiation) would increase the rate of decay. there might not be alot of radiation that reaches earth, but due to the exacting nature of radiometric dating (they "count" the number of, for example, C-14 atoms), a tiny change in their values will mean wrong dates.

i've been watching this series of videos by a guy called ken hovind (very fascinating!!! everyone should watch them...), and in it he says that one reason people propagate the idea of evolution is that the only other alternative, Creation, is unthinkable. they don't want to admit that there is a Creator who is the moral absolute and the infinite. some people want to be god.

well, what to do??? sigh...

Saturday, May 14, 2005

Apologetics: does evolution contradict the 2nd law of thermodynamics?

like i mentioned in my previous post, i came across another shady article in the TalkOrigins.org site. this time, it is about whether or not evolution actually goes against the second law of thermodynamics (you can find the article here: The Second Law of Thermodynamics, Evolution, and Probability).

for those less scientifically inclined, the second law of thermodynamics states simply that "the entropy of a closed system cannot decrease". what exactly does that mean? well, entropy means disorder. so in other words it is saying that left to itself, a system (although here they define a closed system) will become more disorderly.

so what is a closed system? a closed system is a system that doesn't lose or gain energy or matter.

anyway, in that article, that guy states that "there are many examples in nature where order does arise spontaneously from disorder. Snowflakes with their six-sided crystalline symmetry are formed spontaneously from randomly moving water vapor molecules. Salts with precise planes of crystalline symmetry form spontaneously when water evaporates from a solution. Seed sprout into flowering plants and eggs develop in chicks." now, all those that he states do happen, but there is a fundamental difference (and they do not violate the second law!!!)

crystallisation happens when thermal agitation (read: heat) is small enough for atomic bonding forces to arrange the molecules in simple geometric patterns. this is a move towards simple and uniform repeating structure with minimal complexity and are functionless. this does show some kind of order, but certainly not in the magnitude of the complexity necessary for life.

he tend goes on to say that "seeds sprout into flowering plants and eggs develop into chicks". right... notice that these by themselves are complex organisms with complex energy management and conversion systems. of course they have order!!!

the thing is, simply supplying a system with energy doesn't decrease entropy. try aiming a blowtorch at an egg and see if it hatches faster...

another statement that he makes in the article is this: "A favorite argument of creationists is that the probability of evolution occurring is about the same as the probability that a tornado blowing through a junkyard could form an airplane. They base this argument on their belief that changes in living things have a very low probability and could not occur without "intelligent design" which overcomes the laws of thermodynamics. This represents a fundamental contradiction in which (they say) evolution is inconsistent with thermodynamics because thermodynamics doesn't permit order to spontaneously arise from disorder, but creationism (in the guise of intelligent design) doesn't have to be consistent with the laws of thermodynamics. "

he then goes on to say: "A simpler analogy to the airplane/junkyard scenario would be the stacking of three blocks neatly on top of each other. To do this, intelligent design is required, but stacking does not violate the laws of thermodynamics. The same relations hold for this activity as for any other activity involving thermodynamical energy changes. It is true that the blocks will not stack themselves, but as far as thermodynamics is concerned, all that is required is the energy to pick them up and place them one on top of the other."

now look at his statements. yes, i would agree that "stacking does not violate the laws of thermodynamics." however, the fact is that the energy that causes the bricks to be stacked HAS to be intelligently directed. the way he puts it makes it seem as if the whole point was that energy doesn't have to intelligent, but he's missing the point that energy that is undirected could cause more harm than good. in that case if you want to grow taller try using the blowtorch on yourself this time...

by the way, did you know that a boeing 747 is so complex that it takes about 10,000 engineering drawings to put one together?

one of the very irritating things that he states is this: "Of course, the creationist application of the second law of thermodynamics to the development of living things is inconsistent with any model of origins. Creationists get around this problem by invoking the supernatural (i.e. God)". well now, look here you bozo. what creationists (i'm one of them) believe in are NOT inconsistent with the law. WE are the ones who claim that an intelligent Designer CREATED everything there is. He DIRECTED energy flow. YOU bozos are the ones who claim that we all came from a single unicellular organism which came from primordial "soup" which came from a rock!!! GAH!!! THAT MUST BE WHY YOU ARE AS STUPID AND OBSTINATE AS A ROCK!!!

well that felt good. anyway, i've been watching a series of videos by Dr Kent Hovind, who is an evangelist and goes around talking about creation. he said that evolution is a religion, not a scientific fact. but look at the it: what are people being taught? they are being taught something that has never been proven correct, has constantly been proven wrong and has absolutely no bearings in science. they are being taught that evolution is correct. how can they do that? because the only other explanation (which by the way, is far more plausible) is unthinkable. it leaves room for an Intelligent and Almight Creator. and that is what many people are not willing to accept. sad but true. for this reason, they keep teaching stuff like this in school. all the science textbooks say that we evolved. what crap. just calculate the possibility of it happening.

a typical protein strand has about 100 amino acids arranged in a specific way. there are a total of 20 different amino acids available for this arrangement. to get this single protein strand correct would mean getting 1 out of 20100, or 10130 combinations correct. that number is 1 with 130 zeros behind it... that's bigger than a googol. that's an insanely huge number. and that's just getting one strand!!! assuming you had to make, say a modest 10 strands (a living organism of course contain far more). how many trials would that take? you do the maths...

in the book "Genesis and the Big Bang" by Dr Gerald L. Schroeder, he states that "there have been less than 1018 seconds in the 15 billion years since the big bang" (i'm not advocating that the age of the universe is 15 billion years, but a favourite argument of evolutionist is that "the small probability of such things happening is not the issue; given the billions of years, anything is possible" so i'm just using this example to show that even with vast amounts of time it is not possible).

with the given amount of time and given number of trials, approximately 10112 trials would have to be conducted EACH SECOND for 15 billion years... think it sounds ludicrous already? read on...

to "feed" the reactions, 1090 grams of carbon are required. however, the mass of the entire earth and all that it contains is only 6 X 1027 grams. in fact, 1090 grams exceeds the estimated mass of the entire universe... go figure...

in short? evolution is impossible. you do not even have enough time and material to conduct that number of trials... the answer to the title of the post? an unequivocal "YES"!

so will people stop believing evolution? please??? sigh...

ps (for those interested): everyone seems to be talking about the second law. what is the first law? it basically says that there is no increase or decrease in the amount of energy or matter in the universe. matter and energy can be converted into one another, but there is no loss or gain. fyi, the famous formula, E=mc2 is actually a formula for the interconversion between energy and matter, where E, or energy is equals to matter multiplied by c (speed of light in a vacuum) squared. which means, it takes a small amount of matter to make a huge amount of energy.

Saturday, May 07, 2005

Apologetics: Evolution and Dawkin's Weasel Experiment

i've been surfing around the Talk.Origins usenet site. the site claims to try to promote open and honest discussion of the origins of man and the universe. however, if you read some of the arguments closely you would realise that some scientists there are not completely honest in treating the subject and they tend to push for evolution. one of their flagship articles, "The Evolution of Improved Fitness by Random Mutation Plus Selection", by Edward E. Max, M.D., Ph.D., is one that i think relies on pseudo claims and the fact the casual readers do not think that much but accept what they read.

one of the most famous and most cited examples of the probability of evolution is a computer experiment created by Richard Dawkins. In it, he wrote a program to general a pre-defined statement from Shakespeare's Hamlet, "Methinks it is a weasel". the program would make 28 random selections from 27 characters (26 letters and space).

the total number of possible outputs would be 2728 (27 characters picked 28 times), which is approximately 240, which gives something around the region of 1011 (about 100 billion different combinations).

they then rightly state that deriving a single strand of protein from this random arrangment of amino acids is so statistically low that it can be considered impossible.

HOWEVER, they state that "...the real evolutionary model for the origin of protein sequences involves MULTIPLE ROUNDS OF RANDOM MUTATION followed by MULTIPLE selection steps..."

so based on this, Dawkins created another program that supported "The real evolutionist model is that modern amino acid sequences evolved by successive steps in which random mutations of pre-existing sequences were subjected to selection; any rare mutant that provided more efficient function was propagated to future generations, in which the process of mutation and selection was repeated over and over".

this new program would make "...make multiple copies (progeny) of this sequence, while introducing random "errors" (mutations) into the copies. The computer examined all the mutated progeny and selected the one that had most similarity (however slight) to the line from Hamlet. This selected sequence was used as the basis for another generation of progeny with further mutations, from which the best copy was again selected -- and so on."

here lies the problem: the computer had a SPECIFIC GOAL TO WORK TOWARDS!!! there was a predefined statement for it to generate. in evolution, there is no intelligence. how would a process that lacked intelligence know which mutations are beneficial and which mutations are not, thereby enabling it to make informed decisions on which amino acid sequences to propagate?

evolution can't possibly know beforehand what the desired outcome is and therefore can't perform intelligent selection.

further down the page they highlighted a particular creationist, a Duane Gish who refutes their claim saying that the experiment was skewed and that "...the final line from Hamlet was achieved only through an intelligently designed program running on an intelligently designed complex computer..." the author then refutes it by saying "...that Gish's argument is false because it conflates the need for intelligent design in performing the simulation (a need that no one denies) with the need for design in what is being simulated; and it is the latter that is the issue at question."

he then cites an example: "Suppose a computer model of weather conditions is able to predict a rainstorm; no one will reasonably deny that the computer and the weather simulation software were intelligently designed, but this does not imply that the storm itself was created by a designer. The designed computer program is only an analytical tool for studying the natural process, and the necessity of intelligence for the analysis says nothing about the necessity of intelligence in the natural process."

this, in my opinion, is a bad argument that is refuted by a bad analogy. indeed, it is correct that the issue at hand is not the use of a highly complex computer and a highly complex software. to this end, it IS true that the weather, which is random, is possibly predicted by a highly complex and intelligently designed computer and computer program.

but they are missing the point here aren't they? the author is comparing weather, which has a totally random and meaningless end result to evolution, which they claim created all of life.

man still can't comprehend how life works. the simplest unicellular organism is far more complex than any machine that man has ever created. in fact, a single cell is so complicated that scientists still haven't been able to figure out completely how it works.

if a single cell is so complex, how much more complex are humans and other living creatures with more than one cell? and how, when even human intelligence fail to understand the nuances of their inner workings, could a mindless and random process like evolution create such wonders?

the gist of the second law of thermodynamics states that "any organised system, without intelligent and guided intervention and left to its own device will flow from a state of order to disorder". when a cup falls on the floor and shatters, it never forms the original cup again or any meaningful structure. basically, evolution goes against a law of nature. hmmmm...

there's actually another article on the Talk.Origins site that deals with this: The Second Law of Thermodynamics, Evolution, and Probability. That's quite questionable too, and i think i'll deal with that in another post.

now i have to go out and buy food otherwise no dinner tonight... bleahz...

Friday, May 06, 2005

God: Evangelism

there are some people whom i try to talk to about God. for those who have tried evangelising, you would know that winning souls for God's Kingdom is an uphill task.

in my opinion, there are a few categories of non-believers (atheists only, discounting those who believe in other religions.)

there are certain people who are non-believers because they do not yet know the saving grace of our Lord Jesus Christ.

there are others who are non-believers because they do not see the need for a God in their lives. they think, "i'm not that bad am i? why would i need some god to save me?"

then there are those who know about God, but do not want to believe because believing would mean a radical change to their lifestyles. they would have to try to stop all their sinful activities, change the way they behave and try to live in step with God's Word. to some, that is just too much trouble.

there are, of course, others, but i'm generalising here.

for those in the first two categories above, it's not that difficult to get the message into them. the problem is with those in the third category, which i believe are most of the people around me.

most non-Christians are not as uninformed about the Gospel as i think. they know about the Gospel. they know a little about Jesus. they know a little what Jesus did on the Cross. they know enough. they also know that being a Christian entails alot of other things. and that's where the problem comes in.

they are simply too happy with the life that they are living now and they are not willing to change anything about it. to them, believing in God would mean that they have to "be holy and goody-two-shoes, disrupt their activities because those would probably be wrong, admit that they are nobodies who need a God in their lives to direct them". they do not want to change.

however, the change that comes about from being a Christian is brought about by the indwelling of the Holy Spirit, and it is God who changes you, not you change yourself. we are powerless to change ourselves!!!

as a Christian, we must admit that we are weak and our God is strong, and it is through Him that we are changed. God says in Ezekiel 11:19-20 "...I will give them an undivided heart and put a new spirit in them; I will remove from them their heart of stone and give them a heart of flesh. Then they will follow my decrees and be careful to keep my laws. They will be my people, and I will be their God." God says that it is HE who will change the hearts of His people, and He doesn't expect His people to change themselves.

so what does this mean for Christians who try to evangelise? well this means good news!!! we can leave the toughest part of the job to God. our task, as stated in earlier parts of Ezekiel (Ezekiel 3:16-19), we are simply to be a "watchman" who speaks out to non-believers to "dissuade him from his evil ways in order to save his life".

we should simply tell people about God and the good news that God came down to earth in the form of Jesus to die for man's sin and that through Him we can be made pure in the presence of God. of course, telling that person one time is not good enough. continually bring up this topic in love, for the sole reason of that person's salvation.

this is an important task. when the dead are judged (see Revelation 20:11-15) would we want to find out that our loved ones and friends' names are not in the book of life? verse 14 and 15 says "... The lake of fire is the second death. If anyone's name was not found written in the book of life, he was thrown into the lake of fire". how would we as Christians react on that day when we see our friends and loved ones thrown into the lake of fire??? perish that thought! because of this, the salvation of souls is important.

personally, the issue of me sharing the Gospel with my friends is, unfortunately, very dismal. i don't do it enough. there are many friends around me whom i want to share the Gospel with, but i do not have enough courage. sigh...

it's so hard to do! i quote "it is easier to preach ten sermons than to live one" (by i forgot who...). how true that is...

so, all of my Christian friends, please pray for courage for me and for the Spirit to guide me!

ps: i have written some other stuff on the same few verses in Ezekiel; check them out on my main blog.

Databases: Oracle 10g and it's storage management quirk

i encountered this problem when i was doing my database assignment. we were supposed to create two fragmented tables (a table with more than one extent) then write an SQL script that would take in a tablespace name and then run thru all the tables in it and defragment it. i hit the problem when i was creating the fragmented table.

alright, i'm not sure if this is actually a quirk in Oracle 10g or not. it might just be that the people at Oracle decided to change the way stuff works (that's pretty irritating too).

so this has to do with Oracle's extent management. i created a table in Oracle using this:

CREATE TABLESPACE TESTTBS
DATAFILE 'C:\ORACLE\ORADATA\DB\SAMPLE01.DBF'
SIZE 2M AUTOEXTEND OFF;

then later, i created a table in this tablespace using this:

CREATE TABLE TESTTABLE (F1 CHAR(1024))
STORAGE (INITIAL 256K NEXT 256K
MINEXTENTS 2 MAXEXTENTS UNLIMITED)
PCTFREE 20
PCTUSED 70
TABLESPACE TESTTBS;

when i head to the data dictionary DBA_EXTENTS to check on the status of the tablespace, it reports that i have been allocated 8 extents!!!

woah!!!

hold yer horses there... but i thought that i specified only 2 extents in the storage clause? i know i'm supposed to create a fragmented table, but not THAT fragmented right???

ahhh that's where the irritating quirk comes in. a little snooping around on the internet and correspondence with database experts brought me the solution. apparently, last time, Oracle would actually create only 2 extents for you. but all that has changed.

because the extent management clause was not specified in the CREATE TABLESPACE statement, Oracle would add in the default extent management clause for me, which is EXTENT MANAGEMENT LOCAL AUTOALLOCATE.

locally managed tablespace would in effect ignore what i have in my storage clause because objects in system allocated locally managed tablespaces always begin with a minimum extent size of 64K and go on allocating 64K each time it has to allocate an extent.

so this is what Oracle would do:

  1. it would calculate how much space it has to allocate the moment the table is created. in this case, it would be 256K * 2 MINEXTENTS = 512K.

  2. it would then give me the 512K by assigning blocks of 64K extents, which is 512/64 = 8 extents.



ahhhh so there lies the mystery. so how should i create a table with 2 extents each having 256K? simply create a tablespace with a the clause EXTENT MANAGEMENT DICTIONARY. that ought to solve the problem.

so just in case you were wondering, yes, my database assignments are killing me... grrrr...

Thursday, May 05, 2005

Web Scripting: IE6 and it's CSS limitations

most times, IE's CSS support is sufficient for most things you wanna do. In fact, i don't think people normally complain about IE; most times they complain about the others, like Netscape, Firefox etc.

there are, however, a few very nifty and very useful CSS selectors that IE doesn't support. what are they? well they are the following pseudo-element selectors: 'first-line', 'first-letter', 'before', 'after' and the attribute selector.

so what the heck are these? pseudo-element selectors are selectors that select based on the pseudo element that is defined, whatever they may be. for example:

a:after {content: " | ";}

would add " | " after your <a> tags. good for formatting, or in the example above, good for separating your header navigation links. similarly, you could use 'first-letter' and 'first-line' to style your text; for example you could use 'first-line' to add a spacing before the first line starts by padding it.

the real bummer is the attribute selector. take the example below:

input { background-color:#FF9900; }

that would give you a nice orange colour for all your inputs, like:

<input type = "text"...>

ooopss.. not really... how about stuff like these?

<input type = "radio"...>

that would give it an orange background as well, but not in the way you expect...

wouldn't it be good if there were a way to restrict it to maybe only the input type = "text" tags??? well, that's what the attribute selector can do:

input[type="text"] {background-color:#FF9900;}

unfortunately, IE (which most people use) doesn't support it. i have no idea why. netscape supports it tho. i heard that the next version of IE would support it... but until then, i guess the best way would be to use ID selectors (e.g. input#id). that would be a tad inconvenient, but a quick hack is better than none right...

anyway, for an easy-to-use and easy-to-understand and rather comprehensive guide to what browsers support what what CSS, there's a great website here. worth checking out if you use CSS alot... saves you from alot of unpleasant surprises...

Music: talking about chord progressions without knowing the key

i seem to have this problem of describing chord progressions to others. most of the time, when people ask me, "eh what are the chords of this song playing now?" then i'll be like, well firstly i need to know what key it's in.

i don't have absolute pitch; i.e. i can't tell you what note is being played currently or what key a particular song that is being played now is in. however, as long as i'm given a reference note i can work out the key from there. that's perfect pitch. so for all those who know me, i have perfect pitch but i don't have absolute pitch...

so yeah when i describe the the chord progressions to others, i'll be like, "ok assume this is in the key of C major, then the chord now would be blah blah blah..."

but i wanna describe a generic chord. like i wanna say "this is the tonic major, this is the major fourth, this is major fifth, this is minor sixth etc." however people don't seem to understand me.

considering i don't have much music theory background, maybe i'm actually missing something here and that there IS a way of describing generic chord progressions. anyone keen on sharing???