Archive | April 2011

A life well lived is simply a compilation of days well spent.-Douglas Pagels

Thank you for these wonderful gifts… =)

The wonderful gift from Ems: a book: Gifts I’d Like to Give to You… super nice

And Laiza’s mini dress from Boracay… =)

 She is my childhood bestfriend, Honey. We’ve known each other since we were in our mothers’ wombs. Haha. We practically grew together and she’s like a  sister to me. We’ve last seen each other during her wedding at Cebu in 2008. Old friendships, like wine, are really the best because they get better as time goes by. I am so glad we met here in Manila and got reunited after 3 years… =)

This little package really surprised me. I couldn’t believe that he’s capable to do such a thing… thank you! It means a lot to me.

Advertisements

8 Ways to Declutter Your Mind: Tips to Help You Unwind

I’d like to keep an excerpt of this article from Good Housekeeping (Jan-Feb 2007) so I can go back to it when I need some help to declutter my mind.. hope you can make use of this too.

1. Stick to a natural sleep schedule.
Try to align your schedule more closely to nature. (If you feel sleepy, then you should be hitting the sheets…)

2. Turn off the TV.
Emotionally draining or violent programs provoke turbulent thoughts which result to insomnia, indigestion, and headaches.

3. Download your internal conversation.
Keep a journal  by your bedside. Unload anything that’s agitating you from the day that has passed, and anything you’re concerned about. (This one works for me!)

4. Create a musical pharmacy for yourself.
Listening to  mellow music jibes with the unwinding of your mind and body, and enables your brain patterns to remain steady. A slower beat stimulates the right hemisphere of the brain – the area that’s in charge of order, balance, and peace – and will evoke a temporary forgetfulness, allowing you to slip away from your problems. (Doesn’t work for me when I’m emotional because music triggers my emotions and cause havoc in my mind. Haha.)

5. Tune in to your body.
Pay attention to physical sensations to quiet your overactive thought process
a. Listen to the sounds around you.
b. Concentrate on your body, feel your feet rubbing against the sheets. Focus on the passage of your room and your own body. “Continue observing the inflow and outflow of your breath, and it’ll bring you into the now. Staying in the present relaxes your body and mind,” says Dr. David Simon (a neurologist).

6. Look within. Get in touch with your emotions.
Get in touch with your emotions. “If sadness wells up, allow yourself to feel it without resistance, ” says Simon. “If you feel anger, let it move through your body and release it with your exhalations. Negative feelings that aren’t fully expressed will continue to haunt and upset you. Acknowledge them and let go.

7. Envision another world.
Mental anguish often stems from the belief that we’re living in circumstances that we can’t free ourselves from. (Imagine another world where you have complete control.)

8. Meditate.
Lie comfortably, close your eyes, and observe your breath. As you’re inhaling, silently say “hum…” (This works for me too… )

Bureau of Immigration Clearance for CHED Scholars: Secured!

I forgot to post an update of my 2 previous posts on how to request for the lifting of hold departure order for CHED scholars and how to secure clearance from CHED. I have observed that  a lot of people have been coming to my site to learn about how to secure these precious clearances. Well, here’s GOOD news for you! After getting my new clearance (with the right spelling) last February 2011, I also got my Bureau of Immigration (BI) clearance last March!

Contrary to what the CHED people said (that I won’t pay anything to BI), I paid 500 pesos for the processing of my BI clearance. And they didn’t just “stamp” a “No Derogatory Record” note on my CHED clearance – they produced their own clearance instead. And here’s how it looks

Whew! I guess I have to update my previous posts again. . . =)

Let every year make you a better person. =) -Benjamin Franklin

A. What are the greatest lasting memories of the past year?

– Can I just say there’s too many to mention? =) Seriously though, there were A LOT:

  • series of despididas from MSU-GSC, SFC and GenSan friends
  • moving to Davao (and USEP)
  • processing of papers for Qatar
  • Samal and Ozamis/Iligan escapades
  • resting (a.k.a unemployed) stage:part1 at Mangagoy
  • joining and leaving Active Rail Technology Solutions
  • Tatay Primo passed away and instant reunion with Estandarte/Espinosa family
  • moving to Manila and joining Accenture

