NextHub Development on NextHub has ceased. Click here to go to the SourceForge project page.
|
I’ve finally decided to make it official. If you view the NextHub SourceForge project page, you’ll find that it now states the following:
As of 2010-01-21 18:00:00 CST, this project is no longer under active development.
That’s right: NextHub development is indefinitely suspended. Neither Andy nor I have had time to work on it in over a year, and it’s time to stop kidding ourselves into thinking we’ll resume it. My grad school work is occupying all my time, and I just can’t continue regular development on the project anymore. I’m not opposed to handing the project over to excited developers that are interested in pursuing the project. The basic functionality is there, but there is still quite a bit that Andy and I envisioned that we weren’t able to see through.
RIP NextHub. You taught me a lot.
Back in February, when I went to Vienna for the 2009 IMED conference, my biggest complaint about the trip was that I didn’t have a nice camera to capture the experience. Thanks to some friends, I was able to borrow a small Canon point and shoot, but it just didn’t have the horsepower and options I really craved to get the job done. My friend Chris, on the other hand, did have a nice camera and was able to capture some pretty nice images. He had a Canon Rebel XSi at the time, and as soon as I got back, I began researching cameras. Not too long after I got back home, I wound up buying an XSi myself.
Now, I’ve never had an ounce of artistic talent in my body. I’ve always loved good photography, and since I’ve been in college, at least, I always wanted to get into photography myself. I never had the funds, though, until I got to grad school. Since getting into this hobby, I’ve discovered that I can express myself artistically after all! It’s really exciting, and I’ve grown to really love this side of myself.
Even though I’ve only been into photography for about 7 months, I’ve already built up a pretty nice arsenal:
I have really versatile equipment. The only thing currently missing is a general walk-around lens. After much deliberation, I’ve decided to buy the Tamron 17-50mm f/2.8 VC. This Tamron’s younger brother (the non-VC 17-50mm f/2.8) is an incredibly popular walk-around lens for crop bodies due to its speed and sharpness. The new VC-enabled 17-50mm is set to debut sometime this next month, and I can’t wait. It’s priced really well, too, at about half the price of Canon’s 17-55mm f/2.8 IS whose only real advantage is a USM motor providing quieter and speedier auto-focusing. For a grad student, choosing the Tamron over the Canon was a no-brainer.
Alright, the title of this post is “Pretty Things,” so I suppose I should get on with it. Here are some of my favorite pictures. Clicking each image will take you to my Flickr page where you can view the image at a larger resolution by clicking on the magnifying glass above the image that says “All Sizes.”
I will no longer be maintaining the SA emoticon pack on digsbies. tweekmonster on SA has redone his auto-updating site that generates SA emoticon packs, and it now includes support for Digsby (along with many other platforms). So, if you want to get the SA emoticon pack, simply go to http://sae.tweek.us/ now instead of the digsbies site.
SA recently updated the layout of their smileys, and as a result, I had to update my automatic emoticon packager so that I can continue maintaining the Digsby SA emoticons. While trying to fix the regular expressions, a fellow goon pointed me to lxml, an XML/HTML library for Python. He suggested using XPath, something I had learned about in my database class just this last semester. I had already forgotten about it, and it never crossed my mind to use it! Boy, I’m glad he suggested that because the XPath code is much simpler than the equivalent regular expression.
Here an example of what I am parsing:
1
2
| <div class="text">:arghfist:</div>
<img alt="" src="http://i.somethingawful.com/forumsystem/emoticons/emot-arghfist.gif" title="SO ANGRY"/> |
What I was originally doing was reading the website source code line by line and using regex to capture :arghfist: and http://i.somethingawful.com/forumsystem/emoticons/emot-arghfist.gif. However, now I can simply use these two lines to capture every single emoticon:
1
2
| page = html.parse("http://forums.somethingawful.com/misc.php?s=&action=showsmilies")
emoteDict = dict(zip(page.xpath("//li[@class='smilie']/div/text()"), page.xpath("//li[@class='smilie']/img/@src"))) |
That’s really all there is to it! I’ve re-uploaded the source code if you’d like to take a look at it. You can get it at http://www.fangsoft.net/public/SA-emotes-source.7z. Remember that you’ll need lxml in order to run this.
I updated Hasher today. The plugin still functions the same, but I fixed a bug in the hash generation algorithm (thanks to Vladimir Kozlov for pointing the bug out to me). I also greatly increased modularity which in turn reduced the code size rather significantly. Here is how I calculate the hash of a file (the String parameter algorithm can be any algorithm listed at http://java.sun.com/javase/6/docs/technotes/guides/security/StandardNames.html#MessageDigest):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
| private static final char[] HEX_CHARS = "0123456789abcdef".toCharArray();
public static String generateHash(File file, String algorithm) throws NoSuchAlgorithmException, IOException {
byte[] dataBytes = getFileContents(file);
MessageDigest messageDigest = MessageDigest.getInstance(algorithm);
messageDigest.update(dataBytes);
byte[] digestBytes = messageDigest.digest();
// this chunk of code was taken from http://echochamber.me/viewtopic.php?f=11&t=16666&p=553936#p459685
char[] hash = new char[2 * digestBytes.length];
for (int i = 0; i < digestBytes.length; ++i) {
hash[2 * i] = HEX_CHARS[(digestBytes[i] & 0xF0) >>> 4];
hash[2 * i + 1] = HEX_CHARS[digestBytes[i] & 0x0F];
}
return new String(hash);
}
private static byte[] getFileContents(File file) throws IOException {
FileInputStream fileInputStream = null;
try {
fileInputStream = new FileInputStream(file);
byte fileBytes[] = new byte[fileInputStream.available()];
fileInputStream.read(fileBytes);
return fileBytes;
} catch (IOException e) {
throw e;
} finally {
if (fileInputStream != null)
try {
fileInputStream.close();
} catch (IOException e) {
} finally {
fileInputStream = null;
}
}
} |
I’ve updated the SA emoticon packager once again. I’ve added functionality to expand it beyond just Digsby. Currently, it generates packages for both Digsby and Pidgin. The way I’ve designed it, it’d be fairly trivial to add support for Adium or any other chat program. Maybe I’ll do that someday. If you’d like the source code, I’ve put it up on my website for download. You’ll need an archive manager that can open 7-Zip archives to open this file.
Download: http://www.fangsoft.net/public/SA-emotes-source.7z
Don’t forget that you can visit http://digsbies.org/site/project/saemote to download the most recent SA emoticon package for Digsby.
If you find this useful or have a question or comment, please leave me a comment.
I edited the KML ZCTA population map that I posted on 2/22/09. For my uses, it’s important that I be able to calculate distances between ZCTAs. To calculate these distances, I use the center of each ZCTA. To avoid complex centroid calculations, and since the Census Bureau’s ZCTA boundary data includes the centers so that this calculation isn’t necessary, I figured I’d include them.
I did this by changing the KML geometry from a single LinearRing to a MultiGeometry of LinearRings and Points. Let me know if this is useful to you!
Also, if you’re curious, the distance formula for computing the distance (in miles) between two latitude/longitude points (in degrees) is fairly simple. Courtesy, http://www.meridianworlddata.com/Distance-Calculation.asp, here it is:
![3963 \cdot \arccos[\sin(lat1) \cdot \sin(lat2) + \cos(lat1) \cdot \cos(lat2) \cdot \cos(long2 - long1)] 3963 \cdot \arccos[\sin(lat1) \cdot \sin(lat2) + \cos(lat1) \cdot \cos(lat2) \cdot \cos(long2 - long1)]](http://www.fangsoft.net/wordpress/wp-content/plugins/easy-latex/cache/tex_4a3a0655b4715b075e99e731264649de.png)
Download: http://www.fangsoft.net/public/populationZCTA.kmz (20.8mb)
Here’s what this new file looks like in Google Earth:
-
-
ZCTA map of IA with centers included
-
-
52245 population count
My research thus far in grad school has been concentrated around using computer science and GIS tools/techniques to help solve medical problems. For one of the problems I’m working on, I need access to ZCTA boundaries and population counts for each ZCTA. For those of you that don’t know, ZCTA stands for ZIP-code tabulation area; basically, it’s what the Census Bureau uses to split the US population up geographically. ZCTAs typically correspond to ZIP codes, but unfortunately, that’s doesn’t always happen (there is a ZCTA 506HH, for example). Some ZCTAs have populations of 0. However, as far as I can tell, ZCTAs are the best thing we have for geographically representing the US population.
Anyway, what I was doing was using the shapefiles publicly available at http://www.census.gov/geo/www/cob/z52000.html to get the ZCTA boundary information. I also used the 2000 census population data available from http://factfinder.census.gov/servlet/DownloadDatasetServlet?_lang=en. This is all fine and dandy, but reading shapefiles can be kind of a pain. GeoTools works quite well, but it’s Java-only. I’m in the process of converting a Java-based application into a PHP web-based application for some of my research. PHP’s shapefile readers, at least from what I’ve heard, can be kind of hit or miss. Also, having to get this data from multiple sources starts to make code look kinda nasty. Ideally, since population information goes with ZCTAs, there should be a 1-stop shop that gives me both the boundary information and population counts for each ZCTA in the US. And if it’s not too much to ask for, I’d like a human-readable text format. So what do I do?
A KML map seemed like the most obvious answer. It’s XML, so it’s easily readable, and it’s highly extensible and powerful. And since Google’s name is behind it, it’s very widely supported. What’s not to like? Surely, a KML file like this exists, right? Well, after quite a bit of Googling, I came to the conclusion that one didn’t exist. So, I decided to make my own. I wrote a Java program to read in the population information and ASCII coordinates of each ZCTA listed at the bottom of the Census Bureau’s page I linked to in the above paragraph and spit out a KML map.
Because this is so useful to me (and really, anyone doing anything that requires ZCTA-level population counts), I figured I’d upload it here and let anyone that wants it grab it. This took me a decent chunk of time to get done, so maybe I can save someone else some time by sharing this. If you use this, please let me know by leaving a comment. Also, if you’re interested in the Java code I used to create the KML file, feel free to ask.
Download: http://www.fangsoft.net/public/populationZCTA.kmz (size: 20.1mb)
Note: This file has a KMZ extension (not a KML extension). A KMZ file is simply a zipped-up KML file. If you wish to access the underlying KML markup, simply rename the file to populationZCTA.zip, and unzip it like you would a normal ZIP file. Google Earth can read the KMZ file without unzipping.
Here’s what it looks like in Google Earth:
-
-
places selector showing state-level population counts
-
-
places selector for IA showing ZCTA-level population counts
-
-
ZCTA boundaries for the entire US
-
-
ZCTA boundaries for CA, CO, IA, and TX
-
-
ZCTA boundaries for IA
I decided to alter my Python script that automates the process of the creation of the Digsby SA emoticons package. I’m changing it so that it will automate the creation of the emoticon pack for other IM clients (namely, Adium, Miranda IM, and Pidgin). tweekmonster of SA seems to have disappeared off the face of the Earth, and his SA emoticons page is doing wonky things (why does it contain 523 emoticons when SA’s smilies page has only 376?). I figured I’d rewrite it correctly and put it up on my website. The changes to my Python script are almost complete, and then I just need to add the web frontend. This will hopefully be done this weekend.
Update:
Well, for right now, I’ve decided not to do this. I may change my mind sometime in the future. Right now, I’m content with just maintaining the Digsby SA emotes.
In my previous post, I described the SA emoticon pack package manager that I wrote in Python. I’ve had several interested people ask me for it, so I figured I’d go ahead and post the source code. If you want to get the source, just download the following file.
Download: http://www.fangsoft.net/public/SA-emotes-source.7z
If you notice anything I’ve done wrong (like I said, I’m still a Python newbie), please tell me. Or, if you know of a way to do something more efficiently than what I’ve done, please tell me. Let me know what you think, either way.
|
|