My Project Ideas for Google Wave

Posted by knorby on November 10, 2009 under Python, coding, doit, google, internet, wave | 3 Comments to Read

Silly:

  • fortune/doit – Implemented. See Wave Fortune. You can use it be adding wavefortune@appspot.com to your contacts. I mostly made this bot to satisfy my fortune lust, and to get more familiar with app engine and the wave bot api.
  • wompus/adventure – Not sure I am actually going to do this one. If I do, it will be the wompus. Basically, the problem to solve is effectively storing state for such games. Wompus is tiny, and the games are short, so it wouldn’t take much thinking. Adeventure/zork would require a lot more work, and I honestly don’t care that much.

Tools:

  • logging interface – It occurs to me that wave might work great in a situation where I think e-mail falls short now: data/msg dumps. I see this sort of thing at my jobs a lot. I get a log messages I generally don’t care about, and I filter them out, and as a result I sometimes miss something. A similar case is something like a bug tracker, where so many replies can be generated that the thread is easy to ignore. Centralization would help a lot I think, but again, I am not sure I care.
  • RPN calculator - Nothing really to explain here. Could do save the calculator’s state in past blips, and make them editable. The end result would be a collaborative calculator of sorts. Could be interesting.
  • something with jMol – Not too much thought here. When I was a student in the Computational Material Science group at ORNL, I ended up playing with jMol a bit from javascript. Some sort of gadget/bot combo could do some interesting stuff, but again, I don’t care.

I will post more about my thoughts on wave later on, as I have many mixed thoughts on it. Google has a lot to do, both on wave itself and extensions that they should provide. I am hesitant to work on large projects, as I don’t want to have google copy my work, or experience some odd situation with app engine. I don’t think anyone, google included, has any remote idea of what to expect from wave yet.

Something I Want: Simple Environment Setup

Posted by knorby on November 29, 2008 under IT, Linux, Python, Solaris, coding, shell scripting | Read the First Comment

I am mostly jotting this down so I can work on this later and to see if anyone has any suggestions.

I was thinking last night that I need to setup my own personal environment on new systems quite a bit, and that isn’t going to change anytime soon. I do not want to work off of something too centralized, as I really don’t have that option. I need to be able to maintain a setup on my home machines, various UChicago machines, and various other machines. In some cases, I just need a work environment for a short term period, such as on maclab machines (although I usually just ssh into one of the linux cluster machines and use X11 forwarding to load up XEmacs GUI goodness). sshfs isn’t an option, as it sucks, and FUSE isn’t always installed everywhere (for good reason). Subversion might serve nicely, but I can’t assume that it is installed, as it often isn’t; I tend to think Subversion or other repository systems shouldn’t be used for much beyond software development. I also need to worry about various differences in systems. I can always install software to the system or to my home directory, and various UNIX flavors have their own quirks, especially Solaris. So what I want is an initializing setup script that downloads and extracts a basic environment from some central server. Everything in this set of scripts should be sectionalized. There should be some decent metadata format (probably some XML format) to store information about these sections and on the sections installed. There should be some update system on top of that. In the case that a package management system is available, the system should be able to use it, and as fall back, download and install a few specific packages into my home directory. Things like python would use already existing systems for setting this sort of thing up. Given that the system would assume almost nothing, most of the initial system would probably need to do processing on the server side. Other than that, the only software that the system would assume would be ssh, bash, and tar (maybe). This thing will take time, but I think it would be useful for a long time to come.

Fun with One-liners

Posted by knorby on October 23, 2008 under Python, coding, javascript | Be the First to Comment

I have always enjoyed putting as much work as possible into a line, especially in higher level languages. In the crazy javascript (speaking of which, MochiKit 1.4 was finally release!) system I wrote (still need to put the final touches on that….), I was thrilled when I was able to combine all of the parts of my system into one one line. Since I mainly program in python, list comprehensions and generator expressions make it pretty easy to use one liners a lot, and at least with generators, it often means that is efficent too. Basically, what I am trying to say is that I love the one liner. Last night, while I was bored while doing my discrete homework, I came up with a memoized factorial function one liner. The standard, niave version is straightforward:

fac = lambda n: int(n==0) or n*fac(n-1)

Since I was bored, I wanted to see if I could memoize that expression, and still keep it in one line. Here is what I came up with:

fac_dict, fac = {}, lambda x: ((x in fac_dict or fac_dict.update({x:(lambda n: int(n==0) or fac(n-1)*n)(x)})) and False) or fac_dict[x]

