Better HN
topnewbestaskshowjobs
Log inSign up

splintercell

840 karma · joined Dec 21, 2012 (13y ago) · 954 submissions

Submissions

comment 9y ago · link · parent

Actually this is a case for 5th amendment. Police can confiscate your phone on a judge's order, but no judge can compel you to give up your password if it's protected under 5th amendment (i.e. self-incrimination).

comment 9y ago · link · parent

> It's not protected if you lie when you shout it. The risk of injury to others is possible either way, but your intent is what protects you.

Falsely shouting fire in a crowded theater is ALSO protected by first amendment (Supreme Court reversed their opinion in 1969 btw). I clarified more in this other comment[1].

1. https://news.ycombinator.com/item?id=15307871

comment 9y ago · link · parent

Brandenburg vs Ohio[1] overturned Schenck v United States. As it turns out that "falsely shouting fire in a crowded theater" IS protected by first amendment[2], depending upon some more complex criteria called "imminent lawless action"[3] over "Clear and present danger"[4].

Under this, distributing communist fliers is protected by the first amendment. What is not protected is Antifa's call to 'immediately' riot against their perceived enemies. The element of time is important in imminent lawless action test.

1. https://en.wikipedia.org/wiki/Brandenburg_v._Ohio

2. https://en.wikipedia.org/wiki/Shouting_fire_in_a_crowded_the...

3. https://en.wikipedia.org/wiki/Imminent_lawless_action

4. https://en.wikipedia.org/wiki/Clear_and_present_danger

comment 9y ago · link · parent

I anticipated that makeHilarious is more than once used method, even if it is not, once you look at it's definition, you understand the intent behind "xor -> rofl -> lol".

It is one thing to quickly be able to understand that the person is doing a xor, then a rofl and then a lol of each element of an array, and a whole another thing to understand what the combination of these three actions over an array means. The python school of "code is read more than it's written" heavily stresses on explaining how easily the code should be understandable the first time someone reads it, but not whether it's easy to reason about or not.

The beauty of declarative style programming isn't to get more readable code immediately, but rather that once you understand the vocabulary, how easy it is for you to understand and reason about the code.

For instance, imagine reading a novel which is written like this:

"After Jack was done from the place where he went to do things for money everyday, he entered an establishment which served drinks that get you inebriated for money. This establishment was one he frequented regularly and preferred it over the others. He asked the man behind the counter for a wheat fermented brewed drink. After putting the drink to his lips and pouring it in to his mouth, he felt a sense of calmness enter his mind. It pushed all the thoughts which occupied his mind away, as he earlier desired before entering this establishment."

As opposed to:

"Jack really needed a drink after hard day at work. He went to his favorite pub, and ordered his favorite beer. After finishing the pint, he finally felt relaxed."

The Python philosophy (which is permeated everywhere in imperative world) is to describe everything in the simplest possible terms just in case there are people who may not understand what work, pub, beer, bartender, and relaxed means. But this just prevents from understanding of the actual purpose of the code.

This is at least the basic philosophy behind not using for loops everywhere.

comment 9y ago · link · parent

> The argument could have been made without the stereotype, I agree. But it is an open secret in NYC that people, especially in Soviet neighborhoods, abuse the welfare system. I'll drop it though because I only have anecdata.

I'd take those ex-soviet commonwealth welfare abusers anytime over welfare non-abusers any time.

These projects are one of the nicest and the most well maintained projects in the city. They bribe the city housing dept to win the lottery, and take the money they would have to spend on purchasing the property to maintain it.

Its almost like giving UBI to those who don't need it, give you a better society, and giving UBI to those who need it, you get more 'needs'.

comment 9y ago · link · parent

I made my case against the compose in the post.

Composing xor, rofl, lol isn't any better (esp in terms of readability) than it is individual maps.

