skysight-inc/HackerNews huggingface dataset:
Haskell has that exact same definition for its Maybe type here [1]:

data Maybe a = Nothing | Just a

After which it defines the monad operations on that type

instance Monad Maybe where
[...]

This says "the Maybe type is a monad", but the Maybe type could exist and be used without this, as I gather you're familiar with from ML.

When you use it a bare type, every time in your code you use a Maybe, you have to manually check for Nothing and extract the value in Just. And you can't compose functions involving Maybe without either letting Maybe bleed into the input types of functions where it is not necessary, or writing some clever wrappers (which will probably actually end up defining a monad).

Using Maybe in this way has a common structure:

f :: Maybe a -> Maybe b
f Nothing = Nothing
f (Just x) = Just (do something with x)

Pass on Nothing from Nothing, apply the internal logic of the function if there's Just something. We can abstract this out, meaning we can write functions (a -> Maybe b), and compose them to take care of the Just/Nothing check. We can also do other things, like take functions with no knowledge of Maybe and "lift" them from (a -> b) to (Maybe a -> Maybe b). Here's the simplest expression of this abstraction:

wrapMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
wrapMaybe Nothing f = Nothing
wrapMaybe (Just x) f = f x

... this is bind for Maybe, the dreaded (>>=) that scares people away from Haskell.[2] It's half the definition of the Maybe monad:

instance Monad Maybe where
Nothing >>= f = Nothing
(Just x) >>= f = f x
return x = Just x

It's known as a monad because monads are a further abstraction, expressing a structure in common with other patterns than Maybe:

class Monad m where:
(>>=) :: m a -> (a -> m b) -> m b -- (AKA bind)
return :: a -> m b

Just by defining these two functions for a type (in this case the Maybe type), a bunch of higher-order functions, like the "lifting" I mentioned, and composition of monadic functions similar to composition of normal functions, and composition of monads to stack the effects they represent, are already defined, derived from these two functions (return and bind/>>=), taking advantage of having the monadic structure in common.

What seems trivial with Maybe as a monad is that "return", the other part of defining a monad, is just the data constructor Just, whereas in other monads it's more complicated.

---

EDIT: I had previously defined: (Just x) >>= f = Just (f x) -- this is actually fmap for Maybe, which is also the lifting function I mentioned

[1] http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4...

[2] Forgive me, it is at this point that I realize you may actually know all about monads and were just wondering what's monadic about Maybe. But I was already too deep into Writing A Monad Tutorial to throw it away. Incidentally,

NB: I've never actually exposed my tentative understanding of monads in public before, so before trying to follow anything I've said here, wait on someone on surer ground to pipe up with approval (or criticism, which I would very much appreciate).
I'm "in" the sphere of people whom were targeted by this researcher. I never was asked to friend her, but a few of my friends did friend her. A good number of them don't really share anything actionable on Twitter, FB and the like. They "friend" pretty much anyone, and opt to not share things that could come back to bite them. A lot of people who "fell for it" didn't really fall for much of anything. The couple of people who outright offered jobs and such? They were had.
It's not really cool to let just anyone know about Pier 39. Some things are just best left for the locals.
Welcome to the Internet, where the men are men, the women are men, and the kids are cops.
Fraternity of the wired works in the wee hours
"Delay any encrypted packet that is leaving more quickly than average?"

You do realize that would very quickly cause your average to increase, right? Then your average would reach a fairly stable value where practically every packet was being made to wait. But there might be occasional jumps in the average over time from unusually slow-to-process packets, which would

1. slow down all subsequent packet transmission

2. alert an attacker that the packet they just sent was statistically more likely to be of a slower-to-process variety

So depending on what you're working on, I think this might or might not be a better approach.

EDIT:

I think I might have a way to subvert your scheme.

1. Operate a server with specs identical to yours running software identical to yours.

2. Send invalid packets to both my server and your server. Figure the average difference in packet return times and factor that in to subsequent calculations.

3. Very gradually begin executing identical denial-of-service attacks on both my server and your server. The idea is to clog both your CPU and mine in the same way. As I do this, I continue sending both my server and your server authentication packets. However, my server will be configured to always treat the packets' first byte as invalid. Both of our servers' average time-to-process will gradually rise, but yours will rise differently because sometimes a packet's first byte will be correct and therefore take longer to process.

4... Once I think I've got the first byte, I can configure my server to always treat the first byte it gets as valid and begin figuring out the second byte. Etc.

Steps 1 and 2 would be much smoother if I was able to purchase a virtual server in the same cloud datacenter you were in. But hey, I'm told the cloud has some pretty big security issues to begin with, so no big deal, right?
Classified info, even if it has been leaked, is still classified info.

US govt. has been known to visit companies that had un-expectedly come into contact with classified data (usually accidentally as a result of working on some military project for ex.). They take over for a while, issue "gag" orders, take people statements, find out who saw the data, then they take all the storage media and shred it.

