Feb 4, 2011

Repurposing the Blog

I've decided to repurpose this blog to have more consistent types of posts. Right now I seem to have a weird mix of personal stuff, rants, stuff I found on the internets, and web design/development.

So I got a couple of writers who want to come on board, and we've decided to go a bit more niche with it. Expect to find more useful and consistent information/posts.

NOTE: We may be deleting some of the older posts on here, changing the layout, adding some pages etc.

Feb 2, 2011

What's With Blog Titles These Days?

Lately I've seen a lot of blogs with titles like:
  • The Legendary Scribbles of ___________
  • The Mediocre Ramblings of ___________
  • The Incoherent Diary of ___________
And so on...

What's with that? It's like they're setting the reader up to be okay with mediocre posts, because well, it's in the title. That's ridiculous. It's not okay.

Now I'm not saying my posts are amazing, but let's be honest. They are. :D

Stop naming your blogs like your opinions don't matter, because if you think they don't, they won't. I always thought blogging was a great way to share unique thoughts and ideas, but the trend of title's like that and the advent of reblogging leads to exactly what the names say they are: meaningless scribbles and incoherent rambling. People should not be satisfied with mediocrity. It just doesn't make sense.

You don't have to be a genius to make a blog. And you don't need to be a genius to have excellent posts - you just have to stop being afraid that people won't like you.

Weekly Awesome #2

Thank you StumbleUpon for this weeks awesome. Who needs a weather app for your phone when you have this awesome, and always accurate, weather stone?

Feb 1, 2011

HTML5 Quicktip - Cut Out a Few Bytes

Everyone's been talking about all the exciting new features of HTML5, but the little changes sometimes get lost in the fray. You can start using these features now, they are currently supported in all browsers:

No more long doctypes! Save at least 100 bytes per request.
<!DOCTYPE html>

No more long meta tag, content-type and all that. Save a few bytes per request.
<meta charset="utf-8" />

And no need for 'type' tags in script, link, and style tags.
<link rel="stylesheet" href="awesome.css" />
<style></style>
<script></script>

All this can add up to saving a little bit of server resources. And as any web developer knows, a little goes a long way.

Idea for this post taken from a thread I was involved in at indie-resource.com

PHP 5.3 Quicktip - __autoload

With PHP 5, true autoloading is possible. No more calling 'include' for every script you have. All you need to do is define an autoload function like so:
function __autoload($class_name)
{
  include $class_name.'.php';
}
Note - This is the simplest example. You can go as far as to create classes for autoloading that will differ depending on the needed directory structure.

Now when you call classes, if they weren't included, PHP will look for them and call that function to load them.

Jan 31, 2011

When Things Are Slow

Things have been slow in the business department lately. There are some times when you need to wait for one department to finish something before you know your next move - this is one of those times for me. It won't last long, though. Anyone who's ever been involved with a startup knows that you get very little downtime, and the little you have you should relish.

I use my downtime to work on my own projects, or to freelance a little bit, or what have you. Maybe catch up on some video games, watch some netflix and just generally relax for a little while. How do you use your down time?

Jan 29, 2011

Optional Function Arguments

Today's a two-for-one post day. :)

I just read this article, which I must have missed in the mess of RSS feeds I subscribe to. It's an interesting tutorial, definitely worth a read. But what interests me so much is the first part - Passing optional or any number of function arguments.

Now PHP has a huge range of functions, and there are no doubt some you may not know about. A lot of my functions have optional arguments, sometimes written like so:
function foo( $argument = FALSE )
{
  if ($argument)
  {
    //Do something
  }
  else {
    //Do something else
  }
}

Anyway, I had never thought of accepting any number of parameters to a function using func_get_args(). And there are plenty of uses for a function like that. The php.net manual has some examples that illustrate some uses. But I can think of plenty more. For my PBBG for example, I might accept lots of different params in a function that points a user action to it's respective class.

It might look something like this:
function foo()
{
  $action = func_get_args();
  
  //The first argument would always
  //be the action's name
  switch($action[0])
  {
    case 'attack':
      //The second argument would
      //be the players attack stat in this case
      battle::attack($action[1]);
      break;
    case 'retreat':
      //Maybe speed in this case
      battle::retreat($action[1]);
      break;
    case 'cast':
      //And so on and so forth...
      battle::cast($action[1], $action[2]);
      break;
   }
}

This is obviously a simplistic example, but with some extra code this could add a layer of security to my application.

Here's another example that can be used to sanitize queries:
function mysql_safe($q) {
    $x = array_shift(func_get_args());
    return vsprintf(preg_replace('/%([1-9]):(d|s)/','%$1$$2',$q),
    array_map('mysql_escape_string',$x));
}

Comment if you have an interesting use for this function, or if you have a function you'd like me to do a post on. Happy coding!

Goodbye, Little Office

Hello, working from home again.

Before moving out
My company decided to become a non-resident of the incubator we reside in. This event spurred from a meeting we had about the need for the space. As a non-resident we still can use the space, internet and other tools they provide (interns, meeting rooms, conference rooms, etc), so there will really be no change other than the fact that we won't have a formal office.

After moving out

This isn't affecting me much, but there was something nice about being able to say "I'm headed out to my office. Be back in about 12 hours." Now it'll be more like "I'm headed out to the incubator. Be back in 4 or 5 horus."


