Organizing Code

June 8th, 2009

One of the reasons I’m quick to start a project is because the concept’s still fresh in my head. The structure, purpose, and even some of the code is all there, and unless I find a way to translate it to paper or computer, I’m going to lose it. It’s this method of work that harms me in the long-term. Sure, I might be able to write out the idea itself, but on the screen, it’s a bunch of garbled text, nonsensical just days later. There’s got to be a better way to figure out how to organize my thoughts.

Perhaps the Getting Things Done philosophy may help me out. With only a few weeks left of summer before classes start and programming takes to the back-burner again, I’d like to try out GTD and see if it’ll help me produce better code at a faster interval. What’ve I got to lose?

Incorporate Wordpress in Scripts [PHP]

May 5th, 2009

For a new project of mine I wanted to incorporate some posts in Wordpress into a few pages. No comments, just the items themselves. That way, it’d be easy to edit existing posts and to make new ones appear without too much fuss. This is the code I came up with. Note that I catch all the output that Wordpress makes so I can manipulate it later on.

define('WP_USE_THEMES', false);
	require_once('./path/to/blog/wp-blog-header.php');
	ob_implicit_flush(false);
	ob_start();
		// $cat is a category number. If you don't want to filter
		// to a specific category, remove &category to display
		// all latest posts.
		$posts = get_posts('numberposts=10&category='.$cat);
		foreach ($posts as $post)
		{
			start_wp();
			echo "<h2>";
			the_title();
			echo "</h2>";
			the_content();
		}
	$buffer = ob_get_contents();
	ob_end_clean();

This is an interesting followup, to learn what queries one can make to Wordpress.

Quick Idea

April 28th, 2009

Track what’s been played on GeeksRadio utilizing Sam’s code and storing in a database the plays. Able to track most played and last played.

EDIT: Got the basics down. Located here, it simply aggregates the song and artist for now. Once I’ve built a collection of previous plays, I plan on adding additional features. This in particular perks my interests.

Change of Mind

March 7th, 2009

Switching career choices can be one of the most strenuous things out there. All progress made in one field usually doesn’t compare or transition to your new one, and it truly is starting anew. This is the situation I currently find myself in. Sure, I’m not entrenched in the former field, but I had a pretty good mindset of what my next few years were going to be. Now? Not so much.

“Working with computers” has become as vague as “working with English.” One could be an author, news reporter, analyst, translator, or any countless other professions, similar to how there are a growing amount of different computer-related job titles out there. One needs to define the field within they want to focus on to be successful, or in some cases even proceed in their education. Of course, the path chosen defines the job they’ll eventually get, putting more pressure on the decision of their lifes. It’s the pressure that’s keeping me from pursuing a particular field. I like computers in general: The networking and the efforts to reduce bandwidth while still conveying the same amount of information; the choices made in interface design to make more intuitive UIs for consumers; the ability to handle tens of thousands of concurrent connections without screwing everything up. It’s all interesting, and I want to learn it all.

Perhaps I need to dwell on this some more; think of the experiences and people I’d encounter in each field; find out the places I’d be able to go. My father travels the United States training others and crafting database schemes for businesses. I’m not quite interested in the databasing, but training others and travel certainly sounds interesting. Until the decision is made, I doubt much’ll be done on the blog. Certainly expect lengthier posts when they come. I love me some substance to read in my RSS feed subscriptions. I’d hope you would to.

Thank you

February 3rd, 2009

I’d like to thank Tim Burke for providing hosting for this blog. You can follow him on Twitter at twitter.com/timburke

Windows 7 Comments

January 21st, 2009

A few things I notice about Windows 7 Beta:

  • Still doesn’t detect my SATA hard drive. Needed to manually install the drivers. Not a hassle, but disappointing realizing I had to install to my IDE drive as I didn’t have them on a disc.
  • Games are sluggish. I’ve got a 1.5GB computer with a  Radeon 9600. Not the best by any means, but it ran Team Fortress well enough to average over 20 frames per second. Now I consistently pull around 15 frames a second, quite a drop and putting it at the border of unplayable.
  • Grabbing the window and resizing it to the top of the screen causing it to extend vertically to take up all space is nice, but there are times when there are windows lying below it, causing the window to be covered up. I’d love to be able to disable this feature, but I don’t even know what it’s called.
  • Love the Windows + T key combination to select the task bar. Very helpful for those on laptops with a trackpad that can be horrid to use.
  • Dragging a window to the side of the screen to make it half the size of the screen doesn’t seem to work completely with multiple monitors.

Some minor nuiconces, but I’m sure newer computers don’t face some of those issues, and mainstream consumers don’t even use multiple monitors yet.

Google Reader’s Future

January 16th, 2009

Google recently announced they’d be closing some of their less popular services, the ones that they couldn’t successfully monetize. While Google Reader wasn’t among those announced, with the closing of Google Notebook many realized that nothing is safe.

As Google Reader doesn’t utilize advertising, it’s only purpose apparent is to provide statistics as to popular blogs, posts, topics, etc. While Google hasn’t provided a Reader-flavored Zeitgeist yet, it certainly doesn’t appear out of the question. That is, if the service isn’t shuttered in an effort to “focus efforts,” especially considering their new browser, Google Chrome, is still very new and in need of developmental resources as much as possible.

As for Reader’s competition, Bloglines is the only relevant one in the market for online RSS readers, and the traffic to the site has been declining in recent months as users flock to the interface Reader provides. Unless Google comes out and says something definitive of Reader soon, many may switch over to Bloglines or a desktop client in anticipation.

Tumblr in PHP

January 1st, 2009

Tumblr Lookup in PHP utilizing Simplepie.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function tumblr($msg)
{
include_once('simplepie.inc');
$feed = new SimplePie();
$feed-&gt;set_feed_url("http://{$msg}.tumblr.com/rss");
$feed-&gt;init();
$feed-&gt;handle_content_type();
if ($feed-&gt;data &amp;&amp; count($feed-&gt;get_items())&gt;1)
{
$items = $feed-&gt;get_items();
$item = $items[0];
$msg = $item-&gt;get_title() . "; Posted " . $item-&gt;get_date('j M Y');
}
else
$msg = "Nuttin' found der. You eff up the username or sumting?";
echo $msg;
}

IRCBot Dec 31

December 31st, 2008

With a new year coming comes a new bot built from scratch. This time I’ve improved, making changes over previous versions, and planning structural changes for the future. The greatest fix I found was changing the regex rules so as to catch the IRC triggers always at the beginning of the line, and not in the middle as abused by some. As well, I realized the regex had the ability to check for arguments there, saving me code in functions and making it easier to work through. Lastly, I’m working towards modulizing my functions, separating each one into their own page that can be loaded individually. Still don’t have it working, but it’s getting there. Hope to have a working version up soon. :)

Databases.

December 29th, 2008

Fuck ‘em.