|
No Comments »
The Philippines is becoming a hub of global communication and technology, including increased use of YouTube Philippines
Countless numbers of people all over the world use the internet on a daily basis. The numbers are especially impressive in the Philippines, with up to 30 million Filipinos accessing the web regularly, to shop, study, search for opportunities and ideas or even to create new businesses and connect with each other. Interestingly, the online population here is growing more rapidly than it is in the rest of Southeast Asia, and even the West. The statistics show that North America is growing at three percent and Europe is growing at eight percent, while the Philippines is growing at a massive 16 percent.
A prime example of the how the Philippines is growing on the internet is through the use of YouTube. In many countries, it is common for people to surf this site to watch funny, interesting or informative videos, before playing Partypoker or checking their e-mails. YouTube is growing regularly, with over three billion video views every day, up from two billion last year. Especially in Asia, there is a real feeling of growth and YouTube is becoming the ultimate democratic form of media. Anyone can record a video and put it up on YouTube, and with increasing numbers of people owning video cameras or mobile phones, capturing videos is becoming easier all the time.
YouTube officially launched in the Philippines last October 13th, with a localised version of the website called YouTube Philippines. These localised forms of the site mean that local content can be viewed and added to, so that it is always relevant to a specific place and the people of that area will be interested in it. Providing geographically relevant content lures in users who live in one place and connects them to an online community.
|
No Comments »
Problem: Help! Iis it possible to pass the values of an array as an argument in my function?
Anwer: Conveniently, Yes! You can indeed use set an array as the argument of a function.
var mapArgs = [0,20,50,10];
draw.apply(this, mapArgs);
function draw(x1,x2,y1,y2)
{
// do something…
alert(x1 + ‘ ‘ + x2 + ‘ ‘ + +y1 + ‘ ‘+ y2);
}
Of course you can use it in a more creative way
var run = { ready : ["Is this awesome?"], getset : ["or…"], go: ["What?!"] }
var func = {
ready: function(str)
{
alert(str);
},
getset: function(str)
{
alert(str.toUpperCase());
},
go: function(str)
{
alert(str + ‘!!!’);
}
}
for (x in run)
func[x].apply(this, run[x]);
|
No Comments »
Problem: Help! Is it possible to loop or iterate through each object’s key/value pair like an array?
Answer: A very useful trick for iterating over objects is the use of (for x in object), with this you can completely use objects as array!
myObject = {
“this” : “value1″,
“is” : “value2″,
“awesome” : “value3″
}
for (x in myObject)
alert(‘key : ‘ + x + ‘ / value : ‘ + myObject[x]);
|
No Comments »
Problem: One of the problems we find when using setInterval and setTimeout functions in javascript is how the special variable this is switched to the window object on the instance the function executes inside the interval.
Answer: Store the current object in a variable (for this example, the variable is called self) and use that variable for your interval’s function instead of this.
function foo()
{
this.init = function () {
var self = this;
this.interval = setInterval(function(){ self.update(); }, 1000); // this can be setTimeout
};
this.update = function () {
this.counter++;
console.log(this.counter);
};
}
Json Example
|
No Comments »
You can’t use the root user when SSH’ing to WHM but what you can do is issue a SU command once you’ve logged in with another user which isn’t root. On some occassions, you may encounter a no permission error when doing this.
Problem: Help! I can’t seem to login as root in whm so I need to do a SU command instead but i’m getting a permission error!
Answer: In your whm panel, access Security Center -> Manage Wheel Group Users and you will be able to assign the username to the group that allows SU
And that’s the solution to your problem!
|
No Comments »
A common problem for those aren’t aware of using linux are locating certain files(this is when troubleshooting, or simply doing steps from a guide)
Problem: I’m looking for a file in linux! How do I find this?
Answer: You can easily find a file by using the find command:
find / -name “httpd.conf” -print
Note: the -print option will print out the location of the name, / represents what location to start.
If you are interested in knowing more about the find command, look no further than the following link:
http://www.ling.ohio-state.edu/~kyoon/tts/unix-help/unix-find-command-examples.htm
|
No Comments »
Headers already sent issue?
Here’s how to fix one of the most common problems in frameworks and websites:
Problem: Help! i’m getting the errors and/or warnings – “Headers already sent!“
Answer #1: Check the php files which are usually found in your headers(the ones which are loaded first, typically config.php) and look for extra spaces before your <?php start tag and spaces after ?> end tag. Delete them and voila! Problem Solved!
Answer #2: Check your header scripts(The first few lines of code) and make sure you’re not outputting anything(e.g: an echo, sprintf or a warning message) before using header.
|
No Comments »
_Problem_: Help! I’d like to make it so my query results to be a comma delimited format!
_Answer_: No problemo! Simply use mySQL’s group_concat function and you’ll get your results in comma delimited values!
SELECT GROUP_CONCAT(id) FROM users WHERE authenticated=1 ORDER BY NULL LIMIT 1
Note: (Optional) ORDER BY NULL is used to prevent unnecessary sorting with filesort
This query would result to:
1,3,4,6,11
That’s It! This is pretty useful when you are going to use the SELECT… IN statement for your subqueries.
|
No Comments »
Awesome, it seems that mySQL now supports the OFFSET clause.
This is very useful for paginating your SQL statements.
The following will return the first 10 entries of your select statement:
“SELECT field FROM table LIMIT 10″
This, on the otherhand, will OFFSET your result by 10, selecting your entries #10-20:
“SELECT field FROM table LIMIT 10 OFFSET 10″
Here’s an example of how to capture entries #10-30:
“SELECT field FROM table LIMIT 20 OFFSET 10″
Things just keeps on getting easier and easier!
|
No Comments »
_Problem #1_: How do I simplify my mySql where queries?
_Problem #2_: How can I search through an array in my where statement?
Answer: An awesome trick when it comes to querying multiple where clauses is to use the WHERE <…> IN command.
$id = ’1,4,3,6,8,2′;
“SELECT * FROM <…> WHERE id IN ($id)”
Oh and did I mention you can prepend the NOT statement to show results which is NOT included in the list?
$id = ’5,7′;
“SELECT * FROM <…> WHERE id NOT IN ($id)”
Oh-Some!