which can be simplified slightly to:

fac_dict, fac = {0:1}, lambda x: ((x in fac_dict or fac_dict.update({x:(lambda n: fac(n-1)*n)(x)})) and False) or fac_dict[x]

There are still issues with recursion depth for large values, but a helper function could probably solve that.

I needed to write something for my blog, as I have gotten out of the habit, and this thing seemed as good as anything.

Fixing Facebook with userContent.css

Posted by knorby on August 5, 2008 under coding, css, facebook, firefox | 4 Comments to Read

I posted something previously on blocking social ads in facebook with greasemonkey, where I came to the conclusion incorrectly it could not be done with css. I apparently remembered what “! important” did in userContent.css and userChrome.css; I read “! important” as “not important,” but it aparently means the opposite, and overrides any webpages css. I corrected my post on userContent.css and userChrome.css customization as well. Stupid logic. Anyway, if you add the following block into your userContent.css file, you should be able to block most annoying stuff on both the new facebook design and old.

@-moz-document url-prefix(http://www.new.facebook.com/) {
.sponsor, .invitefriends, .findfriends, .gifts_received, .pymk, .social_ad, .adcolumn{
display: none ! important;
}
}

@-moz-document url-prefix(http://www.facebook.com/) {
.sponsor, .invitefriends, .findfriends, .gifts_received, .pymk, .social_ad, .adcolumn{
display: none ! important;
}
}

There may be a way to combine these two, but I don’t know the more mozilla-internal css well enough to know. If you use facebook, most of these should be clear. I blocked gifts, as I find them annoying, and I am glad to just not be aware of them. I also blocked the person finding features like “people you may know” (‘.pmyk’) or the email search things. I also blocked ads of course. Facebook seems to have to idea that everyone will love ads if they are more specifically targeted at you, based on data they have on file. I can’t stop them from doing that (other than by closing and deleting my account), but I shouldn’t have to see ads if I don’t want to IMHO. Also notice that the new facebook design and the old one use the same css classes for everything; the redesign isn’t that extensive apparently.

I’m on the Google Open Source Blog!

Posted by knorby on June 6, 2008 under ACM, Chicago, GSoC, OpenBSD, blogs, coding, globus, google, personal, uchicago | Read the First Comment

It’s true! Borja wrote up a summary of the GSoC lightening talk event, including pictures. If you don’t know what I look like, I am in both the GSoC student one and the ACM officer one. I really wish I got a haircut before this thing….

Borja linked to our website, which hopefully won’t get too much traffic. It is currently at 359 days of uptime, and I have shooting for a year of uptime before upgrading to the latest and greatest version of OpenBSD.

The Last Little Bit

Posted by knorby on April 22, 2008 under Apple, Solaris, coding, google, personal, rants, uchicago | Be the First to Comment

I haven’t been posting a lot recently, so I thought I would just kind of outline a little of what has been going on recently.

Some members of the RAS installed the weather station on the roof of Ryerson today (I wasn’t involved in the efforts today unfortunately). In addition, the web view now works (not me again), which I started on. It is still temporary, but it is currently up. I will be assembling a better website, which will be more permanent. I was fearing we wouldn’t be able to get it onto a POSIX operating system, but then wview came to the rescue. I will put up some pictures soon. It was really great to see it finally on the roof. It was some random idea I had a while ago, and it finally materialized.

The biggest news for me today is that I was accepted to Google Summer of Code on the Globus Toolkit. I will be working on a diagnostic administrator interface framework; essentially, it is more Python+XML work, but with Globus. This will also be the third summer in a row that I have done XML work with people based at a national lab (Globus is based at Argonne–not the same as actually working there for the summer, but I will be visiting soon). I will also be working at the Maclab, which should be fun and a chance to do some real work on projects there.

A lot of people are leaving the maclab at the end of the quarter, so I will end up with quite a bit more on my plate it looks like. After the last two weeks or so, I look foreword to that less. Over the last break, I converted many of the servers to Leopard Server, Apple’s latest rendition in bloated bad design. From that experience alone, I lost all respect for Apple (there wasn’t much there in the first place). What kind of upgrade on a server edition of the Operating System overwrites the most basic of configuration and files on upgrade? This last week, our web/dhcp server went down at the same time as our print system, our two most vital systems. From what it looks like now, DirectoryService, the LDAPesque utility that Apple now uses for local accounts as well. epically failed, and I do mean epic. There are some other problems as well; the actual cause is still allusive, but we at first presumed hackers, which can’t be ruled out. The print system? As far as we can tell, the problem is that Leopard is a horrid piece of shit that ruins every piece of software it touches. The implementation of CUPS on it is horribly broken (to a vast extent), despite the fact Apple owns it! I will spend more time in the short future on a series of posts that outlines my points of hatred for it. Dealing with the problems rated pretty high on my rankings of stressful events, and there is still work to be done.