B. What did I learn this year?

– I learned that Steve Jobs was right when he said that you should “Find what you love”
Life is too short to spend on regrets. I was already happy in my teaching job at MSU but somehow, I felt that I needed to be with my family more. When I was in Davao, I was physically “near” my family but I didn’t have the time to spend with them. I worked and worked and worked. I felt physically, emotionally, and financially drained. I then felt that I needed to earn more money for myself and my family, and try my luck in Qatar and to get away from *. I left my job at USEP, spent quality time with the people I love, and waited. But due to some unforeseen events (and God’s will), I was unable to leave. I joined Active Rail and had a totally awesome time working with friends. The job was so different from teaching, something really new to me but it was something I really enjoyed doing. Something that helped me… find myself or rather, find what I really loved to do. It gave me direction and a totally new purpose.

C. What were my biggest challenges or obstacles?

– ***** has been my biggest challenge for almost 2 years. But I’m glad that I have learned to let go.

D. Who are the most interesting people I’ve met?

–  some USEP students who inspired me
– Tito Pros
– a lady I’ve met at the Davao airport last Feb who “pushed” me to go after my dreams
– (re-met? hehe..) Ate Dulce,  James, and Ate Joie of A.R.T.S.

E. How have they changed my life?

– I am now in Manila and will be working at Accenture

F. How am I different now than I was at the start of the year?

– Very different. I was so lost and confused at the start of the year. Not really knowing where to go and what to do with my life (and has been since I finished my Master’s degree. I just didn’t know what to do next). Until now, I am still learning to discover myself and the world around me. But I am less afraid and more happy. =) Life is really short, and I am glad that God gave me another year – to find my purpose, to love, to serve, to touch a life, to make a connection, to forgive, to be forgiven, to share, to create, to do, to explore, to experience, to be happy… to just be whatever and whoever I want to be. And most importantly, to be a better Me!

7 Places You Shouldn’t Miss This Summer!

One of the things I’m most grateful for the past year is that I had the chance to explore my beloved hometown. Here are some of the places you have to visit in Surigao del Sur (specifically Bislig and Hinatuan):

1. Highlands (located near the Catholic church). It not only boasts of good food and a beautiful view of the city but it also has a mini playground for the kids. Children (and adults) can enjoy using the baby-zipline for only 5 pesos. =)

2. Ocean View Park. From the name itself, this place gives you a breathtaking view of the ocean. They also sell good food at a very low price. It has a function hall (and a pool) that is best for events such as weddings, baptisms, birthdays and company parties. Aside from that, they also have a Doll house (my personal favorite!!!) – a beautiful collection of dolls from all over the world.

3. Boulevard(Chocolate Beach) – It’s best to come here at night, where you could enjoy grilled food and beer at its best – by the bay. Chill in the cool breeze with your friends at the boulevard. =)

4. Sheilah’s Inland Resort. This resort boasts of three pools and comfortable rooms for tourists. Adults and kids alike can enjoy the pools of different sizes. This is really a great swimming spot for all. =) 

5. Tinuy-an Falls. You will not only marvel at the beauty of this falls but you will also enjoy taking a shower in its fresh waters.

6. Enchanted River (Hinatuan).  You’d really be enchanted by its cool, clear blue waters. Take a dip and enjoy swimming (can’t swim?Get a life vest!) with the fishes. You’d also be amazed if you’ll see the colorful fishes during fish feeding time (12 noon). If you’re already here, you should also take a side trip by taking a boat ride for a very reasonable price. Your tour guides will take you to a sanctuary where you can see pawikans (sea turtles) and different kinds of fish. 

7. Hagonoy Island. Ever since I was a kid, I’ve always loved this island. I have celebrated my birthday on this island countless times with my family and friends and we always had an awesome time. If you’re from Bislig, it’s about a 45-minute to 1 hour ride by motorboat. But I and my family usually go there from Caguyao (only about 15minutes!).

