skysight-inc/HackerNews huggingface dataset:
Show HN: Greasemonkey script to put the comment-collapse switch at the beginning
The new feature that was recently added to HN, which is to be able to toggle the collapse of the comment threads, has the toggle switch at the end of the comment header.

The script below puts it at the beginning of the comment header, just after the up/down vote arrows.

This has been tested in Firefox.

// ==UserScript==
// @name HN: Change location of comment-collapse toggle switch
// @namespace HN_sendos
// @include https://news.ycombinator.com/item?id=*
// @version 1
// @run-at document-idle
// @grant none
// ==/UserScript==

(function()
{
var allPosts = document.getElementsByClassName('comhead');

for (var i = 0; i < allPosts.length; i++)
{
allPosts[i].innerHTML = allPosts[i].innerHTML.replace(RegExp("^(.+)(<a class=\"togg\" .+</a>)(.*)$","mg"), "$2 $1 $3");
}
})();
> Either a function can result in an error or it can't.

The problem is handling the error every time the function is called in the same place it is called and adding extra visual noise to the business logic.

Other ways to handle errors:

* Throw an exception. Program for the default happy path and throw an exception if something ... exceptional happened. This way code is not littered with 50% error handling which makes hard to read understand what it should be doing "normally". There is a trade-off there. But this has been implemented badly in other languages C++, Java and Go writers probably looked at that thought "No, way" and threw that idea away. I think Python does this right and it greatly goes to simplify code.

* Crash the goroutine (panic?). It is a bit like an exceptions but it applies to systems with concurrency units (goroutines, threads). However, in general that might not work as well because of two things -- shared memory, you can't just restart or assume a crashed goroutine hasn't scribbled over the heap memory, somehow or left data in an inconsistent state. And the other thing is goroutines don't have identifiers. so you can't say, I want to know if goroutine x crashes, then I want make sure y crashes as well, or I want to restart goroutine x and try again. But, that is not Go, that is Erlang / Elixir. Once you have seen process monitoring, linking, supervision trees and how they result in shorter, clearer code and less operational pain and suffering, it is hard to go back.

(Also if this sounds so alien and crazy, think about OS processes. A program has a pid. You can kill it using a pid, restart it. You know it hasn't scribbled over memory and messed up with other programs. This what sane operating systems do it has been this way for many decades, early Unix and then NT on windows. Other languages basically behave like Windows 3.1, which is cool, but is 1995 cool, not 2016 cool).

Should also mention Rust probably as well. Rust does a good job handling a lot proving there won't be data races at runtime between threads. Restarting a thread there is not as dangerous. But from what I guess still kind of awkward in the code. But even for the case explicit error handling, it has the try! macro which goes a good to visually simply the code. It does this because it decided that functions can return an agreed Result type which can be an ok value or an error. If it returns an ok, it passes the value along to the code that called, it if gets an error it returns early with the error. (Here it assumes both the caller and callee return Result. I don't know much about Rust so this might all be wrong, if anyone knows better please correct this ^).
The Go code in your example could actually be written:

resp, err := http.Get(someURL)
if err != nil {
return nil, err
}
return DoStuff(resp)
TL:DR There's no way any software vendors provide statically linked Python programs, ever.
So this is a better name for what they were calling "universality", right?

... Stuff like this makes me want to throw everything away and study math fulltime. That's still an option if I ever get FU money. Be sure to click through to the related article about the (spoiler) meteorite fragment containing a quasicrystal.
>one persons 'lack of expressive power' is another persons 'this code is easy to read'.

Expressive translates to "easier to read".

Having 100 lines of very simple procedural statements to accomplish what an expressive language does in 5 higher level lines doesn't make the 100 lines easier to reason about or maintain.

At worse it makes reasoning about their memory/speed beahavior harder -- but when it comes to reasoning about their functionality and the correctness of your program it's orders of magnitudes easier.
One possible mechanism: One of the proposed reasons for the recent rise in levels of autism is that more autistic children are sent to the psychiatrist.

You need to be relatively "rich" to be able to afford sending your child to the psychiatrist. Most programmers in Silicon Valley are relatively rich. Therefore, more children are sent to the psychiatrist in Silicon Valley than in the "rest" of the population, so more children with autism are diagnosed.
what were these transactions for?
There's probably a comment above it

// XXX: too general, revisit when we have more than 100 branches
>If it can result in an error and you don't handle that error, your program's behavior is undefined. Undefined behavior is a bad thing.™

There are way more advanced ways to handle errors than if err != nil boilerplate.
"Heck, there are entire public awareness organizations, university departments, and other institutions devoted to providing education on that issue."

They promote specific, biased views given most of them are liberal & pushing similar claims. I meet many Blacks in the South, from other cities, and from other countries whose views contradict points I learned from such organizations. There's a whole spectrum of opinion. Certain things most will agree with for sure but the differences can be pretty big.

