|
Some time ago, I recall hearing a song by Carrie Underwood called "Jesus, Take The Wheel". It's an uplifting country song with a strong religious message. The one problem with the song is common sense. The lady in the song is driving home and her car begins to spin out of control. The next lines are "She was so scared, she threw her hands up in the air. Jesus take the wheel. Take it from my hands." It's really a pretty song until you take a moment to think about what she did. Rather then fighting to maintain control over her car with her child in the backseat, she simply lets go of the wheel and hopes somehow everything will be alright. While in the song, everything ends up alright, what kind of message is this conveying? When in extreme danger, abandon reason and turn to faith? Seems like it. That might seem subtle until you look at the reasoning in a different context. A friend of mine's bother refused to get a car-seat for their child with the excuse "It's in God's hands and the Lord will provide." I think most people would agree: that isn't a positive statement of faith--it's nothing short of negligence and a recipe for disaster. How is it any less negligent to advocate that people should relinquish control when under crises and focus on the totally unproven supernatural power during a crucial life-threating moment? I recall taking a flight from Baltimore, MD to Chicago, IL once and sitting next to a man who said a prayer before the flight departed. On the approach we had a little turbulence. It wasn't bad (relatively speaking), but the man was clearly uneasy about it. As often happens, we were rather bumpy until the aircraft was experiencing ground effect right above the runway. We landed safely and to me, as I'm sure to the pilot and flight crew, it seems business as usual. The man next to me then said "It's a good thing I said a prayer before we took off." It reminds me of an infant with a pacifier. While studies show pacifier are useful within an infant's first year, it creates problems after that. When a person reaches adulthood, it's probably time to stop pretending that talking to your imaginary friend is somehow going to influence the world around you and start facing the reality. If you're going to get on a plane, do so because you feel confident the aircraft designers, flight and ground crew are competent--not because you think your faith will protect you. And stop pretending your prayers are being answered just because what normally happens, happened again.
|
|
|
|
Random pile of bricks. Why they live here I do not know.
|
|
|
Back in April I wrote a script to keep an eye on hard drive prices. It's acquired a bunch of data since it started running, and being the number happy guy I am, I wanted to have a closer look. I exported all 15,000 records from the database and imported them into an Open Office spreadsheet. A bit of organization and I turned out these: Right now, 500 gig drives are the best value per gig of space. A couple of online stores seemed to be in a price war in early September, but it appears that is over and prices have come back up. Prices got down to around $0.18.gig. It may be that refurbished drives were being included in the new drive listings. I've since seen separate categories for referb drives, but I'm not sure when that happened. 750 gig drives are coming in behind 500s lately. Around the first of October they all had a noticeable drop in price and are now sitting around $0.22/gig. That's not bad, considering I payed about $0.20/gig for my 500 gig back in May when 750s were at $0.33/gig. I think in a few more months, we'll see 750 gig drives dropping below 500s in price. The terabyte drives. Pricewatcher didn't track them until late April, so I started the graph in May. Listing became reliable in June and the price has very slowly been coming down. But with the graph, you can clearly see the scatter. Prices can change wildly. However, the fact you can now buy a full terabyte of storage for under $275 is impressive. Today is a new low for this drive at $0.27/gig, and the price will keep dropping I'm sure. I couldn't resist using my recently acquired linear regression skills for this project, and it seems a good place to use it as well. From the regression plots we can get an idea for how much prices are changing. The graphs can be a little misleading, since they are scaled based on min/max price during the time span. 500 gigs have had the most dramatic price drop--70% in 6 months at an average rate of $0.14/day. 750 gigs are dropping at an average rate of $0.47/day, or 60% in 6 months. 1000 gigs are dropping an average $1.34/day, which seems like a lot, but turns out to be only 41% in 5 months. Well, enough fun with numbers!...
|
|
|
A couple weeks back, Nathan posted a comment here. I had begun to write a response, but didn't have time to finish it up. So I'm going to do that here. A little late I know, but Physics keeps me busy! Nathan - That is true, the New Testament is an improvement over the old. As my roommate put it, " The New Testament is after God got on meds." Apparently Thomas Jefferson wasn't a big fan of the mass-murdering God either and published an edited version of the Bible known as " The Life and Morals of Jesus of Nazareth" where he basicly threw out the Old Testament as well as the supernatural parts like the resurrection. He isn't the only one who has attempted to modernize the Bible. The Bible proclaims to be the word of God and I'd venture to say that most Christians who believe in the divinity of Christ also believe the rest of the Bible to be true, even if not regarded as not as important. Fundamentalists emphasize that *everything* in the Bible is true and must be taken literally. More liberal Christians will tell you the Bible is inspired by the word of God but written by man. So fundamentalists literally believe Noah put to of every animal on a boat and Lot's wife literally turned into a pillar of salt for turning to look at the city of Sodom. Liberal Christians tend to pick and chose. What many atheist writers (such as Richard Dawkins) point out is the picking and choosing pretty much nullifies the Bible as a moral guide. If people simply select what they feel like believing, clearly that decision comes from outside the moral guidelines from the Bible. That begs the question: why then bother to even use the Bible? If you're going to selectively pick what you're going to follow, you could just as easily do this with any book you want. To come back to your point, Jesus never did away with the laws in the Old Testament. " For verily I say unto you, Till heaven and earth pass, one jot or one tittle shall in no wise pass from the law, till all be fulfilled. Whosoever therefore shall break one of these least commandments, and shall teach men so, he shall be called the least in the kingdom of heaven: but whosoever shall do and teach them, the same shall be called great in the kingdom of heaven." (Matthew 5:18-19) There are a few other places in the Bible were the Old Testament is enforced, and also a few places where it isn't. ( See the list) Again, if you follow this stuff, you just have to pick and chose--or let someone else pick. My point, the Bible is the Bible, start to finish. If God was a ruthless psycho, even if just in the beginning, then He's still a ruthless psycho. I won't overlook someone committing genocide and proscribing countless sadistic acts just because they've since changed their ways--not even a God.
|
|
|
Had some time to do some real programming this afternoon which made me happy. School is interesting and all, but I'm a fan of the applied life. Lately I've been spending a good deal of time working with the Standard Template Library and C templates. I also wrote a small PThreads class, since the interface for these are plain C. I had to come up with a way call the thread from inside a class. To do this, I made a static function inside the class that the tread will call. The parameters to the thread are the pointer to the thread object to be executed. So we can cast the pointer and call this thread's update function. However, the thread is created before the inherited object is finished initialization, which means the thread can begin executing before the object is fully created. This leads to bad things and to get around this problem, I force the thread to sleep a bit before it execution. The PThread class is abstract, meaning it must be inherited in order to function. The child class has to define an update function, which is the body of the thread. The class keeps a list of all the threads, which is useful for starting and stopping all threads. The list, naturally, is from the Standard Template Library :) Here is the code. /***************************************************************************/ /* Name : PThread.hpp */ /* Uses : A class for pthreads */ /* Date : 10/12/2007 */ /* Author : Andrew Que (http://www.DrQue.net/) */ /* Revisions : */ /* 1.0 - 10/12/2007 - QUE - Creation */ /* */ /* (C) Copyright 2007 */ /* ≡|> */ /***************************************************************************/ #ifndef PTHREAD_HPP #define PTHREAD_HPP #include <pthread.h> #include <semaphore.h> #include <list> #include <unistd.h> #include <iostream> using namespace std; //--------------------------------------------------------------------------- // Class basic class for POSIX threads //--------------------------------------------------------------------------- class PThread { private: void* Parameters; pthread_t Thread; pthread_attr_t ThreadAttributes; static sem_t* PThreadLock; sem_t ThreadInUse; bool _IsTimeToStart; bool _IsTimeToShutdown; static bool _IsFullShutdown; static list< PThread* >* ThreadList; //---------------------------------------------------------------- // Update function // The thread always calls this function, which, in trun, calls // the thread's actual update function //---------------------------------------------------------------- static void* InternalThreadUpdate( void* ThreadPointer ) { // Cast the class pointer PThread* Thread = (PThread*)ThreadPointer; // Wait for thread to start // NOTE: Wait at least once, since it is posible this function // could be called before the thread class has been completly // constructed. do { usleep( 100000 ); } while ( ! Thread->IsTimeToStart() ); // Call and return data form the thread // NOTE: The parameters are stored in the class return Thread->UpdateThread( Thread->Parameters ); } protected: //---------------------------------------------------------------- // Constructor //---------------------------------------------------------------- PThread( void* Arguments ) : Parameters( Arguments ) { // If the thread list hasn't yet been initilized if ( ! ThreadList ) { ThreadList = new list< PThread* >; PThreadLock = new sem_t; sem_init( PThreadLock , 0 , 1 ); } // Lock the thread list sem_wait( PThreadLock ); // Initilize locals _IsTimeToStart = false; _IsTimeToShutdown = false; _IsFullShutdown = false; // Initilize semaphore sem_init( &ThreadInUse , 0 , 1 ); // Lock this thread sem_wait( &ThreadInUse ); // Create thread attributes pthread_attr_init( &ThreadAttributes ); // Set thread as joinable pthread_attr_setdetachstate( &ThreadAttributes , PTHREAD_CREATE_JOINABLE ); // Create thread pthread_create( &Thread , &ThreadAttributes , PThread::InternalThreadUpdate , (void *)this ); // Detach thread pthread_detach( Thread ); // Add thread to list ThreadList->push_back( this ); // Unlock thread sem_post( &ThreadInUse ); // Unlock thread list sem_post( PThreadLock ); } public: //---------------------------------------------------------------- // Signal thread to shutdown // NOTE: It is up to the thread to follow this request //---------------------------------------------------------------- void ShutdownThread() { //_IsTimeToStart = true; // <- Just in case _IsTimeToShutdown = true; } //---------------------------------------------------------------- // True if it is time to shutdown //---------------------------------------------------------------- bool IsTimeToShutdown() const { return _IsTimeToShutdown; } //---------------------------------------------------------------- // True if it's time to start the thread //---------------------------------------------------------------- bool IsTimeToStart() const { return _IsTimeToStart; } //---------------------------------------------------------------- // Signal thread to start //---------------------------------------------------------------- void SetIsTimeToStart() { _IsTimeToStart = true; } //---------------------------------------------------------------- // Destructor //---------------------------------------------------------------- virtual ~PThread() { // Stop thread ShutdownThread(); //pthread_join( Thread , NULL ); pthread_attr_destroy( &ThreadAttributes ); // Lock this thread // (we're about to destory it) sem_wait( &ThreadInUse ); // Lock the list sem_wait( PThreadLock ); // Remove this thread from the list ThreadList->remove( this ); // Unlock list sem_post( PThreadLock ); // Trash semaphore sem_destroy( &ThreadInUse ); } //---------------------------------------------------------------- // Signal all threads to shutdown //---------------------------------------------------------------- static void SignalAllThreadShutdown() { // Signal all thread to stop list< PThread* >::iterator ThreadListIterator; for ( ThreadListIterator = ThreadList->begin(); ThreadListIterator != ThreadList->end(); ThreadListIterator ) { (*ThreadListIterator)->ShutdownThread(); } } //---------------------------------------------------------------- // Signal all threads to shutdown and wait for them to finish //---------------------------------------------------------------- static void ShutdownAllThreads() { SignalAllThreadShutdown(); // Signal all thread to stop list< PThread* >::iterator ThreadListIterator; // Wait for all threads to stop for ( ThreadListIterator = ThreadList->begin(); ThreadListIterator != ThreadList->end(); ThreadListIterator ) { pthread_join( (*ThreadListIterator)->Thread , NULL ); } _IsFullShutdown = true; } //---------------------------------------------------------------- // Returns true if all threads are being shutdown //---------------------------------------------------------------- static bool IsFullShutdown() { return _IsFullShutdown; } //---------------------------------------------------------------- // Thread function (pure virtual) //---------------------------------------------------------------- virtual void* UpdateThread( void* ) = 0; }; #endif // PTHREAD_HPP
|
|
|
|
|
|