Hacker Newsnew | comments | ask | jobs | submit | Scriptor's commentslogin
Scriptor 76 days ago | link | parent | on: Nightwatch.js

This looks interesting and I have something I'd like to use it on, but the documentation could add a few things. How do I install this? How do I run a script?

-----

scriby 76 days ago | link

Good point.

Check out https://github.com/scriby/browser-harness-bootstrap-tests for a full example. Browser harness itself is just a conduit between node and a browser - you need to provide the test framework yourself (mocha, vows, etc.).

-----

Scriptor 76 days ago | link

Awesome! I'm going to try it out now.

-----

Scriptor 91 days ago | link | parent | on: The State of Hy

People might also be interested in http://try-hy.appspot.com/.

Does anyone know how they do sandboxing in there? Judging from the source (https://github.com/hylang/tryhy/blob/master/main.hy) repl.eval is called on each expression. I'm guessing it just uses App Engine's default python sandboxing.

-----

Foxboron 91 days ago | link

Yes, its app engines default sandboxing in use.

-----

Scriptor 91 days ago | link

Is there any way to restrict your app's environment beyond the default sandbox restrictions Google applies? For example, disabling things like urllib2.

-----

Foxboron 91 days ago | link

I didn't write the code, and i'm not sure if you can. You could always use the import hooks and deny modules from being imported.

-----


I was just about to ask how well this would work as a companion to tapl. I'm still very early in the book so the notation isn't indecipherable, but I'm sure it'll get there soon.

-----

Scriptor 112 days ago | link | parent | on: What languages fix

I know Guy Steele was part of Java's original design committee, but in what ways was Java at all "Lisp's bastard child".

-----

gruseom 111 days ago | link

Steele was brought in to write the spec. He didn't design Java.

In fact, his classic talk "Growing a Language" is among other things a very polite and implicit, but devastating critique of the design of Java.

-----


There was a post a bit back (which you might be referencing) about almost this exact situation, except it was about black hat SEO dramatically backfiring. Specifically, businesses were asking bloggers and news sites to delete spam comments that linked back to the sites.

The HTML that Mahbod wants you to paste looks pretty similar to what those spam comments were like...

-----

mdpane 115 days ago | link

> There was a post a bit back (which you might be referencing) about almost this exact situation, except it was about black hat SEO dramatically backfiring. Specifically, businesses were asking bloggers and news sites to delete spam comments that linked back to the sites.

I believe that would be this great write up on the current situation: http://www.theawl.com/2013/12/the-new-spammer-panic

-----

ChuckMcM 115 days ago | link

That is an excellent summary, thanks for the link.

-----

RBerenguel 115 days ago | link

There's still Disallow in Google Webmaster Tools as a solution for bad back links, either done by an "enemy", old agency or previous stupid SEO manager

-----

te_chris 115 days ago | link

Yeah it's there, but it doesn't work anywhere nearly as quickly or effectively as it says it does.

-----


One approach that really helped me out was to extend the problem from three doors to a million doors.

You're allowed to pick one door, out of a million. Then, the host opens 999,998 of the other doors which he knows have a goat. This leaves the closed door you picked and one remaining closed door.

So, there's now two possibilities. Out of one million doors you somehow just happened to have guessed right and picked the right one. Or, you're wrong. If you're wrong then the correct door would be the other closed one.

-----

bluedevil2k 122 days ago | link

I do the same thing by expanding it out to more doors, but when talking about it or explaining it to others (great cocktail party discussion btw), I use 100 doors, to make the percentages easy to follow.

Example - there are 100 doors, you pick 1 that has the grand prize. There's a 1% chance you picked the prize on your selection. Monty Hall eliminates 98 of the doors, meaning there are 2 left. There's STILL a 1% chance you picked the door with the prize, but that means there's a 99% chance the only remaining door has the prize. Obviously, you should switch.

-----

Jtsummers 122 days ago | link

Another way is to take a step back and forget about revealing the goats. You have your initial selection (using your numbers) with a 1% chance of picking the prize. Now you're presented the option to leave it shut and open all other doors keeping the prize if it's in any one of them. So if the prize has equal odds of being in any given door, then opening 99 of them gives you a 99% chance of finding the prize versus the 1% chance of only opening one door. This has helped some people I've talked to realize that the odds the prize is in that remaining door (in the proper Monty Hall problem) is actually the sum of the odds it's in all the doors you didn't select.

EDIT: I've also demo'd this using 3 cards (an ace and two others), but I like the idea of demonstrating with a larger scope. Call the ace of spades the prize, let the player select one card from the deck at random. Now they can keep that card or scour the remaining 51 cards for the ace of spades. A good tactile demonstration that they have a 1/52 chance (~2%) of having selected correctly the first time versus ~98% that they were wrong.

-----

jwr 122 days ago | link

What I find hard to undestand is why I should switch instead of randomly choosing again?

-----

Jtsummers 122 days ago | link

Consider the 3 door case, it's narrowed down to 2 doors. The one you selected has a 1/3 chance of being correct, the one you didn't has a 2/3 chance. If you randomly select between the two (50/50 odds) you come out with a 50% chance of picking the correct door. If you strictly switch, your odds are better, and if you stay the same the odds are worse.

-----

adamio 122 days ago | link

Random choice would be optimal if the host didn't know the location of the car. If the host is blind & car wasn't revealed already, there's 1/2 chance. If the host knows & the car is hidden, then the remaining door has 2/3 chance

-----

Scriptor 122 days ago | link

Ah, I used one million because it really hammers the scale of it in, but I like that with 100 you can easily track the percentages.

-----

frankc 122 days ago | link

The way I explain is to expand it but also change the frame of reference to so its clear that the host is an adversary. Imagine we play a game called "who has the Ace of Diamonds"? I deal you one card face down and I deal me 51 cards. I look at my cards and then choose 50 of them to show you, none of which are the Ace of Diamonds. Do you want to keep your card or take the one I have not turned over?

-----

jiggy2011 122 days ago | link

Does it matter whether or not the host knows? I don't see how it changes the odds in any way, unless of course he opens the door with the car (very likely with 1 million doors).

-----

ds9 122 days ago | link

The fact that you asked this question shows what's wrong with the supposed "problem". In the usual presentation, it's a "trick question" because the person presenting it omits the crucial information that the offeror is intending to act adversely to the decsion making subject.

Without that information, the interlocutor naturally assumes that the offeror opens doors randomly - in which case the fact that he knows what's behind each door is an irrelevant "red herring" and the correct conclusion is different.

In the random-opening case the intuitive conclusion is right - that the agent (offeree)'s decision does not affect the odds. But if the question-poser revealed that the offeror is trying to maneuver the offeree into the result that's less valuable for the offeree, then the supposed mystery of the whole thing evaporates and the correct conclsion is obvious.

-----

hsitz 122 days ago | link

Ha, interesting. Yes, well, back when the problem was invented it was assumed that everyone was aware of the TV show "Let's Make a Deal" and how the scenario worked. The host/offeree (a man named Monty Hall) _never_ picked a door that had the prize behind it, implying that he _always_ knew where the prize was.

-----

ghaff 122 days ago | link

It does. If the host doesn't know, there's a 1/3 probability that the game will end (you won't get a chance to switch) if the host picks the car. If this doesn't happen, it's 50:50 whether you keep your door or switch to the remaining unopened door.

-----

pbreit 122 days ago | link

The host knows where the car is and so leaves it hidden. If some one shows you this with even just 10 doors, it will be immediately and patently obvious that you must switch.

This is, indeed, the most effective way to explain it, imo.

-----

Rudism 122 days ago | link

If the host knows, you should switch. If he doesn't know, it doesn't matter--you have a 50/50 chance of winning either way.

-----

coldtea 122 days ago | link

>Does it matter whether or not the host knows? I don't see how it changes the odds in any way

Of course it matters.

The host uses his knowledge to AVOID opening the door with the car (and thus ending the game prematurely).

So he essentially gives out this information: "the door with the car is one that I, the host, haven't opened".

-----

jiggy2011 122 days ago | link

Let's say that you have 3 doors and you pick door #1.

At that point the host says "Ok, I'm going to open one of the other doors at random and then give you the chance to change your choice".

At this point 2 things could happen. Either he opens the door with the car in which case you will definitely switch to that door and have a 100% chance of winning.

Or he opens the door with a goat. There is a 1/3 chance that you picked correctly in the first place, therefore there is a 2/3 chance that you picked wrongly, so it's safer to assume that you picked wrongly.

You know that he didn't show you the car, so either you picked correctly to being with (1/3) or you picked wrongly (2/3), but if you picked wrongly then it must be behind the door that the host did not open. So you still have better odds from switching even though the host did not know.

-----

Jtsummers 122 days ago | link

You are correct, as long as the host doesn't reveal the prize the odds of winning by switching remain better than the odds of winning with your initial selection. EDIT: And in the case that he reveals the prize your odds have gone up. I suspect (but haven't calculated) that a version where you can switch to the winning prize when it's revealed would give you much better odds of success and a bankrupt game show would result.

-----

Jtsummers 122 days ago | link

Crunched the numbers, I'm wrong. If the host shows a goat (when the host doesn't know where the car is), switch or stay doesn't matter as you have the same odds either way.

