Great Gadgets: Solar-Powered Fan Cap

Published on Aug 31, 2009   //  Gadgets

solarhat

As sad as it may sound, we’re coming up on the end of summer. The kids are going back to the school and it won’t be long before the leaves begin to fill the sky with autumn colors. Even so, it can still be quite warm outside and there’s no harm in stocking up on supplies for next summer, right?

Wearing a regular baseball cap can be helpful on sunnier days, because it can provide your face with a bit of shade, but that’s not enough. Instead, you might want to consider this crazy Solar Fan Cap from Brando. The main construction is like a regular white cap, but you’ll notice that there are two solar panels integrated into the brim. These powered the single fan that shoots through the center of the brim, blowing cool air onto your face.

Because it is solar powered, you could say that this fan cap is quite the green solution for keeping you comfortable during the hottest days in the summer. On cloudy days when the solar panels aren’t fed with quite as much power, it’s likely that you won’t need the cooling fan anyway. That’s green and that makes perfect sense, right?

Check out the Solar Fan Cap for $16 through Brando. They ship worldwide.

WordPress Developing: Following Development

Published on Aug 30, 2009   //  Development

WordPress Development

If you’re interested in the development of WordPress, you may be interested in following along during its development cycles. If you plan on contributing code to WordPress, this will help you stay more current and allow you to make more-relevant patches.

One of the more obvious ways to keep up with development is to run a copy of the in-development version (trunk) of WordPress. You can do this by doing an SVN checkout on http://svn.automattic.com/wordpress/trunk/ and setting WordPress up normally. After that, you can do an SVN update to merge any updates with your local copy.

Along with running the current development version, you may want to be notified whenever something is checked in to the WordPress repository. There are multiple methods of getting these notifications. You can receive them by email, an RSS feed or Twitter.

There are also multiple mailing lists for the discussion of the development of WordPress, all of which are listed here.

In the Sphere: A Picture of Health

Published on Aug 28, 2009   //  In the Sphere
Off

While it is easy to chase after your monetary goals and to enjoy yourself on the weekend, it is also far too easy to let your health hit the backburner to be forgotten and neglected. That’s not a holistic approach to life and it’s not a lifestyle that your mind and body need to endure. We need to take better care of ourselves each day and these five posts should help to point you in the right direction.

RT Cunningham starts us off by looking how we go about treating our allergies and sinus problems. You may be inclined to reach for the nearest medicated nasal spray, but it may be healthier in the long run to use saline nasal sprays instead. There is a growing pandemic of medicated nasal spray addiction and you don’t want any part of that.

John Grohol switches gears and goes inside our heads. He reminds us that while we may think otherwise, we are not good multitaskers. By trying to multitask, you could actually be reducing your overall productivity, since you are spending all of those micro-moments switching between tasks. This can add unnecessary strain and stress to your brain too.

Health Castle takes a look at the choice of breakfast for the kids going back to school. Do you know how to choose the best cereals for back-to-school breakfasts? Skip the cartoon characters, be wary of the zero trans fat claims, and keep it as simple as possible.

Israel Lagares has always been above average in terms of size and weight, but he’s working hard to stay healthy and to keep his body in tip-top condition. At his most recent check-in, Israel discovered that he is 31% body fat. His first goal is to get this figure to 25%, but his ultimate goal is to get it in the 10-15% range. Offer him some words of encouragement!

Jessica Gottlieb has found a rather depressing turn of events in today’s society. We want to strive to be the best that we can be, but it seems that more and more people are embracing mediocrity instead. She doesn’t want to watch a mediocre athlete at a sports game and she doesn’t want a mediocre reporter telling her the news. She expects better.

Marketing 101: Inexplicable Introduction of Accents

Published on Aug 27, 2009   //  Marketing Tips

With so many television commercials aired each day, it is far too easy to get lost in the mix. That’s why you want your television ad campaign to be unique and memorable, in addition to have a strong message that will induce potential customers to inquire further about your products and to make that all important purchase. However, there are so many commercials that really make very little sense.

You may have seen the relatively recent ad campaign promoting Coke Zero (you can watch one of them on YouTube) featuring a series of talking body parts. The blind tongues are tasting the Coke Zero, unaware that they are drinking anything other than the original Coca-Cola formula. To them, it tastes identical. The eye, without the ability to taste the product, informs the tongues that they are not drinking the original Coke. Finally, the brain shows up to tell them to shut up.

