Wednesday, December 30, 2009

Nimbyism as Environmentalism

Atrios on nimbyism masquerading as environmentalism. I think there's some of this going on in the Gowanus Canal Superfund debate: certainly the popular pro-Superfund poster featuring a whale, of all things, seems to be trying a little too hard. I mean, they are on the right side anyway, but I'm just saying.

Wednesday, December 16, 2009

Check Your Premises

Brad wonders why we pay so much money for such crappy health care. I think he's wondering rhetorically, as it were, but I do think it's worth spelling out an answer. Which is that to the extent that "we" do indeed tolerate this state of affairs, it's because "we" derive positive value from the suffering of the underclass: the existence of an enormous number of miserable poor people is the sole remaining component of the American dream.

Monday, November 30, 2009

The Drug War Requires a Police State

Interesting thought experiment by Kevin Carson considering how the War on Drugs would fare in a society in which the Fourth and Fifth Amendments to the US Constitution were respected according to their plain meaning and spirit. "Not well" is the short version.

Carson concludes:
If you want the Drug War, you must sacrifice the Bill of Rights and the due process rights of the accused, and submit to a police state in which you have no rights or protections whatsoever.
I would tend to put this the other way round, that the Drug War (like its antecedents, including Prohibition) exists because of its impact on due process rights: if drugs didn't exist they'd need to be invented, because the same rights that are essential to democracy are obstacles to capitalism.

Six Down, Something Like 300 To Go

As I mentioned earlier, I went back and tried Richard Maltby's first Harper's crossword. It was pretty easy! I've since printed out and solved five others.

The clues seem easier than in current puzzles. I do like that some of the interesting recurring puzzle varieties (dedicated dodecahedron, diametricode, righTangles) were in use right from the start.

At the same time, it seems like the clues in the older puzzles are not quite as "fair" as in his present-day puzzles. That was actually something that prompted me to look up older Maltby crosswords when I wanted more than one puzzle a month and found the ones on offer from the UK too UK-centric, while Frank Lewis's for the Nation strike me as insufficiently Ximenean. But yeah, so one of these first few Maltby clues included "Change livers (6)," which is easy enough, but which he would never use today.

But yeah, fun, in any case. I subscribed to Harper's somewhere around 2002 and haven't finished every puzzle since then, though I've given pretty much all of them the old college "try." So I have about three hundred to catch up to that point. That's what, two years' worth? Maybe I should ration them.

Friday, November 20, 2009

Literary Mashups?

I was thinking the other day that it would be cool to get some Project Gutenberg texts, typeset them nicely in some free document processor, make a cool cover image and then put them up for sale at one of those digital print-on-demand sites. Or even just have a series of classics printed up for your personal library. There must be people doing stuff like that, right?

And then I was wondering, does anyone take advantage of any of the copylefted or public domain texts out there and actually modify them significantly? Like adding a whole bunch of illustrations, or even changing the plot or removing characters. Instead of trying to ban Huck Finn from school libraries, conservatives should be publishing their own rewrites where Huck does the right thing and turns Jim over to the authorities.

Anyway, keep an eye out for my upcoming masterpiece, 10,000 Leagues Under Ulysses, featuring stills from Lady Frankenstein.

Friday, November 13, 2009

Wow

Found this review of The Recognitions:
When carefully and thoughtfully read a rich bounty of rewards awaits the attentive reader. I have had many intimate moments with this work when, perhaps sitting in a coffee shop, I'll be involved in a particularly frustrating piece of dialogue and I'll laugh out loud at Gaddis' razor-sharp eye for the frailty of human interactions...
Too perfect. I suppose furious masturbation does technically qualify as an "intimate moment."

Razor-sharp eye indeed.

Thursday, November 5, 2009

Pointless Satire

This JSF op-ed about how we should eat dogs is pretty silly. I think anyone who's ever really thought about the taboos surrounding which animals we'll eat and which we won't has come to the same conclusion, that it's to a large extent arbitrary with very little basis in reason or any kind of absolute ethical standard. But who cares?

Foer tries to imply that the meat of all the animals euthanized in shelters goes to waste, but then he immediately acknowledges that in actuality a lot of those bodies are turned into feed for other animals. He calls that an "inefficient and bizarre middle step," but of course it isn't: our pets and livestock have to eat something, after all, so why not give them the stuff we don't want?

And it's not like if someone found an unidentified cow wandering along the side of the highway, turned it over to animal control, and nobody claimed it, that it would then be chopped up into hamburger and sold at the supermarket. We're not nearly as careful about monitoring the health of the animals we eat as we should be, but we certainly don't consume "strays" of any species, and I doubt any (perfectly legal!) puppy mill comes anywhere close to satisfying the standards for farms raising animals for human consumption.