Funny thing is people involved in the organizations you mentioned often argue with those views until I say they came from Black people. Then they still argue with them. So, do they represent Black people or a subset of them's views? I'm leaning latter. Means I listen to them, read blogs of many types of people (Black or otherwise), talk to individuals about the issues if they bring up the topic, and listen to white opposition, too. Learned plenty by listening to people from all walks of life instead of just the most vocal groups.

From there, the question remains about how best to do that without causing people discomfort. Seems 90% art 10% science if that. I get mixed results...
The math in The Elements of Statistical Learning is quite basic, if occasionally tedious. Any college junior in STEM should have taken enough calculus, linear algebra, and probability to work through it.
There would also be a number of people complaining loudly, demanding to know "why does WhatsApp look up my exact location [using the GPS] at the precise time I make a call!?".

Good luck convincing them that the location is not being logged permanently by WhatsApp servers -- or even sent to them in the first place.
> it feels like it makes a set of trade-offs that really benefit nobody

You. I'm extremely happy with its trade-offs, with the only thing I really miss being generics. Most other things people complain about Go I find refreshing like standardizing on vendoring, static compilation, no "expressive" bs to stroke a programmer's ego while producing potentially harder to read/debug code and so on.
Not a book, but Stanford's Intro to Databases by Jennifer Widom is offered for free online and I've heard nothing but great things about it.

https://lagunita.stanford.edu/courses/DB/2014/SelfPaced/abou...
What is happening here is that people are claiming that the right to repair already exists, and is being violated by companies. If they think it should exist, that's what they should have argued. But that isn't what they wrote. They wrote that the right does exist. Almost everyone in this thread used that language. That's what I'm arguing against.

I'm not saying that market outcomes are good or bad in general -- they are just there, as the pre-existing default position that may or may not demand a regulatory response. Any action taken should be on the basis that the default position is suboptimal in some way, and that regulation will make a positive difference. Otherwise, it is best to leave things as they are by default, especially when you consider the expense and unintended side effects that accompany regulation.

It seems to me that the only problem with the market outcome in this particular discussion is that some people aren't happy that the products being produced do not have a certain feature they like, namely repairability. This is clearly not the personal preference of most consumers, because if it was, companies would produce products to appeal to that preference. So clearly we are dealing with a small number of consumers who want this feature. That's not a strong case to change the outcome.
I notice there is no link to any actual peer-reviewed papers describing this research. I'm always skeptical of pop science writers' interpretations if I can't read the underlying science for myself to see whether it matches up reasonably well.
Or so racists would have you believe. However, the fact that homo sapiens do not have phylogenetic subspecies renders your argument false.
Well, people don't really start companies (not that easily at least) and it's really a shame because the government should ease things for everyone now that the unemployment level in Spain is around 22%
Oh, btw, a couple of days ago the government announced that they will raise the corporation tax. [1]

[1]http://www.ft.com/cms/s/0/55220458-483d-11e6-b387-64ab0a6701...
Pokemon GO teleportation Hack
Thanks!
Just a question: is this microserver blocking? I mean when a request takes 2-3 sec, can it server other requests in parallel?
> In a universe with no copyright, arguments about its benefits would fall flat.

They must not have, because we once lived in a universe without it, and now we don't. How do you suppose that happened?

Similarly, when the US patent system was created, arguments very similar to mine were presented in its defense, even though patents did not already exist. They worked. The arguments in favor of the status quo predate the status quo, and were convincing in a world without the status quo. That's because they are good arguments.

> Coming up with new concepts is obviously intuitive work - I've laid out what I see as a simple deeper abstraction behind copyright, which you've done nothing but ignore along with every other argument.

Intuition is not a valid or convincing argument. It does not deserve to be considered.
People need to stop beat the dead horse. GIL? Golang does not even support multi-threading.
Since Roger and Nick knew about the allegations

The original NYT article discusses allegations of sexual assault against prominent former TOR employee Jacob Applebaum, in case that's unclear to anyone reading the blog post that's now linked.
That sort of celebration happens defacto. I guess you prefer it to be called out explicitly?

Or when you were in grade school, did you only learn about ["black","asian","latino"] authors, musicians, scholars, scientists, inventors, actors, etc etc?
You're over complicating this. You know exact what I'm talking about or else you live under a rock.
Using R is basically a requirement for my work (biology) unless I felt like reimplementing all the packages I depend on, which I don't want to do since I want to graduate sometime this decade.

