Better HN
topnewbestaskshowjobs
Log inSign up

foo101

982 karma · joined Jul 7, 2016 (10y ago) · 339 submissions

Submissions

comment 7y ago · link · parent

> but in some environments these might be best practice

What are those environments? Can you be more specific?

comment 7y ago · link · parent

What has referring to a variable twice got to do with whether it should be a macro or function?

33.

At a stealth startup, dozens of engineers relentlessly worked 20-hr days(twitter.com ↗)

7 points · by foo101 · 7y ago · 3 comments

comment 7y ago · link · parent

From the header of the website:

> arXiv Vanity renders academic papers from arXiv as responsive web pages so you don’t have to squint at a PDF.

Why aren't more PDFs displayed like this on the web? I thought the math stuff would be a problem but this site shows the math stuff alright.

Anyone knows how to reliably convert complex PDFs to beautiful web pages like this?

comment 7y ago · link · parent

Not a Singaporean. But I have traveled extensively in Malaysia and Singapore and I can attest to the better experience of Grab. The Grab experience (availability, pickup time, price, etc.) was so much better that I never even thought of installing the Uber app in my subsequent visit to these two countries.

comment 7y ago · link · parent

But it can still take a long time for a problem like this to solve itself, especially, in an area dominated by a monopoly. So the need for laws for this is not completely unnecessary.

comment 7y ago · link · parent

But no language, no matter however opinionated, does get most things right, does it? People complain about C, C++, Java, Go, you name it.

I know many people are averse to the idea of macros that makes Lisp so malleable (you can add syntactic abstractions like in-fix expressions etc.) but the same people are not averse to adding new types with classes or new "operators" with functions. I find it curious that many are comfortable at stopping the level of abstraction at just that (types and operations). For some reason, the idea of abstracting away syntax itself or dynamic function definitions (macros) is unpalatable. Why should the comfort for abstraction stop just there? Just like one can make a mess with types and functions, one can make a mess with macros. Just like one can write beautiful and elegant types and functions, one can write beautiful and elegant macros. Does the aversion to macros come due to the traumatic experience people relate to when they think of C/C++ macros?

comment 7y ago · link · parent

The trailer link on this page is very impressive. Here is the direct link to the trailer: https://www.youtube.com/watch?v=ReDDgFfWlS4

comment 7y ago · link · parent

Thanks for the reply.I have a follow up question about the "operator pending mode". I understand you didn't know it was a thing. But say, you press 'd' in normal mode because you want to delete a line and then you change your mind, what do you do it cancel the pressed 'd'?

I know I just rephrased the "operator pending mode" in a more elaborate manner but I am curious how you handle this case? Do you press Esc? Or do you go ahead with the delete anyway and then press 'u' to undo the delete? Or do you have some other technique to cancel the delete operator pending?

comment 7y ago · link · parent

Do you realize that this is open source and being offered to you as a gift? The license allows you to compile this tool with whatever compiler and flags you want. Please do that if you care about the optimizations. But please do not post dismissive comments when someone is putting themselves in a vulnerable position willingly by sharing their hard work for free with the community. If you have feedback to offer, do it constructively with kindness and acceptance, not with reproach and snide.

comment 7y ago · link · parent

Stop! Just stop this! This is a "Show HN" post. Someone out there is trying to develop something useful and share it with the community. By doing so, the author is willingly putting themselves in a vulnerable position where the author's work could be examined critically. The project is also open source. Don't forget that it means that it is being given to you as a gift!

If you think this needs more testing, do it yourself. The author of this project does not owe you any testing. If the Makefile works for author, that's good enough for the author. If it isn't good enough for you, fix it. The license allows you to do that. Then consider being nice and giving that fix back to the community with a pull request.

Don't come here on your high horse and post vile comments on something that is being shared with you as a gift! If you come here with your pull requests, code, or even better--your own projects, you would be welcome!

comment 7y ago · link · parent

I do this. But then I find that whenever I have to help someone out at work in their Macbook, I have to go through the hassle of first mapping Caps Lock to Escape on their Mac, do the work, then remember to unmap it again after the helping session is over. Is there any good way to automate this workflow for helping other people on others' Mac?

comment 7y ago · link · parent

> inoremap jj <Esc>

That takes care of returning from insert mode to normal mode. What do you do for returning from other modes (operator pending mode, visual mode, etc.) to normal mode? I don't think it is possible to reliably reproduce all of the <Escape> in all the modes with remaps.

comment 7y ago · link · parent

Is it? djk in normal mode would delete the current line and move the cursor one line up!

