Tuesday, February 28, 2012

[MySQL] Reset Auto Increment

Sometimes when we create a program that was paired with a database, we test it like hundred or thousand times before we say that it was working correctly. As a result of this the id, which was always auto incremented will now be starting in like more or less 100 so often we just delete the table and create it again for the id to start again on zero. There is a way to reset the auto increment counter by altering the table itself. Here's the code:

This will start the counter at zero

This will start the counter at 10

Thursday, February 23, 2012

First Person VS Third Person

Writers have their own preferences how to write their stories whether it's on first person or in third person.

First Person is where you use "I". A lot of new writers usually use this method for it's easy for them to pretend that they are the the character they are writing. Based on my experience, yes, it's easy to used this kind of writing style.

The advantage of using this method is you can concentrate only in one character at a time. You can go deeply into details of what the characters feels, sees, or thinking. Remember that writing in this manner, you cannot show the other characters thoughts so if you cannot make a strong points or scenes then you're story would be boring which result to its disadvantage. Sometimes you need to show the thoughts of other characters of the story but since you're using the first person method, you cannot do so.

Third Person writing is using "he/she". This method is kind of complicated for you'll shift from one character to another that can become an advantage or disadvantage to you depending on how you shift between the characters. Just be careful using this method for it may also confuse your readers from the shifting like one moment character A is talking then on the next paragraph the scene was change to character B without giving a hint of character change.

Another method is the Second Person where "you" was used. I haven't use this style but I've seen this mostly on short stories throughout the web.

Overall, I'm confident writing whether in first person and third person but I prefer writing in third person for I can just shift between the characters without much hassle though I can do that in first person but it's kind of complicated.

A Daughter's Love

This is some story I created when I was having a programmer's block. I don't know if it's good or something but this is just a draft of some story in my mind.


There's a mother who loves her husband dearly. When her husband died she lost all her will to live. She lost her job, she leave her two children to starve, she got drunk every day.

One day, she noticed that her daughter always come home late like almost midnight. One night, she waited for her daughter to arrive. At quarter to midnight her daughter arrived. Immediately she slapped her hard. The daughter was taken aback. She started yelling at her daughter and accusing things but her daughter remain silent while crying quietly. Once she had enough, she go to her room and immediately sleep came for she was already drunk.

The next day, her daughter came home again at the same time. And again she slapped her and nag at her but still her daughter remain quiet throughout her outburst.

This went on every night, with an occasional another physical blow from her. One day, someone inform her that her daughter got an accident and was now in the hospital. When she reach the hospital, the doctor inform her that her daughter is already dead.

She cried hard all day. She can't believe that another member of her family was dead when she haven't move on yet on her husband's death. She reminisce the times when she hit and accused her. She knows it was wrong but she needed some outlet of her grief.

Hours after her son arrived at the hospital. She hug him tightly for he is the only family she had. Her eight year old son asked, "where is my big sister?". She can't find the words how to explain the situation to him so she simply answered him, "she already followed his dad."

On the day of her daughter's burial, a man approached her. "you must be pretty sad to lost such a good friend like her" the man told her. She was confused with what the man said so she looked at him and recognize that he was the priest in the church they used to attend before her husband died. Before she could ask what he's talking about he handed him a booklet, "She told me to give that to you". She look at the booklet and found out that it was a bank passbook. She open it and was surprise to see the big amount. "did you know that she go to school during day time and works different jobs at night? I think she have three different jobs. She is a very kind child, working for her family to go on with their life. She told me about her mother and I pity her for not seeing a child of God." he pause for a moment and looked at her. "You must be very proud as her best friend". And with that, he left.

She cried once again. She felt so guilty with all the bad things she did to her daughter. Her son approach her and gave her a bottle of beer. Confused, she asked her son "why are you giving me this?" Her son replied "Because my big sis told me that old people like the taste of beer so they forgot the pain just like when I got a wound on my knee she gave a chocolate then i forgot about how my knee hurt."

She hug her son tightly as if he is the source of her life. She decided to live for her daughter and for her husband.

Tuesday, February 21, 2012

Luke 4:8

Jesus answered, "It is written:
'Worship the Lord your God and serve him only'"

Thursday, February 16, 2012

See you in Dreamland

I'm done reading Song of the Lioness by Tamora Pierce last night so this morning I started reading Dreamland by Sarah Dessen. While reading the prologue, I read the line "see you in dreamland".

Reading the line, I laugh internally. I was actually using that phrase when I say my good nights to people without knowing that it was actually use in a book.

Wednesday, February 15, 2012

A Post-Valentine Qoute For You

To love is to risk rejections,
to live is to risk dying,
to hope is to risk failure.

It's a line from an article my friend shared yesterday. I just read it this morning and found that line then I thought that it's perfect!

