Drupal taxonomy snippet - get all terms for a vocabulary

I was unable to find this anywhere online, but it's a pretty basic one - get all terms for a vocabulary and create a list with their names...

<?php
/*
* Get all terms for a vocabulary
*
* @author Benjamin Lowenstein, Colingo Labs LLC
*/

// set vocabulary id #
$vid = 1;

$sql = "SELECT * FROM {term_data} WHERE vid = %d";
$result = db_query(db_rewrite_sql($sql), $vid);

$terms = array();

while (
$data = db_fetch_object($result)){
 
$term = $data->name;
 
$terms[] = $term;
}
echo
theme_item_list($terms);
?>

delving into JavacriptMVC

Back-story: I just started a new big web app project today.

In my never-ending quest for better front-end javascript design patterns, I decided to give javascriptMVC a shot. Their tagline?

JavaScriptMVC is a framework that brings methods to the madness of JavaScript development. It guides you to successfully completed projects by promoting best practices, maintainability, and convention over configuration.

Removing all .svn directories

HOWTO Recursively remove all svn directories from a directory... yay I love shell scripting. BE CAREFUL WITH THIS!!

find . -type d -name ".svn" -exec rm -rf {} \;

Beer at House of shields!

After a extended virtual relationship consisting of some 10000 emails, instant messages, and phone calls, I finally had the pleasure of finally meeting Jason and Jeff from Initsoft yesterday at House of Shields in downtown SF - only wish Salim could've made it!

Here's the proof, taken with my OLPC XO -

Imitation and Context

In case anyone is ever curious: Here's a paper I wrote my last year at Oberlin College about the evolution of human language. It summarizes a lot of scientific literature suggesting that human speech evolved from hand gestures, as well as talking about genes likely involved in human speech. It mentions Chomsky, Pinker, and many more...

I've been getting back into neurolinguistics lately as I return to working on Colingo and realized that I had never made this paper publicly available. Let me know if you find it interesting!

USB problems with VMWare Server 2 and Ubuntu 8.10 - AKA how I got my webcam to work in vmware

Can't get VMWare to recognize your USB devices even though you added them to your virtual machine in the VMWare console?

1) sudo gedit /etc/fstab/
2) Add this at the bottom

# code to get VMWare to recognize USB devices
usbfs /proc/bus/usb usbfs auto 0 0
none /proc/bus/usb usbfs devgid=46,devmode=664 0 0

3) Save and close gedit, then sudo shutdown -r now to reboot.
4) When you reopen VMWare you might have to manaully connect to the USB device in question...(In my case, the camera)

My first red5 flex video recorder

So this is a bit cooler than adding two numbers together....
Here's my very first bare-bones Flex / red5 video recorder, and a few lessons I learned in creating it.

1) Red5 handles NetSteam's .publish() methods automagically. In other words, your java application does not have to do anything except extend ApplicationAdapter to let you use it from Flex to record video. In fact, if you don't want to tinker with java/red5 at all, you can just use a demo application like oflaDemo as your NetConnection hookup. So if you have red5 running out of the box and do:

Eureka! My first red5 application!

Boo-ya! Finally got this working! My "Hello world" red5 app is attached...It's nothing fancy (adds two numbers together and spits it out in the eclipse debug console), but I couldn't find a good template to work off of that used red5 v.8 and Flex w/ AS3, so here it is.

You'll need Adobe Flex Builder set up in Eclipse to run this.

Installation:
1) Unzip myapp.tar_.gz and place myapp/ in ~/projects/red5/dist/webapps
2) Unzip red5test.tar_.gz and place into your eclipse workspace.

Setting up Eclipse to work with red5

Look at you...you've finally got red5 built from source. Now you're getting greedy and want to try developing for it.

Indeed, building at the command line has a nice nerd-factor, but building within Eclipse is wayyyy more practical for plugin development.

We're going to add some plugins to Eclipse:

1) Open up Eclipse
2) Go to Help > Software Updates > Find & Install

Installing red5 from source on Ubuntu 8.10

I had a hell of a time trying to figure out how to properly configure my Ubuntu system for red5 application development. If all you need is red5 server, go ahead and use the prepacked .deb installer.

However, if you want to build your own red5 apps (or have a generally masochistic personality) you're gonna want the bleeding edge red5 from trunk (v .8 r3 at time of writing).

Syndicate content