mga kayamanan sa baul

Posted on

i’ve been doing some cleaning with my old stuffs last night. and guess what i’ve found? my old writings like essay and poems. can’t believe they’ll be preserved for a long time. the paper are like old scrolls, brown and delicate. i was an aspiring writer before. actually, i want to become a biologist, chemist or a journalist but in the i end up in the computer world. i do not resent being here where i am right now, im happy and excited on how my career has developed. anyways, talking back with my discovery, i’ll start posting them here to share. =) un lng hehe

Advertisements

Developer / PHP Syntax Exam from BlueShoes

Posted on Updated on

been looking for free PHP exams online so that i could test how well am i progressing in programming. i found an exam on syntax, variables and comparison. it’s was very simple and was very tricky. it’s amusing to know that the keywords and functions that i “always” used are the ones that i don’t know much about. they are just under my nose and yet i didn’t give mind studying them or paying much attention on their functionality.

lesson learned: study and familiarize yourself of the basic. usually, the problems we encountered, in coding when diligently debugged and analyzed, are just basic syntax that we usually overlooked or forgot. i guess, even though PHP manual is my friend, there are still a lot of things i don’t know much about it. hehe, well here is the link:

http://www.blueshoes.org/en/developer/syntax_exam/

i took the exam on the spot and sadly i didn’t reach at least 25% of the total score (69 total) . *sigh

PHP Table Class

Posted on Updated on

Here is a PHP class that creates an HTML table
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxx FILE INFORMATION xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// @title : HTML Table Class
// @author : Jhoy Q. Imperial
// @date created : February 7, 2008
// @function : creates an HTML table object;
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
class Table
{
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxx DECLARE CLASS VARIABLES xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
var $tVars;

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxx CREATE NEW TABLE OBJECT xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
function Table($name,$attribute=NULL)
{
/*
Set table name and attribute
attribute string should be written as it is in HTML tag
ex. class=”tableclass” border=”1″
*/
$this->tVars[’name’] = ‘name=”‘.$name.’” id=”‘.$name.’” ‘.$attribute;
}

function setHead($name=NULL,$col)
{
/*
Set table header name and corresponding column title
*/
$name = (is_null($name))? ”: ‘id=”‘.$name.’”‘;
/*
store table header row in $this->tVars[’head’]
*/
$this->tVars[’head’] = “\t”.’<tr ‘.$name.’>’;
/*
run through $col if it is a valid array variable
*/
if(is_array($col)){
foreach($col as $value){
$this->tVars[’head’].=’<td>’.$value.’</td>’;
}
}
$this->tVars[’head’].=’</tr>’;
}
function setData($data)
{
/*
xxxxx This sets data in normal table rows xxxxx

Set table data values
store row of data in $this->tVars[’data’]
*/
$this->tVars[’data’]=”;
/*
run through $data if it is a valid array variable
*/
if(is_array($data)){
foreach($data as $row){
$this->tVars[’data’].=”\t”.’<tr>’;
/*
run through $data if it is a valid array variable
*/
if(is_array($row)){
foreach($row as $key=>$value){
$this->tVars[’data’].=’<td>’.$value.’</td>’;
}
}
$this->tVars[’data’].=’</tr>’.”\n”;
}
}
}
function setAlternate($data)
{
/*
xxxxx This sets data in alternating table rows xxxxx

assign variables
$rowCount = start count for foreach row
$rowOdd = id string for odd row
$rowEven = id string for even row
*/
$rowCount = 0;
$rowOdd = ‘ id=”odd” ‘;
$rowEven= ‘ id=”even” ‘;
/*
Set table data values
store row of data in $this->tVars[’data’]
*/
$this->tVars[’data’]=”;
/*
run through $data if it is a valid array variable
*/
if(is_array($data)){
foreach($data as $key=>$row){
$rowCount++;
$checkOddEven = $rowCount %2;
$displayRowID = ($checkOddEven==0)? $rowOdd:$rowEven;

$this->tVars[’data’].=”\t”.’<tr’.$displayRowID.’>’;
/*
run through $row if it is a valid array variable
*/
if(is_array($row)){
foreach($row as $key=>$value){
$this->tVars[’data’].=’<td>’.$value.’</td>’;
}
}
$this->tVars[’data’].=’</tr>’.”\n”;
}
}
}
function getTable()
{
/*
store table object to $this->tVars[’table’]

$this->tVars[’name’] = the table name and attributes
$this->tVars[’head’] = table header row
$this->tVars[’data’] = table data row(s)
*/
$this->tVars[’table’] =’<table ‘.$this->tVars[’name’].’ >’.”\n”;
$this->tVars[’table’].=$this->tVars[’head’].”\n”;
$this->tVars[’table’].=$this->tVars[’data’];
$this->tVars[’table’].=”\t”.’<table>’.”\n”;
/*
return $this->tVars[’table’] for output display
*/
return $this->tVars[’table’];
}
}
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxx HOW TO USE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// A sample demo for this class
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/*
include ‘class.table.php’;

$data = array();
$data[]= array(’2′,’Johnny’);
$data[]= array(’4′,’Kathy’);
$data[]= array(’5′,’McCain’);

// @param : new Table($string table name, $string atttribute [’attrname=”value” attrname=”value”‘]);
$table = new Table(’resultTable’, ‘class=”newTable”‘);
// @param : setHead($string row name,$array col names);
$table->setHead(’head’,array(’ID’,’Name’));
// @param : setData($array data value)
$table->setData($data);
// use setAlternate($data) if you want to display with alternating row design
// @param : setAlternate($array data value)
//$table->setAlternate($data);
echo $table->getTable();
*/
?>

skinning my wordpress blog for the first time

Posted on

it took me almost 30 minutes browsing over and over the 5 pages themes of wordpress because im having hard time choosing.

after trying each for more than 3 times, i ended up with “Contempt by Michael Heilemann”. it’s simple and i like it.

afterwards, i had fun customizing my sidebar and got overwhelmed of the many options that i have.

now it’s time to publish some more posts. =)

jhoy imperial and the web invades wordpress

Posted on Updated on

i’ve been seeing a lot of wordpress blogs around the net and i’ve heard so much about it from other people. they say it’s cool and very much easy to manage. well, i guess it’s time for me to try it.