Finally, Foer avoids the almost obligatory "Chinese restaurant" jokes, but only just barely. I have no idea what I'm talking about and will gladly retract if I am wrong, but I am going to go ahead anyway and call bullshit on this little factoid: "the Sino-Korean character for 'fair and proper' (yeon) literally translates into 'as cooked dog meat is delicious.'" Sure it is. The Filipino recipe for dog stew that begins with slaughtering instructions is also way out of line, again for obvious reasons.

But yeah, anyway, retarded essay. The old rule of thumb, that any piece of satire that has to include the phrase "modest proposal" in its title or subtitle is not worth the reader's time, holds up once again.

Thursday, October 29, 2009

Puzzling!

I was paroozing some crossword-related discussion boards, specifically wondering if the fact that I only ever do Richard Maltby's puzzles in Harper's means I'm really just a fan of Maltby's rather than cryptics in general.

I have definitely been completely frustrated trying to solve English cryptics (which require quite a bit of general knowledge), and also found the clues in Frank Lewis's Nation offerings to follow the cryptic "rules" much less strictly than I was used to, though maybe they were just going over my head.

In any case, someone mentioned that Maltby started setting puzzles for Harper's in January 1976, and he prefaced the first one with a nice little introduction to cryptics (subscribers-only link, images posted below) that even includes his "mental repunctiation" refrain. So I'm going to try that one and see whether he had that style from the beginning.

Also! it appears that Stephen Sondheim wrote puzzles for New York! Weird! They did a blog post with his first three. Apparently he is credited with developing the "US style" of cryptic. I am going to try those out as well.

Introduction to cryptics
Introduction to cryptics page 2
Cryptic puzzle

Tuesday, October 27, 2009

PUZZLE








TRANSPORTATION ALTERNATIVES
By Travis Scholtens




Eight answers from the Across clues must first be altered before they can be entered in the diagram. Naturally, word lengths are omitted for these clues.


When the diagram is completed, the entry at 15A will be a familiar slogan describing the alteration.


Altered entries are common words and contain no proper nouns. Clued answers include one proper noun. 27A is an alternate spelling. As always, mental repunctuation of a clue is the key to its solution. The solution to the last puzzle appears after the jump.




across
   1.  After being fixed, paler cat is calmer
   5.  Shows are inside: second-rate, front of stage (5)
   9.  Sounds likely to be grounds for a lawsuit (5)
10.  Bordeaux cartel broken up
11.  World government players regarded to be intact
13.  Speaker czar
14.  Ovation less enthusiastic, initially: bravo! (3)
15.  See instructions (3,4,3)
18.  Frolicked in reversible scarlet cloak
20.  Old pie goes bad, becomes water molecule, e.g. (6)
22.  Chats about gym class, love, urges (6)
24.  Sweet drink from bar at center thrown back
25.  Pains leave shore with fore moved aft (4)
26.  Alarming contents of NASCAR in German
27.  Sore on eyelid in crust (yellow) (4)
28.  Put into concrete form, a nice rant goes off the rails


down
   2.  Beginning of novel buried amidst property claim sheets (5)
   3.  Core shown in bas-relief (3)
   4.  Overjoyed to be part of a family with no head (6)
   5.  Buffets for smokes (5)
   6.  Audible shaft moisture to perform again (4)
   7.  Everybody else up late? (2,2)
   8.  Convenience store blends test puree (9)
10.  Lions missing a thousand toy bricks (4)
11.  Great places mix up oxtail soup with no lox (7)
12.  Until death preserves Iberian diacritic (5)
13.  Thoroughly hinder packaging record with missing note (6)
16.  Not pro game: without me, it's a Cuban line dance (5)
17.  Wide awake right after beer (5)
19.  Project beginnings of each movie in theater (4)
21.  Write new leader (leader of English colony) (4)
23.  Tails-up nickels are evil (3)



Friday, October 23, 2009

I Wonder

When Microsoft named the ThreadPool.QueueUserWorkItem method, did they name it that way so it would sound like you were talking about something involving a "pool cue" when you said it aloud?

Wednesday, October 21, 2009

Bodega

This is by my house:

Bodega called 'Food Inc.'

Monday, October 19, 2009

"Privatized" Utilities

Love it: phone companies still cater to the needs of shareholders rather than those of the public, but when it comes to their communications with the government, well that's a state secret or something. State capitalism's privatization of public services once again gives ordinary citizens the worst of both worlds.

I also love love love the argument that any sort of conversation should remain private in the context of defending the telecoms from charges of eavesdropping on their customers.

Wednesday, September 30, 2009

Cycling Mugs

I spent all morning on these:



The minimum pixel size option on Google image search is a tremendous boon to the casual zazzler.

Monday, September 28, 2009

Listen to the Rich Guy

Robert had shared this Joel Spolsky essay on "duct-tape programmers" the other day, and it was sort of bugging me. In searching for it again, I found that it's already received its share of criticism.