The article if beautiful, I must say. You should it read!

Tuesday, February 14, 2012

I Got Chocolates!

Hey! look at what I got on valentines day!

No flowers? Yup no flowers. I'm not fond of them. They would just decay after a couple of days. At least for chocolate, I could eat them. Nyam, nyam!

♥ Happy Valentines! ♥

The first thought that came into my mind when I woke up this valentine's day is "no date, no expense"

I find it funny how I thought of that phrase. Yes, I don't have a date today but this coming Saturday, I do have. I'm still sticking on my "straight home on working day" attitude.

My co-worker's and I are joking around where were we going after work. Some replied they would hang out with friends in some buffet, some said they have a dinner with their love ones but me, I said I would go straight home. hahaha...

Anyway, I don't know what to say. I guess I'll just leave you some bible passage.

"Love is patient, love is kind. It is not jealous, is not pompous, it is not inflated, it is not rude, it does not seek its own interests, it is not quick-tempered, it does not brood over injury, it does not rejoice over wrongdoing but rejoices with the truth. It bears all things, believes all things, hopes all things, endures all things." (1 Corinthians 13:4-8)

Eating Fruits

I decided to open my old email account and found this piece of information. It's a kinda long yet I assure you it's informative.


We all think eating fruits means just buying fruits, cutting it and just popping it into our mouths. It's not easy as you think. It's important to know how and when to eat.

What is the correct way to eating fruits?


If you eat fruit like that, it will play a major role to detoxify your system, supplying you with a great deal of energy for weight loss and other life activities.

Let's say you want to eat two slices of bread and then a slice of fruit. The slice of fruit is ready to go straight through the stomach into the intestines, but it is prevented from doing so...

Sunday, February 12, 2012

Until Death Do Us Part

I was browsing on my facebook wall when I came across this story. It struck me reading it, giving me goosebumps in the process. I cannot find the original author of this story for it was just shared from person to person but if given a chance, I would give the credit on that person.


“When I got home that night as my wife served dinner, I held her hand and said, I’ve got something to tell you. She sat down and ate quietly. Again I observed the hurt in her eyes.

Suddenly I didn’t know how to open my mouth. But I had to let her know what I was thinking. I want a divorce. I raised the topic calmly. She didn’t seem to be annoyed by my words, instead she asked me softly, why?

I avoided her question. This made her angry. She threw away the chopsticks and shouted at me, you are not a man! That night, we didn’t talk to each other. She was weeping. I knew she wanted to find out what had happened to our marriage. But I could hardly give her a satisfactory answer; she had lost my heart to Jane. I didn’t love her anymore. I just pitied her!

A (Stupid) Lesson I've Learned as a Programmer

Always double check if you're editing the right file

Have you ever been in a situation where you know you're doing the right thing yet the result is still wrong? Yes, I've been in that situation a lot of times, actually.

It may sound stupid to be editing the wrong file but believe me once in a while you'll found yourself in the same scenario. Editing in three different sites with the same file, who wouldn't be confused with that?

In the end, you'll just laugh at yourself just like I do every time. =P

God's Measurement

God is saying to His people,

I will rejoice with you on your big day,
but I will measure you on your low day.
I will rejoice with you in victory
but I will measure you when you take defeat.
I will rejoice with you in success
but I will measure you when you fail
I will cheer you when you’re up;
but I will measure you when you’re down
I will cheer you when you win
but I will measure you when you lose.
I will praise you when you’re on top
but I will measure you when you’re on bottom.
I will congratulate you when you’re on the top of the mountain

Saturday, February 11, 2012

[Joomla] Hello World Component ver 5

For this version, I'll add the template in our View

First, create the xml file and name it jchelloworld.xml
<?xml version="1.0" encoding="utf-8"?>
<install type="component" version="1.5" method="upgrade">
  <name>JC Hello World</name>
  <creationDate>February 2012</creationDate>
  <author>Joef Clarin</author>
  <description>JC Hello World</description>

[Joomla] Hello World Component ver 4

For this version, I'll add the template in our View

First, create the xml file and name it jchelloworld.xml
<?xml version="1.0" encoding="utf-8"?>
<install type="component" version="1.5" method="upgrade">
  <name>JC Hello World</name>
  <creationDate>February 2012</creationDate>
  <author>Joef Clarin</author>
  <description>JC Hello World</description>

[Joomla] Hello World Component ver 3

For this version, I'll add the "V" in MVC

First, create the xml file and name it jchelloworld.xml
<?xml version="1.0" encoding="utf-8"?>
<install type="component" version="1.5" method="upgrade">
  <name>JC Hello World</name>
  <creationDate>February 2012</creationDate>
  <author>Joef Clarin</author>
  <description>JC Hello World</description>

[Joomla] Hello World Component ver 2