Together with another failure, this time from NSIT, I think I know fully grasp an important life lesson: assume incompetence. NSIT made a pathetic effort to announce that they were going to switch the LDAP server from OpenLDAP to a Sun-based implementation . Apparently, they had a test server, but they neglected to give the address out, or test it on their own machines. NSITE/USITE has its own Macs, even another Maclab (I think of it as the bazarro Maclab; the imaging work is handled remotely, the none of staff know much computers from what I hear, there are few users, and the software is up to date), of which at least some run Tiger. No one tested these to see if logins would, you know, work. Anyways, all our tigers failed to login after the switch. It turned out to be some check box on some security page (in fact the only check box on the security page), for which it took 7 people 48 hours (I think that’s with few breaks in it) to find the fix. We decided to let them deal with it as it was their problem. Incompetence really explains this whole thing well. When we were switching to Leopard on the servers, the ServerAdmin presented us with a catch-22; it was impossible to save setting on one page without saving the settings on another, but it was impossible to save settings on the other one without first saving the changes on the first. What accounts for this flagrant error in the GUI? Why incompetence of course! I experienced a similar sort of situation on a Sun box I work on; everything program I used seemed broken. I e-mailed the sysadmins for a while at which point this golden rule struck me. I ended up compiling any program that failed to work on something. For example, there was some weird error with make. so I compiled and installed gmake to my home directory, and it solved all my problems. I suppose it is not fair to just call this incompetence; laziness should be added in there somewhere.

Some other stuff has been happening, but that makes for a decent mind-purge. It’s nice out again! I can where sandals and shorts comfortably!

Playing With Ctypes and Ghostscript

Posted by knorby on March 25, 2008 under C, Python, coding, postscript | Read the First Comment

I have been playing around with the ctypes library in python recently. It is a foreign function interface for dynamic linked libraries(DLL)/shared libraries. It works back to python 2.3, and it was added into the standard library in python 2.5. Anyway, it provides a much nicer way to access C libraries then using one of the various methods to create a C extension, though it is a bit slower. As I learned at pycon, one of the benefits is that PyPy (one of the craziest things I have ever seen) can use ctypes. I was thinking of staying for the PyPy sprint at pycon, but I think they were going to work on a pure python implementation of the library, which was far too intimidating to me. I will post about pycon at some point soon.
I guess I find ctypes so special just because it is the first thing in recent history with python where I was really amazed. I first saw it with µTidylib, which is a python wrapper around the HTML tidy library. What got me was just playing with it on the interpreter:

>>> from ctypes import *
>>> libc = CDLL("libc.so.6")
>>> libc.printf("Hello, World!\n")
Hello, World!
14
>>>

Obviously, it is a lot more powerful than this example illustrates, but you get the idea. I have been fixing up some of the filters in the print system at the Maclab over spring break, so I have been working with ghostscript a bit. There is an API for ghostscript, so I have started writing a wrapper library for it in my free time to practice using ctypes, and, well, because one doesn’t exist. I am trying to think of a name that somehow combines ghosts, snakes, and desktop publishing….

Removing Social Ads from Facebook Feeds

Posted by knorby on March 3, 2008 under coding, css, facebook, firefox, internet, javascript | Read the First Comment

Update: see my post “Fixing Facebook with userContent.css” for a corrected and more extensive way to go about this. There are some stupid errors in this post that lead me to use a bad approach, but the greasemonkey script should still work.

I am not a huge fan of ads. I say that somewhat hypocritically as adSense proudly barfs somewhat random ads out on this page, none of which I really expect will ever click on, but that is besides the point ;) . Anyway, I can normally block ads with adBlock, but social ads are trickier. Every social ad div has for a class:
feed_item clearfix social_ad
Each one is a seperate class. They do some trick so it is hard to override with a page wide css that doesn’t take out everything, so userContent.css and similar tricks are out. I ended up brute forcing it and writing a greasemonkey that does the job.

Download it here: hidefacebookfeedadsuser.js

Update: There is another class used as well. If I remember correctly, instead of social_ads, its ad_capsule with everything else the same.