There are 4 outcomes to the selection phase of this game:

1/3 - both pick goats

1/3 - you pick the goat, host picks the car

1/3 - you pick the car, host picks the goat

0 - you pick the car, host picks the car

So given the host picks a goat, switching or staying doesn't matter it's 50/50.

EDIT: An aside - why we shouldn't trust our intuitions, but instead actually work out these problems.

-----

jiggy2011 122 days ago | link

You're right. When doors are opened randomly you can not tell whether the host was "lucky" (to not reveal the car) or whether you picked the right door to begin with since these are both equally likely.

-----

maxerickson 122 days ago | link

The host doesn't open a door at random. He always shows a goat.

You are discussing some other game show.

-----

jiggy2011 122 days ago | link

Let's assume that both of these game shows are showing on different channels and you were invited to participate in one of them. But once you get to the studio you have a case of nerves and forget which show you are on. Should that change how you make your decision?

-----

maxerickson 122 days ago | link

No, the odds for switching at the real show are 66-33 and the odds at the fake show are 50-50, you might as well switch after the reveal (what you are calling 'better odds' boils down to 'sometimes you can see the car so you switch to it'. When you see a goat, you have equal information for the remaining doors.).

-----

scrabble 122 days ago | link

Yes, it matters. The host opens every door other than the one with the car - or one with the goat if you picked the car.

