False, I would expect, because no number is congruent to itself plus one mod 3.3, and Python modulo is sane with respect to negative numbers. You can't add 1 to a string, and only numbers and strings admit the % operator. Is there a trick?
- ⓞnor
I cheated and ran it in the interactive interpreter. Its false for all numeric values of x I tried. Amazingly a string cannot be taken modulo 3.3. (Edit: I mean its a dynamic language after all, a string modulo 3.3 should skip every third letter or something equally clever but useless).
- DGentry
does it involve integer/long overflow?
- Eric Kerr
There is no long overflow in Python (longs are arbitrarily large). I'm waiting for the answer to Daniel's question.
- Tudor Bosman
It's True for certain values of x. I leave it to you to determine which values :)
- Paul Buchheit
Paul, as you said "values of x", I'm assuming that this is not a precedence issue. That is, if I have def foo(x): return x % 3.3 == (x+1) % 3.3, then foo(x) will be True for some values of x.
- Tudor Bosman
True for x = 1e+100 (insufficient precision to represent the +1). What do I win?
- ⓞnor
Heh -- by like 6 seconds. Real time, bitch.
- Joe Beda ()
okay, now I have to look at the code to see what you were using large floats for :)
- Tudor Bosman
Yeah, I'm wondering about the context. (Assuming this was the case you had in mind.)
- ⓞnor
Yeah, somewhere around x=2**53 the loss of precision on the int to float conversion causes it to lose the +1 and the expression is True.
- Paul Buchheit
Liked for the real time smackdown. Hi Joe! Long time no see. How's the family? We gotta get up to Seattle again soon to see all my friends there.
- Robert Scoble
x was the hash() of a string, and at some point the values returned by hash() must have gotten a lot larger than when I had originally written the code.
- Paul Buchheit
Wolfram|Alpha is never sure what to do with _my_ input.
- Paul Buchheit
Wolfram|Alpha just hangs for me most of the time.
- Joe Beda ()
If I have a counter 'i', then i % 3 == 0 will be True 1/3 of the time, but what if I want it to be True with some other arbitrary probability (such as 1/pi), but non-randomly? (so that the values are distributed as evenly as possible) This was my solution (except with > instead of ==). It's kind of overkill, but I couldn't resist the puzzle.
- Paul Buchheit
I think a normal person would have done "hash(i) % 1000 < 318" or the like... but sure, it's cute that you do the modulo directly in floating point space. Cute until the gremlins of floating point *eat your brains*. There's a reason we stay away from that stuff!
- ⓞnor
Okay - it gets stranger -- I wrote a binary search to find the inflection point. I didn't get what I expected. x=9007500000000000 -> True, x=9007500000000000+1 -> False, x=9007500000000000+51 -> True. There is something strange going on. Python version 2.5.4 (r254:67916, Apr 1 2009, 17:38:54) \n[GCC 4.0.1 (Apple Inc. build 5490)]
- Joe Beda ()
Dan, that solution would produce unnecessarily long sequences of zeros (or ones). Once I have that, I may as well just use random(). On the other hand, [int((i+1) % f > i % f) for i in range(0, 30)] will not produce any adjacent zeros if f is >= 2.
- Paul Buchheit
You could use fixed point if you had a typed language and could select longs to hold the result, e.g if you want 3.3, then (counter * 10 + increment) % 33. Overflow bugs are insidious, these days languages should have support for arbitrary precision promotion. I'm reminded of Joshua Bloch's "Nearly All Binary Searches are Broken" blog post: http://googleresearch.blogspot.com/2006...
- Ray Cromwell
Python already has arbitrarily large longs Ray (no integer overflow), so it should not be vulnerable to Joshua's binary search bug. I'm not sure what "counter" and "increment" are in your example though.
- Paul Buchheit
Oh, I see, you want evenly interleaved values with the appropriate distribution? Then why were you using hash() at all?
- ⓞnor
The hash() provides a starting position (hash(feed_id) + i). This is used by the crawl, and I don't want all the feeds having the same True/False values at the same time. The hash provides an even distribution across feeds, and the other part provides an even distribution across time.
- Paul Buchheit
Paul, counter in your case would be hash(feed_id), and increment would be 'i' I'm guessing, the amount you want to add each time. The idea is, if you want to say, mimic x + 0.1 % 3.3, you instead use x * 10 + 1 % 33. Then, if you have arbitrary precision integers, you'll never overflow (the float mantissa/round-off error)
- Ray Cromwell
Ray, the even easier solution was to use hash % 1000000 so that I'm nowhere near the floating point rounding error :).
- Paul Buchheit
No objection there, keep it simple, and floats will be faster than arbitrary precision longs I suspect. :)
- Ray Cromwell
There's a bug in there. Where's the if statement immediately inside the if still_not_Crashed condition that checks "If(bootLog.BootsSinceLastCrash >2), throw new BSOD();".
- Kamath (नमः)
funny - but i've never had a problem with Vista - in fact I'm a Mac owner who LOVES vista. take that
- andy brudtkuhl
Octomom's next attempt at monetization.
- Mona Nomura
This is a variation of the subset-sum problem.. my follow up question is what about 4 numbers that sum to 0? (I'm the friend who asked)
- Adam Derewecki
Eric: that's kind of the worst case solution but yeah it works. I haven't written any code but I think you can make it faster by separating it into two problems because you know you'll need at least one negative number in each set of triplets (either a negative and 2 positives or 2 negatives and a positive).
- Benjamin Golub
Ben, yeah that would be much better for large sets. it would need a little work because a set of 0s works too. Is the list already sorted? The best case would probably use some sort of interval halving and recursion, but it depends on what you know about the list beforehand..
- Eric Kerr
N integers.....based on just a glance at that post I thought you were being racist! My bad...
- Matthew Gottlieb
I came up with this in Python, assuming the list of integers is not unique. http://pastebin.com/madfc9c1 - also Adam you can then easily look for combination of 4 numbers.
- Aviv
http://pastebin.com/m11fc09d7 requires that the list is sorted, but it should be a lot faster for large sets. feel free to modify and/or suggest an alternative.
- Eric Kerr
Or people should just backup their phone numbers somewhere...
- Tom Ribbens
yes, of course. however, the type of people likely to lose a phone and make a group afterwords probably aren't taking this in to consideration until it's too late. this is just a common use-case that wouldn't be hard to detect
- Eric Kerr
Actually, I got very confused by the navigation. I keep clicking in the wrong place, and I'm still not sure which actions cause music to start playing. It seems kind of cool though, and apparently they have FriendFeed integration!
- Paul Buchheit
Wow, this is really impressive! It's the best new website I've seen in at least 6 months.
- Eric Florenzano
5 minutes in, was still trying to figure out how to get a song to play. and then that thing on the bottom left expanded and I figured it out. A little too much discovery involved for me tastes, but cool idea nonetheless!
- Chu Yeow
Impressive!! I like the sound of the bubbles.
- Ray Chen
This is pretty sweet - yeah, lil grey box bottom left w/green dot - listening 2 Code Monkey by Jonathancoulton - great find, Paul!
- Cheryl Allin
from twhirl
Would love it if Songbird could pull tracks from it...
- abacab
updates remind me of the iminlikewithyou UX
- tagami
Thanks for the feedback. We just added a mouseover tooltip for songs to make the action of playing music more obvious.
- Samuel Hsiung
hey raymond, what issue did you have w/ the navigation? if you would be so kind: james at thesixtyone dot com
- James Miao
Amazing good UI (or even genius), very nice site and I found a lot of interesting and unknown music there! I somehow never liked last.fm and ilike.com was a bit better for me, but still not the best. I'm not interested in sharing what I'm listening to at the moment (as I often listen to one album for many days or weeks), but I like to discover new music and maybe share recommendations with friends. I'm highly impressed with thesixtyone.
- Wojciech Polak
Loving the interface! Any new music service is a blessing these days.
- Majento
Somthing to keep an eye on. That, is if the RIAA don't get hopping mad. Anything to keep music going....
- Roberto Bonini
Damn it's a great implementation of JS and UI
- Jorge Escobar
Also, a friend developer of mine tried it on a Linux desktop and it didn't work
- Jorge Escobar
awesome work -- great JS magic. well done Sam. yet again.
- Puneet Thapliyal
About 2 hours of listening now, the default station, great tunes and perfect connection.
- Majento
Thanks James! I am hooked! Great job...
- Jorge Escobar
thanks, glad to hear people are enjoying the experience.
- James Miao
@ gregory: candidness appreciated. while thesixtyone's positioning is very deliberate, we can always improve on communicating the wide range of benefits for using the site (i.e. you can listen without having to interact with the site).
- James Miao
Excellent site and great service, I check out the Hot tunes each week
- Kol Tregaskes
I believe this site is a lesson in how not to design a UI. After a couple minutes of registering and trying to figure stuff out...I'm done and I haven't even heard a song yet. Someone's going to have to make it a bit easier to get started. Going to this site for the first time is just like running Emacs.
- Todd
agree with greg, todd and whoever else who felt frustrated and left tuneless
- viki saigal
OK, after restarting Firefox, I seem to have music playing. Not the best experience...but since I'm into music and always looking for new ways to discover music, I went through the pains. I don't think I can point my non-techie friends to this site, though.
- Todd
Hmm, music started playing for me immediately, and it was pretty obvious what to do. But I'm not sure why that thing at the left is closed by default. If I hadn't read about it in this thread, I might not have discovered it.
- j1m
I've been using this site for a while. A great place to find new music.
- Dennis Jackson
Great quote - "It's very, very difficult to wear both the developer and the evangelist hats at the same time: being a developer requires that you be very pessimistic, so you can see and fix all the problems in your design, while being an evangelist requires that you be very optimistic, so others can feed off your passion. I suspect that if I tried to do both, the cost would be my sanity"
- Eric Kerr
"Linux started as a terminal emulator".. !!!? Or not.
- Nick Lothian
Definitely a lot of points that rang true for me, especially the "Chicken and Egg" point.
- Adam Thorsen
I myself have worked on two start-up concepts and a revitalization effort, each of which bombed, but each one taught me something different. I finally threw in the towel on my last start-up and picked up a full-time day-job because I couldn't find anyone willing to share hats. We were already incorporated, so I was the CEO, book keeper, technology evangelist, sales guy, support tech,...
more...
- Chris Stewart
from twhirl
Haven't read the article yet, Nick, but Linux didn't start out as a terminal emulator. Linus Torvalds deliberately started working on implementing a "practice OS" called "Minix" from a book, and it grew from there. http://en.wikipedia.org/wiki...
- Phil G
The thing's got great D, but still needs some speed and accuracy on offense. I look forward to welcoming our robotic air hockey masters.
- Kevin Fox
from Bookmarklet
When it evolves into a super human world spanning robotic military network that turns on its human masters and sends Arnold Schwarzenegger back in time to exterminate us, you'll be sorry you wished it was better at offense.
- Ranjit Mathoda
haha yeah, its primary strength seems to be not forgetting to go back to defend the goal
- bob
Domain parkers are banking on one principle: domains will be used forever. I wouldn't be surprised to see the system start to change in the next couple years, as evident by browsers in asia with no URL bar (albeit for a few different reasons). When the system starts to change, there will be tons of supply and no demand and people hording domain real-estate will be SOL.
- Eric Kerr
"...and people hording domain real-estate will be SOL" Really? Given that it's less than a buck a month per domain, if the jerks who squat on domains make just a few pennies per day in folks who click on their ads, they're coming out ahead :-(
- Adam Lasnik
Ah confusion :). "Domain squatters" who grab tradmarked names are doing something illegal & no real domainer does that (too expensive if/when caught). The others profit from the ".com"ism that users were taught. When they're looking for something, lots of them type "[thing-I-want].com" into their browsers. If they end up getting a page with "search results" (targeted ads), I think that's ok.
- John μller
True, I shouldn't have conflated those two, John. But I think the folks that own stuff like popular-hobby-name.com or sport-type.com or art-form.com are scumbags, too.
- Adam Lasnik
Some pages have more value, some pages have less. If you land on a domain that gives you a link to the domain you want, I'd say that particular page has just as much value as an equivalent search page in Google - even if it is a parked domain. Given that there is an unlimited supply of domain names (e.g. one for every, say, videocard for example), and there is an unlimited number of products (e.g. one for everything that mankind can invent), I don't think its bad to create landing pages w/limited value...
- Justin Long
I do hate domain parking where the page has nothing whatsoever to do with the subject at hand, tho...
- Justin Long
@stefan Unfortunately, eminent domain is often used by local governments to hand property to private developers. In this case, I just have two domains I would really like to own as I plan to launch something shortly. Neither can be generating any revenue at all. But the owners of both have asked for tens of thousands of dollars to part with them. I believe in markets, etc, etc. But, considering the unique nature of names, it just frustrates me.
- Christopher Sacca
Hi Sacca, it frustrates me that in order to get a reasonable house for my family here I have to pay >1.5 million. However, people are paying that much for houses here so if I want something like that here, I'll either have to wait for a bargain or pay up. Who knows, maybe the market will collapse and we can get house & domain name for much less ...
- John μller
I miss the good old days of domain registration when you just sent an email to hostmaster@internic.net.
- Ken Norton
can you filter with regular expressions on friendfeed?
- Sam Purtill
i don't know if thats possible. talk about alienating your userbase though if they have a "guide to use regular expressions to filter friendfeed". I was more talking about on the internet in general though
- Eric Kerr
yes, but in my case it's a best of Scoble
- Duncan Riley
mine, at least for today, is definitely a best-of popular bloggers
- MG Siegler
Duncan: interesting. I see other stuff on my best of page. I definitely like the same kind of stuff that you do, though. So that probably is why that's what you see.
- Robert Scoble
Best of Scoble, Louis Gray, and FriendFeed employees. Something to be said though about what the people i follow find interesting.
- Eric Kerr
i'm now included twice in my own top 4 best of the day, something which i'm really proud of.
- MG Siegler
@duncan - I'm seeing a good mix of my friends - some Scoble, but he doesn't dominate the list by a long shot.
- Frederic
I love the new feature, and your coverage of it was excellent
- Gavin
Agreed. even the term "application" that facebook uses has a bit of a learning curve. I like iGoogle's approach - "Add Stuff"
- Eric Kerr
Firefox has a Twitter presence (firefox_answers) and replied: "@sacca plug-ins: needed for online media. extensions: add browser features. people get it. Add-ons is a blanket term for both (plus themes)" I still don't agree. Particularly in the UI it seems redundant. I think plug-ins and extensions should be lumped in under add-ons. Themes seem clear enough to be separate. Either way, I think it is cool that Firefox replied. :)
- Christopher Sacca
Yet, you can search for "false" which is an edge case and doesn't fit the article's explanation [meaning its tad more complicated than a scripting language doing if(query)...]
- Eric Kerr