Russellbits design portfolio requires Macromedia Flash. Get Macromedia Flash. If you have Flash installed, click to view gallery.
The latest from

Headquarters

Those Pesky NaNs

Now and then, as a result of calculating a matrix of numbers, you’ll get some strange results in certain spots in the matrix; namely if you divide something by zero, which as we all know is (say it with me) “not a number” or shows up as NaN in matlab.  For some of the work that I do with probabilities, these little gremlins show up on the edges of matrices, often surrounded by ones. Often I still need to continue with more matrix calculations and matlab won’t let you as long as there are NaNs in the matrix. So the simplest thing, for me, is to turn them into ones.1  The first way I accomplished this feat was to iterate through two loops the length of my two matrix and manually examine each result with isnan().

Unbeknownst to me, that was the brute force method. There is a much more elegant way to accomplish this little task. Assume that we have a matrix ‘A’ that has some NaNs in it. Behold:

A(isnan(A))=1

isnan() will return a matrix of the same size as the one that you give it, filled with true-false values (1 or 0) and by using this new matrix as an index for the original matrix, we can set all original values that have a new index of 1 to the value of 1! Tre simple, no?

My thanks to Dmitry for this one!


  1. Understand your application!  There can be many instances when these NaNs can be trying to tell you something.  You may not want to ignore them at all but rather examine why they’re occurring. 

Filed under: Code — Tags: , , , , ,

Wordpress and Formatting Poetry

This is a piece of the Hemingway theme that I’ve been trying to fix for a while.[^1]  I finally settled up to get ‘er done today.  The deal is, poetry has a lot of line breaks and sometimes the series of spaces (if your poetry is like mine) but the <pre> tag is a span tag and so not really appropriate to use for the whole of a poem—not to mention that you don’t want your poetry to look like code.

Read more…

Filed under: Code — Tags: , , ,

Schadenfrued Much?

“One of the few good things about modern times: If you die horribly on television, you will not have died in vain. You will have entertained us.”
- Kurt Vonnegut

Filed under: Uncategorized

Using Thickbox AND Simpleviewer

I totally haven’t tested this on many browsers, but I’ve managed to get the Jquery Thickbox 3.1 to load up Simpleviewer in a modal window.  You can see it work by clicking gallery at the top of this page.

Filed under: Code

A Ruby Convert?

A series of discoveries have led me to question my initial decision to stick with PHP and a PHP-based web framework (Symfony is my favorite) for the web, rather than switching to the vaunted Ruby on Rails framework.  The first discovery was just a simple article on the origins of Ruby.  Here, I have to admit a personal bias and say that if you asked me to choose between something designed by a Japanese designer and an American one, I would select the Japanese.  9 times out of 10, the object, the artifact if you will, will be less complex and more beautiful.1  And after working my way through this fantastic interactive tutorial, I really begin to get a feel for the simplicity of Ruby.  It’s actually aesthetically pretty—uncluttered and easy to parse (grammatically).  And the, finally, the kicker was this screencast tutorial of how to build a database driven blog in about fifteen minutes.  Woah.  So, I’m rolling up my sleeves and giving Ruby a try.  If I like it, I just might switch.


  1.  I’m note sure where this bias comes from by my friend [Osamu Koyama](I’m note sure where this bias comes from) has something to do with it. 

Filed under: Code — Tags: , , , , ,

It’s On, Congressman

For those of you who subscribe to my personal feed, which is all my goings-on all over the web, I’m sure you noticed the enormous barrage of activity there tonight. Make no mistake, barrage is a wholly accurate word for what I intend to be a flanking manuever on Google against Congressman Russell Warner (and no I will not link to his site and add to his Pagerank). For some time now I have been waging a campaign to become the dominate Russell Warner on Google. I was it, for a while, thanks to my very early arrival on the web. But I got knocked off the hill, as they say—I got too big for my britches and took it all for granted. And the hell of it all was that I was again number 1 for about two weeks before Congressman Warner overtook my lead (from second, I think).

But now, between the rejiggering of my blogs, Friendfeed, Lijit, and Claimid, I intend to get it all back! Beware Russell Warners. I’m coming for you, and no corner of the web is safe.