The host is not opening just one door.

-----

JamesArgo 122 days ago | link

This is the most intuitive description I've found:http://lesswrong.com/lw/2b0/bayes_theorem_illustrated_my_way...

-----

dopamean 122 days ago | link

This is a great explanation I hadn't thought of before. Thanks.

-----

basch 122 days ago | link

I will never understand how one million doors is easier to understand than 3. Switching doors means you get two doors out of three doors. 66% > 33%. 66/33 illustrates the benefit much better than 1 vs 2 out of a million.

I think what confuses people is that they think a random door is revealed, whereas the problem says a goat is specifically chosen before the offer to switch.

-----


Free? All the airlines I've been on had wifi but usually charged for it.

-----

Kiro 126 days ago | link

Never seen anyone charge for it. Are you in the US?

-----


This is definitely not usable as an early intro to CS book, as it's pretty dense. There's a wide variety of introductory material that you can pick from, depending on your interests (what kind of stuff are you interested in doing). But TAOCP is aimed at someone a bit more advanced. Since you have a math background though I think you could give it a shot and see how far you get.

-----


I'm not sure which plugins you have running, but it definitely splits it into three pages for me.

-----

BlackDeath3 134 days ago | link

Three pages here as well.

-----

Scriptor 134 days ago | link | parent | on: Yotaphone

I feel like a lot of this trendy stuff comes out because it demos very well. The designer shows it off in a controlled setting, everyone's wowed and impressed and glad they hired a "good" designer, and nobody bothers to check whether it's actually useful at all. Someone should've pointed out the website is there to sell the product, not to showcase the FE guys's skills.

-----

GalacticDomin8r 134 days ago | link

> I feel like a lot of this trendy stuff comes out because it demos very well.

You've expressed a thought, not an emotion. Please use "think" instead of "feel".

http://www.wildmind.org/applied/depression/distinguishing-th...

-----

More

Lists | RSS | Bookmarklet | Guidelines | FAQ | DMCA | News News | Feature Requests | Bugs | Y Combinator | Apply | Library

Search: