Monday, August 23, 2010

Web Tool: nextDate.js

Type : text/javascript
Description: nextDate.js is helpful if you are trying to embed an automatic countdown timer on your website. It simple and less complex that the idea might seem. Basically, you just have to input the day you request. For example, if you'd like to obtain next Monday's date.
Future Path: I will be working on functionality for holidays and so on.


INSTRUCTION
Create an html file and include the content below.
---------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Get next Date</title>
<script type="text/javascript" src="nextdate.js"></script>
<script type="text/javascript">
window.onload = function()
{
//To fetch how many days to Next Sunday at 5pm(12+5 = 17 G.M.T).
tDay = "Monday";
tHour = 17;
tMin = 0;
tSeconds = 0;
var daysTillNextSunday = day.Next(tDay,tHour,tMin,tSeconds);
document.getElementById('timetillnextSunday').innerHTML =daysTillNextSunday.getMonth()+"-"+daysTillNextSunday.getDate()+"-"+daysTillNextSunday.getFullYear();


//right now
ds =new Date();document.getElementById('daterightnow').innerHTML+=ds.getMonth()+"-"+ds.getDate()+"-"+ds.getFullYear()+" "+ds.getHours()+":"+ds.getMinutes()+":"+ds.getSeconds();
}

</script>
<style type="text/css">
<!--
body
{
background-color:#999;
}
p {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
h1,h3 {
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;
font-weight: bold;
background-color:#FFF;
display:inline-block;
padding:0px;
margin:2px;
text-shadow:1px 1px 1px #ccc;
}
h2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
margin-bottom:0px;
}
-->
</style>
</head>

<body>
<center>
<div style="background-color:white">

<h2>Right now is </h2>
<h3 id="daterightnow"></h3>
<h2>NEXT Monday at 5pm is</h2>
<h1 id='timetillnextSunday'></h1>

</div>

</center>
</body>
</html>


Then right click and save nextdate.js in the same directory.
-----------------
Finished!
This should be your result. DEMO

Friday, August 13, 2010

Even when all hope seems to be lost

Two recent events, which happened between this week and last week, that proves (more to me) the goodness of a loving God. First, my phone fell into a bucket of dirty liquid mixture, and stopped working. After a week, I somehow resuscitated it back to a good working condition without expending any money. Secondly, I was outbid on a wrist watch at ebay in the last few minutes because I fell asleep. Afterward, I found the same wrist watch for even a lower price than I had bidden before. Truly, God is great.
Trusting in the lord is the best thing to do in any situation, good or bad. In fact, my favorite passage of the bible, Psalm 125:1, reads "those who trust in the lord are like mount Zion which cannot be moved, but abides forever," And following this in verse 2 "as the lord surrounds Jerusalem so He will surround you forever." He also said "never will I leave you no forsake you." Hence, he is my stronghold anytime anywhere.
As per unknowingly trusting my phone into the bucket full of water mixed with some detergent, I thought "this is the end of another new phone in three months. Well, God thanks...good day" This all happened while I bent down to pick up something, and my phone was uncovered in the upper pocket of my shirt. A minute ago, I had forced myself to move its location from the desk to my pocket because I inadvertently hit it down while writing. Little did I know that this was the beginning to an end of it's use for a week. Suddenly, while it dropped helplessly into the water, I heard a sound somewhat like a ball of metal being dropped into an endless pit.Then I peeped to ensure my eyes were not mistaken-- there laid my phone in the bottom of the long cylindrical bucket three-forth full of liquid.
At first I contemplated putting my hand into the liquid to take out the phone thinking the chemicals might be irritating to the skin, but then it was blatant that was my only option unless I never want to use the phone again. So finally I summoned some courage to take it out after a 1-minute hiatus. Turning it ON was easy, but I had to blow off the moisture from the phone before use. It worked after I turned it On,so I switched it off in order to disintergrate and blow off the liquid from its intricate parts. This was successful, but now it was impossible to turn it ON again -- the reason for which I am still obfuscated.
For a week I tried several means to get the phone working again. First, I got it checked out at a t-mobile retail store. Then tried to dry it under the sunlight, and once with a drying machine, but all to no avail. Soon I was running out of options to restore my phone. Even the t-mobile representatives said my warranty couldn't cover a water damage so I was left helpless with a phone that would only charge. I was timorous knowing that buying a new phone might be the last resort, but I committed everything in prayer to God nonetheless.
Even though I felt and believed that somehow the lord will come true for me, to have increased the stakes of losing the phone by leaving it in the liquid for 1-minutes was undoubtedly the root of my despair.
Exactly six days after this unforeseen tragedy, I recalled that one of the t-mobile representatives had mentioned storing the phone amidst a bag of uncooked rice. He said rice was capable of sucking up the moisture in days, but this was just a mere believe. Knowing that was almost my only hope, I set-out to try... believing that God is capable of using this procedure to restore the phone. I was a bit doubtful after trying other means that never worked, but I wanted to see this outcome of this one-last-trial.
To my greatest surprise, rice was a powerful moisture absorber. My phone now works perfectly. Even in my wildest, I would never think that storing a phone in a bag of rice was capable of ridding it of moisture. But nevertheless, I believe the lord had a hand in this so I am grateful. Actually, this is the high of my week thus far.