It did make me wonder what made Spolsky so willing to promote Jamie Zawinski's advice despite a lot of it appearing to me to be pretty badly misguided. And I guess it has to be because, whatever happened to Netscape later on, he got his zillions of dollars, making him a success by the only meaningful metric of capitalism. And therefore someone whose wisdom should be respected.

Friday, September 25, 2009

Finally!

Terrible piece in the Times about next Tuesday's runoff for comptroller. "Sparks finally fly," but not word one about whether any of the candidates' spark-emitting accusations might have some validity.

Sadly not unusual when it comes to political reporting, but weird in light of the fact that the same reporter profiled each of candidates John Liu and David Yassky in yesterday's edition. Those are good articles! Very informative! And yet from today's piece you'd think the Times couldn't care less about informing voters, four days before they go to the polls.

Tuesday, September 22, 2009

And in More Mixtape Non-News

I never listened to Lil' Wayne's "rock" stuff when it was coming out. How did nobody tell me about his take on an "End of the World as We Know It"/"We Didn't Start the Fire"–style laundry list of modern evils, "Politics"?


Love, hate, size, race, grime, grace, lip injection, lethal injection, lip injection
Lethal injection, your assumption, economical destruction, breast reduction, police corruption
Love, hate, size, race, grime, grace, crime rate, lip injection, lethal injection
Lip injection, lethal injection, breast reduction, police corruption, your assumption
Economical destruction, breast reduction, police corruption, your assumption, economical destruction
Amazing.

Friday, September 18, 2009

Dips of the Woooooorld

The French Dip, which is actually a roast beef sandwich that you DIP.

Invented by France, hence the name.

Dips of the World!

Artichoke Dip, coming to us from Middle America.

Thursday, September 17, 2009

Dips of the World

Dips of the World.

Guacamole of Mexico.

Google Fails Me!

My street cleaning program appears to be working just fine, except for the fact that for some reason Google never sent me either of my SMS reminders this morning. I looked at the calendar and they're set up and everything; I just never got the message. And it worked perfectly on Monday!

It cost me a $115 ticket for double parking, though thankfully my neighbor alerted me before they could tow my car.

Clearly, I'll need a text-messaging system more robust than reminders in Google calendars. AppEngine will let me set up cron jobs (nullus), which I should then be able to use to trigger a message via Zeep.

Tuesday, September 8, 2009

Another SMS Thing

I keep track of my checking account balance and track all my bills in a sparsely populated spreadsheet, with a row for each calendar day and a column for each category of credit or debit (paycheck, transfer to savings, gas bill, ATM, &c.). The resulting balance is tracked in the rightmost column.

My practice has been, when withdrawing money from an ATM machine, to pocket a paper receipt until such time as I find myself before my computer and may record the transaction.

So I made another App Engine service that lets me enter ATM withdrawals into a database,

Withdrawals web app showing a $101.75 withdrawal on 2009-09-03,

and publishes monthly accounts as XML,

XML listing same withdrawal,

which are then consumed by Google spreadsheets' ImportXML() function:

Withdrawal shown in spreadsheet.

I called it "A.T.Them," and once I had it working, I added an endpoint to handle Zeep operations. Now when I withdraw money, I can decline the offer of a paper receipt, saving some trees, and text "atthem 61.50" or whatever and it will pop up right in my spreadsheet.

I can't figure out how to post the source without Blogger mangling the HTML, but it's all trivial in any case. One note is that ImportXML() doesn't do any kind of authentication, so the monthly lists of all my ATM withdrawals are not protected by anything beyond my keeping the URI's at which they may be found a secret.

Likewise (and this vulnerability, such as it is, applies equally to any Zeep service), someone who knew the URI that handles Zeep requests and my Zeep subscriber ID could impersonate "atthem" messages and populate my spreadsheet with junk. It's easy enough to add some sort of challenge and response to Zeep operations, but I didn't bother.

Monday, September 7, 2009

Cyclones vs. Spinners

Sarah and I biked down to Coney Island yesterday for the Cyclones' final regular-season game. Playoff slots had already been determined, so there wasn't anything at stake, which might have been why both teams kept putting in new pitchers. It was weird.

Carlos Beltran was playing for Brooklyn on rehab. He had a solid hit for his second at-bat, and some good if unspectactular fielding, but I think he struck out swinging a couple times. Not really a big hitting day for anyone, actually, with a really strong wind coming in off the water.

Ultimately an exciting game, with Brooklyn attempting a rally in the ninth but unable to overcome the 4-2 deficit. We were glad we brought sweaters, and didn't stick around for the fireworks show scheduled for ninety minutes later.

The ride down was fun, it was our first time going down into Brooklyn from the new neighborhood, which really just means we take Bedford down and then go West on Caton Ave where before we would have been going East on it. I think next time I'm going to stay on Bedford and take Church instead; maybe it was just West Indian Day Parade traffic last night, but I think Caton is usually pretty crazy.

Friday, September 4, 2009

Okay, Now I'm Really Done