These are just 7 places that will make your summer at my hometown a vacation to remember! Enjoy! =)

Java Tutorial Vol.1 Part 2

I hope you now have established a connection to your MySQL database using DBConnector from the previous tutorial. By the way, here is the database schema in case you haven’t located it on the home page flash widget:

CREATE TABLE `acct_type` (
`acct_id` INT(10) NOT NULL AUTO_INCREMENT,
`acct_desc` VARCHAR(20) NOT NULL,
PRIMARY KEY (`acct_id`)
)
ENGINE=InnoDB
ROW_FORMAT=DEFAULT
AUTO_INCREMENT=4

CREATE TABLE `accounts` (
`username` VARCHAR(20) NOT NULL,
`password` VARCHAR(20) NOT NULL,
`acct_type` INT(20) NOT NULL,
PRIMARY KEY (`username`),
INDEX `user_acct_type` (`acct_type`)
)
ENGINE=InnoDB
ROW_FORMAT=DEFAULT

CREATE TABLE `team` (
`team_id` INT(10) NOT NULL AUTO_INCREMENT,
`team_name` VARCHAR(10) NOT NULL,
`team_leader` VARCHAR(10) NOT NULL,
PRIMARY KEY (`team_id`),
INDEX `FK1_team_user` (`team_leader`),
CONSTRAINT `FK1_team_user` FOREIGN KEY (`team_leader`) REFERENCES `accounts` 

(`username`)
)
ENGINE=InnoDB
ROW_FORMAT=DEFAULT

CREATE TABLE `logs` (
`log_id` INT(10) NOT NULL AUTO_INCREMENT,
`username` VARCHAR(10) NOT NULL,
`log_start` DATETIME NOT NULL,
`log_end` DATETIME NOT NULL,
`log_description` VARCHAR(50) NOT NULL,
PRIMARY KEY (`log_id`),
INDEX `FK1_log_user` (`username`),
CONSTRAINT `FK1_log_user` FOREIGN KEY (`username`) REFERENCES `accounts` (`username`)
)
ENGINE=InnoDB
ROW_FORMAT=DEFAULT
AUTO_INCREMENT=4 

Next, we are going to create a class named LoginManager.

/**
*
* @author Mylene E. Sereño
*/
import java.sql.*;
import javax.swing.JOptionPane;
public class LoginManager {
private Connection conn;
public LoginManager(Connection conn) {
this.conn = conn;
}
protected int login(String username, String password) throws SQLException {
ResultSet rs;
String userPassword;
int result = 0;
try {
PreparedStatement ps = conn.prepareStatement(“SELECT acct_type, password from accounts WHERE username=?”);
ps.setString(1, username);
rs = ps.executeQuery();
if (rs != null) {
rs.next();
userPassword = rs.getString(“password”);
if(password.equals(userPassword)) {
result = rs.getInt(“acct_type”);
}
}
}
catch(SQLException sqlEx) {
sqlEx.printStackTrace();
}
return result;
}
protected String getPassword(String username) throws SQLException {
ResultSet rs;
String userPassword= null;
try {
PreparedStatement ps = conn.prepareStatement(“SELECT password from accounts WHERE username=?”);
ps.setString(1, username);
rs = ps.executeQuery();
if (rs != null) {
while(rs.next()){
userPassword = rs.getString(“password”);
}
}
}
catch(SQLException sqlEx) {
sqlEx.printStackTrace();
}
return userPassword;
}
protected String getAcctType(int acctType) throws SQLException {
ResultSet rs;
String type= null;
try {
PreparedStatement ps = conn.prepareStatement(“SELECT acct_desc from acct_type WHERE acct_id=?”);
ps.setInt(1, acctType);
rs = ps.executeQuery();
if (rs != null) {
while(rs.next()){
type = rs.getString(“acct_desc”);
}
}
}
catch(SQLException sqlEx) {
sqlEx.printStackTrace();
}
return type;
}
}

In this class, the constructor has a Connection parameter so that the objects of the class would be able to connect to the MySQL database through it. It has a method named login with parameters username and password and which returns an integer (account type).

