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

Ya'lls know what I mean: Back to the lab: http://is.gd/9YzV --TREES (via Twitter)

ruzel posted a message on Twitter
“Ya'lls know what I mean: Back to the lab: http://is.gd/9YzV --TREES”
18 hours ago - Comment - Like

ichatting with my bro; though I am about to move on back to the lab (via Twitter)

ruzel posted a message on Twitter
“ichatting with my bro; though I am about to move on back to the lab”
18 hours ago - Comment - Like

@mileskahn Can we expect a Daily Show twitter in the not-to-distant future? (via Twitter)

ruzel posted a message on Twitter
“@mileskahn Can we expect a Daily Show twitter in the not-to-distant future?”
yesterday at 12:36 pm - Comment - Like

@warnerdan42 They're suddenly all doing really well and developing the correct strategies! (via Twitter)

ruzel posted a message on Twitter
“@warnerdan42 They're suddenly all doing really well and developing the correct strategies!”
yesterday at 12:32 pm - Comment - Like

Wow. I'm running iteration 4 of my experiment and the results so far are shocking. (via Twitter)

ruzel posted a message on Twitter
“Wow. I'm running iteration 4 of my experiment and the results so far are shocking.”
yesterday at 10:59 am - Comment - Like

@warrenellis I follow your twitter b/c it's funny. I had no idea you wrote Freak Angels. The first book was awesome! (via Twitter)

ruzel posted a message on Twitter
“@warrenellis I follow your twitter b/c it's funny. I had no idea you wrote Freak Angels. The first book was awesome!”
yesterday at 10:24 am - Comment - Like

MonDec1

...with the exception of the fact that I am DELETING all songs with DRM. Goodbye DRM, you were annoying as hell while I knew ye. (via Twitter)

ruzel posted a message on Twitter
“...with the exception of the fact that I am DELETING all songs with DRM. Goodbye DRM, you were annoying as hell while I knew ye.”
Monday at 7:59 pm - Comment - Like

Wow. With this new machine I have finally united my music collection in one place. What wonderfulness! (via Twitter)

ruzel posted a message on Twitter
“Wow. With this new machine I have finally united my music collection in one place. What wonderfulness!”
Monday at 7:55 pm - Comment - Like

No sooner do I leave the office than it starts to hail. HAIL! Surely, this is God's way of saying, "No pizza for you!" (via Twitter)

ruzel posted a message on Twitter
“No sooner do I leave the office than it starts to hail. HAIL! Surely, this is God's way of saying, "No pizza for you!"”
Monday at 4:41 pm - Comment - Like

@warnerdan42 P.S. if you get this message, hop on ichat (via Twitter)

ruzel posted a message on Twitter
“@warnerdan42 P.S. if you get this message, hop on ichat”
Monday at 3:59 pm - Comment - Like