Finished porting my street cleaning reminder program to Python for AppEngine, where it seems to be working fine. One unfortunate thing about moving the original desktop C# 3.5 code to ASP.NET 2.0 was that I had to replace all my nice Linq queries with regular loops, so being able to make use of Python features like tuples and list comprehensions was enjoyable.

Here is the code, with my personal identification information removed, and which I hereby release into the public domain:


import cgi


from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app


import gdata.service
import gdata.calendar
import gdata.calendar.service
import atom.service
import gdata.alt.appengine


import string
import time


class Cleanendar(webapp.RequestHandler):
  
  def __init__(self):


    manager = CalendarManager()
    self.commands = { 'n': manager.north, 's': manager.south, '': manager.clear }




  def post(self):


    if self.request.get('event') == 'MO':
      if self.request.get('uid') == MY_ZEEP_UID:


        self.response.headers['Content-Type'] = 'text/plain'
        self.response.out.write(self.process_command(self.request.get('body').lower()))
        return


    self.response.clear()
    self.response.set_status(400)




  def process_command(self, body):


    if body in self.commands:
      self.commands[body]()
      return ''


    else:
      return 'Bad command [' + body + ']'






class CalendarManager:


  def __init__(self):


    self.service = self.get_service()
    (self.calendar, hcalendar) = self.get_calendars(self.service)
    self.id = self.calendar.id.text.split('/')[-1]
    self.holidays = self.get_events(hcalendar.id.text.split('/')[-1])


    self.prefix = 'Cleanendar: '
    self.begin = time.strptime(time.strftime('%Y%m%d', time.localtime()) + '1230', '%Y%m%d%H%M')
    self.end = time.strptime(time.strftime('%Y%m%d', time.localtime()) + '1400', '%Y%m%d%H%M')
    self.daynames = ['Mo','Tu','We','Th','Fr','Sa','Su']




  def get_service(self):


    service = gdata.calendar.service.CalendarService(MY_GOOGLE_ID, MY_GOOGLE_PW, MY_APP_ID)
    service.ProgrammaticLogin()
    return service



  def get_calendars(self, service):


    feed = service.GetAllCalendarsFeed()
    calendar = None
    holidays = None
    for i, c in enumerate(feed.entry):
      if c.title.text == "Cleanendar":
        calendar = c
      elif c.title.text == "2009 NYC Alternate Side Parking":
        holidays = c
    return (calendar, holidays)




  def north(self):
    self.set_days([0,3])




  def south(self):
    self.set_days([1,4])




  def clear(self):
    events = self.get_events(self.id)
    for i, e in enumerate(events.entry):
      if e.title.text.startswith(self.prefix):
        self.service.DeleteEvent(e.GetEditLink().href)




  def set_days(self, days):
    self.clear()
    self.add_event(self.make_event(self.begin, "Move car", days))
    self.add_event(self.make_event(self.end, "Move back", days))



  def get_events(self, id):
    return self.service.GetCalendarEventFeed('/calendar/feeds/' + id + '/private/full')




  def make_event(self, t, desc, days):
    event = gdata.calendar.CalendarEventEntry()
    event.title = atom.Title(text=self.prefix + 'Street cleaning')
    event.content = atom.Content(text=desc)
    event.recurrence = self.make_recurrence(t, days)
    event.reminder = self.make_reminder()
    return event




  def add_event(self, event):
    return self.service.InsertEvent(event, '/calendar/feeds/' + self.id + '/private/full')




  def make_recurrence(self, t, days):
    data = ('DTSTART;TZID=UTC;VALUE=DATE-TIME:' + time.strftime('%Y%m%dT%H%M%S', t) + '\r\n' +
      'DURATION:PT5M\r\n' +
      'RRULE:FREQ=WEEKLY;BYDAY=' + string.join([self.daynames[d] for d in days], ',') + ';' +
      'UNTIL=' + time.strftime('%Y', t) + '1231\r\n' +
      'EXDATE:' + string.join([time.strftime('%Y%m%d', d) + time.strftime('T%H%M%S', t) for d in self.make_exclusions(days)], ',') + '\r\n')
    return gdata.calendar.Recurrence(text=data)




  def make_exclusions(self, days):
    e = []
    for i, h in enumerate(self.holidays.entry):
      for t in [time.strptime(w.start_time, '%Y-%m-%d') for w in h.when]:
        if t.tm_wday in [0,3]:
          e.append(t)
    return e




  def make_reminder(self):
    return gdata.calendar.Reminder(minutes=10, method='sms')




application = webapp.WSGIApplication([('/', Cleanendar)],
                                     debug=True)


def main():
  run_wsgi_app(application)


if __name__ == "__main__":
  main()

Thursday, September 3, 2009

Victory!

Zeep did indeed do what I wanted, and I found a site that hosts ASP.NET for free for 90 days, so I can now set my street cleaning days from my phone!