d<Escape> on the other hand would cancel the operator-pending mode for delete and do nothing.

comment 7y ago · link · parent

There is no guarantee offered by the standard that you must be able to read and write to memory allocated by malloc(). What if the memory was allocated and just a split second later, the physical RAM burnt out due to overheating? How is the standard supposed to guarantee reading and writing to it then?

Both the hardware burning after memory allocation and lack of availability of physical memory after memory allocation are outside the scope of the standard. The standard says nothing about them. A C program can fail in these scenarios without violating the standard.

comment 7y ago · link · parent

I tried the idea of using `jk` in the past and found that it surely cannot be a perfect replacement of Escape.

Say I perform these mappings:

  :noremap jk <Esc>
  :inoremap jk <Esc>
Now granted, pressing `jk` in insert mode escapes me to normal mode. But many use cases that work with the Escape key do not work with `jk` anymore.

For example, try:

  :ab hn Hacker News
Now type `hn` in insert mode and press Escape, it would expand to `Hacker News` like it should. But then type `hn` in insert mode and press `jk`, it does not expand to `Hacker News`.

comment 7y ago · link · parent

Your original critique from https://news.ycombinator.com/item?id=19161365 said this:

> Yes, C doesn't force you to use braces here, but this is really overdoing it.

It said nothing about nesting level depth. The question of nesting level appeared later in a child comment of yours which I believe is moving the goalposts. Sorry, I didn't make this clear in my previous comment.

Having said that, I do agree with you that braces are helpful. But then, we should all decide the pants policy in our own homes: https://groups.google.com/d/msg/nodejs/MWaivVTirPY/0pnRjKsgg...

comment 7y ago · link · parent

The second example does lack braces in two nested 'if' statements. Did you ignore that? Granted it is not three levels deep and granted there is a brace in the 'else' part but that's no reason to ignore the fact that K&R does in fact omit the braces for nested 'if-else' statements.

Demanding now that the nesting has to be less than three levels deep to omit braces is just moving the goalposts.

comment 7y ago · link · parent

How were the illustrations in this post created?

comment 7y ago · link · parent

How can we show that real numbers form a vector space over rational numbers? I mean a real number like 2 is just a real number. How is it also possibly a vector? Where is the origin and where does this vector point to?

comment 7y ago · link · parent

Why would you make such an unfounded assumption and ask a loaded question?

comment 7y ago · link · parent

What is "Google+ for consumers"? Is it different from the Google+ a regular user like me?

comment 7y ago · link · parent

> The investigation also found that He’s experiment ran counter to national regulations forbidding people with HIV from using assisted reproduction — an allegation reported for the first time in the Xinhua article.

What is the rationale behind this regulation? Is it that the baby is likely to be infected with HIV or is there some other reason?

comment 7y ago · link · parent

> Algorithmic ability has no correlation to the ability to write maintainable code, though.

This is not true in my experience. I usually see a strong correlation between algorithmic ability and writing maintainable code. At various organizations I have worked for, I have seen that the ones with strong algorithm skills also happen to be critical thinkers who put a lot of emphasis on simple, elegant, and robust design and code.

So I am very surprised to know that this correlation I observe may not be true in general. How did you come to this conclusion?

comment 7y ago · link · parent

> If one has great work ethics, the connection to the teacher doesn't really matter because one would learn regardless

If one has great work ethics, there is a possibility that the student with connect better with the teacher. Do you have concrete references that prove that under the condition that the teacher has great work ethics, the effectiveness of learning is independent of connection to the teacher. Equivalently, do you have references that show that the effectiveness of learning is more or less the same in both of these cases: (1) Teacher has great work ethics and students have better connection to the teacher (2) Teacher has great work ethics and the students have poorer connection to the teacher.

> fear can have a really positive effect when it comes to learning something

You seem to be presenting a personal anecdote that opposes a peer-reviewed study of Patricia K. Kuhl from University of Washington but you do not present any evidence to corroborate your claim. It's great that fear worked out well for your class but without supporting evidence for it, I doubt if this would work for the majority. I would be wary of using fear as a tool while teaching.

comment 7y ago · link · parent

Is this sentence incomplete or am I missing the context of the word "compelling" here?

> be able to write up a compelling

Can someone clarify what this means?

comment 7y ago · link · parent

Same question as cjohnson318's.

What are some low hanging fruits in mathematics? I have been looking for them for a few years now and have found none.

comment 7y ago · link · parent

Please don't do this here. Comments like this degrade the reading experience on HN. This is why you are getting downvoted. The HN crowd generally prefers more substantive comments and discourages low effort humor.
12345
12