But of course, practically, I am not sure what they will now when everyone on the Internet can access this data. I guess they can still selectively enforce the law if they wanted to ... ? Or at least threaten to inforce the law.
Disclosure: I like hotels a lot – and I’ve spent much of my life in them. Both of my parents are career-long hoteliers, first managing large corporate chain units and now owning their own hotel in the UK.

Why would you even bother taking the opinion of such a biased source seriously?
Indiscrimnate killing of civilians followed by a cover-up is "explosive" enough for me.

If I may ask, what were you expecting? US Marines sacrificing Iraqi babies and drinking their blood?
K1GF
Noticing that vulnerability was massively clever, IMHO.
Establishing a fictional name in order to separate concerns is not lying unless you are prepared to assert that Marion Morrison, Samuel Clemens and Brian Hugh Warner are lying when they do the same.
I rent an apartment on a 1 year lease. I expect my neighbors to live under the same situation as that forces a social contract. I don't fuck their lives up so they don't fuck mine up.

What does a vacationing transient care about pissing in the hallway? He'll be gone in 8 hours. AirBNB ignores the reality that apartments are part of shared property. That shared property maintains its state of repair thanks to people from the building having large stakes in making sure they don't leave human feces in the stairwell.
Indeed. This advanced spy network could infiltrate Microsoft and insert deliberate security holes into their applications. These can later be exploited by people back in the motherland to create gigantic botnets, which they can then sell time on back to the West while filling all our inboxes with spam.

Clearly this isn't serious ("never attribute to malice...", etc), but it's no worse then most other conspiracy theories.
I think there's much less power over people who don't have security clearances. In the cases you describe, the companies are government contractors whose employees probably have clearances, and have agreed to all sorts of checks (and are required to follow certain procedures as a result of getting their clearances). The companies most likely agree to those clean-up visits anyway, if they want to keep getting government contracts, so it's not necessarily even using the government's law-enforcement power.

If leaked information gets to a normal civilian who's never gotten a security clearance, though, I don't think that's illegal, if they didn't have a hand in leaking it themselves. That was basically the outcome of the Pentagon Papers case: that the people who leaked the papers to the NYT could be prosecuted, but the NYT couldn't be stopped from republishing them. Not that that'll necessarily save someone from getting hassled.
You go right ahead and do that - great thing about a free market, it makes room for everyone.
Best General Science Books
Yes it's about the idea, but the idea is hugely important to Bach. Baroque music was centered around this idea of an "economy of material": letting a single small kernel of an idea unfold into an entire piece of music. That's how Bach's brain worked; he could think of a simple theme and improvise a 5-voice fugue based on just a few notes.

This canon comes from his "Musical Offering" which are a set of pieces dedicated to Frederick the Great of Prussia (a flutist like me :-) ) all based on a single awkward theme given to him by the king, as a kind of challenge.

So I guess my point is when you look at this as one of a collection of many variations, renderings, and re-imaginings of a single short melody, with an eye to the importance that Bach placed on the aesthetic idea of an economy of material, that this becomes more than just a clever trick.

Although I agree Bach probably wrote it in less time than it took him to write it down. And I don't think he would have imagined people after his death would be playing it, let alone making CGI youtube videos and run-on sentences discussing it on internet message boards. :)
Let's straighten this out -- I can't stand when people start complaining about "government". It's like complaining about "private enterprise" or "computers" -- yeah everything sucks sometimes but you need to be specific.

Here, we have 2 reasons that Paterson and the New York State Assembly/Senate got involved:

1) There is a legitimate public health concern with running unlicensed hotels -- subletting your 2 bedroom for a couple months is one thing, renting places in order to run a business out of them while circumventing health regs that are there for good reason is something entirely different. They were seeing a shift to the latter.

2) Simultaneously, hotels have money, have lobbyists, didn't like this and had a great argument to make with public health. The senator in question can keep the donations flowing while all the while claiming he's only concerned about the public welfare.

So, some mixture of that is what happened. Notice how none of it involved Glenn Beck's nightmare socialist conspiring to reduce "freedom" and expand "government" in order to, you know, piss off Glenn Beck or whatever motivates all of those socialists. When you unpack political reality, it turns out to be a lot less about "government vs private sector" and a lot more a combination of who has the money (usually one aspect of the private sector).
Not a crime. The US doesn't have an equivalent of the UK's official secrets act. I don't think it's actually a crime, although there could be court injunction against publishing, which you could then be in contempt of if you went ahead.