I have two main questions about this ad campaign that I would like to see clarified, since they don’t seem to make any intuitive or logical sense whatsoever. First, the eye and the tongue are both depicted with leg-like appendages, allowing them to “walk” around on the set. Why, then, is the brain not provided with a similar walk-enabling appendage? It has two arm-like extensions, but it moves around on what appears to be a wheelchair. Is there a hidden message to this depiction?

Second, the eye speaks with what sounds like a French accent. Coca-Cola Bottling Company is an American company and, as far as we can tell, the tongues and the brains speak with typical American accents. The possibly pretentious eye, however, has a foreign accent. Are we being led to believe that sight is a foreign sense in some ways? One that should be ignored?

While I think that Coke has done a good job in creating a memorable ad campaign (albeit one that is mildly disturbing in appearance), there are some inexplicable details that don’t make any sense. Does this hurt their effectiveness? What do you think? How do you explain the “French” eye character?

Everything PHP: Counting Rows

Published on Aug 27, 2009   //  Development

Everything PHP

At some point in time, you’ll need to know either how many rows were returned in your result resource or how many rows match your query. While these two may seem the same, they use different methods to get the result and how different use cases. As such, we’ll take a look at these separately.

Number of Rows Returned

In your code, you may want to check how many rows where returned to you from your query. Commonly, you’ll check to see if you have more than 0 (or not 0) rows to work with (otherwise you may encounter errors while trying to process non-existing rows). We will accomplish this by using the mysql_num_rows() function, which takes a resource as a parameter. You cannot give this function the result of mysql_fetch_assoc() (or similar), the original resource is required. The function will return the number of rows. Let’s have a look at an example of this function:

[php]$query = mysql_query("SELECT * FROM posts");
if (mysql_num_rows($query) > 0) {
// Do something with the data
}[/php]

Number of Matching Rows

This method allows you to retrieve the number of rows that match your query, without actually retrieving the data. This is preferable if you will not need this data, as you will not need to waste processing power to download the data. With this method, MySQL will do all the heavy lifting and give you the result as a single “row”. This method utilizes a select query, where you wrap the field in COUNT(). For example:

[sql]SELECT COUNT(*) FROM posts WHERE type=’page'[/sql]

On the PHP side, you will still get the standard resource returned to you. If you use mysql_fetch_assoc() on it, the array key of the number will be what you used in the query (in this case, the key would be COUNT(*)). Because that will look messy in your code ($array[‘COUNT(*)’] is a pain to type out), you may choose to use mysql_fetch_row(), which will return a numerical array to you (so you would use $array[0] instead to get the number of rows). Let’s have a look at an example:

[php]$query = mysql_query("SELECT COUNT(*) FROM posts WHERE type=’page’");
$array = mysql_fetch_row($query);
echo ‘Number of pages: ‘ . $array[0];[/php]

The Main Difference

The main difference between these two methods is the fact that with the former, you have all the data that you’re counting available to you. With the latter method, you don’t have the data available. If you just need the number of rows (without needing the data) use the second method, which will be much quicker and less resource-intensive.

WordPress Wednesday: Reverse Chronological Comments

Published on Aug 26, 2009   //  WordPress
Off

The default configuration for a WordPress-powered blog is to have the reader comments displayed in chronological order. That’s how they appear here on the BlueFur blog and that’s how they appear on Beyond the Rhetoric, among the countless other blogs out there that accept user comments on the posts. In doing this, the oldest comments show up on top and the newest comments show up at the bottom.

This sounds like it would be the most logical way to display comments, but some of you may want to go the other way. By having the comments displayed in reverse chronological order (newest on top), you can effectively eliminate the possibility of having users post a “first!” comment purely for the reason of always showing up at the top of the comment list for that post. This can be a problem for more popular blogs.

Thankfully, reversing the order of the comments on your blog is actually a very easy process and it only involves altering a single line of code in your WordPress theme. If you go into the comments.php file for your theme, you’ll find a specific snippet of code that looks like this:

foreach ($comments as $comment)

Add in an extra line of code above it that reads as follows:

$comments = array_reverse($comments);

And that’s all you need to do! Most WordPress themes will have that first line in their comments.php file, but there may be some that don’t. Naturally, this modification will not work for those themes.

Page 1 of 712345...Last »