Anyway the topic that comes to mind is this: The space where you work decides what gets done. If you don't like your work space, chances are you're not getting as much done as you could be. For us, the office was great, but it was a matter of balancing cost versus productivity. We got about the same amount of work done from our respective home offices, but we held less meetings. We decided that we would go back to working from home, but increase meeting time by using online meeting tools like Skype, and increase organization by utilizing tools like Tada List.

If you're starting a company, no doubt you're trying to get organized. This is far and wide one of the most important factors in improving productivity. If teams don't communicate well, things just don't get done. Try to figure out a workflow that is adaptable - if your team grows, the tools you use will need to be scalable to accommodate.

Jan 27, 2011

Weekly Awesome #1

This is an awesome coat hanger. Thanks to Google's "I'm feeling lucky" feature, I've decided to start a weekly broadcast of something awesome I've found using that feature. This is the first of many.

I found this here.

There seems to be a bunch more awesome stuff on that site. Maybe it's worth checking out. I didn't spend much time there, but the wine maker caught my eye, as did the "Shit happens!" bandaids. I probably won't ever buy anything, except maybe this coat hanger, but hey, it's worth knowing where you can find something cool when you want it. Definitely worth bookmarking for a gift or two.

Jan 26, 2011

Me On: Having Lots of Pets

I live with a ton of animals. The list includes a small hamster named Mao (rhymes with now), a turtle whose name escapes me, about a hundred fish, a cat, and five dogs.

I love the English bulldog, Dexter. He and I are pals.

Dexter taking a dog nap.
But sometimes it's tough to keep up. We manage it; but put together, all these pets can be a handful. Dexter has chased our cat, KiKi, down the street on a few occasions. The puli's tend to start barking fests at four in the morning. KiKi brings friends back when she goes outside. In fact, KiKi's such a social cat, so far she's made friends with a raccoon or two, several birds, and two or three other cats.

I can't tell you how many times I've been woken up by a howling chorus or by Dexter opening my door to come and sleep in my bed, because he's tired of his other ones - but, through all of it, I have to say there's nothing like being surrounded by your pets. They bring humor, love and compassion into an otherwise normal household.

Jan 25, 2011

Reviving an Old Project

So I was watching this video of an old flash game I was working on following a tutorial at ASGamer.com. I must admit, I haven't had much experience with Flash or AS3, but I had fun working with them. I don't remember why I halted development on this thing, but after watching the video, I kind of want to pick it up again.

At the same time, there are several other projects I've got going, and it might be a bit of a distraction. Every programmer I know has a similar dilemma. Often we abandon a project for awhile, and come back to it later. Sometimes we abandon one and never return to it.

I think for non-nerds it's hard to understand our seemingly short attention span. We, or at least I, tend to read an article online and suddenly become excited about this new idea I got from it, or this new framework I want to try, or ... well, you get the picture. I have to say, it's time for me to start getting my hobbyist projects organized.

So here's my question to you:
How do you deal with organizing your projects? Are you like me, and tend to get wrapped up in several at a time? If not, what's your secret?


Also, here's the video for anyone who wants to see it. It's a little drawn out, fast forward towards the end if you wanna see the boost power up! (probably not as exciting as I made it sound just there)



UPDATE: Unfortunately, the hard drive this was stored on just crashed, and I don't have a backup. But, maybe this is a good thing. I might redo this from scratch and if I do, maybe I'll do a post or two on AS3.

Jan 24, 2011

Node.js and the future of javascript



The future of Javascript is looking bright and shiny. If you follow the latest web development trends you'll probably have heard of node.js and web sockets and all the other beautiful things JS is doing these days.

I for one am very excited. I'm always looking for new and exciting mediums to deliver some web app (or to start on one that I may never finish), and node.js coupled with HTML5's web sockets seemed like a good platform to build the PBBG (persistent browser based game - see this) I've always wanted to make. (more on my PBBG in a future post)

I'm off to a rough start (it's always a little rocky when you're trying something new), but I've got a server up and running and I'm experimenting with the possibilities. I'll post progress articles in the future, suffice it to say that it seems like I'm going to be having a lot of fun with all of this.

Check out Node.js and Web sockets. I'd like to see what others come up with (there's some creative stuff out there utilizing these tools already)

Jan 22, 2011

The Start of my Blogging Career

I never really considered myself much of a blogger. But one fine day, just sitting around, me and a good friend of mine started discussing how Facebook and Twitter and any other social medium we find ourselves in are not provoking the kind of conversations we'd like to be having.

I sat on that thought for a few days. Facebook and Twitter don't promise to be anything that they aren't, and for that reason there's nothing wrong with them. But I want to share more than a couple sentences or some website that I thought was funny, so I began researching some blogging platforms.

My first thought was that I should develop my own. Did I mention I'm a mediocre web developer? Anyway, after finishing a simple CRUD platform with some flashy AJAX features, I realized I'd get more bang for my buck if I just used one of the great free services that are already available. Then began my research.

I found two articles comparing blogger and tumblr that I completely agreed with. This one and this one. After reading those, I realized that blogger was the way to go for what I wanted. As a web developer I am quite impressed with Tumblr. They definitely know how to grab users. Everything is so easy, what with being able to re-blog and post from your mobile. But that is exactly the kind of behavior I'm trying to get away from. Those sort of tools don't provoke new, fresh thoughts and ideas. They only perpetuate peoples' need to win some kind of invisible online popularity contest.

Anyway, I'll probably be posting in a large range of subjects. It'll probably include life in general, web design, development, stuff about technology, rants, stories, tutorials, and the occasional funny link.