Wednesday, August 4, 2010

Return: back to blogging.

The hiatus is over! A need to journal has forced me out to begin writing in this blog again, and I am quite excited,to say the least. From now, my postings on this site shall be rather random than specific. The reason behind this decision is to garner all my essays and discussions in one directory. Someday when I need to refer back to them, querying will be simple. While on vacation from writing here, my activities ranged from web designing to being a student with the usual student routines.
Speaking of web design, I have been working arduously on a various web projects, one of which I look forward to publishing very soon. Although, the content creation is complete, there still need to be some sort of testing before this site is publicly unveiled. Therefore, minor house-keeping routines are currently performed as I scribble this note.
The site in question will (at first) be a non-profit web application that enables students with their class grade analysis and also help them create flash cards, which will be publicly available at their request. Maybe not the best application ever created, but my aim behind this project is to focus specifically on certain aspects pertaining student-life. As you may have understood from the previous sentences, this site will be subdivided into two sections -- the grade analysis section and the flash card (online and printable) section. At this point, however, I refuse to impart the name of the site, but rather wait till September 2nd. You will love what you see! Security will also be a key with time, but that all for now.
When web designing is not occupying my time, surfing the web for new discoveries takes the lead. Although I might not be as great at surfing the web as I might be at ...say... working in the science laboratory, over the past few weeks I have discovered some interesting facts I'd like to share.
One of them- spleen has beneficial functions in the body. Prior to learning this, I'd thought the spleen is never necessary. But after being asked the question "what is the function of spleen?" on the PCAT, I thought it worthwhile to query the word on Google. Actually, the moment I saw that question, I thought "who cares about the spleen?" Even in high school, I don't recall ever being taught the function or location of the spleen. But somewhere within me (during the PCAT) the question seemed less complex than it appeared.
As I queried the spleen on the search tab, the results from the google was so enormous I became curious about the need for animals to possess this feature. Spleen functions a bit like the liver, I learnt. It helps detoxify the blood of dead red blood cells and stores some blood in case of emergency such as hemorrhage. The spleen contains half of the body's monocytes in its reserve. Moreover, it is very significant to also note that the spleen functions in place of the liver early in ones life while the liver develops. Eventually when the liver is fully grown, the function of spleen slightly changes and serves more like an 'alternate' in time of need.
Today, the spleen is surgically removed in many patients after they contact splenomegaly, owing to the finding that one can live without it. A life without a spleen has been proven to be true, but then the individual is more prone to infection. In my opinion, the spleen might be of greater need than what is far fetched, but scientists are yet to uncover and perhaps construe these importance.
That said, recently, I have cut down a great deal on my use of the internet because everything is busier. But summer is almost over now so I look forward to coming back full time to online blogging.