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.


Categories
Programming

GitHub

Did I mention that I’m now on GitHub? See: https://github.com/jd-boyd

I figured that would be easier that uploading raw source code into WordPress. I could always post my own git archives, but GitHub provides online browsing nice visualization features, so I finally joined the crowd.

Categories
Programming

ReferUrl.net, Updated

I’ve been continuing to poke at the ReferURL.net URL shortening service I run. Recently I’ve added the following new features:

  1. The biggest change is the new bookmarklet.  Instead of redirecting you away from the page you are viewing, it overlays a modal dialog giving you your results. Please delete your old bookmarklet and bookmark the new one to gain this feature.
  2. Accessing a ReferURL in an email or tweet is now much faster. The 1-2 seconds saved will improve the impression your ReferURL leaves on your readers.
  3. Enter an Amazon URL and ReferURL will return a shorter Amaon URL in addition to a ReferURL.  Thus, http://www.amazon.com/jQuery-Cookbook-Solutions-Examples-Developers/dp/0596159773/ref=sr_1_1?ie=UTF8&qid=1292044752&sr=8-1 is now offered to you as http://amzn.com/0596159773 as well as http://referurl.net/3568 .
  4. Also, ReferURL does the same for eBay auction links.
  5. Email from the ReferURL result page.  Just click under Mail It!, and the ReferURL is placed in a new email message for you (this opens the new message in your local Outlook, Mail.app, Thunderbird, or other configured default).

I like using ReferURL.net a lot better now, and I hope you do as well.

Categories
Programming

RESTq, RESTful queuing, update

First, I renamed it from msgQ to RESTq (or more likely just restq).  Also, I’ve joined the modern age and pushed it up to github:

https://github.com/jd-boyd/restq

Up next, I shall put it into real use, and I do still want to add clients for more languages. Also, just because I can, I might rewrite the server in more languages (Python will probably remain the main one).  I’m thinking of Go, perhaps C, and of course from the beginning I meant to also do so in erlang.

Categories
Programming Reviews System Administration

πp-v2, the new Plan 9 file protocol

The symbol is Pi. I point that out since it doesn’t render very nicely in my web browser. The URL for the paper is:
http://proness.kix.in/misc/%CF%80p-v2.pdf
Yes, they stuck the symbol into the file name as well. Plan9 people seem to like to do such things just because they invented UTF-8 and were the first to heavily use unicode.

πp intends to replace NFS, SMB/CIFS, HTTP, FTP, 9p2000/Styx (the former plan9 file system), as well as more obscure options like Coda. To that goal, it tries to contain all of the features of those different choices that the authors deemed still useful into one new protocol.  Ideas like extended metadata, non-file files (meaning the target on the other end is a file representing a printer, raw disk, or any other sort of device), offline operation, caching, and tolerance for proxies (possibly also caching) in the middle.

So, I think there are some features and decisions to like here. Here are a few.

File versioning can serve two purposes. It can be used to preserve history and it can be used for cache invalidation. πp intends to support both. File versioning to support history is potentially the most handy feature, but it will only work if it is matched with an appropriate on disk file system that supports file versioning. ZFS, one file system that can support versioning (by snapshots, but it doesn’t keep every revision automatically), doesn’t need the file sharing protocol’s help to support looking at the versions from remote systems. On ZFS, the snapshot history can be accessed in a directories .zfs sub-directory.

Without such a file system that supports versioning, πp’s versioning feature can still work for cache invalidation by setting an extended attribute on file systems that have some mechanism for doing so (xattr on some, resource forks on others).  Personally, I think that supporting caching is largely only of use when πp is used as a replacement for http, which is further discussed later.

Pipelining would help resolve a major NFS complaint of mine, but it also seems like a large pit of danger. I’d be happy to consider using this protocol, but only for applications that don’t depend on heavy synchronous behavior out of concern about this feature, until it is better proven.

Extended support for special files is great for remotely sharing devices.  This was always one of the nice features of plan9 (at least so it sounded, since I never gotten around to using plan9).

OTOH, here are some “features” that I require convincing of.

To replace http, the author’s get rid of the plain text parts. In web development, having those parts be human readable are tremendously useful and I doubt they waste much time in any given session. They also make web connections stateful using this protocol, while being stateless has always been one of http’s strong points (albeit one with some pain). Also extended file attributes seem like a poor alternative to http request and response headers.