What would be better is this:

  const makeHilarious = compose(rofl, lol, xor);
  
  things
    |> pluck('bar')
    |> map(makeHilarious)
    |> reduce(differenceWith('id')

comment 9y ago · link · parent

I feel like the functional code you wrote was written to intentionally obfuscate what is being done. For instance, composing a bunch of methods inline doesn't have any utility for it unless you define what compose(xor, lol, rofl) really means.

Ideally this is how it should be written for maximum readability.

  things
  |> pluck('bar')
  |> map(xor)
  |> map(lol)
  |> map(rofl)
  |> reduce(differenceWith('id')

The code is written equally well without using pipe operator but the proposal to introduce it is in works [1].

Here is it using lodash (not even lodash-fp), and this is going to do a single for loop when executing because this is lazy.

  _.chain(things)
   .pluck('bar')
   .map(_.xor)
   .map(_.lol)
   .map(_.rofl)
   .reduce(_.differenceWith('id'))
   .value();
It's no less readable than the code you'd write using using unfolded transformations.

1. https://github.com/tc39/proposal-pipeline-operator

comment 9y ago · link · parent

In my experience, there is almost never a need for creating a loop on an array purely for the sake of side effect.

For instance, if you want to write something on the log, then loop and collect everything into a single array (using map) and then perform the side effect with a single command (which is a lot more performant in most cases).

For asynchronous side effects, create an array of promises using a map, and then run a Promise.all() on that array if you need to resolve all of them.

But again, if your experience is different or in your requirements, it is not possible to create a map/reduce/filter transoformation for side effects, then I'd love to hear about it.

comment 9y ago · link · parent

> Vim just takes longer for those tasks and gives worse overview/feedback on which they are/where they are/etc, including with the relevant plugins.

As I said, there are fast plugins for that task and slow plugins. Command-T and Ctrl-P are megafast because they are run as native binaries.

comment 9y ago · link · parent

I used to be the guy who would say that people need to stop writing code which others can't understand, but then I migrated to, "why am I working at a company where I need to lower the bar so much that making changes in a code you understand well takes ages".

I joined that school when I used FP for my own project (I use Elm, and RamdaJS+JS) and found how amazingly handling bugs and complicated logic became. This clearly came with a higher barrier to entry for other people to understand my code (but this cost only needs to be paid once, I look at other people's functional code and I got no problem understanding it btw).

I understand large companies where logic needs to be written so simply so that anyone can understand it (Python philosophy "Code is read a lot more times than it is written"), but they don't end up with fewer bugs, it's just a LOT LOT BIGGER codebase, with 5 million for loops, doing 1500 things in one for loop.

In fact, before I fully went to FP side, I started writing my JS code without using for loops or forEach. Even this simple change of writing code using map/reduce/filter/drop/reject/take etc made code lot simpler to maintain, reason with, and eliminate bugs.

comment 9y ago · link · parent

> I never felt typing speed or special text transformation shortcuts being my limiting factor.

You don't because the purpose of all the actions you take while editing text is to not think about it. As a non-vim users, you have trained yourself to not think about the time you spent editing text. You want to move an object of options from one file to another file and move it to another object (something which I did moments ago), then the moment you come to the conclusion that you need to make that change, you start using your mouse, select the object, Ctrl-C, then move to the other file, Ctrl-V, and press the shortcut to auto format. But you don't think about it any more than you think about switching windows when moving from one app to the other.

In vim too I probably think about it no more than you do about your own text editing, but with vim, I don't press modifier keys, I don't reach out for mouse, and opening a file is the same speed as IntelliJ (an editor my coworkers use), using Ctrl-P, if not faster. Traversing files is much faster. Splitting screen and navigating is a billion times faster than what you can achieve on any of these editors. All without using the mouse or modifiers.

But these are only small benefits when compared to the biggest difference I've seen between Vim/Emacs users vs non-Vim/Emacs users. Take for instance, few minutes ago I was doing pair programming with my coworkers, and I noticed that there were thousands of productivity shortcuts that he wouldn't use, and he is not the only one, majority of non-vim using people I've met, fail to make use of these productivity enhancements.

* Pressing Ctrl-C/X without selecting text just cut/copy the whole line. * Pressing double click on a line selects the word, triple click selects the whole line (or paragraph in text) * Using Alt-Tab to switch windows * Ctrl-Backspace deletes the whole word/token * Ctrl+Arrow key for navigation * Split Screen, nearly all their editors support split screen functionality, but opening multiple files in multiple panes is like crazy person talk

Even with this minor experience I have with their editors, I look like a magician using their IDE. Not to mention how slow their editor is while trying to help me by auto-completing. I was done typing the name of the class before their auto-completion kicked in. You call that slight convenience of marginal utility, but to

My point is that, productivity enhancements is a desire people have, which makes these people to move towards Vim/Emacs. For the people who don't even use Ctrl-A to select the whole text, they fail to see what they're really capable of doing on their editor.

> As I've said, I've used Vim for 15+ years (still do, a decade after every time I'm in a shell). I've known all these shortcuts, used them, etc. Haven't seen it make any great difference in that respect.

Considering you complaint about speed of navigating between files, I highly doubt that you know "all these shortcuts", because even if you do, the philosophy of vim is to keep optimizing your workflow, so you create a shortcut for shortcuts. I think it would be a cool idea to hold competitions where two people are given a codebase, and their own completely configured editor on the same machine with same processes running and then they are asked to do a number of tasks, like open UserController.js, UserView.html, UserService.js and refactor a variable and change some data.

comment 9y ago · link · parent

With all due respect, I don't think you understand the purpose of currying and partial application. In your defense, the article merely explains what currying is, but does not explain why you need it.

For instance while writing functional Javascript code, I never curry my methods, instead I use helper methods from functional libraries such as lodash or Ramda to curry.

Where currying is useful is in cases like this:

  ```javascript
  //Definitions
  const filterUsers = (fieldName, value, users) => //Implementation
  const sortUsersBy = (fieldName, users) => //Implementation
  const takeUsers = (count, users) => //Implementation

  //Without currying
  UserService
   .getUsers()
   .then(users => filterUsers('active', true, users))
   .then(users => sortUsersBy('age', users))
   .then(users => takeUsers(3, users));

  //If these methods were curried
  UserService
   .getUsers()
   .then(filterUsers('active', true))
   .then(sortUsersBy('age'))
   .then(takeUsers(3));
  ```
Here is a video which explains proper uses of currying (and does it very well) [1]. Here is another article if your coworker start using functional programming and you want to stop them [2].

1. https://www.youtube.com/watch?v=m3svKOdZijA

2. https://brianmckenna.org/blog/howtostopfp

comment 9y ago · link · parent

This whole problem exists not because taxis didn't embrace technology soon enough, but because in 1936 they put a cap on issuing new medallions in NYC. Which meant that since then, irrespective of the economic growth and the number of people, the number of taxi cabs became severely restricted. This created an artificially increased prices for taxies. In the year 2011 a taxi cab medallion was sold for $1 Million in 2011 [1].

Taxi Cab industry is a heavily regulated industry which was screwing only one group of people, i.e. the consumers. This is why there is little love for the cab industry in America. For more economic analysis on this, check out the lecture by Murray Rothbard given in 1989 at NY Polytechnic [2].

1. https://cityroom.blogs.nytimes.com/2011/10/20/2-taxi-medalli...

2. https://mises.org/sites/default/files/Government%20Cartels%2... [Part about taxi cab medallions start from 29:21]

comment 9y ago · link · parent

> Multinational companies pay Canadian engineers doing the same quality of work much less than American counterparts.

So tell me why don't multinational companies pay less to their American engineers, the same as their Canadian engineers?

> Canadians do pay more for things than Americans do

I oversimplified when I said "paying higher", it's more about profit margin. So lets say if a market is located in a much more geographically difficult area then people of that market could be paying more, but still that wouldn't result in higher profit margins when compared to a market which is easier to access.

These restrictions could be geographical, economic, political, regulatory, etc or a combination of these.

comment 9y ago · link · parent

Right now nearly all new social networks (esp the one which promise free speech) will see an influx from alt right and conservative refugees.

Dtube (distributed Youtube) is see it for yourself. People are complaining about alt-right and conservative refugees being the early adopters of any distributed/decentralized/free speech platform:

https://www.reddit.com/r/dtube/comments/6zlza1/please_dont_m...

comment 9y ago · link · parent

> Canada doesn't have a problem with talent exodous, they have a problem that Canadian employers are stingy and then complain when all they have left are people willing to settle for half they'd make in the US, or 2/3rds of what they would make in Europe. [0]

That's not how prices work. Labor isn't a consumer good, wages aren't determined by the employer, they are determined by the goods they're eventually producing which the end user or consumer is willing to pay. If they pay less than what end user is willing to pay, then they lose labor to competition, if they pay more, than the increased price of the final good results in consumers going to the competition.

Canadian employers can't control the fact that their consumers don't pay higher prices for the things they producing/providing.

comment 9y ago · link · parent

Which one of you is closer to this?

https://www.youtube.com/watch?v=Sxo5pyElIts

comment 9y ago · link · parent

Which reminds me of GATTACA law which congress passed after the movie came out.

comment 9y ago · link · parent

What about Hispanics? Where did you get that stat from, can you cite your source please?

comment 9y ago · link · parent

But at what point, OP's criticism is a qualitative criticism of the approach being advocated?

For instance, if someone says that alternative medicine fails for n different reasons, would you say that the person is committing Nirvana fallacy or that there is something to say about the fundamental failures of alternative medicine?

The qualitative fault I'm trying to point out is that trying to tax 'rich people' is a failed attempt because no matter how effective you can implement your tax measures, at the end of the day people can move to other countries and your own country starts to suffer more than it benefits from the increased taxes.

It is a Nirvana fallacy if someone says "No matter how hard you try to curb murders, serial killers always keep finding new ways to commit crime", because at the end of the day, if all the serial killers move out of your country to a more serial killer friendly country, you don't actually suffer, you did your job.

On the other hand, in terms of taxes, you don't want your tax paying population to move out or be rendered incapable of producing wealth. That kind of 'equality' is not worth it.

comment 9y ago · link · parent

Capitalism in India (and many other countries), 1990- is bringing enormous, unprecedented and historic improvements in poverty levels.

comment 9y ago · link · parent

You print[1] more money and spend it.

1. Create more money should be the accurate term here. They can create more money by printing or, using debt.

comment 9y ago · link · parent

In November I predicted this to my Indian friends (who were quite excited by the new changes) that a rational Indian person shouldn't throw away their old black money, because this money would make a come back in a few years, when the new money starts to lose value due to inflation (Indian Rupee is inflated by the govt at a crazy rate, because that's how the govt funds itself in lieu of taxes).

This would eventually reach to a point when new currency would die out in the hands of the old currency. Why? Because what Indian govt has done is not 'demonetization' rather they have announced that they would stop printing more old currency and start printing a new currency. But it's like USG issuing Bitcoin like currency (without the electronicy parts, but with the fixed supply, and anonymity of cash).

In other words, the old Indian currency is the perfect black market currency created, and it will just keep gaining value over time as new currency keeps losing value.

My prediction was for at least 4-5 years, but pleasantly surprised to have it come true in only a few years.

comment 9y ago · link · parent

> Governments have so much leverage they don't need to be efficient to be a huge net benefit.

But aren't you just saying that when you have $1 Billion then paying $500k more to a contractor doesn't seem that bad based on the net benefit it would bring to have a dream home.

But imagine if this was a charity (something which govt is, if we look at it a certain way), that inefficiency means more people could have benefited out of it.

comment 9y ago · link · parent

If English is your second language, then I highly recommend their premium plan. Both my wife and I love it and how much it helps us in writing better English and getting better at it (in terms of that 'last mile' learning which could take up to a decade for most people to get perfect).

This is how Grammarly's premium edition would have corrected your post:

> Grammarly is a great tool. I never forget to check my article ~~with~~/on (Incorrect correction, think 'with' makes more sense here) it before publishing. If you had asked me a few years ago how much would anyone pay for a Grammar-checking tool, I would have guessed it would be no more ~~that~~/than (Probably a typo on your end, rather than a grammatical mistake) $3-4 / month. Grammarly charges $29 a month. Of course, its value can be measured with the improved communication but $29 _is_ a lot. It's amazing that it convinced people that it's worth it.

>~~High~~/The high (probably the most common mistake non-native English speakers do) price point is the only reason why I haven't gotten around purchasing its premium plan even though I think it would very beneficial for me.

comment 9y ago · link · parent

You're thinking of real crimes, but he is talking about actions which are perfectly legal for a citizen but illegal for an illegal immigrant, like working, using fake papers, driving without a permit, depositing money in someone else's name, etc.

If you're already doing all these things, what's illegal voting added to it.

comment 9y ago · link · parent

> Many programmers who enjoy programming will have a preference for hiring other programmers who also enjoy it. That doesn't mean they can't hire dispassionate programmers but that still doesn't erase the preference for passionate programmers.

Exactly, and it isn't just 'Work Ethic', I wanna work with these guys [1] in 'Silicon Valley' tv show who would go around doing a Jerk off calculation just because it is a fun calculation to do. Not just people with strong 'Work ethic'.

1. https://www.youtube.com/watch?v=nY7aQEhIxYA

comment 9y ago · link · parent

> For example, the idea that the Pentagon was hit by a cruise missile on 9/11 is worth brief consideration. But when you dig into it, there's no support, while there's plenty of support for the airliner.

The way I convinced my buddy to get out of that 9/11 conspiracy mode was to ask him questions about the shitty conspiracy theories he thinks US govt comes up with.

For instance:

* Why claim that it was an airplane which hit Pentagon, when they can claim that terrorists got hold of a rocket launcher, or a cruise missile. Since they claim that it was a CIA agent who launched the missile, then it would be even better to claim that there is a 20th terrorist who is hiding among us, and thereby getting more advantage of what they did by claiming conspiracy (i.e. to create an environment of panic in public).

* After I told about the ridiculousness of the 'conspiracy theory' like the point above, they would talk about Hitler's quote "bigger the lie, the more they'd believe it". When I tried to do more research on it, it turns out that there is no documented proof of Hitler claiming bigger unbelievable lies. In fact that quote was used by Hitler to claim the grand Jewish communist conspiracy theory of blaming Germany for the loss of WW1, which he had no proof for. Other than that, that's it.

* Since the purpose of govt officials who conspired is the same as the purpose of 'alleged terrorists', i.e. to create widespread fear and panic (just for a different end goal), literally everything govt did, can be attributed to the terrorists. The terrorists performed the demolition, they destroyed WTC7 after stealing gold, etc etc. This way govt ends up with having an even more foolproof conspiracy. In fact, if the conspiracy theorist questions that by making terrorists do that many things, it would make things more ridiculous, then you can point them to "bigger the lie, more they'd believe it" statement.

* Finally I asked my buddy, "Imagine if I was the person behind the attacks, I was one of the terrorists, how could I convince you that I did it, what proof can I provide you that I did it". Thankfully, my buddy hadn't lost all touch with reality, so he didn't really blame me for being a govt plant. He didn't really respond to me, but as far as I know that was the last time he advocated the conspiracy theories to anyone. And now we laugh at other conspiracy theorists.

1
171819
32