So if I have it set for the South side of the street (reminding me to move the car on Tuesdays and Fridays), my calendar looks like this:

Week from a Google calendar showing reminders to move the car on Tuesday and Friday

And then I go somewhere and when I come back I park on the North side. So I text "cleander n" to 88147, and the reminders jump to Mondays and Thursday, (excluding any day in the green holiday calendar):

Same week with reminders to move the car on Thursday, with none on Monday because of Labor Day

Zeep recognizes my phone number and uses the "cleander" string to route everything following it to my ASP.NET page in an HTTP POST request.

When the message gets to my site, the "n" or "s" populate the calendar with reminders on the appropriate days, an empty text clears the calendar completely (useful for going on vacation), and anything else will result in an error response.

I've saved "cleander n" and "cleander s" as message templates on my phone, so now any time I park it's just a few quick clicks.

Of course it will all fall apart in 90 days when my AspSpider account is deleted, but in the meantime maybe I'll be able to find some other free hosting option: all I need is to be able to run some sort of code in response to a POST request; the code is in C# right now, but it's short, and Google has APIs for Python and PHP and Java and whatnot as well, so I should be able to find something that works.

Update: Okay, Google's AppEngine will totally do what I need. I'll try it out tonight. It's fun and amusing to cobble together a baroque solution like this all to accomplish something that would take no effort at all if stupid T-Mobile would let me run a program on my phone in the first place. but also sort of depressing that I have to.

Update Deuce: This makes me feel a little better...apparently I'd have to do something similar on the Apple phone, as they don't provide a calendar API. Android does, but it's undocumented, though I would assume they make syncing with Google Calendars pretty easy so maybe it's less work. Palm gets it right.

Wednesday, September 2, 2009

Nerdery

So after being stymied (is that anti-Semitic?) in my attempt to run an alternate-side parking reminder program on my phone, I finally decided to just write a desktop version:

Window for selecting side of street

It sets up recurring events for the beginning and end of street cleaning hours, with an SMS reminder 10 minutes before, and excluding any days listed on a user-specified "holidays" calendar.

So, almost fine. I'll still need to remember to run the program after I get home and park my car, whereas with the mobile application I could have done it right from the phone. But text reminders and not having to set alarms twice a day on street cleaning days gets me 80% of what I wanted.

Something I definitely want to look into is the possibility of using an SMS web gateway to control a similar program running on a web server. I don't know if there are any free web hosts that allow you to run .NET or Python programs...you'd think that kind of thing would be de riguer in this day'n'age, but you could fill a wikipedia with what I don't know about internets hostering.

Update: I forgot to specify that when I wrote "sets up recurring events" that I meant it adds them to a Google calendar. That's where I got the idea to exclude holidays, because there's already a public calendar I subscribe to with all the street cleaning holidays. I also neglected to include the name of the project, which is "Cleanendar" and makes perfect sense.

Monday, August 31, 2009

Dog-Proofing the Litter Box

I was googling around for info on keeping dogs out of the kitty litter a little while ago and ended up at a site that sells covered cat boxes that dogs can't get into. They're sort of expensive, and a little more complicated that what we'd need since Prancis is big enough that he could be foiled by something pretty simple. Here's what I came up with:

Computer model of litter box cover

It's not to scale, but there's the general idea...a little doorway for the cats and an interior wall to keep Prancis away from the goodies. (The litter box on the inside is a model I found on the web.)

I got the wood cut to size at the wood store and put it together with drywall screws because they are the best.

One side and top
Two sides and top
Three sides and top
Four sides and top

They wouldn't do curved cuts, so I had to get a jigsaw (racist).

Box with internal wall visible
Doorway cut

And here it is set up:

Covered litter box

The Colonel (and hence Lucy) can get in:

The Colonel stepping into the box

But Prancis cannot:

Prancis looks at the opening

I still need to sand and paint it. The inside should be glossy white for ease of cleaning. Not sure what we'll do with the outside.

Tuesday, August 18, 2009

Red Bulls!

Via Atrios, one can now take NJ Transit to Giants stadium. I should go watch some soccer!

Friday, August 14, 2009

Nice

I did enjoy this joke, despite it relying sort of overmuch on childhood nostalgia. But well done, in any case. Which also reminds me of this game I read about the other day that sounds like it might be in sort of a similar vein. Being vague here so as to prevent spoiling the comic.

Tuesday, August 11, 2009

What Digby Said

What Digby said:
If these Democrats had spent less time gossiping about what Clinton really did with Monica or handwringing about Gore's "lies" and more time analyzing how those spectacles unfolded, they wouldn't be caught flat footed today. But they didn't because they blamed Clinton for being "weak" and Gore for being "inauthentic" as if those were the real problems. I'm sure it made them feel very confident that it couldn't happen to them.
Though actually I had been surprised with how well the Obama administration was doing in this regard, right up until the health insurance reform lunacy. My guess is that the economic crisis had media types genuinely unsure of the future, to the point where they were less willing to undermine a president who seemed to be trying to make things better, even if he was a Democrat. Now that we're on more familiar ground, it's back to business as usual.

Sunday, August 2, 2009

Baseball Sex

Man, it's been forever since I downloaded mix tapes...now Gucci Mane is everywhere? With OJ Da Juiceman?

But Lil Wayne's "Baseball Sex" was basically designed in a laboratory to appeal specifically to me.

Monday, July 27, 2009

The Victim-Blaming Impulse

Excellent post from Amanda on abusive police. Especially this passage:
Victim blamers are often also telling a story about how they personally will never be...arrested unfairly for doing something totally legal. To blame Gates for being stupid is to say, "I would never get arrested for breaking into my house, because I have the sort of self-preservation instincts that this man is clearly missing." People enjoy the illusion of having more mastery of the world than they do, because it makes them feel safe, but it also contributes to an atmosphere where victim-blaming can flourish, particularly in situations that are loaded with racial or gender politics.
I think this is hugely significant. And also tragic, because it's a reaction basically rooted in the recognition of just how horrible it would be to find oneself in a victim's situation, i.e., empathy. Ideally we'd be able to channel that initial identification with the victim toward something more constructive.

Cyclones @ Yankees

Well we finally made it to the Ballpark at St George on Staten Island, which was as awesome as advertised. The seats along the third base side have the best views of the harbor. Crazy thunderstorms prompted two separate rain delays, neither of which were called when it was actually raining...very bush league, guys.

Great game, though. The Yankees came back against an early Cyclones lead, but couldn't quite overcome the Brooklyn powerhouse. Wish it hadn't run so long that the ferries were on their hourly schedule by the end, but what can you do.

Friday, July 24, 2009

Barcode Question

You know when you buy tickets to something, or check in for a flight, online, and they send you an Url you can click on to print your tickets out at home? And then you bring in the ticket and they scan the barcode? The tickets are full page deals, which seems like such a waste: can I print 2- or 4-to-a-page and still have them scan?

May try a few mini tickets in Staten Island just to check.

Setup Error

I have been working on this stupid bug like all week: one of my programs would occaisionally pop up a window entitled "Setup Error," with the contents "Failed to load resources from resource file. Please check your Setup" and then disappear when the window was dismissed: no exceptions to catch, no other clue as to what might be wrong.

It's evidently a symptom that can arise under several different circumstances: I found several people who saw it when causing an infinite recursion, or when running an application on a machine with certain third-party anti-virus software installed. I didn't find anything that sounded like my circumstances, so I record them here in hopes that frustrated searchers might be helped along.

My setup and architecture were as follows:

  • .NET Framework 1.1;
  • One UI event handler hides the main form and creates another form, displayed in its own Get/Translate/Dispatch message loop until it's closed;
  • The new form creates a System.Windows.Forms timer;
  • At which point, certain calls (the two I found were System.Threading.Thread.Start() and the overloaded System.Xml.XmlDocument.Load() that takes a URI string; the one taking a TextReader worked fine) cause the "Setup Error" when made from the timer elapsed event handler.
Also, the "Setup Error" only occurred when running a Release build, either from Windows or from Visual Studio "Without Debugging."

I'm still not sure exactly what I was doing wrong, or whether I was encountering a bug in the framework. I refactored the code to get rid of my inner message loop and it seems to have fixed things, so I assume that the implementation of the forms timer somehow relies on its only being maintained by the built-in message loop...but in such a way that causes only certain other methods to fail? It's a mystery.

Please Save Us from the Liberals

Some of the commentary around the Skip Gates arrest regarding how much benefit of the doubt to give the police officer has been pretty absurd. But Bob Somerby's hints towards police apologia are positively risible:
Gates is wealthy, affluent—famous, influential. Officer Crowley quite plainly is not—which forms part of a famous old American story.
As if Gates had demanded "do you know who I am?" of a surly counter clerk at Au Bon Pain, rather than the armed officer of the law standing in his foyer.

Teasing his upcoming Friday post, Somerby opts for verbal irony:
Guess what, kids? Upper-class people, of whatever race, often have trouble respecting working-class people.
And cops "often have trouble" acknowledging the rights of (let alone respecting) anybody without a badge. And I will grant in a heartbeat that we wouldn't have heard word one about this injustice had the victim not been a Harvard professor, but that's an argument for more scrutiny of law enforcement, not less.

And then this:
(Persistently, this has harmed progressive interests.)
Again, this is part of the teaser for Somerby's Friday post, so I can't really say exactly how his argument for this point will go. But from the content of this post, it sure looks like it might be along the lines of clueless limousine liberals who don't have time for the concerns of the working class. Which is normally the kind of nonsense that Somerby is so good at taking apart, so it's especially annoying to see inklings of it here.

A reminder: Democrats, and liberals, do great with the working class. It's those of the suburban middle class who like to defend their Republican voting habits by claiming that progressives are out-of-touch elitist snobs; the voters who seek out "safe neighborhoods" with "good schools" and worry about "personal responsibility," and vote Republican because John Kerry looks French. Those people are out of Democrats' reach, for what should be obvious reasons.

One set of people that liberals could do better with are those on the left who see things like Democrats turning a blind eye towards police thuggery as a reason to vote third-party or stay home. Somerby is an all likelihood correct that "progressive interests" don't have anything to do with resisting abuse of authority; to which I say, to hell with progressive interests, and to hell with liberals who side with the bullying cop over the rich professor because it will play in Peoria.

Thursday, July 23, 2009

Having not been to a Cyclones game (yet!) this summer...

...I have no idea whether, or in what capacity, the team may have made use of Jay-Z's "Brooklyn (Go Hard)", but now that I'm thinking about it, it seems like an ideal stadium chant.

Of course immediately you run into the problem of, with the "Brooklyn, we go hard" chant and then "Brooklyn" spelled out over it, is doing that as a group in an audience setting really something that is rhythmically within the grasp of your average baseball fan?

And then of course I realized that minor league baseball was probably not the sport for which Jay-Z intended the song to function as a cheer, and I looked up the lyrics and he even mentions how he's going to "bring the Nets" in a verse of the song.

So I'm an idiot basically, but also I hope they've been playing the song at KeySpan.

Tuesday, July 21, 2009

The Capitalist Solution to Health Care: More Money for Capitalsts

The apologists for capitalism really are beyond parody.

I will quibble with digby's implication that this has anything to do with a misplaced faith in markets per se; there's nothing inherently absurd about insurance insurance (and it sort of exists in, e.g., auto policies that include coverage for collisions with uninsured drivers), and if there were sufficient demand for those kinds of policies then insurance companies would offer them.

That's not good enough for the likes of Cato, however, who aren't happy unless the very maximum amount of wealth is being extracted from the populace and funneled into corporate coffers. The crisis of the medically at-risk being insufficiently covered by rapacious insurance companies becomes the opportunity for those selfsame insurers to squeeze out one more drop of blood. Such is the nature of capitalism: markets are a means to an end, but it is the end—the continued ascendancy of the capitalist class—that is paramount, and when markets aren't getting the job done they are dropped to the side without a second thought.

Wednesday, July 15, 2009

My Afternoon on the Internet

I have a recurring idea that it would be sweet to make some sort of 2D platform type game but with really awesome character animation, like if not actually rotoscoped then approaching rotoscope-caliber.

Sometimes I even start trying to animate a walk cycle before I remember that making awesome character animation is actually really difficult, and if you can pull it off then it is pretty much enough to carry a hit game. I have literally wanted to do something along these lines since I was making crappy games on the Mac using Ingemar's Sprite Animation Toolkit. And it haunts me yet!

The latest incarnation of this lunacy was an idea I had, while walking the dog, that there should be a game where the player is a dog, but only it's animated totally awesome and you can sit down and gallop and stuff and it looks like the movements of an actual dog, albeit 2D and lo-res. Amazing right!

And actually there is a game where you're a dog, but it's 3D and for the Playstation Deuce and the character animation is not even that good. (No disrespect, the animators did a great job, but it looks like they didn't use motion capture, so it's both not quite realistic and damned impressive that it looks as realistic as it does.)

And thus did I find myself searching for visual references regarding the canine walk cycle, which led me to this link, and damn. That page is huge! And loaded with diagrams! And very heavily footnoted!

And then I scrolt up to the top of the page and it was chapter ninety-one! Of what?!? A textbook with the best cover graphic ever.

If only Netflix had been around during college

Just remembering all those all-night bull sessions spent debating which Meatballs sequel was most Lynchian.

Netflix recommendations window suggesting that 'Meatballs 4' and season one of 'Coach' are similar to 'Eraserhead'

Tuesday, July 14, 2009

Personal Virtue as a Poor Substitute for Political Change

Via the Just Seeds blog, a great article summing up the flaws inherent in the personal virtue model of social change.

Not a new idea by any means, but one that I've always found interesting and thought-provoking. I've always liked Noam Chomsky's succinct rejoinder along these lines:
Q: [H]ow can you justify living a bourgeois life and driving a nice car?

A: ... When I go to visit peasants in southern Colombia, they don't want me to give up my car. They want me to help them.
Just so. It's an obvious point, but so easy to lose track of in our culture, even once you're aware of the dynamic at work.

And it really is a distraction, as teeth-gnashing over one's contribution to gentrification, for example, ends up being "white guilt" of the most pointless sort: you either waste your time twisting yourself into knots, trying to explain how you're actually not part of the problem; or you shrug your shoulders and resign yourself to being an irredeemable oppressor, and thus liberated from any responsibility to change the system.

Monday, July 13, 2009

Dog Walk Conversation

"How much did you pay for that dog?"