Supporting lossy file transmission is rather a head scratcher. Their idea is that it could make for efficient streaming video transport, but still I’m not convinced. Does the client or server decide that the response is to be lossy? It looks like this is a client decision (client choosing by opening the πp connection over TCP versus UDP), however how is the client to know in advance which type of file this is? Is it supposed to query first? That seems ludicrous.

My conclusion though is that if you drop the usage ideas that I don’t like, I don’t see any changes being required in the protocol itself. This idea is obviously in the early states, but it looks like it could be worth exploring when there is more code to run.

On a side note, one thing that did interest me in the paper is that they wrote the initial implementation in Go, and then translate that to C. I didn’t know that Go existed on Plan9, but in looking into that it seems that it still doesn’t quite exist on plan9 since the runtime has yet to be ported. Oh well, one can hope for the future.

It also made me wonder how many plan9 from user space users make use of 9p still?

Categories
Reviews

Eken M001, Upgrade Follow Up

Installation

Today, I tried upgrading to a newer SlateDroid than what came on the device.

BTW, a small tip for use on Ubuntu:
sudo apt-get install p7zip p7zip-full p7zip-rar

Find the new firmware at: http://www.slatedroid.com/downloads.php?do=file&id=99

Stupidly, to get the download link, you must create an account on the SlateDroid forums to do so. Did I mention that many aspects of the Android community are really aggravating? Would it really be that bad to use github or sourceforge for this sort of thing?

Anyway a direct link is: http://www.mp4doggie.com/calver/M001%20Slatedroid%20Mercury%20Beta%202.7z
Note, by using this, you may miss out on newer versions. Also, this seems to be on a rather slow server, which would raise reliability concerns.

Once you have the file, extract it some where. In the long directory created, there will be a text file and a script folder. Copy the entire folder to the root directory of a SD card, then move the card to the M001, and reboot the M001.

You will get a message indicating that it will re-install in a few seconds, and if you do nothing, it just runs for about 2-5 minutes, then ask you to remove the SD card, and when you do it turns off. Turn it back on and it takes a very long time to boot the first time, about 10 minutes for me. Easy Peasy, but I would have felt better if the process was described.

How Is It?

After booting into the updated OS, the first thing I noticed is that screen rotate is no longer working.  I checked the settings for this, but nothing jumped out as wrong.  I didn’t put much more effort into why this was mis-behaving.

Since battery life was supposed to be one area of improvement, I tested that out with a full charge.  What I found was that with light usage of contacts, web browser, flipping around through menus and ebooks, but not playing any audio (other than default system sound effects) or any video, the battery lasted under 2 hours.  2 hours is about double what the battery life was was before.

While I ran through various menus, web sites and so on, I paid attention to the responsiveness of the system.  It  may be a bit more responsive than the ealier SlateDroid firmware, but it is hard to be sure.  The M001 is still is rather tricky to navigate.  Scrolling in particular is difficult.  Half the time I try to do so, it registers a click as I swipe across a list item, which means I enter a new menu, have to hit the back button, then try scrolling again.  I haven’t a clue why this behavior exists.  Is the touch screen not good enough?  Is the processor too slow?  Is the software too un-optimized?  Or is it that there are ill timed software pauses that cause it to miss a beat?  I don’t know, but if someone would work this out, it would be really nice.

This software upgrade brought the Aldiko e-book reader.  This program is nice.  You swipe to flip pages, and unlike general list scrolling, this actually works reliably.  If you had decent battery life and wanted to use only this program, this could be worthwhile.  Certainly if that was the goal, you could turn off wifi, which would help a little.

Web Browsing is the same after the upgrade as it was before.  It is a real web browser.  Web sites tend to just work correctly, including javascript.  It is no speed demon.  Scrolling is very sluggish, but unless there are lots of links on the page, you at least don’t have to worry about it mistaking a scroll for a click.

One weird note is the continued inclusion of the phone dialer.  Why?  There is no phone here.

The End

I think that is about it for me and this device. I could load Debian on it still, but I just don’t feel motivated to try. While I could then try using it as a music player, I still have the problem of major noise on the output. With Debian I could use it to show pictures, but the screen still sucks even compared to my bargain basement picture frame. Of course, on Debian there don’t seem to be any polished enough WebKit based web browsers, so using it for the web doesn’t seem realistic (at this point Firefox on 128 megs of RAM is not pretty). I don’t see a lot of point.

I could keep it as a platform to hack on, but it doesn’t seem to be as open as other choices like the OMAPs, so if I was to get around to it, time would probably be better spent on my HawkBoard.

So, I say Adieu. Maybe I’ll try some Android 2.1 (or better still 2.2) tablet in the future.