What is a PreparedStatement?

A PreparedStatement is . It allows you to create dynamic queries. Question marks ? are used as placeholders for values of fields in queries.

Example: PreparedStatement ps = conn.prepareStatement(“SELECT acct_type, password from accounts WHERE username=?”);

You can then set the value of username by using: ps.setString(1, username); username in this case is the parameter passed to the method. The first attribute of setString which is the integer 1 is the ID of the fields in the PreparedStatement.

If there are more unknown fields in the query, example: PreparedStatement ps = conn.prepareStatement(“SELECT acct_type from accounts WHERE username=? and password=?”), then the next statements would be:

ps.setString(1, username);
ps.setString(2, password);

or ps.setString(1, ‘mylene’);
ps.setString(2, ‘thisismypassword’);

A ResultSet object is returned when an executeQuery is performed:
rs = ps.executeQuery();

You can then use the while loop and the next method to access each row in the ResultSet object. However if there is only one row returned by the query, you can skip the while loop.

if (rs != null) {
rs.next();

Next, you can access each field in the row by using methods such as getString and getInt to get Strings and integers correspondingly.

userPassword = rs.getString(“password”);

You can use the name of the field (such as password) to specify which field you want to retrieve or use indexes instead – example, userPassword = rs.getString(2);.

Java Revisited: A Tutorial for My Students Vol.1 Part 1

I have promised my former students that I would give a tutorial on Java because they wanted to learn more about it. I know that this has already been delayed but I hope this little tutorial series on Java/MySQL would still be helpful. =) If you find some errors/glitches in the code, please feel free to post a comment. Or if you have any suggestions on how to improve this, please let me know. Thanks!

First off, I’d like to let you know the tools and platforms that I am using.

– JDK 1.6
– NetBeans IDE 6.1
– MySQL (bundled with WAMP)
– HeidiSQL (a lightweight, fast, and flexible interface to MySQL)
– Windows XP

For this tutorial series, I would expect that you already have a working knowledge on Java and databases (specifically MySQL), and an understanding of object-oriented programming. We will start with a mini project entitled “Time Management System”. I have chosen this mini project for simplicity.

We have 4 tables in the system. Accounts, Acct_type, Logs, and Team. Using HeidiSQL, create a database named tms with this schema (will be posted on the flash widget: right side of My Lane page).

First, we will create a class for database connection and we will name it DBConnector.

/**
*
* @author Mylene E. Sereño
*/
import java.sql.*;
public class DBConnector {
private String url;
private String user;
private String password;
private String driver = “com.mysql.jdbc.Driver”;
private Connection conn = null;
public DBConnector(String url, String user, String password) {
this.url = url;
this.user = user;
this.password = password;
}
public Connection connect() throws Exception {
try {
Class.forName(driver);
conn = DriverManager.getConnection(url, user, password);
} catch (SQLException sqlEx) {
sqlEx.printStackTrace();
}
return conn;
}
}

We will create a second class (not included in the system) named DBConnectorTest to test if DBConnector works.