Jquery Sandbox

I’m pretty excited that I’ve finished my first real Jquery UI widget.  You can see it running over on Banapana.  It’s basically just a graphic dropdown menu that shows all the categories for the blog, highlights each button and hides itself when a Jquery “mouse leave” event occurs.  By the way, that’s one thing that I just love about Jquery—the incredibly simple and somewhat intuitive syntax.  The fact that it works exactly like CSS selectors is a huge boon to someone who already knows CSS, and the names for events and such are almost so straight forward that you don’t even have to look them up.  You can see some more of my Jquery work over at my Jquery Sandbox.

Filed under: Code — Tags: , , , , ,

Brazilian Girls

Just found Brazilian girls on my Pandora radio.  Super smooth.  There’s a nice infusion of electronic instruments that still leave the sound feeling mainstream, maybe even—dare I say it?—pop?  At any rate it feels more sophisticated than pop.  And probably my favorite aspect of the sound has to be the lead singer’s (never seen without eyewear, interestingly enough) laid-back relaxed (and sometimes electronically modified) voice.  The whole sound reminds me a lot of Telepopmusik and Hooverphonic–pretty vocals over nice electronica.  Especially their tune “Don’t Stop” will be in heavy rotation for the next few weeks.  I can tell.

On Last.fm: Don’t Stop

On iTunes: Don’t Stop

Using Simplepie

Well, part of my goal with this site was to pull together my various social web site pages, i.e. Flickr, blogs, Facebook, del.icio.us, etc.  So what I needed was a really nice php library that would help me parse feeds.  And oh boy, did I find it.  It’s called Simplepie and it’s just dynamite.  Great documentation, to boot.  If you’re a developer looking for something to work with feeds of any type, this is really an extraordinary library for PHP.  It took me all of about five minutes to put together a starter example–a php page that pulls in all my recent Banapana posts from Feedburner.  All right, all right.

WP Plugin: Random Background

This is a post that I created that will bla bla bla.  This post is a test for the Code page.

Filed under: Code
The Latest from me

On The Web

WOAH. Watching Fringe on the iPod looks even better than the TV! (via Twitter)

ruzel posted a message on Twitter
“WOAH. Watching Fringe on the iPod looks even better than the TV!”
Thursday at 7:38 pm - Comment - Like

First twit from my new iPod! (via Twitter)

ruzel posted a message on Twitter
“First twit from my new iPod!”
Thursday at 7:07 pm - Comment - Like

Syncing my new iPod. OMG the idea of carrying around my absolute favorite music is just incredible. And then there's the apps! (via Twitter)

ruzel posted a message on Twitter
“Syncing my new iPod. OMG the idea of carrying around my absolute favorite music is just incredible. And then there's the apps!”
Thursday at 6:54 pm - Comment - Like

Technology is Finally Catching Up (via Blog)

ruzel posted an entry on Banapana
Thursday at 6:00 am - Comment - Like

Everybody's Changing by Keane (via Pandora)

ruzel bookmarked a song on Pandora
Keane – One Tree Hill Music From The WB Television Series
Wednesday at 10:34 pm - Comment - Like

WedNov19

Hardwire by Metric (via Pandora)

ruzel bookmarked a song on Pandora
Metric – Grow Up And Blow Away
Wednesday at 7:50 pm - Comment - Like

Just ordered a band new MacBook Pro! My life inches closer to a geek utopia! (via Twitter)

ruzel posted a message on Twitter
“Just ordered a band new MacBook Pro! My life inches closer to a geek utopia!”
Wednesday at 6:01 pm - Comment - Like

Mad Scientists Under Attack… By Non-mad Scientists (via Blog)

ruzel posted an entry on Banapana
Wednesday at 1:06 pm - Comment - Like

@Moltz may I humbly suggest that you just put all your tweets together and publish in book format on lulu.com? (via Twitter)

ruzel posted a message on Twitter
“@Moltz may I humbly suggest that you just put all your tweets together and publish in book format on lulu.com?”
Wednesday at 12:41 pm - Comment - Like