If you have a security clearance, it's possibly unwise to download/have this information on your own, especially if you have had secret access to it, mainly because there is going to be a bunch of counterintelligence to figure out how things were leaked (presumably PFC Manning, but who knows?). It would complicate things during an investigation if you had information on your hard drive, even if you could document that it had come from an outside commercial source. With some information, even if it is "known" by the public, having access to it through classified channels is a way to vet the information, so if someone posted "super secret a" to a website, and you commented "oh, yes, I've heard of that", you would actually be corroborating information and leaking classified information.

FWIW, nothing in these seems to be particularly damning of the US. It is basically "war is hell", "mistakes are made", "we like to put a spin on things". It's pretty much par for the course for special operations forces to do things and then have the positive outcomes attributed to indigenous forces, and the negative outcomes hushed up.

There probably would be some net benefit to prompt declassification and publishing of much of this information. I don't condone illegal leaks, but there is definitely a public interest in having the public informed about what is going on. Aside from the reporting on TF 373, nothing in the NY Times or Guardian analysis of the documents (I haven't looked at the raw documents) is a big deal. As far as I can tell, nothing particularly sensitive about 373 was published, either.
For perspective: the risks from riding a motorcycle are almost certainly greater than that of renting an apt short term. Should we ban motorcycles?
"in 1960, a coffee maker cost $29.95"

Oh sheesh, do you think that that's what had to buy to make coffee rather than a percolator or a french press?

This can work both ways.

Fun fact: In 1960 a percolator cost $2.95, but in 2010 an espresso machine costs as much as $10,000.
Ok, he's probably being hyperbolic.

All the same. There's a reason that hotels have to be licensed, and it's because people occasionally die if they're not.

Do you consider the board of health restaurant inspections to be a bad idea?
Wonderful summer weather? Where is it?
There's one thing that bugs me in this document (well, a couple more, but this is the biggest) - page 64:

> Multithreaded server coding is more intuitive - You simply follow the flow of whats going to happen to one client

Is it really? I'd agree if we were talking about something like server spawning a scripting language probably, but in other cases? Most network endpoints are described as state machines. They're not supposed to "flow" - they're responding to input and changing their state. I'd claim that if you implement a protocol with more than 5 states as a properly abstracted state machine, it would be more intuitive than anything that's supposed to emulate "flow". And that's more natural in asynchronous design.
.. if only to drop in on the mindblowing Madonna Inn and wake a wizz in their bizarre urinal (in an ideal world, stay there - best hotel/motel on the planet).
See NY Times vs. USA

http://en.wikipedia.org/wiki/New_York_Times_Co._v._United_St...
Ah, you beat me to it.

Some additional info:
http://www.exploratorium.edu/

It's so mighty, it has a .edu instead of .org
Make sure to get a reservation for the kinesthetic dome. Totally worth it.
I am also interested in Frink and I've emailed the author about license issues. Hopefully I'll get a reply that I can work with... I am working on an application that is partially C++ and partially Clojure, but I'm looking for a non-programmer friendly JVM-based scripting component. I was considering using Yeti for that, but Frink is a much much better fit for my needs.. Hopefully I'll be able to use Frink.
What kind of items were you thinking they might omit?
Ditto. I respect Techcrunch enough that I actually can't believe they published such a ridiculous article. My family (me plus wife and 3 kids) have used vrbo.com for our last two vacations (granted, not many data points). In each case, we saved money over staying in a hotel, enjoyed superior lodging over a hotel at almost any price range, and in both cases enjoyed far greater customer service over any hotel experience I've ever had.

Any time someone trots out the tired old argument of "well, with big huge companies, you have recourse if something goes bad", I always want to know which big company X they're talking about. Whether it's dealing with the DMV, trying to get JDBC driver bug fixes from Oracle, trying to get billing questions answered from Comcast, or trying to get the shower in you room fixed at a <major hotel chain here>, big organizations simply aren't organized around their customers. There may be legitimate reasons to pick a major hotel chain over AirBnB or the like, but customer satisfaction hardly seems like the best avenue of attack.

But of course none of this is rocket science... Whenever an industry resorts to competing through legislation, they aren't fighting the good fight to provide you with a better quality of life.
Would you support a ban on couchsurfing? Maybe you'd be deterred by our right to peaceably assemble. Is paying for access really so different?

Edit: as noted below, the implied question is: what "legimate health concerns" exist for short-term renting but not couchsurfing?
The Canadians lost their entire air force this weekend
Well, for one, because it's an opinion... He's overly dramatic in his post and he doesn't present a lot of facts, but I think he's entitled to his opinion, especially as long as he's honest about his bias...
Too much time surfing the web?

http://www.wired.com/magazine/2010/05/ff_nicholas_carr/all/1

http://tkcollier.wordpress.com/2009/07/19/acquired-attention...

Also relevant: http://news.ycombinator.com/item?id=956493
I wonder how you phrase the offer.