import java.sql.Connection;
public class DBConnectorTest {
private static DBConnector dbConn = new DBConnector(“jdbc:mysql://localhost:3306/tms”,”root”,””);
public static void main(String args[]) throws Exception {
Connection conn = dbConn.connect();
if(conn != null) {
System.out.println(“Connection to database established!”);
}
}
}

The url is jdbc:mysql://localhost:3306/tms. It indicates the protocol (in this case, mysql), hostname (localhost or IP address), port (3306 for mysql), and the database name, which in this case is tms.

If this code doesn’t work, please make sure that you have installed Java support for MySQL correctly. If you are not sure about it, please refer to this tutorial. I was able to get things right when I found Java’s lib/ext directory. Where? It really depends on your system. But in my case, the path looks like this: C:\Program Files\Java\jdk1.6.0\jre\lib\ext.

Download the current version of MySQL Connector/J from mysql.com’s Drivers and Connectors. If you are a Windows user, then you’d want to choose the .zip file. Expand the file and move the driver(mysql-connector-java-X.X.X-bin.jar) to the lib/ext directory from the previous step.

The values of the instance variables user, password and url of  DBConnector would depend on your system. It is of course, always advisable to make your systems secure so please avoid using root and do create a strong password for your MySQL instance. Or else, you’re in BIG trouble! Just for simplicity, I used WAMP’s default values.

Some events bring us together. Some events tear us apart.

FAMILY is the only thing constant in this world. No matter what happens, you can always count on FAMILY.

We said goodbye to our dear grandfather last April 2, 2011 – an event that brought us all together once again.

I always hated goodbyes. Saying goodbye was never easy. I will miss Tatay. I will miss looking through his window and checking on him. I will miss chatting with him while I help him eat his meals. I’ll even miss cutting his nails… But I am glad that Tatay has finally joined Nanay in heaven. It was already painful for us to see him in such a helpless position for so long…

Farewell Tatay… you will always be alive in our hearts. Thank you for being a good provider. And as what Mama and the rest of your sons/daughters say, you have been a very good father to them – responsible, loving, and without any vice. You have successfully brought up 8 professionals – midwife, nurse, lawyer, teachers, and engineers. You have sacrificed so much to make all your dreams for your family come true. You worked in Indonesia for years as an OFW, away from your family just to give your them a comfortable life.

We are so PROUD of you and we love you Tatay!

Happy Birthday Super Fabulous Girl!

Once upon a time, she was just the Math student whom I saw defending her thesis in our office who brought a delicious mango float to charm her panelists. She never really mattered to me then. I was just checking my papers and I didn’t even pay attention to what she was discussing (I just looked forward to eating her mango float! Haha! =D). Never did I imagine that that girl was to be one of my most favorite people in this world. I feel that God must really love me because He gave me Ems, one of the best gifts I’ve ever had.

She looks really vulnerable but actually she’s tough and strong. I am amazed with how she handles everything with grace. And I am more amazed with how this girl has remained pure and innocent, almost unaware of the evils of this world. I admire her for being a woman who has always worked on being a better person each day.

I really, really miss her. We used to spend each waking, working, shopping, cooking, and sleeping moment together. My life at BQ couldn’t have been more fun without her. She took me in her arms and wiped my tears when I felt so down and broken hearted.  She saw me at my best and at my worst – with all the tears and sipon on my face. Ewww.. 😀 Thanks Ems for all those crying times…for just being there. I can’t imagine another breakup without you. 🙂

I am so happy to see the woman that you have become. And I know that you are about to achieve one of your goals soon. I pray that you will continue to be a blessing to everyone around you and thatall your relationships will be blessed. Stay in love, happy, and blooming! He is soooo lucky to have you!

Life is really so different now that we don’t live together. I don’t have anyone to be maarte with anymore. Haha. I miss spending time in the kitchen and praising each other’s work. I miss sitting across each other in the living room and being emo when we both have our pre -menstrual syndrome (PMS) moments. I miss sharing each other’s guy blues. I miss eating your food, raiding your fridge and “parasiting” your ulam. I miss sharing habal rides with you. I miss all the things we do together!

You have blessed my life in so many ways. Thank you so much Ems!!! Happy, happy birthday! May all your wishes come true! I love you!!!

Happy birthday Sassy Girl!

Laiza at Bora

She’s more than just a dimpled pretty face.

She can also throw tantrums and drive you nuts. Hehe. Just kidding. Laiza is more than just a sexy supermodel wannabe. She’s the best gal friend anyone could ever have…the youngest in our trio… but oftentimes she acts as the most mature. She loved being the bunso in the office and even pleaded our chairman to hire only those who are older than her so she’ll remain our bunso. =) Haha.

Don’t be deceived by her maarte and sosyal facade…because underneath the shades and fashionable clothes, lies a heart of gold. I admire this girl. She deserves everything she has right now because she has worked hard to get them. And she has given much of herself not only to her family but also to her friends…and loved ones 😉

Happy birthday dear Laiza! I feel blessed to have you as my girlfriend! I love you!!!