"He's from a shelter, so nothing."

"What's his name, German shepherd?"

"Uh, it's Prancy."

"Okay, Fancy. Don't bite me."

"Oh, he doesn't bite."

"Yes he does."

Calorie Labeling

Ezra has an anecdote about how a restaurant labeling its menu items with calorie counts would have changed his lunch order. At the Mets game Saturdy we noticed that the roving food vendors now wear buttons advertising the calorie counts of their wares. It was a welcome bit of information, and did lead one of our number away from the fallacious "not sure if I could eat a whole hot dog, maybe just a soft pretzel" line of thinking.

The game, by the way, was great, and we all had a blast on our first visits to Citi Field. Santana was amazing, and though for the most of the game he didn't leave the rest of the Mets defense with much to do (probably a good thing), we did get to see a double play in the latter innings. And though rain threatened from about the seventh inning stretch on, it held off until we were on the way home.

Friday, June 26, 2009

Boo

The program I wanted to write for my phone was simple: I wanted to be able to select which side of the street my car was parked on, and have it add alarms to the calendar reminding me to move my car for street cleaning on the appropriate days of the coming week.

It was easy! And it runs perfectly in the Nokia emulator, but when I tried running it on my actual phone...SecurityException!

And basically I'm screwed, as it seems T-Mobile locks everything down...no "third party" access to user data (such as the calendar) at all.

Of course, I'm not even a "third party," I'm the second party, the owner of the phone. How annoying.

Needless to say, my next telephone will run Lunix.

And my code I hereby release into the public domain:

package street;


import java.util.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.pim.*;


/**
 * @author Travis
 */
public class StreetCleaning extends MIDlet implements ItemStateListener {
    public void startApp() {
        Form form = new Form("Street Cleaning");


        options = new ChoiceGroup(null, Choice.EXCLUSIVE);
        options.append("North (Mon/Thu)", null);
        options.append("South (Tue/Fri)", null);
        options.append("None", null);


        form.append(options);
        form.setItemStateListener(this);


        Display.getDisplay(this).setCurrent(form);
    }


    ChoiceGroup options;
    static final String summary = "Move car";


    public void itemStateChanged(Item item) {
        PIM pim = PIM.getInstance();
        String reminders = pim.listPIMLists(PIM.EVENT_LIST)[4];


        Calendar today = Calendar.getInstance();


        try {
            EventList events = (EventList)pim.openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE, reminders);


            // get rid of existing notices
            for (Enumeration items = events.items(); items.hasMoreElements(); ) {
                Event event = (Event)items.nextElement();
                if (event.getString(Event.SUMMARY, PIMItem.ATTR_NONE).equals(summary))
                    events.removeEvent(event);
            }


            // select days of week based on side of street
            int[] days;
            int side = options.getSelectedIndex();
            if (side == 0) {
                days = new int[2];
                days[0] = Calendar.MONDAY;
                days[1] = Calendar.THURSDAY;
            }
            else if (side == 1) {
                days = new int[2];
                days[0] = Calendar.TUESDAY;
                days[1] = Calendar.FRIDAY;
            }
            else
                days = new int[0];


            for (int i = 0; i < days.length; i++) {
                // set alarms for next coming weekday
                int apart = days[i] - today.get(Calendar.DAY_OF_WEEK);
                if (apart < 0 ||
                        apart == 0 && today.get(Calendar.HOUR_OF_DAY) > 10)
                    apart += 7;


                // first event
                Calendar day = Calendar.getInstance();
                day.setTime(new Date(day.getTime().getTime() + apart * 24 * 3600 * 1000));
                day.set(Calendar.HOUR_OF_DAY, 8);
                day.set(Calendar.MINUTE, 20);
                day.set(Calendar.SECOND, 0);
                day.set(Calendar.MILLISECOND, 0);


                Event event = events.createEvent();
                event.addDate(Event.START, PIMItem.ATTR_NONE, day.getTime().getTime());
                event.addInt(Event.ALARM, PIMItem.ATTR_NONE, 1);
                event.addString(Event.SUMMARY, PIMItem.ATTR_NONE, summary);


                events.importEvent(event).commit();


                // second event
                day.set(Calendar.HOUR_OF_DAY, 9);
                day.set(Calendar.MINUTE, 50);


                event = events.createEvent();
                event.addDate(Event.START, PIMItem.ATTR_NONE, day.getTime().getTime());
                event.addInt(Event.ALARM, PIMItem.ATTR_NONE, 1);
                event.addString(Event.SUMMARY, PIMItem.ATTR_NONE, summary);


                events.importEvent(event).commit();
            }
        }
        catch (PIMException ex) {
            Display.getDisplay(this).setCurrent(new Alert(ex.getMessage()));
        }


        destroyApp(false);
        notifyDestroyed();
    }


    public void pauseApp() {
    }


    public void destroyApp(boolean unconditional) {
    }
}