If I were planning to interview with a company and they suggested I use the service, I would get the impression the company is cheap beyond practicality, and find a way to politely back out of the interview.
The best and the brightest redux
Because I don’t want to be burned alive by faulty wiring. Because I don’t want to be robbed, or scammed or murdered. Because I want to pay by credit card and not have that card cloned. Because I want legal recourse if something goes wrong.

That government licensing will protect you from these better than the market is an untested assumption.
Also

fmap :: (Functor f) => (a -> b) -> f a -> f b
fmap f (Just x) = Just (f x)

So

fmap (\x -> x * x) (Just 4)
=> Just 16

Am I correct in saying that `fmap` is a functor which lifts the first argument `f` into the monad and then applies it to the second argument?
"There's a reason that hotels have to be licensed, and it's because people occasionally die if they're not."

Show us something that backs up your statement. People die all the time. Even from things that are heavily regulated and licensed.
The scary thing is that Pakistan apparently now produces "Stingers" as well (ANZA-II); probably superior to the other foreign MANPADS out there. We let them distribute thousands to the Muj in Afghanistan vs. the Soviets, and they apparently reverse engineered some.
To clarify for other readers, the Stinger is a U.S. made MANPAD (Man-portable air-defense systems). If the Taliban have any, they are 20 year old missiles left over from the war with the Soviets, and they are most likely non-functional, since they have a limited life time. It would be embarrassing to the U.S. to loose aircraft to Stingers, but if there are any left that still work, there probably aren't very many, and the risk is limited. It's more likely that the Taliban has managed to acquire newer MANPADS (probably a Soviet design). This would be especially scary if these missiles were being supplied by the ISI or the Iranians, since it's then possible that the Taliban could acquire quite a lot of them.
I am thinking that this comment came about in the era of the OS/2 Microsoft-IBM project. It was clear that IBM had a culture of kloc being a positive metric, and Microsoft did not.

I think it is useful to keep in mind that gobs of features sell, and (was it Joel Spolskey?) someone noted that any given user needs only 11% of a product such as a word processor, but another user needs a different 13%.
A Weekend Experiment with The Lean Startup - Part 2
Ipad connectivity &ndash; wired and wireless connection of apple ipad
How many non apple updates have you seen in the apple update center ? How many non microsoft updates have you seen in the microsoft update center ?
I think near all of the time Linux sales are chalked up as "Windows sales" anyhow.

In my current job, and in my previous job as well, all the tech staff PCs are corporate order Dells/Acers/whatever. They all come with Windows, and the first thing the developer/ops person does is installs Linux.

It's basically easier to do it that way than to communicate the Linux requirement back through to whoever is actually ordering the PC.

I think the only time either organisation doesn't preorder with Windows by default is for servers.
I considered this while writing it, but figured there's a fine line one must walk with a utility like this. If it's too annoying to disable, you won't use it.

Typically once I flip it on, I forget about it, until I actually try to check a site that's been blocked. I find that being unable to load a site or loading a local webserver hosted file injects just enough time to realize I should be doing something else.

Previously I wasn't in the "trick yourself" camp, but having used this for a while, I definitely am. Used in conjunction with the Pomodoro Technique, it's a really solid way to keep oneself on track.
Ask HN: Selling my first company - need help with the process
I built a product which company x is willing to acquire/license. From my estimations, they will be adding at least $*M to their bottom line. Company x also agreed that my estimations are reasonable and accurate. It is really glad that most arduous initial part of the initiation/demo are all done and both of us are completely upbeat about the deal. For a lot of reasons, I prefer selling out instead of releasing it to market myself - unless deal falls apart. I haven't raised any money so far.

Now, I need help in some best practices going forward. Things like,
1. how do I come up with price tag for my product(I don't want to have them low ball or I don't want to ask really high number either).
2. what is involved wrt legal paper work.

anything else i should watch out for in this time frame

thanks

PS: I am a regular user and contributor - I am using throwaway login just to be anonymous.
Automatic upvote for having come up with that username before reading this article's title.
but apartment swaps are allowed
I think it'd be a good idea to explicitly state it, but you know, it's up to you.
FWIW, the bill still allows couchsurfing where exchange of money is strictly prohibited by the terms of service.
In one of the past AirBnB articles about NYC the author mentioned that many landlords owning multiple apartments are making money on their vacant apartments by renting them on AirBnB. Maybe a bulk of AirBnB revenue comes from these operators who are doing hotel rentals on scale?
System76 specializes in Linux machines:

http://www.system76.com/index.php?cPath=28
> It's just what I was doing and good at since the days when I was 7 or 8 writing BASIC on my Apple //c.

change that to age 10 and the ][+ and you just described how I got started with computers too. CALL-151 for the win! :)
Look at HN user tptacek's posts. He makes a living at crypto and frequently posts about good practice or resources.
They never edit anything out. If they release a summarized or abridged version of something with a political spin to it, you can always find the full, unaltered sources if you bother to look on wikileaks.org.