Wednesday, September 12, 2012

Frustrated White Collar

when i was a kid, a teacher told me that i have a future in journalism. maybe back then i was really good in making make believe stories. but that kid never made any advancement in that line of career. life has pulled him to a different kind of job. jobs that never made him any money or offer enjoyment and satisfaction. maybe life is really a bitch and wants us to be miserable.

but while listening to a linkin park song, leave out all the rest, i was hit. if my time has come, what will i leave in this world to remember me by? maybe a few disappointments here and there, but that is not a good thing. this is really a tough question, not only to me, but to everyone.

what have i already done that i can be really proud of? that when i pass, atleast others can say, "oh i missed that guy because...". right now, nothing i can think of. but i am trying. hope someday i can contribute something that have an impact to others. i don't want to die and turn into fertilizer without leaving a mark.

for now, this is my quest. i will do something that can impact others life. starting now!

what about you?

Tuesday, August 28, 2012

i just learned about php, so i was very eager to try it out. the first problem was how to test php offline, which i solved and blogged it on my previous post. here's a link in case you missed it. test php offline

now a new problem arises.

i figured out how to test it offline, so i quickly wrote some php codes. first i was, "wow, i'm doing it!" then i have to do my assignment in that class. if you are wondering why i have an assignment, it's because i'm taking this course in a free lms site. it's called village88.com . here's a link of a post about it about village88.com.

as i was saying, i'm doing my assignment. the assignment was to create a page that somehow does what a facebook wall does. the user can create an account, have a wall where they can post some status and other users can comment/reply on a post. they can also delete their post but only their own post or comment/reply. the assignment sounds cool, right! so i hurriedly created the pages. i coded the html, added some css to make it look good. created the forms for log-in and registration purposes. i layed out the pages for the wall and profile. everything was looking good. then i inserted the php codes. then everything started to head south.

when i ran the pages, wow, my browser displayed rows and rows of error messages. from mysql errors to missing variable errors to unexpected etc etc. i was down. i really thought this was going to be easy. though feeling down, i pursued, debugged the codes one by one. for hours, i continued tracking down all that nasty bugs until they are all gone.

in the end, i learned my lessons which i am going to share to you all so you won't have to experience what have i been through. though this is not 100% bullet proof, at least it will lessen the hours spend debugging errors.

  • semi-colon

    this is the nastiest culprit of all times. you can spend hours and hours finding that bug and in the end you'll find out that it is a single semi-colon you forgot to place in the end of the line. a piece of advice, always have that semi-colon ready whenever you enter a new line. type that semi-colon, press left arrow once, then, go with your code. take some time to repeatedly do it when coding and your muscle will memorize the steps. before you know it, it is already embedded in your coding style.
  • terminators ")}] ?>"

    like semi-colon, terminators can be hard to track down specially when you have a hundreds of lines of codes. best way to deal with this is to readily place your terminators before proceeding with your codes. just like how you deal with semi-colons. just a reminder, if you don't readily place terminators it will easily be very tricky where to place them afterwards.
  • functions

    always use functions. use functions to connect to mysql. use functions to redirect to a page. use functions to prevent mysql injections. use functions to display database query results. this way, your code will look cleaner and compact. the lesser the codes the easier to detect the bugs.
  • mysql

    sometimes it's the connection, some other times it's the query. sometimes you just misspelled the table name or field name. either ways, it's harder to debug if you don't really know your mysql. master it, and then proceed with php.

that's all folks. hope you learned something from me. 'til next time!

Thursday, August 23, 2012

i know i am not a genius, but i also know that i am not dumb. so when i was stuck on this problem i can't solve, i doubt myself. am i really not dumb?

see, the problem i was trying to solve is how would i test my php codes. i tried opening it on my browser but all i see was my codes. it's not supposed to be like that. i am supposed to see the result or an error message but none of these came out. i checked my wamp server, it's ok. it is green so i know it is running perfectly. i tried mysql if it is good, made a few query, and it ran well. i spend hours thinking but to no effect. i can't solve it. so i did what most men do if they can't solve a problem, i went to sleep.

i think that was the best idea i ever had that day, to go to sleep. after that , i feel refreshed and good. my brain was working well that i solved my problem myself.

it is really not hard to figure out the solution. to test my codes, i was dragging my file into the browser. well, that is how i was testing my html codes and it works perfectly. a total noob in php as i am, i did the same for php. so there is where my trouble started. how did i found out of the solution, well through mysql. i am using mysql through phpmyadmin. i opened a browser then i go to localhost and click on phpmyadmin link. then i thought, is this supposed to be the way to test my php? turns out, you have to place your file into the www folder where your wamp is intalled. in my case it is in my d:\wamp\www. then access the file by typing in the address bar of your browser localhost/[the name of the php file]. just like that and i can test my codes now, one problem solved.

my headaches are supposed to go away but no. yes, i can test my php codes now but the results are still erroneous. so many error messages that i have to sleep again. hope that can solve my problems, again. i am still a noob but i can get past this, hopefully. 'till next time!

Wednesday, August 15, 2012

...sunshine

well, i am like this most of the time. always seeking ways to improve myself. though most of the time i failed at my attempts, there are still a few good times i succeeded. these might not yet be categorized as successful but still there’s a chance.

see, i have been a programmer for quite some time now. but most of my projects are geared toward desktop applications. maybe a few years back this is a good source of income, but now, it is slowly dying. technology is now on mobile and web applications. i should have adjusted to these changes years ago but i didn’t. i have been so busy with massive amount of projects that i lost time to improve myself professionally. so now i am cramming.

good thing is, i found this website. it is an online tutorial site perfect for those who want to learn web development. it have video tutorials that is short, concise, direct to the point, easy to understand and student friendly.Mentors are willing to help and guide you on web development until you can stand on your own feet. and wait, there’s more! the best thing is, it’s FREE!. yeah, it’s absolutely FREE!.

currently, i am enrolled in a course and i am enjoying it. i am learning a lot. want to try it? just visit village88.com and enroll on the courses they offer.

hello corporate world…:(

it’ s been a year now that i am struggling to survive. life is hard as it is, then heavy rains pour down. alas, my roof is a mess-up. rain is pouring through it. money seems harder and harder to come by. i have a job that i hardly like. i have bills i hardly pay. i have problems i can’t solve. i have almost everything that most people don’t want.

i am a FRUSTRATED WHITE COLLAR man…