For this version, we will be using the "C" in MVC.

First, create the xml file and name it jchelloworld.xml
<?xml version="1.0" encoding="utf-8"?>
<install type="component" version="1.5" method="upgrade">
  <name>JC Hello World</name>
  <creationDate>February 2012</creationDate>
  <author>Joef Clarin</author>
  <description>JC Hello World</description>

[Joomla] Hello World Component ver 1

Whenever a developer want to learn a new language or framework, it always starts on creating on what we call "Hello World" application or program. So in this post (and on the next ones), I'll teach you on how to create a "Hello World" in Joomla component. This will also let you have an overview of how the MVC structure works in Joomla.

I won't explain every code in this post because this post will be about the codes. Maybe in other post, I will.

[Joomla 1.5 Extension] JC Daily Message 1.0.0

A simple module that displays a daily message set on module's parameter
You can use the module as a reminder, daily bible verses, or some other stuff.

Download module.

[Joomla 1.5 Extension] JC Random Facts 1.0.0

I created a simple Joomla component and module. If you're new to Joomla, then you'd find the said extensions easy to read and study the codes.

JCRandomFacts component let's you add, edit and remove a fact.

JCRandomFacts module displays one fact save from the component.

Download component and module.

Tuesday, February 7, 2012

[PHP] Referred by Who?

Want to know where you viewers came from? Or which site referred you? PHP have a code for that!

$refer = $_SERVER['HTTP_REFERER'];
echo "You were referred by " . $refer;

Sample Output:
You were referred by http://entertainmentgames09.blogspot.com

Joshua 24:15 (NIV)

Choose for yourselves this day
whom you will serve

Monday, February 6, 2012

True, True!

How to Block Sites in Windows?

There are many ways to block a site. The most common is through the browser but what if I use another browser? It still have a glitch eh? Another is through antivirus. I'm not really familiar with this but yes you can block sites using it. What if I disabled the antivirus? In this post, I will show you how to block sites by digging into Windows files. This is not the most effective way but people usually don't bother looking at files that has to do during Windows OS installation. So here's how to do it:

Sunday, February 5, 2012

Late Night Dinner

10:43 pm. Yup, the current time right now and I'm just about to eat my dinner. As far as I can remember, this would be my first time eating this late. What can I say, I lost track of time. But don't tell my mom! She'll scold me for not eating at the right time. =P

PS. The photo is a crap, I know. To me, it looks like worms. Ew, Disgusting! What am I even thinking?! I'm eating it like right now! That's spaghetti if you can't figure out what it is. hahaha...

Guitar Neck Focus

This is my guitar. I know what you're thinking --- Wow, you know how to play the guitar! Yeah, right (note the sarcasm). Actually, I'm still learning how to play it and it's frustrating! Anyway, this is not about my guitar skills but about the picture. I know it's poorly captured because I only use my cellphone for this one but I like the angle and how it was focus on the guitar neck.

Proverbs 16:3

Commit to the Lord whatever you do,
and your plans will succeed

Friday, February 3, 2012

Father's Love Letter

Father's Love Letter
An Intimate Message From God To You.

My Child,

You may not know me,
but I know everything about you.
Psalm 139:1

I know when you sit down and when you rise up.
Psalm 139:2

I am familiar with all your ways.
Psalm 139:3

Even the very hairs on your head are numbered.
Matthew 10:29-31

For you were made in my image.
Genesis 1:27

In me you live and move and have your being.
Acts 17:28

For you are my offspring.
Acts 17:28

I knew you even before you were conceived.
Jeremiah 1:4-5

Wednesday, February 1, 2012

MySQL Tricks

I was rummaging on my college stuff last night when I came across to some of my database subject notes.

Displays all the data that ends with letter 'a'
SELECT * FROM table1 WHERE column1 LIKE '%a';

Displays all the data with letter 'a'
SELECT * FROM table1 WHERE column1 LIKE '%a%';

Displays all the data that starts with letter 'a'
SELECT * FROM table1 WHERE column1 LIKE 'a%';

Displays all the data but limits the displayed data to only 4 characters
note: no spaces between the underscores. I just emphasize that there are four underscores
SELECT * FROM table1 WHERE column1 LIKE '_ _ _ _';

Displays all the data that starts with 'an', 'be' and 'cy'
SELECT * FROM table1 WHERE column1 IN ("an", "be", "cy");

Displays all the data but sorted by its 'name'
SELECT * FROM table1 ORDER BY name;

Displays only the first 20 data
SELECT * FROM table1 LIMIT 20;

Displays the number of data that have 'asdf' entry
SELECT COUNT(*) FROM table1 WHERE column1 = 'asdf';

Determines what data have the highest entry
SELECT MAX(column1) FROM table1;
Related Posts Plugin for WordPress, Blogger...