The multicore strategy calls mcparallel under the hood which uses the forking strategy (hence why it doesn't work on Windows). I don't recall exactly where in the source code I figured this out (again, this was a year ago), but it suffers from the same problem that there are a limited number of communication channels (what I generically call "ports") for all interprocess communication in R, which includes fork-based parallelism. The problem is that R does not allow you to tell it which port to communicate across for forked processes. The only advantage that the fork method has that I can tell in R is that you can share memory and don't have to copy stuff around.

My topology was a set of 3 analyses (didn't depend on each other), which had to be run in replicate 1000 times (those didn't depend on each other), and each task had two independent subtasks that were combined together to form a final result. I was running these on a server with 48 cores.

I'm sure there are other more heavyweight things that I could do to fix it, like using custom packages or setting up external software, but this was for a one-off analysis for a paper. It had to be reproducibly run (hence the desire for Windows compatibility) but as long as I could run it, it didn't matter if it was the best architecture.
For 1. We already have that model running in North Korea and I heard the people love it absolutely.

For 2. We already have that model running in USA and I hear it is the absolute worst place to live in.
Yeah. As a side note, I remember what Steve Klabnik once said: "Basically, Go is like a lower level Ruby or Python and Rust is like a higher level C or C++".
That wording doesn't attract clicks, and it's all this generation is about. You think I'm joking but I'm sure future anthropologists will document how clickbaiting changed the English language. Heck, I have seen common people baiting in their own captions "check what they put in this sandwich, this would be unbelievable in America"
This is the right answer really. In large at least that's how sane operating systems deal with failed components (processes). They crash, but then they can restart if monitored by a supervisor (systemd / init). On a higher level most places handle it as well at machine / node level -- auto-failover, auto-provision, health-monitoring, centralized logging. All that is the right answer to building concurrent systems, except most current languages except a few (Erlang / Elixir) are stuck in the equivalent of early 90's Microsoft Windows 3.1 environment.
Dan,

First, thank you for all you do. Huge fan, and you're an asset to the community.

One question I have is around this quote:

> Learn React first and try to use it. If you have issues related to state or if you’re just curious, you can also learn Redux to compare their approaches.

I tried to go down this route with a new employee who I've positioned on a React project (mostly as means of exploration + learning in between other projects)

But as soon as I had to deal with fetching data from the server and pushing it back, I felt the need to jump into Redux. Yes, I could manage this in React, but as soon as I had two "pages" in my app, I feel it would become unwieldily note to use the Redux + Redux-Think (or Sagas) combo.

Am I wrong here, or am I just "comfortable" with Redux, and thus, not persuing the idea of trying to build a more featured app in pure React?
I have an idea but can't code.
I've spent a few hours looking at previous questions like this here. There's a camp that says GO LEARN, another that says GO LEARN A LITTLE, AT LEAST, then find a technical co-founder. A few say other.

I would love to learn, and have dabbled (albeit slightly) in it. I mean, I've done very basic stuff. Very foundational stuff, but nothing close to even close to sufficient. I'll still keep going.

Here's the thing. I'm going to law school. I start in a few months. There's literally no way I'm going to have the time to learn anything of value while in law school. I don't think having the idea itself is worthless but I understand offering my idea to the company isn't good enough, and isn't good enough to have staying power, either. I could have something of value to offer as a lawyer, but I'm not there yet and won't be for 3 years.

I don't want to sit on this idea for too long, it's pretty simple by nature, convenient but easy for big, already established companies to replicate it in a heartbeat, especially with the man power, smarts, and data that they have.

What should I do?!

I'll add that because of the caliber of law school I'm attending (and the institution's business and other associated schools), I'll meet some entrepreneurial/coding/etc. individuals, with connections, I'm just not sure I 1. actually will 2. If this even makes sense to bank on? 3. Is this my best bet at this point? Finding a classmate/colleague?

Any other suggestions appreciated.
More appropriately no one seems to know who is routing them to null island.

You can't deal with this type of data for very long before you run into the case where you (or someone who processed the data before you got it) messed up and you end up with 0,0 coordinates.
I think it's the bad kind of impressive, one where ATMs still run COBOL.
I wouldn't be as alarmed at the NSA's data collection revealed by Snowden if I felt they took their job of defending and protecting US systems with as much zeal.

Of course, as the government's own reports show mass surveillance doesn't prevent terrorism, and we are also seeing how poorly citizen data is being protected.

This feels very familiar. Instead of seeing a malicious organization, I'm just realizing its incompetent. Forget about Pokemon Go asking for too many permissions, your data is already lost.
In practice optimization fence is not normally a problem, and can even be an advantage. The general rule is - just use CTEs. And the specific rule is - learn to profile and optimize using EXPLAIN ANALYZE
Does that mean the LinkedStateMixin is going away?
Here you go :-)

https://hub.docker.com/r/ontouchstart/asciinema/
If you don't have time to learn to code, then you almost certainly don't have time to be a co-founder etc.

It's unfortunate, but there's only so much we can do at once. It comes down to priorities.
Send tax dollars to dictators who execute people that ask for elections in order to support...democracy?
Determination of the Yield of the Trinity Nuclear Test 70 Years Later
I don't think it compares. There's no click through to definition in night code. I'd say nothing beats cursive so far.
>In a more free market, insurance wouldn't be tied to specific states - you could buy insurance from any firm in the nation willing to provide it.

That's an idea that sounds good but turns out to be a nightmare in practice. You would end up with a classic "race to the bottom" scenario of the sort seen in credit card regulations, corporate tax rates, and employee disability reimbursements -- eventually you would end up with a state that allows such egregiously poor insurance practices that every company would flock there to avoid more onerous regulations.

The current system is byzantine and a nightmare to deal with -- I still wake up in the middle of the night with implementation guides scrolling behind my eyelids -- but it's an improvement over a policy that would, in effect, let the payers pick and choose the least-protective regulatory structure.
>In many cases go programs ignore errors

This would be an absolutely terrible Go programmer. Like "I only log in as root to avoid typing sudo and my password" level retarded.
The Market Fairy isn't, despite it being a fairy, capable of dealing with imaginary problems.
Haha you know you've failed at your joke when you need to explain it, but I totally sympathize with you now that I know where you're coming from :) Good job on your app
Which other laptops support macOS?

