﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>joseph's Xanga</title><link>http://www.xanga.com/joseph</link><description>Latest Xanga weblog from joseph</description><language>en-us</language><ttl>60</ttl><image><title>The Weblog Community</title><url>http://s.xanga.com/images/xangalogobutton.gif</url><link>http://www.xanga.com/joseph</link></image><item><title>The demoralizing solution...</title><link>http://www.xanga.com/joseph/657271702/the-demoralizing-solution.html</link><guid>http://www.xanga.com/joseph/657271702/the-demoralizing-solution.html</guid><pubDate>Fri, 16 May 2008 18:33:26 GMT</pubDate><description>This is the solution to the &lt;a href="http://weblog.xanga.com/joseph/657253715/my-demoralizing-interview-question.html" target="_new"&gt;post&lt;/a&gt; I made earlier today.&amp;nbsp; If you aren't interested in the explanation, feel free to skip to the &lt;a href="#solution" target="_new"&gt;bottom&lt;/a&gt;.&amp;nbsp; &lt;br&gt;&lt;br&gt;On first appearance, this question looks like something that could be solved via binary search.&amp;nbsp; In other words, you could divide the problem in half by dropping a sphere half-way up, and using that to determine whether to search up or down from that point.&amp;nbsp; &lt;br&gt;&lt;br&gt;This isn't a bad solution, especially if the first sphere doesn't break on the first few drops.&amp;nbsp; A good case for this solution is the following.&amp;nbsp; 5 drops before the first sphere breaks.&amp;nbsp; Floors 50, 75, 88, 95, 98, 100. and then one additional drop to verify that the spheres break on the 99th floor or the 100th floor.&amp;nbsp; 6 drops!&amp;nbsp; not bad.&amp;nbsp; A better case would be that the spheres are super fragile and break on the first floor.&amp;nbsp; Then it would only take 2 drops.&amp;nbsp; One on the 50th floor and one on the first floor.&amp;nbsp; The problem is, we're solving for the worst case.&amp;nbsp; The worst case is that the sphere breaks on the 49th or 50th floor.&amp;nbsp; Why?&amp;nbsp; Because to verify which floor it breaks on.&amp;nbsp; You drop the first sphere on the 50th floor and it breaks.&amp;nbsp; Then you drop the second sphere 49 additional times (starting from the bottom of the stairs, because you can't know if one of those lower floors is your actual answer).&amp;nbsp; Worst case?&amp;nbsp; 50 drops.&amp;nbsp; Ouch.&amp;nbsp; &lt;br&gt;&lt;br&gt;So obviously we can do better.&amp;nbsp; Now lets take my ex co-worker's (Patrick and Justin's) solution.&amp;nbsp; This was also my second attempt to answer this question.&amp;nbsp; Drop the first sphere at 10 floor intervals, starting from the bottom.&amp;nbsp; The best case solution for this strategy is 2 drops.&amp;nbsp; First sphere shatters on the 10th floor, and second sphere shatters on the 1st floor.&amp;nbsp; Nice.&amp;nbsp; How about worst case though?&amp;nbsp; Worst case is the 99th or 100th floor.&amp;nbsp; You drop the first sphere on floors 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 and then it shatters.&amp;nbsp; Next you start from the 91st floor and work your way up 91, 92, 93, 94, 95, 96, 97, 98, 99.&amp;nbsp; Worst case performance is 19.&amp;nbsp; Not too shabby.&amp;nbsp; Much better than the first solution.&amp;nbsp; But still not the best.&amp;nbsp; &lt;br&gt;&lt;br&gt;I failed to make this next intuitive leap, which would have made the solution very apparent to me.&amp;nbsp; Essentially, you need to find a way, such that every time you drop your first sphere, you reduce the number of possible times you'll have to drop your second sphere.&amp;nbsp; But you don't need to be greedy.&amp;nbsp; You don't have to reduce the number of times you drop the second sphere by a lot.&amp;nbsp; Just by a little.&amp;nbsp; Only one less in fact.&amp;nbsp; &lt;br&gt;&lt;br&gt;But how can I reduce the number of times I have to drop the second sphere?&amp;nbsp; Simple.&amp;nbsp; Reduce the number of floors between each drop of the first sphere.&amp;nbsp; If I drop the first sphere on the Nth floor and it breaks.&amp;nbsp; Then my worst case is N-1 drops of the second sphere.&amp;nbsp; 1 drop + N-1 drops = N drops.&amp;nbsp; &lt;br&gt;&lt;br&gt;If it doesn't break on the Nth floor, then I know none of the floors below it have to be checked, but I've used one of my drops.&amp;nbsp; So my next drop will occur from N -1 floors above the Nth floor.&amp;nbsp; If it shatters now, then my worst case is N-2 drops of the second sphere.&amp;nbsp; 2 drops + N-2 drops = N drops.&lt;br&gt;&lt;br&gt;Now if it still hasn't broken, I can just continue this pattern, by going up N-2 floors, then N-3 floors etc... until I reach the 100th floor.&amp;nbsp; We effectively have a way to keep the worst case performace constant!&amp;nbsp; Using this strategy and working backwards you can find that the best "N" to start from is 14.&amp;nbsp; This is because 1+2+3+4+5+6+7+8+9+10+11+12+13+14 = 105.&amp;nbsp; If N is too small to start out with then your interval will reach zero before you reach the top of the building, and you'll have to make up the difference with extra drops.&amp;nbsp; &lt;br&gt;&lt;br&gt;&lt;span id="solution" style="font-weight: bold;"&gt;Solution&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;So the final solution is to start on the 14th floor and drop a sphere.&amp;nbsp; Then as long as the first sphere doesn't break, move up the building in intervals that shrink by 1 floor.&amp;nbsp; Once it breaks, start from the floor above the last place you dropped a sphere from that didn't break and move your way up.&amp;nbsp; Your worst case will always be 14 drops.&amp;nbsp; &lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;br&gt;Later - &lt;br&gt;&lt;br&gt;Joe&lt;br&gt;</description><comments>http://www.xanga.com/joseph/657271702/the-demoralizing-solution.html#firstcomment</comments></item><item><title>My Demoralizing Interview Question</title><link>http://www.xanga.com/joseph/657253715/my-demoralizing-interview-question.html</link><guid>http://www.xanga.com/joseph/657253715/my-demoralizing-interview-question.html</guid><pubDate>Fri, 16 May 2008 13:49:25 GMT</pubDate><description>I've been doing interviews all week, and this last Thursday, I was interviewing with Hi5.com.&amp;nbsp; The interview had being going surprisingly well.&amp;nbsp; The interviewer was really impressed with the work I'd done in grad school and at Xanga, and I'd just answered a pretty interesting question about optimizing data stacks for performance. &amp;nbsp; Then I got this question:&lt;br&gt;&lt;br&gt;You have two identical spheres that break when dropped from a height greater than X floors.&amp;nbsp; You have a 100 Floor building and you're guaranteed that X is less than 100.&amp;nbsp; Give a strategy to determine the greatest height that the spheres can be dropped from without breaking.&amp;nbsp; &lt;span style="font-weight: bold;"&gt;[edit:&amp;nbsp; Assume that until a sphere breaks, it is just as strong as it was before you dropped it. ]&lt;/span&gt;&amp;nbsp; Once a sphere breaks, you can no longer drop it (cause its broken duh!).&amp;nbsp; Now give a strategy that minimizes the worst case number of times you drop a sphere.&amp;nbsp; &lt;br&gt;&lt;br&gt;I know the answer now, but only after being coached through the mud by the interviewer.&amp;nbsp; &amp;gt;_&amp;lt;&amp;nbsp; Feel free to give it a shot, and prove that you're smarter than I am.&amp;nbsp; I'll post the solution later if nobody figures it out.&amp;nbsp; &lt;br&gt;&lt;br&gt;Over and out,&lt;br&gt;&lt;br&gt;-Joe&lt;br&gt;&lt;br&gt;[Edit:&amp;nbsp; The solution can be found &lt;a href="http://weblog.xanga.com/joseph/657271702/the-demoralizing-solution.html" target="_new"&gt;here&lt;/a&gt;. ]&lt;br&gt;&lt;br&gt;</description><comments>http://www.xanga.com/joseph/657253715/my-demoralizing-interview-question.html#firstcomment</comments></item><item><title>The real reason I'm terrified of Chris Choi...</title><link>http://www.xanga.com/joseph/654812022/the-real-reason-im-terrified-of-chris-choi.html</link><guid>http://www.xanga.com/joseph/654812022/the-real-reason-im-terrified-of-chris-choi.html</guid><pubDate>Wed, 30 Apr 2008 15:56:39 GMT</pubDate><description>&lt;P&gt;&lt;A href="http://photo.xanga.com/joseph/0eae6186611801/photo.html" target=_blank&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" alt=bunny src="http://x0e.xanga.com/ae68523175db8186611801/z143243014.jpg" width=400&gt;&lt;/A&gt; &lt;/P&gt;&lt;P&gt;By Chris Choi.&amp;nbsp; &lt;/P&gt;&lt;P&gt;And now you know why he scares me.&amp;nbsp; O_O&amp;nbsp; &lt;/P&gt;&lt;P&gt;[edit:&amp;nbsp;I had the following IM conversation&amp;nbsp;with chris:]&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;FONT color=#ff4040 &gt;Chris Choi:&lt;/FONT&gt;&lt;/B&gt;&lt;FONT &gt;&lt;/FONT&gt;&lt;FONT &gt; &lt;A href="http://photo.xanga.com/chrischoi/70ef5831775/photo.html" target=_new&gt;http://photo.xanga.com/chrischoi/70ef5831775/photo.html&lt;/A&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;B&gt;&lt;FONT color=#ff4040 &gt;Chris Choi:&lt;/FONT&gt;&lt;/B&gt;&lt;FONT &gt;&lt;/FONT&gt;&lt;FONT &gt; wow - i guess i do have problems with bunnies&lt;/FONT&gt;&lt;BR&gt;&lt;B&gt;&lt;FONT color=#409fff &gt;Joe:&lt;/FONT&gt;&lt;/B&gt;&lt;FONT &gt;&lt;/FONT&gt;&lt;FONT &gt; WOW&lt;/FONT&gt;&lt;/P&gt;</description><comments>http://www.xanga.com/joseph/654812022/the-real-reason-im-terrified-of-chris-choi.html#firstcomment</comments></item><item><title>Good-bye and thanks for all the fish!</title><link>http://www.xanga.com/joseph/654648058/good-bye-and-thanks-for-all-the-fish.html</link><guid>http://www.xanga.com/joseph/654648058/good-bye-and-thanks-for-all-the-fish.html</guid><pubDate>Tue, 29 Apr 2008 15:53:03 GMT</pubDate><description>It has been a fun and crazy year here at Xanga, but alas my time as a member of the Xanga Team has come to an end.&amp;nbsp; I'll still be posting my blogs on Xanga, but I'll no longer be responsible for adding new features or fixing bugs.&amp;nbsp; I'm happy to say I accomplished almost everything I wanted to work on while here at Xanga.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;For those of you who had requested my help on various bugs and features that I didn't get around to, I'm very sorry, but hopefully those issues will be addressed by the other engineers over the course of this next year.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;To my co-workers, I wish the best of luck.&amp;nbsp; I can honestly say that working at Xanga has challenged me more in one year than I ever imagined possible, and that I feel like a better, more confident person for it.&amp;nbsp; I'll miss y'all alot, and hopefully you won't curse me too much while working with my code.&amp;nbsp; ^_^ &lt;BR&gt;&lt;BR&gt;(Transforms and Rolls Out)&lt;BR&gt;&lt;BR&gt;[edit:&amp;nbsp; yes, yes... it is "so long, and thanks for all the fish", sheesh...]</description><comments>http://www.xanga.com/joseph/654648058/good-bye-and-thanks-for-all-the-fish.html#firstcomment</comments></item><item><title>New Feature:  Comment Replies on Pulse</title><link>http://www.xanga.com/joseph/651553451/new-feature--comment-replies-on-pulse.html</link><guid>http://www.xanga.com/joseph/651553451/new-feature--comment-replies-on-pulse.html</guid><pubDate>Thu, 10 Apr 2008 18:06:29 GMT</pubDate><description>Just finished themifying the pulse item page, which means comment replies on pulse!&amp;nbsp; A couple of things to note.&amp;nbsp; &lt;br&gt;&lt;br&gt;You can only reply to one person, per comment you post.&amp;nbsp; This all builds on the theory that pulses should be as minimal as possible.&amp;nbsp; (You start adding too many features, and your pulse just becomes a sad little weblog.&amp;nbsp; O_O)&lt;br&gt;&lt;br&gt;I know lots of you have been asking for automatic conversion of URLs into links - unfortunately I didn't get around to rolling that feature out.&amp;nbsp; It'll be in the works, but probably at a later date.&amp;nbsp; &lt;br&gt;&lt;br&gt;The maximum length of a pulse depends on how long your username is.&amp;nbsp; (and in the pulse universe, comments ARE pulses) The longer your username, the less space you'll have available for other text.&amp;nbsp; This is all tied directly to the maximum length of a text message.&amp;nbsp; The entire pulse + username + other stuff has to fit into the text message, so if we didn't limit the size of your message, it would be cut off when you get the pulse on your cellphone.&amp;nbsp; &lt;br&gt;&lt;br&gt;Alrighty, thats all!&amp;nbsp; Play around with your pulse and let me know if you've got any weird issues or bugs k?&amp;nbsp; Over and out!&lt;br&gt;</description><comments>http://www.xanga.com/joseph/651553451/new-feature--comment-replies-on-pulse.html#firstcomment</comments></item><item><title>Xanga Meet and Greet: Itinerary</title><link>http://www.xanga.com/joseph/651235646/xanga-meet-and-greet-itinerary.html</link><guid>http://www.xanga.com/joseph/651235646/xanga-meet-and-greet-itinerary.html</guid><pubDate>Tue, 08 Apr 2008 22:55:47 GMT</pubDate><description>Alrighty boys and girls, the following is our approximate bar and snack schedule for the evening.  &lt;br&gt;If you're running late, just head us off at the next location on the list - and look for the Xanga shirts.  ^_^  &lt;br&gt;&lt;br&gt;Date:  4/9/2008 (This Wednesday)&lt;br&gt;&lt;br&gt;Who:  Any Xanga user who is over 21, and wants to meet us?&lt;br&gt;&lt;br&gt;When/Where:&lt;br&gt;9:00 - 9:45 pm&lt;br&gt;Grassroots Tavern.  20 St. Marks Place, New York, NY 10003&lt;br&gt;&lt;br&gt;9:45-10:15 pm&lt;br&gt;Pommes Frites.  123 Second Ave. New York, NY 10003&lt;br&gt;&lt;br&gt;10:15-11:00 pm&lt;br&gt;Decibel.  240 East 9th Street, New York, NY 10003 &lt;br&gt;&lt;br&gt;11:00-12:30 pm&lt;br&gt;Crif Dogs.  113 St. Marks Pl. New York, NY 10009  &lt;br&gt;[I'll try to swing a reservation for the top secret lounge inside.]&lt;br&gt;[edit: Reservation Confirmed for 11:30!]&lt;br&gt;&lt;br&gt;Current Guest List (revised):  Joseph, Michael, Natalia, Eugenia, Ben, Patrick, MoonBunny, SqueakySoul?, Konrado, Aimvpr?, WeaponG, BlueShortyx3.&lt;br&gt;&lt;br&gt;Remember, that you don't need to be invited to come, but it'll help us if we have an idea of who's coming and who is not.  &lt;br&gt;&lt;br&gt;Disclaimer: This dinner is not endorsed by Xanga (the company). You pay for your own food and drinks. You must be over 21 to consume alcoholic beverages. You will not hit on Ben Koh unless he hits on you first.  &lt;br&gt;&lt;br&gt;</description><comments>http://www.xanga.com/joseph/651235646/xanga-meet-and-greet-itinerary.html#firstcomment</comments></item><item><title>The Unofficial Xanga Dinner Club</title><link>http://www.xanga.com/joseph/650372278/the-unofficial-xanga-dinner-club.html</link><guid>http://www.xanga.com/joseph/650372278/the-unofficial-xanga-dinner-club.html</guid><pubDate>Thu, 03 Apr 2008 13:03:28 GMT</pubDate><description>Like ravenous bears after the long winter months, me and my fellow Xanga employees are looking to celebrate spring by stuffing our faces.  Starting this month, I'm going to organize a monthly dinner excursion in and around New York City.  Why are we doing this?  1)  Its a chance for us to actually eat a meal outside of the Xanga office (yes, we actually work that much) and 2) its a chance for y'all to come out and meet up with your favorite members of the Xanga team!  &lt;br /&gt;&lt;br /&gt;Each excursion will be set in a neighborhood and will include myself and several members of the Xanga Team for a moveable feast of dinner, drinks, and snacks.  Next week will be set in the St. Marks neighborhood, and will likely include a stop at Pommes Frites or Crif Dogs (but not both, as it would likely kill us).  Dinner will be by invitation only, as organizing reservations for more than a small group is really hard, but drinks and snacks will proceed in bar crawl style, with the whole flock of us moving en masse from location to location. &lt;br /&gt;&lt;br /&gt;Guest List so far:  Me, Michael, Janet, Dan, Chris Choi, Natalia, Ben Koh, Eugenia, Patrick, MoonBunny, TheBlackSpiderMan, squeakysoul, konrado, aimvpr&lt;br /&gt;&lt;br /&gt;Dinner &lt;br /&gt;***&lt;br /&gt;Who:  By invitation only.  (but you can certainly try to convince me or a Xanga Team member to invite you.  ^_^)&lt;br /&gt;When:  7:00, Wednesday, April 9th&lt;br /&gt;Where:  (You'll receive a message from me)&lt;br /&gt;&lt;br /&gt;Meet and Eat, bar crawl style&lt;br /&gt;***&lt;br /&gt;Who:  Open to everyone who uses Xanga, but rsvp so we can be on the look out for you.  &lt;br /&gt;When:  9:00 - 12:00, Wednesday April 9th&lt;br /&gt;Where: 5 St. Marks Place, New York City, NY  in front of yakitori taisho - I'll have a more complete list and schedule up as soon as I figure out the logistics.  Anyone who's willing to help with this should message me.  &lt;br /&gt;&lt;br /&gt;Disclaimer:  This dinner is not endorsed by Xanga (the company).  You pay for your own food and drinks.  You must be over 21 to consume alcoholic beverages.  You will not attempt to mooch for credits.  &lt;br /&gt;</description><comments>http://www.xanga.com/joseph/650372278/the-unofficial-xanga-dinner-club.html#firstcomment</comments></item><item><title>Problem with albums?</title><link>http://www.xanga.com/joseph/648343602/problem-with-albums.html</link><guid>http://www.xanga.com/joseph/648343602/problem-with-albums.html</guid><pubDate>Sat, 22 Mar 2008 11:02:45 GMT</pubDate><description>&lt;P&gt;We got an e-mail earlier this week stating that there was a problem arranging the order of photos and videos in the "arrange items" page.&amp;nbsp;&amp;nbsp;Has anyone else (who uses albums)&amp;nbsp;noticed this problem?&amp;nbsp; I need to know specific browser and OS settings.&amp;nbsp; I'm putting a bounty on this - the first person to reproduce the bug - and provide the steps to do so gets the prize of a 1000 eprop mini from me.&amp;nbsp; &lt;/P&gt;</description><comments>http://www.xanga.com/joseph/648343602/problem-with-albums.html#firstcomment</comments></item><item><title>Feature updates - themed Video and Smileys!</title><link>http://www.xanga.com/joseph/648069116/feature-updates---themed-video-and-smileys.html</link><guid>http://www.xanga.com/joseph/648069116/feature-updates---themed-video-and-smileys.html</guid><pubDate>Thu, 20 Mar 2008 15:26:24 GMT</pubDate><description>Rolled out the themed Video comment page today along with smileys for a bunch of comment pages.&amp;nbsp; I have been wanting to add smiley capabilities to the "unified" commenting system for some time now, and I had a few cycles to spend adding them to photo, video, and chatboard comment pages.&amp;nbsp; I would have rolled it all out last night, but I had a CRAZY glitch with the smileys. The error occurred when using Microsoft Internet Explorer 6 (update your browsers people!) and only on the video comment page, and not on any of the other smiley enabled pages.&amp;nbsp; &lt;br&gt;&lt;br&gt;Special thanks go out to Sean, whose Super Smileys actually provided the key insight on how to fix the problem.&amp;nbsp; The Super Smileys kept working, even though the normal Smileys were broken.&amp;nbsp; Since the Super Smileys piggie back off of Xanga's normal smileys system, it stands to reason that he had to be doing something extra that we weren't.&amp;nbsp; Turns out that installing and resizing the flash movie player steals focus from the text editor.&amp;nbsp; The super smileys have a special line of code that returns focus back to the comment box.&amp;nbsp; Needless to say, I owe Sean several beers the next time he comes to visit us in Manhattan.&amp;nbsp; &lt;br&gt;&lt;br&gt;Alrighty, back to work.&amp;nbsp; Feel free to message me if you're noticing any glitches or bugs with the comments or the video page.&amp;nbsp; &lt;br&gt;&lt;br&gt;</description><comments>http://www.xanga.com/joseph/648069116/feature-updates---themed-video-and-smileys.html#firstcomment</comments></item><item><title>What is the opposite of pay it forward?</title><link>http://www.xanga.com/joseph/648047642/what-is-the-opposite-of-pay-it-forward.html</link><guid>http://www.xanga.com/joseph/648047642/what-is-the-opposite-of-pay-it-forward.html</guid><pubDate>Thu, 20 Mar 2008 12:53:12 GMT</pubDate><description>For anyone who hasn't seen the Haley Joel Osmond movie.&amp;nbsp; Pay It Forward, is a movement where you do three difficult good deeds to three people who need your help.&amp;nbsp; The only thing you ask in return is that each person continue the chain by doing three good deeds for three more strangers.&amp;nbsp; It is a sort of save the world pyramid scheme.&amp;nbsp; Of course the first thing we wonder is - "what's the opposite"?&amp;nbsp; We've gotten a couple suggestions, 1) pay back, 2)&amp;nbsp; pass the buck, 3)&amp;nbsp; comeuppance - but none of them really have the same strength in the negative direction as pay it forward does in the positive.&amp;nbsp; Any ideas?&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description><comments>http://www.xanga.com/joseph/648047642/what-is-the-opposite-of-pay-it-forward.html#firstcomment</comments></item></channel></rss>