photo meme, because I should be in bed
Sep. 19th, 2008 12:29 am( photo of me. boy, do I look tired. )
1. Take a picture of yourself right now.
2. Don't change your clothes, don't fix your hair - just take a picture.
3. Post that picture with no editing.
4. Post these instructions with the picture.
via: just about everyone on my friends list
1. Take a picture of yourself right now.
2. Don't change your clothes, don't fix your hair - just take a picture.
3. Post that picture with no editing.
4. Post these instructions with the picture.
via: just about everyone on my friends list
This post made mainly for the benefit of google, since this took me over a day to solve and I can't possibly be the only one to have run into this problem. Deep geek stuff follows, feel free to skip it.
HTTP specifies a mechanism for the client to negotiate what the content-type of the response will be: the Accepts: header. This is a list of content-types, including asterisks; e.g. text/html, application/xml, text/*, */*. The server is supposed to match the available formats for rendering the requested resource against the list the client has requested and return the resource in the first matching format.
Merb is a lightweight Ruby web framework that's often used for places where a Rails app would be overkill or inappropriate (e.g. somewhere you need to be able to handle concurrent requests without running a whole pack of Mongrels, since Rails isn't threadsafe). Merb supports HTTP content negotiation, but it does not support requested content-types containing only one wildcard (it'll handle text/xml and */*, but not text/*).
Finally, Flash for Windows sends Accepts: text/* in HTTP requests. Flash on Mac and Linux sends Accept-Types: text/*; I have no idea where this comes from, as this header is nonstandard.
Since Flash for Windows sends an Accepts: header, Merb will perform content negotiation and explode messily (returning http status 462), since it doesn't know what to do with text/*. Since Flash for Mac and Linux doesn't, it will happily assume that the client sent */* and proceed merrily on its way. I've talked to the Merb guys and they agree that Flash for Windows just might be a sufficiently popular use case to make it worth fixing this.
So, if you have a Flash app embedded in your app that talks to a Merb app on the server (e.g. a file uploader that provides a progress bar and multi-file uploads) and you're rendering a string of XML as content (e.g. the results of asking an object to produce an XML representation of itself), bypass content negotiation completely by calling
Note to self: clean this up later.
HTTP specifies a mechanism for the client to negotiate what the content-type of the response will be: the Accepts: header. This is a list of content-types, including asterisks; e.g. text/html, application/xml, text/*, */*. The server is supposed to match the available formats for rendering the requested resource against the list the client has requested and return the resource in the first matching format.
Merb is a lightweight Ruby web framework that's often used for places where a Rails app would be overkill or inappropriate (e.g. somewhere you need to be able to handle concurrent requests without running a whole pack of Mongrels, since Rails isn't threadsafe). Merb supports HTTP content negotiation, but it does not support requested content-types containing only one wildcard (it'll handle text/xml and */*, but not text/*).
Finally, Flash for Windows sends Accepts: text/* in HTTP requests. Flash on Mac and Linux sends Accept-Types: text/*; I have no idea where this comes from, as this header is nonstandard.
Since Flash for Windows sends an Accepts: header, Merb will perform content negotiation and explode messily (returning http status 462), since it doesn't know what to do with text/*. Since Flash for Mac and Linux doesn't, it will happily assume that the client sent */* and proceed merrily on its way. I've talked to the Merb guys and they agree that Flash for Windows just might be a sufficiently popular use case to make it worth fixing this.
So, if you have a Flash app embedded in your app that talks to a Merb app on the server (e.g. a file uploader that provides a progress bar and multi-file uploads) and you're rendering a string of XML as content (e.g. the results of asking an object to produce an XML representation of itself), bypass content negotiation completely by calling
render @foo.to_xml, :format => :xml
explicitly.Note to self: clean this up later.
(no subject)
Nov. 25th, 2007 02:02 amI've actually done some technically interesting stuff at work in the past few months. I should collect my thoughts and start blogging it sometime instead of just braindumping into IRC; I'm sure everyone in all the channels I'm in would appreciate it. I think I'll talk about the insane Solr patch next time I make an entry, as a start.
Bed, however, beckons at the moment.
Bed, however, beckons at the moment.
IRC silliness
Oct. 20th, 2006 12:27 am<@teferi> BREW /frenchroast/black HTCPCP/1.0
<@teferi> \r\n\r\n
* teferi waits
< Veloso> Holy shit, man
< Veloso> You need to use SHTCPCP
< md> This is the age of terrorism teferi
< md> What if your coffee pot was hijacked and began brewing coffee for
terrorists.
<@teferi> md: it is entirely likely that they would die of caffeine overload
< md> The arabs can't handle the hybrid of american-jew coffee
<@teferi> I should see if it can eat through plastic
<@teferi> Actually
<@teferi> I know a guy who makes a brew that does that
<@teferi> Seriously observant Orthodox Jew
<@teferi> The coffee is...well, unbelievably Hasidic.
< md> like lexan or just asdfhasdlkhsdaflajsdf
I am a horrible, bad person.
<@teferi> \r\n\r\n
* teferi waits
< Veloso> Holy shit, man
< Veloso> You need to use SHTCPCP
< md> This is the age of terrorism teferi
< md> What if your coffee pot was hijacked and began brewing coffee for
terrorists.
<@teferi> md: it is entirely likely that they would die of caffeine overload
< md> The arabs can't handle the hybrid of american-jew coffee
<@teferi> I should see if it can eat through plastic
<@teferi> Actually
<@teferi> I know a guy who makes a brew that does that
<@teferi> Seriously observant Orthodox Jew
<@teferi> The coffee is...well, unbelievably Hasidic.
< md> like lexan or just asdfhasdlkhsdaflajsdf
I am a horrible, bad person.
random day trip
Oct. 15th, 2006 09:56 pmI had a nice day out today. Got up, went into Manhattan, had a bowl of pho for lunch at Pho 32, went across the river to Brooklyn (after rather more hilarity than I expected; I always forget how much maintenance the MTA does on the weekends and doesn't really go out of its way to tell you about), and visited the Transit Museum, which was much more fun than I expected, even being the gigantic train nerd that I am.
The highlight of the museum was, of course, the old subway cars on the lower level (the museum is a converted subway station and is still live and tied into the rest of the system) - I need to upload the photos of the old ads in the cars that I took, which range from hilarious ("Protect your country from the forces of International Communism! Join the Civil Defense Corps!") to slightly disturbing ("Every Woman Will Eventually Vote - For Gold Dust"). And apparently eighty-four out of a hundred women prefer a man who wears a hat.
Other neat bits from the museum: at the end of the lower-level platform, there's a control tower that's still hooked into the system, with a board that you can watch trains moving around on. I realize that I'm being a five-year-old here, but it was cool. The normal exhibits were interesting, including one on the workers who built the system in the first place that touched on race and labor issues more than I thought it would.
After the museum, I stopped into a bookstore to have a coffee and replenish my stock of reading material, as I'll be damned if I spend an hour getting somewhere to only do one thing once getting there. Shared a table at the cafe with a gentleman who turned out to be a math teacher at a local school; the two of us ended up helping a young mother at another table with her algebra homework while her friend at her table calmed her over-excited child. It was a bit of a touching moment.
I had dinner (mmm, yaki ika) and a beer at the izakaya (named "Yakitori Taisho", I believe) on St. Mark's Place that
pvx0 has raved to me about before; it was as good as he promised. Said place (well, a photo of it) was featured in the New York Times recently as part of a story on a subculture of Japanese expats who frequent the area; strange coincidence.
I haven't been looking at craigslist for places to live hard enough. I think I need to set some deadline for me to be moved out by that's closer than "the end of the year"; I'm really missing out by not living in New York proper.
The highlight of the museum was, of course, the old subway cars on the lower level (the museum is a converted subway station and is still live and tied into the rest of the system) - I need to upload the photos of the old ads in the cars that I took, which range from hilarious ("Protect your country from the forces of International Communism! Join the Civil Defense Corps!") to slightly disturbing ("Every Woman Will Eventually Vote - For Gold Dust"). And apparently eighty-four out of a hundred women prefer a man who wears a hat.
Other neat bits from the museum: at the end of the lower-level platform, there's a control tower that's still hooked into the system, with a board that you can watch trains moving around on. I realize that I'm being a five-year-old here, but it was cool. The normal exhibits were interesting, including one on the workers who built the system in the first place that touched on race and labor issues more than I thought it would.
After the museum, I stopped into a bookstore to have a coffee and replenish my stock of reading material, as I'll be damned if I spend an hour getting somewhere to only do one thing once getting there. Shared a table at the cafe with a gentleman who turned out to be a math teacher at a local school; the two of us ended up helping a young mother at another table with her algebra homework while her friend at her table calmed her over-excited child. It was a bit of a touching moment.
I had dinner (mmm, yaki ika) and a beer at the izakaya (named "Yakitori Taisho", I believe) on St. Mark's Place that
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-userinfo.gif)
I haven't been looking at craigslist for places to live hard enough. I think I need to set some deadline for me to be moved out by that's closer than "the end of the year"; I'm really missing out by not living in New York proper.
long-overdue update
Jun. 20th, 2006 10:28 amWow, I haven't updated in a while. Here's what I've been up to:
And now, the big thing:
I finally got around to posting my resume to Monster (annoying site! why must you only accept them in Word format!) and applied for a job I found through there. I got rejected for that by the automated system the very next morning (isn't technology wonderful?), but the very next day (last Friday), I got a call from a recruiter for another company. I told him I was interested in the job he recruiting for (junior Java developer), and he put me through to the company's senior developer, who put me through a phone screening. I breezed through the screening (easier than I thought it would be!) and they scheduled me for an interview the next day. I was kinda nervous when I showed up and took much longer on the first interview question (write an iterative Fibonacci number calculating routine) than I should have, but after that, I loosened up and the rest of it went pretty smoothly. They told me that I'd hear from them next week.
Yesterday, as I was boarding a train home from New York (hooray, more medical stuff), I got a call from the recruiter. He offered me a job.
Let me say that again: THEY OFFERED ME A JOB!
The work sounds interesting, the people I met seemed really nice, and the money and benefits are apparently good for an entry-level tech job in New York, so I accepted. Starting next Monday, I'll be a junior developer at IPSoft, a big IT company in downtown Manhattan. Wheeeeeeeeeeeee!
I'm so excited. I thought I was going to be job-hunting until mid-July at the earliest.
Finally, Susannah is hopefully coming down to see me later this week. Happiness all around :)
- After I got home from graduation, I interviewed for a job at the startup that my friend Adam works for. I kinda blew that one, though to be fair, there was a language barrier issue (the senior dev interviewing me didn't speak English very clearly and I don't speak Chinese at all, so we were more or less in a constant state of confusion).
- I went and visited Susannah for the better part of a week. Yay :)
- I finally got to play Katamari Damacy on my friend Matt's PS2. Um. Coolest console game ever. I can't really justify buying a PS2 for just one game, though.
- I visited various doctors for routine checkups and found that my left eye is lazy again and needs surgery again. Bah.
And now, the big thing:
I finally got around to posting my resume to Monster (annoying site! why must you only accept them in Word format!) and applied for a job I found through there. I got rejected for that by the automated system the very next morning (isn't technology wonderful?), but the very next day (last Friday), I got a call from a recruiter for another company. I told him I was interested in the job he recruiting for (junior Java developer), and he put me through to the company's senior developer, who put me through a phone screening. I breezed through the screening (easier than I thought it would be!) and they scheduled me for an interview the next day. I was kinda nervous when I showed up and took much longer on the first interview question (write an iterative Fibonacci number calculating routine) than I should have, but after that, I loosened up and the rest of it went pretty smoothly. They told me that I'd hear from them next week.
Yesterday, as I was boarding a train home from New York (hooray, more medical stuff), I got a call from the recruiter. He offered me a job.
Let me say that again: THEY OFFERED ME A JOB!
The work sounds interesting, the people I met seemed really nice, and the money and benefits are apparently good for an entry-level tech job in New York, so I accepted. Starting next Monday, I'll be a junior developer at IPSoft, a big IT company in downtown Manhattan. Wheeeeeeeeeeeee!
I'm so excited. I thought I was going to be job-hunting until mid-July at the earliest.
Finally, Susannah is hopefully coming down to see me later this week. Happiness all around :)
- One finished filesystem for Operating Systems
- 36 lines of Ruby to generate power sets and check (set,set of subsets) pairs for topology-hood
- Four pages of notes breaking the first 18 3-element topologies on a three-point set into three homeomorphism classes. Will do the remaining 28 and write the paper tomorrow.
Not too bad for a day's work. I just might get this all done on time after all.
(no subject)
Apr. 24th, 2006 04:25 amNew Rule: No more building release tarballs at four in the morning.
I rm -rfed the wrong directory and blew away my working copy of the Cinf compiler. I didn't lose any of the compiler itself - thank God for version control - but all of my test programs and scratch stuff are gone. D'oh.
Even worse, I accidentally posted this to
debian at first. Yikes. Time to go to bed before I break something else.
I rm -rfed the wrong directory and blew away my working copy of the Cinf compiler. I didn't lose any of the compiler itself - thank God for version control - but all of my test programs and scratch stuff are gone. D'oh.
Even worse, I accidentally posted this to
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-community.gif)
shopping trip challenge
Apr. 19th, 2006 03:47 pmI just got back from PriceChopper, where I bought the following:
I think that everyone would agree that this is a strange assortment of items. *I* know why I bought them, but you don't. I challenge you, readers and friends, to come up with a coherent story behind my buying all of these. Winner gets, I dunno, a cookie or something.
- Two (2) sets of mousetraps (of two different kinds)
- Two (2) sympathy cards
- One (1) tuna roll
I think that everyone would agree that this is a strange assortment of items. *I* know why I bought them, but you don't. I challenge you, readers and friends, to come up with a coherent story behind my buying all of these. Winner gets, I dunno, a cookie or something.