WHAT money mistakes can turn P20,000 to waste in a year?
While mistakes are normal (even so-called experts make them), it won't hurt to know which ones you are committing and how to learn from them.
Putting your act together financially may prove especially useful when times are tough and rocky because even little mistakes that happen again and again can set you back thousands of pesos in a year.
Here are 10 money mistakes most of us make:
Mistake #1: Living beyond your means
Filipinos are consumed with "wanting to live a better life."
Are you trying to live "that kind of life" with income that cannot sustain that lifestyle and ending up spending more than your monthly paycheck? Yes, you can fund that lifestyle with debt. Don't. Spending more than you earn is the surest way to keep that "better life" further away from reach.
Ralph Liew, chairman of the International Association of Regional Financial Consultants (IARFC) for the Philippines, Thailand, Malaysia and India, points out that the millionaires next door are the ones who save so much more than they spend.
"They are the ones who are saving a lot of money," he says.
The fix: Put off expenses if the income for the month will put you in debt or cause you not to save money for that period. Thinking twice about small things like the cost of lunch, a frapuccino or dinner at a restaurant will instill discipline and the habit of living within your means, which is most valuable in fixing money mistakes.
Mistake #2: Not saving enough
You've heard of the expression "It's not what you make that matters, it's what you keep." Saving monthly is the fundamental habit that makes any person-- whether a Jollibee crew or a professional working in a posh office in Makati--wealthy. Starting your first job and earning minimum wage may not make it easy for you to save regularly, but P50 savings per week in a simple jar near your bed is not a bad start.
As you mature, it will be easier to set aside a bigger chunk of money because you've been used to the habit.
"I save half of my salary automatically and try not to think about it," says Anna, a professional working in Ortigas.
The fix: Find a way to automate your savings to make it easier for you to save. There are some banks that provide this service. Make it a goal to save monthly, even if it's just a small part of your income--say 10 percent. Then increase this regularly when finances allow you to squirrel away more of your income.
Mistake #3: Being materialistic
It is common to see families in the provinces living simply with chickens running around in the yard, pigs being raised in the backyard, malunggay and other vegetables growing near the home. IARFC's Liew says when he saw Filipinos living this way, he realized that living simply and not measuring your worth by looking at what you have and what you can buy makes a person's life more meaningful.
"Don't try to keep up with the Joneses and don't just keep looking at the material part of life. Be frugal; don't overspend. Some of the people I see in the provinces live simply and they are okay," says Liew.
The fix: Keep your attention focused on the things that matter most: health, family, friends, and community. While money may make your children happy because of the things that it buys, there are other things that will make them equally happy, like loving attention, quality time and playing together, among others. Sometimes, the returns from non-monetary gifts are even higher.
Mistake #4: Giving in to greed
Billions of pesos every year are sucked into get-rich-quick schemes and scams that easily separates a Filipino from his hard-earned money. Liew says the reason for this is greed. Running after very high returns is a sure way of getting scammed.
The fix: Don't be wowed by quick wealth. Lightning may strike for some people, but the more stable and sure way to wealth is a slow accumulation of savings and investments. How about that hot stock tip or "new investment strategy" earning four percent in a day that made someone a millionaire? Just walk away from it. They will never tell you just how quickly they lost their money.
Mistake #5: Not knowing what you want
"People don't know what they want and then they end up wanting everything they see," says Liew. One of the building blocks of wealth is to know yourself and your limitations as well as your strengths. Husbands, wives and children should take time to talk about financial goals (i.e. our own home in three years, our own car in two years, studies in the United States for Junior in 10 years, etc.).
The fix: New Year or this coming Christmas holiday is a good time to create a financial road map for yourself or your family. Talk about what you want and how you intend to get there. Think about how long you want to attain your goals. Make a pact to revisit your goals every year to see how you are doing.
Mistake #6: Failing to pay off debts
The Philippines owes P122 billion in credit card debt, P14.2 billion of which have already fallen overdue as of June. Unfortunately, that's only a small part of consumer debt, as loan sharks still abound. Debt is like a Damocles sword that hangs over your head and makes you afraid to wake up in the morning.
Interest from debt never sleeps; it doesn't take days off or holidays. They are worms that eat voraciously at your financial dreams.
The fix: If you are thinking of borrowing money with no plan on how to repay it, don't.
If you have debt or several debts that need to be paid, create a plan now.
Start paying the ones with the highest interest while paying off the others with as much money as you can spare.
Then work on through that list until you have paid everything.
Mistake #7: Getting killed by advertisements
Glossy magazine inserts come in through the mail at a frenzied pace when the holiday season draws near. There are flat-screen LCD televisions to buy and new mobile phone models. Resist them if you don't need them or can't afford them yet.
The fix: If you are vulnerable to advertisements, make the remote your best friend and speed up your channel surfing. Don't even start flipping that glossy magazine insert. Avoiding advertisements or keeping yourself disciplined enough to enjoy them from a distance should help you keep your finances secure this holiday season.
Mistake #8: Not having a plan
"One of our most common mistakes is not having a financial plan, not following up on the plan and not implementing the plan," says Liew. He notes that many people have New Year's resolutions--for example, to quit smoking--but find themselves still doing so when the next New Year's eve arrives.
The fix: Give yourself the gift of your very own financial plan this Christmas season. You can talk to a financial planner to help you out or do it yourself.
There are many resources on the Internet to help you create a plan that will save you from money mistakes and point you to the right direction when it comes to understanding your money personality, how to save and invest, how to prepare to retire wealthy and prepare to be pampered in your golden years.
One of these is MoneySmarts, the personal finance blog of the INQUIRER.net.
Mistake #9: Not having financial education
People think financial education is only for those working in banks, mutual funds or in the financial services industry.
Granted, mathematics or statistics are not easy subjects for all, but knowing financial principles is useful to everyone.
Liew says that even children should have subjects on financial management.
The fix: Don't be shy. Ask among your friends if they know something about taking care of finances. Invest in books and take classes. Personal finance is a growing topic in local media.
Mistake #10: Procrastinating
Time doesn't stand still, not even for the Pope.
The best time to start making money moves that will save you from a life of want and need is now, not tomorrow or next week.
The best time to start a budget is now. The best time to save for retirement is now.
The fix: Stop reading and start doing.
Credits: Philippine Daily Inquirer
Tuesday, December 16, 2008
Friday, October 03, 2008
Get Started With SimpleXML in PHP
If you're starting out in web development, you're probably going to have to transfer data between applications. These days, most do this using XML. XML is a protocol used to share data, especially via public APIs.
Hacking XML code can get pretty messy and unmanageable if you don't know what you're doing. Mercifully, PHP 5 has a library called SimpleXML that lives up to its name. The hard work of turning XML into a usable format for programming is done for you. All that's left is working with the object SimpleXML creates.
In this tutorial, I'll show you how to make sense of the SimpleXMLElement object and the many ways it can be used. Come to the head of the class, because it's time for SimpleXML School.
What you'll need
Example XML File
You can download the example XML we'll use in this section, or copy the text below into your own file named school.xml. Make sure you store this file in the same directory as your PHP file.
Read in XML
The most common way to use XML in your PHP programs is "reading in" someone else's XML. Most APIs output their data as XML. To be able to use these APIs, you need to be able to read in, parse, and make sense of the XML it sends.
Read XML From a File
To read the XML from school.xml, use the simplexml_load_file function:
I have also printed out the way the XML is interpretted in PHP: as a SimpleXMLElement object.
Read XML From a String
To create a SimpleXMLElement object from a string of text, use the simplexml_load_string function:
Here I loaded the school.xml text into a string variable ($xmltext), before passing it to the simplexml_load_string function. If this looks like an extra step, it is in this case. But if you received a string from an API, you'd want to be able to use this function.
Now that we have a SimpleXMLElement object, let's talk about how to use it.
Understand the SimpleXMLElement Object
The SimpleXMLElement object is how SimpleXML converts textual XML into a format that PHP can understand. The object is essentially a collection of tag names with the values inside the tag. As is common in XML, sometimes a tag contains other tags. In that case, the value of a tag is actually another SimpleXMLElement object.
Take a look at the strange indented text that my code above has produced. It begins with a SimpleXMLElement object. The next thing is the <grades> tag, which is itself another SimpleXMLElement object. It contains a <grade> tag, which has an array of—you guessed it—SimpleXMLElement objects.
There's not much use to printing out the entire object, other than to understand it. So, now let's try accessing some individual pieces of data.
Want to print out the name of the principal? Try this:
Which produces the name of the principal from the XML file:
How about the number of boys in Kindergarten? That gets a little more complicated:
As expected, it outputs the number of boys from the "zeroth" grade element:
Luckily, SimpleXML has another even easier way to access pieces of the results. It's called XPath, and you can find out more in the next section.
Use XPath for Even Simpler XML Access
XPath is a web standard, just like XML. XPath is a way to query XML for particular elements and there's a function within SimpleXML that makes XPath a cinch.
All you need to do is call the xpath function on the SimpleXMLElement object with the special "path" you want to find. For example, to get the principal tag and its children, just use this code:
Notice this example describes the entire path to the <principal>tag, including the root (<school>). Each level is preceded by a slash, including the first one.
Output:
You can also search for all instances of a specific tag, regardless of its place in the hierarchy. The same example above is now shorter:
Notice the double-slash at the beginning of the XPath call this time? It tells XPath to look for any <principal> tag. The output is the same as the previous example.
The same double-slash syntax can be used to find multiple results. Here, we'll retrieve an array of all the grade levels in the school:
Output:
You can even call up certain tags based on their content. Here we'll grab any tag that contains a <level> tag with a K (for Kindergarten). Notice the asterisk, which tells XPath to match any tag:
Output:
In addition to checking for a specific value, XPath can also look for numbers that are greater than or less than. Here, we get all <student_count> tags with more than 31 girls:
Output:
Here, it also grabs the <boys> tags, both of which are less than 31. That is because we're only checking against the <girls> tag, but then grabbing its parent, which is also the parent of the boys.
We can include the boys in the count to check the overall count by using XPath's addition operator:
Output:
Again, both boys and girls are returned, but here they only return if the total of the two counts is above 60.
These many examples are just a small sampling of what XPath can do. Hopefully it helps you find out how to read in and query XML for the data you need. In the next section, we'll look at writing your own XML using SimpleXML.
Write out XML
As you've seen in the previous section, the SimpleXMLElement object is central to using SimpleXML. This object holds the structure of the XML in a way that makes it easy for PHP to access it. However, sometimes we want to output it back as raw XML. For example, if you're creating an API, you would probably be sending XML out as output.
Output SimpleXMLElement Object as XML
If you already have a SimpleXMLElement object, writing out the XML is as easy as calling the correct function: asXML.
Assuming you have a SimpleXMLElement object called $xmlobj, here's the code you need to print out as XML:
The print command does the printing, because asXML just returns the content. If you don't want to immediately output the XML, you can store the content into a variable:
Now that you know how to print out the XML, let's create a SimpleXMLElement object from scratch.
Create SimpleXMLElement from Scratch
When you want to create XML, using the SimpleXMLElement object can help avoid errors in syntax, so you know your XML is as good as your object.
Before we create a SimpleXMLElement from scratch programatically, let's look at the XML we want to achieve:
Start with XML and Root Tag
To create an empty SimpleXMLElement object, you can pass an XML structure essentially void of content. Here we'll give it just an <xml> tag, then create a root tag. In this case, I've chosen <classroom> as my root element, under which I'll add all other XML tags.
Here's the code to give us an empty SimpleXMLElement:
The first line holds the blank XML. The second line uses that XML to create a SimpleXMLElement object.
Add Elements to SimpleXMLElement
The SimpleXMLElement object doesn't do us much good unless we start adding elements to it. Glancing up at the XML we're hoping to achieve, I see we need a <teacher> tag next. To add this, we need to call the addChild function on our SimpleXMLElement object. This function takes two arguments: the name of the tag and the value. Here's the code:
The $xmlobj variable from the previous section holds the empty SimpleXMLElement. To call a function on an object, we use the -> operator, followed by the name of the function.
The asXML line might look familiar from the above. It prints out the XML code from the SimpleXMLElement object. In future sections, you'll need to put new code above that line to avoid printing before all your XML is in place.
Save your PHP file and load it up in your browser. You should now see our XML. Blown away? Probably not, but let's add some more elements and see if we can change that.
Add Sub-Elements to SimpleXMLElement
Now that we've added a normal element, let's get more advanced and create an element that contains other elements. To do this, we need to create a new element, then get access to the new object.
Luckily, the addChild function we used above returns the new object that it creates. Here is the code to create a sub-element:
(Remember to place the code above the asXML line).
The first line creates an empty <students> tag. In addition to creating the tag, it also sends the output of the addChild function to the $studentsobj variable. The output is a new SimpleXMLElement object holding just the new tag.
Calling the addChild function on the new object, as we did in the second line, creates a <student> tag. This second line is similar to the <teacher> tag we added, but here is will go inside the <students> tag instead of under the root tag.
Reload the file and see for yourself. We're now most of the way toward re-creating some XML by using SimpleXML. Just one tiny step remaining.
Add Attributes to SimpleXMLElements
Attributes go inside XML tags. They often hold meta-data, which supports the main data, but is not as important. Sometimes the value is extremely important, such as the anchor tag in HTML, which stores the URL inside the href attribute.
Here are are going to add a new student named Daisy and set a gender attribute of "F" for her. Here's the code:
(Remember to place that code above the asXML line).
The first line may look familiar. As with adding the first child (Sammy) above, we need to call the addChild function on the $studentsobj variable. The difference is that we set the output of that call to yet another SimpleXMLElement object. This one holds only the data for the most recent tag, Daisy's <student> tag.
We use the newest object to add an attribute for Daisy. The name of the attribute is "gender" and the value is "F." So, when you reload the PHP file again, you should now see the complete XML that we were trying to emulate.
I hope you're at least a little bit blown away now, because you just created an entire XML file programmatically.
Where to Use SimpleXML
Now that you know how to read and write XML with SimpleXML, you're probably looking for ways to use it. As I've mentioned above, APIs often output XML, so that's a good place to start. Below we have some tutorials that use SimpleXML to parse real live XML from APIs.
Credits: Webmonkey
Hacking XML code can get pretty messy and unmanageable if you don't know what you're doing. Mercifully, PHP 5 has a library called SimpleXML that lives up to its name. The hard work of turning XML into a usable format for programming is done for you. All that's left is working with the object SimpleXML creates.
In this tutorial, I'll show you how to make sense of the SimpleXMLElement object and the many ways it can be used. Come to the head of the class, because it's time for SimpleXML School.
What you'll need
- PHP 5, a programming language available on many web hosts.
- SimpleXML, a library usually installed along with PHP 5.
- Some knowledge of PHP and XML
Example XML File
You can download the example XML we'll use in this section, or copy the text below into your own file named school.xml. Make sure you store this file in the same directory as your PHP file.
<?xml version="1.0"?>
<school>
<grades>
<grade>
<level>K</level>
<student_count>
<boys>49</boys>
<girls>41</girls>
</student_count>
</grade>
<grade>
<level>1</level>
<student_count>
<boys>29</boys>
<girls>32</girls>
</student_count>
</grade>
<grade>
<level>2</level>
<student_count>
<boys>26</boys>
<girls>31</girls>
</student_count>
</grade>
</grades>
<principal>
<name>Dr. Hamilton</name>
<experience timein="years">
<time>14</time>
</experience>
</principal>
<classrooms />
</school>
Read in XML
The most common way to use XML in your PHP programs is "reading in" someone else's XML. Most APIs output their data as XML. To be able to use these APIs, you need to be able to read in, parse, and make sense of the XML it sends.
Read XML From a File
To read the XML from school.xml, use the simplexml_load_file function:
$xmlobj = simplexml_load_file("school.xml");
print header("Content-type: text/plain");
print_r($xmlobj);
I have also printed out the way the XML is interpretted in PHP: as a SimpleXMLElement object.
SimpleXMLElement Object
(
[grades] => SimpleXMLElement Object
(
[grade] => Array
(
[0] => SimpleXMLElement Object
(
[level] => K
[student_count] => SimpleXMLElement Object
(
[boys] => 49
[girls] => 41
)
)
[1] => SimpleXMLElement Object
(
[level] => 1
[student_count] => SimpleXMLElement Object
(
[boys] => 29
[girls] => 32
)
)
[2] => SimpleXMLElement Object
(
[level] => 2
[student_count] => SimpleXMLElement Object
(
[boys] => 26
[girls] => 31
)
)
)
)
[principal] => SimpleXMLElement Object
(
[name] => Dr. Hamilton
[experience] => SimpleXMLElement Object
(
[@attributes] => Array
(
[timein] => years
)
[time] => 14
)
)
)
Read XML From a String
To create a SimpleXMLElement object from a string of text, use the simplexml_load_string function:
$xmltext = join(file("school.xml"), "");
$xmlobj = simplexml_load_string($xmltext);
print header("Content-type: text/plain");
print_r($xmlobj);
Here I loaded the school.xml text into a string variable ($xmltext), before passing it to the simplexml_load_string function. If this looks like an extra step, it is in this case. But if you received a string from an API, you'd want to be able to use this function.
Now that we have a SimpleXMLElement object, let's talk about how to use it.
Understand the SimpleXMLElement Object
The SimpleXMLElement object is how SimpleXML converts textual XML into a format that PHP can understand. The object is essentially a collection of tag names with the values inside the tag. As is common in XML, sometimes a tag contains other tags. In that case, the value of a tag is actually another SimpleXMLElement object.
Take a look at the strange indented text that my code above has produced. It begins with a SimpleXMLElement object. The next thing is the <grades> tag, which is itself another SimpleXMLElement object. It contains a <grade> tag, which has an array of—you guessed it—SimpleXMLElement objects.
There's not much use to printing out the entire object, other than to understand it. So, now let's try accessing some individual pieces of data.
Want to print out the name of the principal? Try this:
print $xmlobj->principal->name;
Which produces the name of the principal from the XML file:
Dr. Hamilton
How about the number of boys in Kindergarten? That gets a little more complicated:
print $xmlobj->grades->grade[0]->student_count->boys;
As expected, it outputs the number of boys from the "zeroth" grade element:
49
Luckily, SimpleXML has another even easier way to access pieces of the results. It's called XPath, and you can find out more in the next section.
Use XPath for Even Simpler XML Access
XPath is a web standard, just like XML. XPath is a way to query XML for particular elements and there's a function within SimpleXML that makes XPath a cinch.
All you need to do is call the xpath function on the SimpleXMLElement object with the special "path" you want to find. For example, to get the principal tag and its children, just use this code:
print_r($xmlobj->xpath("/school/principal"));Notice this example describes the entire path to the <principal>tag, including the root (<school>). Each level is preceded by a slash, including the first one.
Output:
Array
(
[0] => SimpleXMLElement Object
(
[name] => Dr. Hamilton
[experience] => SimpleXMLElement Object
(
[@attributes] => Array
(
[timein] => years
)
[time] => 14
)
)
)
You can also search for all instances of a specific tag, regardless of its place in the hierarchy. The same example above is now shorter:
print_r($xmlobj->xpath("//principal"));Notice the double-slash at the beginning of the XPath call this time? It tells XPath to look for any <principal> tag. The output is the same as the previous example.
The same double-slash syntax can be used to find multiple results. Here, we'll retrieve an array of all the grade levels in the school:
Output:
Array
(
[0] => SimpleXMLElement Object
(
[0] => K
)
[1] => SimpleXMLElement Object
(
[0] => 1
)
[2] => SimpleXMLElement Object
(
[0] => 2
)
)
You can even call up certain tags based on their content. Here we'll grab any tag that contains a <level> tag with a K (for Kindergarten). Notice the asterisk, which tells XPath to match any tag:
print_r($xmlobj->xpath("//*[level='K']"));Output:
Array
(
[0] => SimpleXMLElement Object
(
[level] => K
[student_count] => SimpleXMLElement Object
(
[boys] => 49
[girls] => 41
)
)
)
In addition to checking for a specific value, XPath can also look for numbers that are greater than or less than. Here, we get all <student_count> tags with more than 31 girls:
print_r($xmlobj->xpath("//student_count[girls>31]"));Output:
Array
(
[0] => SimpleXMLElement Object
(
[boys] => 49
[girls] => 41
)
[1] => SimpleXMLElement Object
(
[boys] => 29
[girls] => 32
)
)
Here, it also grabs the <boys> tags, both of which are less than 31. That is because we're only checking against the <girls> tag, but then grabbing its parent, which is also the parent of the boys.
We can include the boys in the count to check the overall count by using XPath's addition operator:
print_r($xmlobj->xpath("//student_count[boys+girls>60]"));Output:
Array
(
[0] => SimpleXMLElement Object
(
[boys] => 49
[girls] => 41
)
[1] => SimpleXMLElement Object
(
[boys] => 29
[girls] => 32
)
)
Again, both boys and girls are returned, but here they only return if the total of the two counts is above 60.
These many examples are just a small sampling of what XPath can do. Hopefully it helps you find out how to read in and query XML for the data you need. In the next section, we'll look at writing your own XML using SimpleXML.
Write out XML
As you've seen in the previous section, the SimpleXMLElement object is central to using SimpleXML. This object holds the structure of the XML in a way that makes it easy for PHP to access it. However, sometimes we want to output it back as raw XML. For example, if you're creating an API, you would probably be sending XML out as output.
Output SimpleXMLElement Object as XML
If you already have a SimpleXMLElement object, writing out the XML is as easy as calling the correct function: asXML.
Assuming you have a SimpleXMLElement object called $xmlobj, here's the code you need to print out as XML:
print $xmlobj->asXML();
The print command does the printing, because asXML just returns the content. If you don't want to immediately output the XML, you can store the content into a variable:
$xmltext = $xmlobj->asXML();
Now that you know how to print out the XML, let's create a SimpleXMLElement object from scratch.
Create SimpleXMLElement from Scratch
When you want to create XML, using the SimpleXMLElement object can help avoid errors in syntax, so you know your XML is as good as your object.
Before we create a SimpleXMLElement from scratch programatically, let's look at the XML we want to achieve:
<?xml version="1.0"?>
<classroom>
<teacher>Mr. Deckelmann</teacher>
<students>
<student>Sammy</student>
<student gender="F">Daisy</student>
</students>
</classroom>
Start with XML and Root Tag
To create an empty SimpleXMLElement object, you can pass an XML structure essentially void of content. Here we'll give it just an <xml> tag, then create a root tag. In this case, I've chosen <classroom> as my root element, under which I'll add all other XML tags.
Here's the code to give us an empty SimpleXMLElement:
$xmltext = "\n<classroom></classroom>";
$xmlobj = simplexml_load_string($xmltext);
The first line holds the blank XML. The second line uses that XML to create a SimpleXMLElement object.
Add Elements to SimpleXMLElement
The SimpleXMLElement object doesn't do us much good unless we start adding elements to it. Glancing up at the XML we're hoping to achieve, I see we need a <teacher> tag next. To add this, we need to call the addChild function on our SimpleXMLElement object. This function takes two arguments: the name of the tag and the value. Here's the code:
$xmlobj->addChild("teacher", "Mr. Deckelmann");
print header("Content-type: text/plain") . $xmlobj->asXML();The $xmlobj variable from the previous section holds the empty SimpleXMLElement. To call a function on an object, we use the -> operator, followed by the name of the function.
The asXML line might look familiar from the above. It prints out the XML code from the SimpleXMLElement object. In future sections, you'll need to put new code above that line to avoid printing before all your XML is in place.
Save your PHP file and load it up in your browser. You should now see our XML. Blown away? Probably not, but let's add some more elements and see if we can change that.
Add Sub-Elements to SimpleXMLElement
Now that we've added a normal element, let's get more advanced and create an element that contains other elements. To do this, we need to create a new element, then get access to the new object.
Luckily, the addChild function we used above returns the new object that it creates. Here is the code to create a sub-element:
$studentsobj = $xmlobj->addChild("students");
$studentsobj->addChild("student", "Sammy");(Remember to place the code above the asXML line).
The first line creates an empty <students> tag. In addition to creating the tag, it also sends the output of the addChild function to the $studentsobj variable. The output is a new SimpleXMLElement object holding just the new tag.
Calling the addChild function on the new object, as we did in the second line, creates a <student> tag. This second line is similar to the <teacher> tag we added, but here is will go inside the <students> tag instead of under the root tag.
Reload the file and see for yourself. We're now most of the way toward re-creating some XML by using SimpleXML. Just one tiny step remaining.
Add Attributes to SimpleXMLElements
Attributes go inside XML tags. They often hold meta-data, which supports the main data, but is not as important. Sometimes the value is extremely important, such as the anchor tag in HTML, which stores the URL inside the href attribute.
Here are are going to add a new student named Daisy and set a gender attribute of "F" for her. Here's the code:
$daisyobj = $studentsobj->addChild("student", "Daisy");
$daisyobj->addAttribute("gender", "F");(Remember to place that code above the asXML line).
The first line may look familiar. As with adding the first child (Sammy) above, we need to call the addChild function on the $studentsobj variable. The difference is that we set the output of that call to yet another SimpleXMLElement object. This one holds only the data for the most recent tag, Daisy's <student> tag.
We use the newest object to add an attribute for Daisy. The name of the attribute is "gender" and the value is "F." So, when you reload the PHP file again, you should now see the complete XML that we were trying to emulate.
I hope you're at least a little bit blown away now, because you just created an entire XML file programmatically.
Where to Use SimpleXML
Now that you know how to read and write XML with SimpleXML, you're probably looking for ways to use it. As I've mentioned above, APIs often output XML, so that's a good place to start. Below we have some tutorials that use SimpleXML to parse real live XML from APIs.
Credits: Webmonkey
Tuesday, May 20, 2008
What does it take to become a millionaire?
These days, the day time and prime time game shows on TV are raking in the audience and the advertising support — 1 vs. 100, All-Star K!, Gobingo, Pilipinas Game K N B?, Singing Bee, Wheel of Fortune, etc. Filipinos are tickled pink at the thought of taking a chance at becoming a millionaire in one day.
Lotto outlets also get long queues when there’s an upcoming super lotto draw. People, from the low-income to the middle-income classes, are lining up in hopes of winning the elusive jackpot.
But the chances of winning in game shows and lotto draws are very slim. Instead of dreaming about becoming a millionaire through these schemes, choose to work on becoming a millionaire yourself. No, it’s not too far out to dream of becoming one.
Look around you. There may be millionaires you already know living in your neighborhood or going to the same office as you do. These are the people who live in their own homes with their own cars, whose assets total more than P1 million. Whether or not they feel like millionaires is up to them. But the crucial factor is that they have built up an asset base valued at over P1 million. It is an attainable goal.
There are the really rich and visible millionaires who are business taipans. When you read their life stories, you’ll be struck with the fact that some of them were born poor. If they made it from rags to riches, there’s no reason why you can’t try.
To reach that goal, you have to learn the secrets of millionaires. Here they are:
1. Treat money as something to save and invest. The minute you receive your paycheck or a windfall (example, an inheritance or a bonus), think of how much you can put away as savings. Then look for venues where you can invest your money. If you think this way, you won’t be tempted to splurge money.
Some people splurge their retirement pay on BMWs or Mercedes Benzes. But when they get really sick, they find themselves with not enough cash to pay the hospital. So save more, rather than spend more.
2. Assume some risk when investing. When you play safe in investing, you’ll get safe (but low) returns as well. Millionaires have gone out on a limb putting up businesses which they hoped would earn — nothing is guaranteed. But it is in taking calculated risks that they are rewarded.
When investing, look at higher-yielding investments. Sure, they may be more risky than regular ones (such as savings and time deposits), but you may earn more in the long run. Just be wary of get-rich-quick investment schemes. Remember the adage: If it is too good to be true, it is.
3. Live simply. If you keep your cost of living low, you will have more cash to save and invest. Some millionaires have lived in the same homes they have had for the past 30-40 years. Or they live in the homes they inherited.
You can also take a cue from the way millionaires live: not all party every night, nor do they buy every new car model that’s released. Instead, you’ll find these millionaires working at their desks at 8 a.m. and having just two cars in the garage.
4. Have a goal. Don’t just dream; set financial goals for yourself. By being specific, you will be more motivated to reach your goal. For instance, make it your goal to have your own home by the time you are 35 or 40. It may be a studio condo unit or a three-bedroom home in a subdivision—it will depend on your income and how you save over the years. Having a goal will help you focus your efforts well.
5. Choose good debt over bad debt. Take out a loan only when the loan proceeds will be used to earn you more money. For instance, apply for a bank loan to expand a business that’s feasible. But to take out a loan to buy assets that depreciate quickly (examples: sports cars, yachts, etc.) may not be wise as these assets will not earn you enough to pay off the loan. If you really want to buy such assets, pay in cash so you don’t have to pay the cost of borrowing.
6. Share your blessings. There seems to be a unique mathematical formula at work: The more you give, the more you are blessed back in return. Help those who are in financial need, and you may find yourself blessed all the more. If you’re an employer, share profits with your employees; they’ll be more motivated to work for you, leading the way to increased productivity.
7. Train children to handle money well. It would be sad if money you earned will just be spent unwisely by the next generation. Teach children the basics of money management, and caution them against vices such as gambling, drugs, and the like. Being responsible about wealth will be rewarded in the long run.
Credits : Philippine Daily Inquirer
Lotto outlets also get long queues when there’s an upcoming super lotto draw. People, from the low-income to the middle-income classes, are lining up in hopes of winning the elusive jackpot.
But the chances of winning in game shows and lotto draws are very slim. Instead of dreaming about becoming a millionaire through these schemes, choose to work on becoming a millionaire yourself. No, it’s not too far out to dream of becoming one.
Look around you. There may be millionaires you already know living in your neighborhood or going to the same office as you do. These are the people who live in their own homes with their own cars, whose assets total more than P1 million. Whether or not they feel like millionaires is up to them. But the crucial factor is that they have built up an asset base valued at over P1 million. It is an attainable goal.
There are the really rich and visible millionaires who are business taipans. When you read their life stories, you’ll be struck with the fact that some of them were born poor. If they made it from rags to riches, there’s no reason why you can’t try.
To reach that goal, you have to learn the secrets of millionaires. Here they are:
1. Treat money as something to save and invest. The minute you receive your paycheck or a windfall (example, an inheritance or a bonus), think of how much you can put away as savings. Then look for venues where you can invest your money. If you think this way, you won’t be tempted to splurge money.
Some people splurge their retirement pay on BMWs or Mercedes Benzes. But when they get really sick, they find themselves with not enough cash to pay the hospital. So save more, rather than spend more.
2. Assume some risk when investing. When you play safe in investing, you’ll get safe (but low) returns as well. Millionaires have gone out on a limb putting up businesses which they hoped would earn — nothing is guaranteed. But it is in taking calculated risks that they are rewarded.
When investing, look at higher-yielding investments. Sure, they may be more risky than regular ones (such as savings and time deposits), but you may earn more in the long run. Just be wary of get-rich-quick investment schemes. Remember the adage: If it is too good to be true, it is.
3. Live simply. If you keep your cost of living low, you will have more cash to save and invest. Some millionaires have lived in the same homes they have had for the past 30-40 years. Or they live in the homes they inherited.
You can also take a cue from the way millionaires live: not all party every night, nor do they buy every new car model that’s released. Instead, you’ll find these millionaires working at their desks at 8 a.m. and having just two cars in the garage.
4. Have a goal. Don’t just dream; set financial goals for yourself. By being specific, you will be more motivated to reach your goal. For instance, make it your goal to have your own home by the time you are 35 or 40. It may be a studio condo unit or a three-bedroom home in a subdivision—it will depend on your income and how you save over the years. Having a goal will help you focus your efforts well.
5. Choose good debt over bad debt. Take out a loan only when the loan proceeds will be used to earn you more money. For instance, apply for a bank loan to expand a business that’s feasible. But to take out a loan to buy assets that depreciate quickly (examples: sports cars, yachts, etc.) may not be wise as these assets will not earn you enough to pay off the loan. If you really want to buy such assets, pay in cash so you don’t have to pay the cost of borrowing.
6. Share your blessings. There seems to be a unique mathematical formula at work: The more you give, the more you are blessed back in return. Help those who are in financial need, and you may find yourself blessed all the more. If you’re an employer, share profits with your employees; they’ll be more motivated to work for you, leading the way to increased productivity.
7. Train children to handle money well. It would be sad if money you earned will just be spent unwisely by the next generation. Teach children the basics of money management, and caution them against vices such as gambling, drugs, and the like. Being responsible about wealth will be rewarded in the long run.
Credits : Philippine Daily Inquirer
Saturday, April 12, 2008
How to Smell a Scam
Question: I just read recently about yet another investment scam that victimized a lot of people in the country, basketball stars included. They were duped in the millions of pesos and dollars. How can one tell if an investment scheme offered is a scam or not? I’d like to invest but want to be sure the plan I get is legitimate. — Joey
Answer: It’s sad to know that there are unscrupulous people who victimize unsuspecting investors. It has happened before several times, and it’s happening yet again. And this is not unique to the Philippines; investment scams have been reported all over the world for decades.
In fact, the notorious Ponzi scheme is named after Charles Ponzi, a man who cheated a lot of people in the US back in the 1920s. He became a millionaire in Boston using his investment scheme. The Ponzi scheme works this way: High returns are promised to would-be investors. The investors then plunk money into the company. More investors are enticed by the company and their money is used to pay off the promised high returns to the first investors. It goes on and on but will collapse later on as there really is no revenue generated. In the meantime, the owners of the company may have already fled with the investors’ money.
The pyramiding scheme is somewhat similar to the Ponzi scheme. However, investors are made to recruit new investors (to be called their “downlines”), and if they don’t, they won’t get much in return. There is no real product or service offered in a pyramiding scam, thus no revenue too. This scheme is also doomed to collapse, with the owners running away with the money.
Many investment scams have already victimized a lot of people in the country. In fact, the FrancSwiss Investment scam has made it to Wikipedia’s Notable Ponzi Schemes. According to that website, as of 2007, the company has allegedly victimized Filipinos to the tune of P1 billion.
How can you ensure that an investment proposition is legitimate and not a fraud? How can one tell if a scheme is a scam? Below are red flag signs to watch out for.
1. The investment plan offers or guarantees an interest rate that is much higher than prevailing market rates. In fact, these rates may be too good to be true. Beware of promises such as “50 percent return in 90 days,” or “double your money in 1 year.” These are unbelievable rates of return which the legitimate investment market will not be able to give.
Before signing up for an investment plan, study the prevailing market rates. Long term time deposit rates can go up as high as 6 percent per annum. Research on the Internet and go to legitimate websites of Philippine banks and financial companies and see how their mutual funds and unit investment trust funds are performing to give you an idea of the yearly average rate of returns. These may run up to only 20 percent per annum. Clearly then, a 100 percent return on your investment is very fishy.
2. The company does not take time to explain the concept of the investment thoroughly and pressures you into making a decision. They may give you testimonials of “satisfied” investors and just make a quick run down on the kinds of investments they will handle for you. Or they present you with awesome presentations of high risk investments you are not thoroughly familiar with, such as accounts receivable factoring, dollar hedging, commodities trading, etc., capitalizing on people’s unfamiliarity with such forms of investments and promising high returns.
Before you get into any investment, you should be given all the details of the offer or plan. You should also be given as much time as you need to study your options. Don’t ever be bullied into making an investment decision.
3. The company has no track record. When you get an investment proposal from a company you have never heard of, be extra cautious. Find out all that you can about the company: who started it, when was it incorporated, and what is the track record of the company so far. Some scammers may brag that they are a new offshore branch of a company based abroad that is why they have never been heard of. That’s even more reason to be cautious.
You can get information from the Securities and Exchange Commission, and from knowledgeable people among your network. When in doubt, do not transact business with that company. Instead, deal only with banks and established financial investment companies.
4. The company does not have a physical office address. If the company is legitimate and will handle investments from many people, they have to have a reputable office address, one that you can go into at any time of the day, or call by phone anytime during office hours. Take note though that there have been some companies with physical addresses that still turned out to be swindlers so be careful.
5. When you do finally invest, you have difficulty getting your money after some time. The returns may be very attractive at first, but in the long run, their checks may start bouncing, or you may be given promissory notes for the returns promised to you. Or they suddenly impose strict procedures, such as not allowing withdrawal for a very long period of time contrary to what was explained to you at first. When any of these happen, contact the Securities and Exchange Commission right away.
Investing is a good way to manage one’s money. Just make sure you go into it with legitimate entities.
Credits: Philippine Daily Inquirer
Answer: It’s sad to know that there are unscrupulous people who victimize unsuspecting investors. It has happened before several times, and it’s happening yet again. And this is not unique to the Philippines; investment scams have been reported all over the world for decades.
In fact, the notorious Ponzi scheme is named after Charles Ponzi, a man who cheated a lot of people in the US back in the 1920s. He became a millionaire in Boston using his investment scheme. The Ponzi scheme works this way: High returns are promised to would-be investors. The investors then plunk money into the company. More investors are enticed by the company and their money is used to pay off the promised high returns to the first investors. It goes on and on but will collapse later on as there really is no revenue generated. In the meantime, the owners of the company may have already fled with the investors’ money.
The pyramiding scheme is somewhat similar to the Ponzi scheme. However, investors are made to recruit new investors (to be called their “downlines”), and if they don’t, they won’t get much in return. There is no real product or service offered in a pyramiding scam, thus no revenue too. This scheme is also doomed to collapse, with the owners running away with the money.
Many investment scams have already victimized a lot of people in the country. In fact, the FrancSwiss Investment scam has made it to Wikipedia’s Notable Ponzi Schemes. According to that website, as of 2007, the company has allegedly victimized Filipinos to the tune of P1 billion.
How can you ensure that an investment proposition is legitimate and not a fraud? How can one tell if a scheme is a scam? Below are red flag signs to watch out for.
1. The investment plan offers or guarantees an interest rate that is much higher than prevailing market rates. In fact, these rates may be too good to be true. Beware of promises such as “50 percent return in 90 days,” or “double your money in 1 year.” These are unbelievable rates of return which the legitimate investment market will not be able to give.
Before signing up for an investment plan, study the prevailing market rates. Long term time deposit rates can go up as high as 6 percent per annum. Research on the Internet and go to legitimate websites of Philippine banks and financial companies and see how their mutual funds and unit investment trust funds are performing to give you an idea of the yearly average rate of returns. These may run up to only 20 percent per annum. Clearly then, a 100 percent return on your investment is very fishy.
2. The company does not take time to explain the concept of the investment thoroughly and pressures you into making a decision. They may give you testimonials of “satisfied” investors and just make a quick run down on the kinds of investments they will handle for you. Or they present you with awesome presentations of high risk investments you are not thoroughly familiar with, such as accounts receivable factoring, dollar hedging, commodities trading, etc., capitalizing on people’s unfamiliarity with such forms of investments and promising high returns.
Before you get into any investment, you should be given all the details of the offer or plan. You should also be given as much time as you need to study your options. Don’t ever be bullied into making an investment decision.
3. The company has no track record. When you get an investment proposal from a company you have never heard of, be extra cautious. Find out all that you can about the company: who started it, when was it incorporated, and what is the track record of the company so far. Some scammers may brag that they are a new offshore branch of a company based abroad that is why they have never been heard of. That’s even more reason to be cautious.
You can get information from the Securities and Exchange Commission, and from knowledgeable people among your network. When in doubt, do not transact business with that company. Instead, deal only with banks and established financial investment companies.
4. The company does not have a physical office address. If the company is legitimate and will handle investments from many people, they have to have a reputable office address, one that you can go into at any time of the day, or call by phone anytime during office hours. Take note though that there have been some companies with physical addresses that still turned out to be swindlers so be careful.
5. When you do finally invest, you have difficulty getting your money after some time. The returns may be very attractive at first, but in the long run, their checks may start bouncing, or you may be given promissory notes for the returns promised to you. Or they suddenly impose strict procedures, such as not allowing withdrawal for a very long period of time contrary to what was explained to you at first. When any of these happen, contact the Securities and Exchange Commission right away.
Investing is a good way to manage one’s money. Just make sure you go into it with legitimate entities.
Credits: Philippine Daily Inquirer
Friday, March 14, 2008
Speed Up Windows XP
Despite Microsoft's best marketing efforts, you haven't yet upgraded to Vista. You still prefer your trusty old copy of Windows XP. And, despite your diligence in protecting your beloved XP machine from viruses and sneaky trojan horses, Windows is noticeably slower than when you first installed it. Don't panic -- there are a number of things you can do to get your XP system running faster.
Keep in mind though, that, while these tips listed below can help you speed up Windows and recover hard drive space, you aren't going to see the sort of speed boost you'd get from upgrading your key hardware components. If you're unhappy, for instance, with the write speed of your hard drive, a few of these tips may help, but not nearly as much as upgrading to an ultra-fast Serial ATA (SATA) drive capable of 10,000 RPM. Also, adding more RAM almost always brings life to an older, slower system.
Defragment Your Hard Drive
Once the go-to solution for all speed problems in Windows, Windows Vista has largely eliminated the need for defragmenting by doing it automatically in the background. In Windows XP, however, defragmenting is still a fact of life.
Fragmentation happens when the computer writes files to disk without keeping everything together in one spot. Thus, if you just saved a large image you've been working on in Photoshop, part of it might be near the middle of the disk and part of it might be at the end, which means it takes longer for the disk to find it. Bring those separate parts together is what's known as defragmenting.
In XP, it's fairly simple process. However, note that you won't be able to use your computer while it's busy defragmenting. And if it's been a while since you defragmented, it can take some time. In other words, don't do this in the middle of busy day at the office.
To defragment your boot drive, open My Computer and right-click the disk you want to defragment. Select Properties and then click the Tools tab where you'll see the Defragment Now option. Just click Defragment and wait for the process to finish.
daBayrus personally use Auslogics Disk Defrag. It is extremely simple to use, does not require any analysis phase and is faster than most of the other disk defragmentation software. It will help you get the maximum performance out of your expensive hardware investments. And, what’s most important, it's absolutely free.
Improve Startup Times
Whenever Windows starts it automatically loads a number of programs, many of which you may not need. Unfortunately stopping programs from running at start-up isn't easy because there's several places these programs can live.
The three main places to investigate are the Startup folder, inside logon scripts and, in some cases, the Registry. By far the easiest of these is the Startup folder which can be found here:
C:\Documents and Settings\username\Start Menu\Programs\Startup
Just open the folder and delete the shortcuts to any programs you don't need when you start Windows.
Tip: You can also clean out the startup items by navigating to Start >> Programs >> Startup and then right-clicking items you want to remove.
To get to the other startup items, open up a command window and type msconfig. Look for the Startup tab and uncheck the box next to the program. Be careful though. Some items in here are required for Windows to function properly, and sometimes it's difficult to tell what a program actually is.
Tip: Maximize the window so that you can see the full file path to the application. In most cases, that will give you a better idea whether or not you need that application.
Another thing to clean is the Scheduled Tasks folder (C:\Windows\Tasks) where you can get rid of any programs that you don't want to run automatically on a schedule.
Keep in mind when you're disabling things that it's better to try them one at a time rather than disabling programs in large batches. That way if you restart and something isn't working you know the culprit.
Turn Off Unnecessary Services
Services are background processes that run silently without you ever knowing about them. Because Windows takes the everything-and-the-kitchen-sink approach there's likely to be some unnecessary services running in the background.
To get rid of them go to Start >> Run, type "services.msc" and hit return. Double-click on the service you want to get rid of and change the startup type to Disable.
Here are some examples of services you may not need: Alerter, Distributed Link Tracking Client, Fast User Switching, Indexing Service, Netmeeting Remote Desktop Sharing, Secondary Logon, Telnet and Workstation. There are dozens more you sift through to see if you need them and run a few rigorous web searches to see if you need all of them.
Use caution. If you disable the Computer Browser service, for example, you might find that you can no longer connect to computers on your local network. Before you make changes to unknown services, see if you can find a source that quantifies the exact performance gain you'll see from making this change. Many will only reclaim a few megabytes of RAM.
Clean House
Like most people, you probably have a number of files and programs you don't need that are eating up dard drive space. When it comes to files it's your call, but for getting rid of programs we recommend the free application CCleaner which is faster and much more thorough than the default Add/Remove application provided with Windows.
Optimize Your BIOS
The BIOS is a set of instructions that's hard-wired into your computer's motherboard. It stands for Basic Input/Output System, and it's responsible for initializing the hardware on your computer whenever it boots up. Tweaking your BIOS will only provide small performance gains on most computers, but on heavily-customized or recently upgrade older computers, it can make a noticeable difference.
Update Your BIOS. Most computer manufacturers and motheboard manufacturers regularly release updates to their BIOS versions. Check with the company which manufactured your computer or its motherboard for the appropriate download. You can usually find out which BIOS version you're running in the BIOS's settings. In the old days, they used to use floppy discs. Now, BIOS upgrades can be performed using bootable CD-Rs or installers that run within Windows. If you need to update your BIOS, the download should come with instructions.
Disable Unused Ports. Are you using that parallel port? What about the VGA port? Have a look at the back of your PC and see if there's anything that you don't have a monitor, scanner or some other peripheral attached to. Then, go into the BIOS when your computer boots and disable that port. You can usually find them in a menu called "integrated peripherals." If you need the port in the future, go back into the BIOS menu and enable it.
Turn Off Built-in Features On Your Motherboard. Most motherboards have a lot of the basics, like RJ-45 networking and sound, built-in. Some even ship with RAID controllers or other fancy hardware you're not using. If you've recently upgraded to a better sound card, you can disable the one that came installed on your board. Likewise if you installed a wireless card -- you won't be needing that Ethernet component any longer. Disable the built-in components you're not using by turning them off in the BIOS. Just like disabling ports, you can always turn them back on if and when you need them.
Additional Reading
Microsoft has some good advice for XP users on its website.
Credits: Wired How-to Wiki
Keep in mind though, that, while these tips listed below can help you speed up Windows and recover hard drive space, you aren't going to see the sort of speed boost you'd get from upgrading your key hardware components. If you're unhappy, for instance, with the write speed of your hard drive, a few of these tips may help, but not nearly as much as upgrading to an ultra-fast Serial ATA (SATA) drive capable of 10,000 RPM. Also, adding more RAM almost always brings life to an older, slower system.
Defragment Your Hard Drive
Once the go-to solution for all speed problems in Windows, Windows Vista has largely eliminated the need for defragmenting by doing it automatically in the background. In Windows XP, however, defragmenting is still a fact of life.
Fragmentation happens when the computer writes files to disk without keeping everything together in one spot. Thus, if you just saved a large image you've been working on in Photoshop, part of it might be near the middle of the disk and part of it might be at the end, which means it takes longer for the disk to find it. Bring those separate parts together is what's known as defragmenting.
In XP, it's fairly simple process. However, note that you won't be able to use your computer while it's busy defragmenting. And if it's been a while since you defragmented, it can take some time. In other words, don't do this in the middle of busy day at the office.
To defragment your boot drive, open My Computer and right-click the disk you want to defragment. Select Properties and then click the Tools tab where you'll see the Defragment Now option. Just click Defragment and wait for the process to finish.
daBayrus personally use Auslogics Disk Defrag. It is extremely simple to use, does not require any analysis phase and is faster than most of the other disk defragmentation software. It will help you get the maximum performance out of your expensive hardware investments. And, what’s most important, it's absolutely free.
Improve Startup Times
Whenever Windows starts it automatically loads a number of programs, many of which you may not need. Unfortunately stopping programs from running at start-up isn't easy because there's several places these programs can live.
The three main places to investigate are the Startup folder, inside logon scripts and, in some cases, the Registry. By far the easiest of these is the Startup folder which can be found here:
C:\Documents and Settings\username\Start Menu\Programs\Startup
Just open the folder and delete the shortcuts to any programs you don't need when you start Windows.
Tip: You can also clean out the startup items by navigating to Start >> Programs >> Startup and then right-clicking items you want to remove.
To get to the other startup items, open up a command window and type msconfig. Look for the Startup tab and uncheck the box next to the program. Be careful though. Some items in here are required for Windows to function properly, and sometimes it's difficult to tell what a program actually is.
Tip: Maximize the window so that you can see the full file path to the application. In most cases, that will give you a better idea whether or not you need that application.
Another thing to clean is the Scheduled Tasks folder (C:\Windows\Tasks) where you can get rid of any programs that you don't want to run automatically on a schedule.
Keep in mind when you're disabling things that it's better to try them one at a time rather than disabling programs in large batches. That way if you restart and something isn't working you know the culprit.
Turn Off Unnecessary Services
Services are background processes that run silently without you ever knowing about them. Because Windows takes the everything-and-the-kitchen-sink approach there's likely to be some unnecessary services running in the background.
To get rid of them go to Start >> Run, type "services.msc" and hit return. Double-click on the service you want to get rid of and change the startup type to Disable.
Here are some examples of services you may not need: Alerter, Distributed Link Tracking Client, Fast User Switching, Indexing Service, Netmeeting Remote Desktop Sharing, Secondary Logon, Telnet and Workstation. There are dozens more you sift through to see if you need them and run a few rigorous web searches to see if you need all of them.
Use caution. If you disable the Computer Browser service, for example, you might find that you can no longer connect to computers on your local network. Before you make changes to unknown services, see if you can find a source that quantifies the exact performance gain you'll see from making this change. Many will only reclaim a few megabytes of RAM.
Clean House
Like most people, you probably have a number of files and programs you don't need that are eating up dard drive space. When it comes to files it's your call, but for getting rid of programs we recommend the free application CCleaner which is faster and much more thorough than the default Add/Remove application provided with Windows.
Optimize Your BIOS
The BIOS is a set of instructions that's hard-wired into your computer's motherboard. It stands for Basic Input/Output System, and it's responsible for initializing the hardware on your computer whenever it boots up. Tweaking your BIOS will only provide small performance gains on most computers, but on heavily-customized or recently upgrade older computers, it can make a noticeable difference.
Update Your BIOS. Most computer manufacturers and motheboard manufacturers regularly release updates to their BIOS versions. Check with the company which manufactured your computer or its motherboard for the appropriate download. You can usually find out which BIOS version you're running in the BIOS's settings. In the old days, they used to use floppy discs. Now, BIOS upgrades can be performed using bootable CD-Rs or installers that run within Windows. If you need to update your BIOS, the download should come with instructions.
Disable Unused Ports. Are you using that parallel port? What about the VGA port? Have a look at the back of your PC and see if there's anything that you don't have a monitor, scanner or some other peripheral attached to. Then, go into the BIOS when your computer boots and disable that port. You can usually find them in a menu called "integrated peripherals." If you need the port in the future, go back into the BIOS menu and enable it.
Turn Off Built-in Features On Your Motherboard. Most motherboards have a lot of the basics, like RJ-45 networking and sound, built-in. Some even ship with RAID controllers or other fancy hardware you're not using. If you've recently upgraded to a better sound card, you can disable the one that came installed on your board. Likewise if you installed a wireless card -- you won't be needing that Ethernet component any longer. Disable the built-in components you're not using by turning them off in the BIOS. Just like disabling ports, you can always turn them back on if and when you need them.
Additional Reading
Microsoft has some good advice for XP users on its website.
Credits: Wired How-to Wiki
Watch Higher Quality YouTube Videos
Run a well-encoded video through YouTube's backend compression engine and it's going to turn out looking worse for the wear. It's a well-known critique of the site among videophiles, and to its credit, the video-sharing site has been promising it would start encoding videos at higher resolutions. Thankfully, YouTube is finally making good on that promise.
Select videos on the site are already available in 480x360 resolution -- it's not HD, but it is a step up from the old 320x240 format. For the most part, this change only affects newer videos and YouTube is rolling it out in a somewhat haphazard manner. Some the videos are identified on the site with a little link offering to take you to a higher res version, but if you want to see the high quality version by default here are a few ways to pull that off.
The URL Hack. Add &fmt=18 to the end of a normal YouTube URL. If there's a high quality version available, that extra string will cause it to load.
The Firefox Add-on. The team over at Lifehacker makes the Better YouTube extension for Firefox and the latest version of the add-on includes the URL hacking technique above (as well as some other goodies, like the ability to stop movies from auto-playing).
The Easily Overlooked Obvious Method. If you're logged in to YouTube anyway, just head over to your account settings page. Near the bottom you'll find a "Video Quality" option. Click that link and you'll land on a page where you can choose to always see the higher quality videos. Obviously, this requires you to login to YouTube, so if you don't want to do that, just stick with one of the methods above.
Even at the higher quality, YouTube videos aren't going to look good on an HDTV. But for smaller monitors and laptops, they may be good enough to at least watch in full screen mode without the video turning the chunky moving blocks of color.
Tips
If you're ripping YouTube videos to your iPod, Zune or other handheld, always grab the higher-quality version. Even though those screens are tiny, they show a lot of detail, so the extra quality goes a long way.
Credits: Wired How-to Wiki
Select videos on the site are already available in 480x360 resolution -- it's not HD, but it is a step up from the old 320x240 format. For the most part, this change only affects newer videos and YouTube is rolling it out in a somewhat haphazard manner. Some the videos are identified on the site with a little link offering to take you to a higher res version, but if you want to see the high quality version by default here are a few ways to pull that off.
The URL Hack. Add &fmt=18 to the end of a normal YouTube URL. If there's a high quality version available, that extra string will cause it to load.
The Firefox Add-on. The team over at Lifehacker makes the Better YouTube extension for Firefox and the latest version of the add-on includes the URL hacking technique above (as well as some other goodies, like the ability to stop movies from auto-playing).
The Easily Overlooked Obvious Method. If you're logged in to YouTube anyway, just head over to your account settings page. Near the bottom you'll find a "Video Quality" option. Click that link and you'll land on a page where you can choose to always see the higher quality videos. Obviously, this requires you to login to YouTube, so if you don't want to do that, just stick with one of the methods above.
Even at the higher quality, YouTube videos aren't going to look good on an HDTV. But for smaller monitors and laptops, they may be good enough to at least watch in full screen mode without the video turning the chunky moving blocks of color.
Tips
If you're ripping YouTube videos to your iPod, Zune or other handheld, always grab the higher-quality version. Even though those screens are tiny, they show a lot of detail, so the extra quality goes a long way.
Credits: Wired How-to Wiki
Subscribe to:
Comments (Atom)