I have a company Dell that's horrible. Had many Vaios in the past that were great but the new ones aren't that great. Don't want a tablet or a touch screen as my main device or an Internet only device (chrome book).
Yeah, I didn't see that coming. He's a practical, experienced cryptographer whose also worked on things like digital voting important to government accountability. Great choice for such a role.
The real issue is whether this is a fad or not (i.e. if only hardcore Pokemon fans are left playing in a month).

If it's not a fad, this is a good idea monetization wise.

If it is a fad, this will alienate the fans, and the game will fade into obscurity (e.g. Draw Something, QuizUp, etc).
What's the point of this thread? Honest question.

I have the feeling it is pointless keeping such map from the perspective of Brexit. Soon Scotland will be off of Eu, and all these businesses will be facing very different realities in short time. I would refrain make business with companies with whom I'd face more taxes or red tape just because their countries would left the EU.

So what are we trying to do here? Explore more the Scottish market? The soon-to-be limited UK market?

I am lost. Could someone explain it to me?
> you lose context

Sometimes you don't care about the context. You can have middle-ware code: [top level code]<->[your code]<->[library]. Maybe you don't care if library throws a "disk full" exception or "network down", littering that part with "if err != nil ... " might not be the best solution. Top level code might decide to log the error, retry, retry and log, send a page, or even just let another layer on top of it decide.

But as you say it is a trade-off. At lest Rust provides a neat try! macro, it goes a long way in handling boilerplate.

let mut f = try!(File::open(filepath));
let a_byte = try!(f.read_u8());

Perhaps Go would provide a source code transformation tool, to automatically expand code to do the equivalent.
Many years ago I added a feature (image upload button) to a minified WYSIWYG editor code without prettifying it :)
Genes and Cells that Determine the Lifespan of C. Elegans
Trades (stock, etc) the bank and/or their clients made.
There are a lot of people who view games as pretty much the same as Hollywood: no doubt it has a lot of impact, but ultimately it is "just" entertainment.

Personally I'm just not very interested in gaming.
You have two options: 1. Drop law school and do it. 2. Finish law school and do it.

You will always have another idea. You will make important connections even without law school. You will always be able to learn new things.

Let go of the idea of who you might become in 3 years.

Pick the option you think will make you feel the most alive, follow your stomach and intuition.
I don't think you can conflate intent with real world application. Certainly they didn't intend for Javascript to take over the server-side world when they built the language.

I don't think you can compare a GC memory model with heap/stack. There's a sliding scale of tradeoffs that you get from a fixed stack -> heap -> GC. There's also a set of hardware out there that doesn't have a unified memory model. There's millions of these types of devices out there in your set-top box, game console and many other places. If you don't have direct control over memory you'll never be able to work with them and will always need a C/C++/Rust wrapper around the low level bits.

Lastly, I'd never want to use volatile for threading[1]. There's no memory barrier semantics, instruction ordering semantics(aside from with other volatile reads). If you need thread synchronization you should to use the platform specific atomics otherwise you're in for a world of pain(and god help you if you're going from x86-win32 -> ARM, there's an implicit memory barrier in x86-win32 that most people don't know about).

[1] Note that volatile variables are not suitable for communication between threads; they do not offer atomicity, synchronization, or memory ordering. A read from a volatile variable that is modified by another thread without synchronization or concurrent modification from two unsynchronized threads is undefined behavior due to a data race. - http://en.cppreference.com/w/c/language/volatile
Such as?

In before: Unchecked exceptions that I can forget about instead of always handling the errors gracefully or consciously pushing down the stack.