Categories
Programming

Change of Theme

I like the basic design of TwentyTen (the WordPress default), but I didn’t like the stock header choices. After some time thinking about it, I decided that there should be something dynamic up there. Dynamic is more invasive than just an image swap, and thus some theme customization is required.

I didn’t want to deal with a completely custom theme, nor with being able to update WordPress if I hacked on TwentyTen directly. A bit of Google querying turned up the idea of Child Themes. WordPress allows you to make a new theme that starts by inheriting from an existing one (see http://codex.wordpress.org/Child_Themes).

So, I made the directory for my new theme, set it to inherit from TwentyTen, then started digging around for how to control the header. The header is pretty tied to just supplying an image referred to by the database (with all sorts of logic for changing the image based on the post/page being viewed), with no hooks for writing your own header HTML code, so I just copied the entire header.php, and whacked out the image.

Now, the question is what to use for the new banner. I ended up deciding to use Processing.js for the banner. This has the advantage of being fairly easy to program. The downside is that it uses the canvas element, and so some web browsers won’t be supported now, and it probably won’t run as fast as limiting myself to div/img sprites would. However, on the upside, I don’t have to reconsider the choice every time or limit myself only to simple sprites.

My goal is to periodically change the banner now. The first program running up there is taken from the header of the Processing.js web site. I changed the canvas size to match WordPress header sizes, and I made some minor graphical changes. The original source code is here. My modified source code is here. At some point, I’m going to move the header above the Processing.js app into the Processing.js app to save some space, but I haven’t gotten there yet.

At this point, I hope to periodically (maybe monthly) write new banners to go up there.

Categories
Family

David on Easter

Categories
Reviews System Administration

HTPC

Back in September, I posted about evaluating an Intel D510MO board for HTPC applications, and determined that it wasn’t good enough.

Now, I am trying again with an Atom 330 / ION motherboard. This is a slower CPU, but a faster Nvida graphics chipset. Last September it still wouldn’t have done the job, but as of a few weeks ago it comes closer. The key change is Adobe’s Flash 10.2, which finally supports hardware assisted video decoding.

With this new box, I first tried XBMCLive. My plan was to use the launcher feature to launch Hulu Desktop as well. After the install, things somewhat worked. It took some fiddling to make HDMI audio work, but it turned out that the answer was on the XBMC faq. However, it used a lot of the CPU power, all the time, and I could never get Hulu desktop working acceptably.

Yesterday, I reloaded with Ubuntu 10.10, then installed the current Nvidia drivers, Hulu Desktop, and XBMC. Things are much closer to just working. It took me a little to figure out how to enable HDMI audio, but I found the setting in Sound Preferences. On the Hardware tab, there is a drop-down labeled “Profile:”. From there, I just had to select “Digital Stereo (HDMI) Output”.

Hulu Desktop is usable, but it still under performs. I have to keep the video quality set to low to prevent dropped frames. When I flip through the menus performance suffers and frames are dropped, but when I just leave it be, it behaves. This is when the display resolution is set to 720p though. When I had the display set to 1080p, it still dropped frames in low quality mode.

I think that Flash is still inefficient and that it just is running out of power. I have to say that I would probably recommend someone trying to duplicate this should use a good Core 2 Duo or better, along with 9400 or better Nvidia graphics to get more satisfactory results.

To control the system I am using a semi-generic Adesso USB remote. It uses IR to a receiver dongle. It acts like a keyboard and mouse, so no messing with LIRC is required. I am having trouble with Wake On USB. When I enable that, the computer won’t stay off. I have no way of knowing if Linux, the computer, or the remote are to blame. With that caveat, I would recommend this remote. I think it cost $25. Sometimes you want a real keyboard though, so I am going to have to look into getting a small wireless keyboard to use with this system.

Things I still want to explore is setting XBMC to launch Hulu desktop. Also, can I find another remote friendly launcher program to have Ubuntu auto-run on startup? I would like to try adding Boxee to the list. And I would like to find something better for image viewing, either a sepe

Categories
Reviews

OCZ SSD in my Toshiba laptop.

I put a OCZ Vertex 2 60 Gig SSD in my Toshiba laptop.

It really is fast. Booting is pretty quick, although I don’t do much of that. Chrome and Thunderbird launch quickly although, again, I mostly just leave them running all the time.

Beyond that, I hope it helps battery life, but since I took the machine from Windows 7 to Ubuntu 10.10, I suppose I will never know which change it was that made the difference.

Still, while I have little to no hard evidence to support it, I feel fairly happy with the choice.

Categories
System Administration

How I Setup Ubuntu 10.10

I’ve found myself doing this 3 times in the last month. I thought I would write up what I do so that I don’t have to try to remember the next time I need to do this (which probably won’t be all that soon).

First, I do a basic install from the live CD.

Then I open Gnome-Terminal and do:
sudo apt-get install rxvt-unicode thunderbird git python-virtualenv build-essential emacs23

Then I install Chrome from the web.

That takes care of basic software installs. What remains is what I consider to be the essential customization.

First, move the Workplace switcher and Window list to top panel. Second, delete the bottom panel.

Add Gnome-Terminal, Thunderbird, and Chrome to the panel (select them in the Applications menu, right-click, and select “Add this launcher to panel”. Use the preferences (right-click on the terminal icon on the panel) for gnome-terminal to change the launch command it to rxvt -rv -sl 2000. Remove Firefox from the panel.

Finally, use the Keyboard system preference (Layouts tab, Options button, Ctrl Key position submenu) to make CapsLock a second control key. Then use the Windows system preference to select windows when the mouse moves over them.

Categories
Programming

Progress

I’ve been working on two projects. Well, one project with a sub project. And I switched jobs (more soon).

I have a web app that I’ve been working on updating to be ajax’y. It is a feed reader (think Google Reader). I originally forked feedonfeeds when it was going through a period of being abandoned. It was originally written in PHP. First I made some small work flow tweaks. Then, I got sick of the feed downloader code getting stuck, so I rewrote the backend cron job in Python. I think that feedparser is more reliable than whatever the original used. I know forget what it was since I’ve since deleted it. Then I ran into issues with badly formatted HTML in the feeds causing the HTML display to go crazy, so I added in BeautifulSoup to cleanup the HTML. That fixed it for formatting, but I’m still having some issues with forms (yes, people embed those in feeds, irritatingly) interfering with each other, so there is obviously more work to be done there.

My more recent focus was replacing the frames based front-end (still PHP on the server) with more AJAX style code. That is going well, and picking up speed as I learn jQuery more, but there are plenty of rough spots, and some functionality isn’t quite on par with the frames. I’m forcing myself to use the ajax version though.

I don’t know if I will ever share the project. Currently, it is written to be single user and still has a lot of rough edges, as mentioned, so I can’t easily just make it multi-user with me hosting. I could post it for download, but it depends on postgresql, php, python, and quite a few other libraries for both so and I doubt that I’d attract anyone to try to install it. So, for the near future, it will continue to be a private project.

Perhaps once I get the UI more polished, I will replace all the PHP with Python and the CherryPy framework. Then it might start to become distributable at least.

The sub project is that I’m working on a jQuery sliding divider plugin. You can follow that here:
https://github.com/jd-boyd/jsplitdiv

The relationship to the feed reader is that frames are resizable, but divs aren’t, at least not without help. There is no reason for this not to be used plenty of places, so I put it on github.

I’m happy that when I spot check it, it pretty much works on IE 8, even though I’m not doing anything to specifically target it. I am using jQuery though, which I’m sure hides some of the possibly troublesome parts.

Anyway, since it is a project that can’t easily be shared, it is hard to write about.

Categories
Reviews

Replaced the touchscreen on a HTC Droid Eris

I got a free HTC Droid Eris with a broken touch screen. The LCD seemed to operate without issue. The glass touch screen in front was badly cracked, but still fully functional. I looked on line and found that replacement touch screens are a little under $50, and I found a YouTube video that made it look easy enough (see video here).

The procedure took a little more than two hours. Disassembly the phone was easy. Removing the glass of the broken touch screen from the front bezel was a bit challenging, but still only took a few minutes. Cleaning the bezel then took forever. Applying super glue cleanly was difficult (more later).

The tutorial video on YouTube said to use a T6 screw driver for the outer screws. None of my T6s fit, I had to go by a T5.

I got it all back together with an unpleasant splotch of super glue on the back of the glass. I wasn’t happy with it, but I figured it would be usable. But then minutes later, the screen got a bit foggy. I figured it was just moisture, and set it out to dry. 15 minutes later it was much worse. Days and then a week later it was just as bad. I found out that super glue is NOT the correct adhesive to use for this, and this is what probably caused the fogging.

I was later talking to a friend who does camera repair, and he says I should have used G-S Hypo Cement. Now I know for next time.

Things learned:

  • Replace the front bezel/housing in addition to the touch screen itself.
  • Trying to clean  the  plastic adequately was by far the most time consuming part.

  • Use a cheap small brush to apply the glue.
  • This will result in less mess, and thus less chance of getting glue on the glass. A different glue may make this unnecessary.

  • USE THE CORRECT GLUE!

I keep thinking of getting new parts for this phone and trying again, but the further I get from it, the less likely I think I am to do so.

Categories
Family

Deb @ Home

Categories
Programming

PodTrack

This is a little command line utility for downloading podcasts into a directory. This can make for easy rsyncing to a flash card, or listening with a command line audio player.

Find it at:
https://github.com/jd-boyd/Podtrack

I use it.  I don’t think anyone else does.  It prints a large amount of crap when running, which I really should clean up.  Otherwise, it is fairly complete, allowing you to do full management from the command line, and offering opml import and export.

Also, it does feature a thread worker pool class.  The implementation is actually a bad idea for any computation task (because of the Python GIL), but it works well enough for code that blocks in C extensions a lot.  Still, another TODO task for me is to update PodTrack to use multiprocessing, which already has worker pools.

Categories
Programming

C++ Message Passing (overview, between threads)

Having installed Google Analytics two months ago, I now know that the two most popular search phrases that people use to get here from Google are “elisp hex” and “c++ message passing”.  There isn’t much more to say about using hex in elisp, but I’m sure that there is more to say about C++ message passing.

The first thing that comes to mind is what does that phrase mean?  The obvious interpretations are passing messages between threads, passing messages between processes, passing messages on a network (local or Internet).

I previously mentioned that phrase in C/C++ Message Passing and Small Revisit of C++ Message Passing (in a Threaded Program) .  Both relate to passing messages between pthreads in a C++ program.  I rely heavily on that pattern because I prefer to try to treat my threads as shared nothing.  When possible, pass messages between threads instead of relying on shared data structures, and you will eliminate a lot of potential bugs.  If done correctly, it will also help eliminate bottle necks coming from lock contention.

In theory, I don’t like shared everything threading, but there are times when sharing things is required for performance, and there are times when parallization tools like OpenMP (or auto-parallelizers) are very valuable, and they required a shared every thing environment.

One of these days, I should try adjusting the implementation to use shared memory to enforce the seperation even more.  That, of course, would take us into messages between processes, which is a post still in progress.