You don't need to install anything; you could put this on the first line of your file, and achieve the same effect, with just tools you already have installed:
It's a hack because it's relying on the fact that without a shebang line or the appropriate magic number for your executable format, most platforms interpret scripts as a shell script; and it's using the fact that // can be treated as a comment delimiter in C or as a redundant way of referring to / in shell. So we interpret the first line as a shell script which calls out to make, to build the input file, then execute it, then exit so we don't try interpreting the rest of the C source as shell; and that first line of shell is interpreted as a comment in C.
Apparently I had a reading comprehension failure. I thought he was just saying that you can use that as an alias instead of downloading a new command. That is neat.
I thought of that, and even tried it, but on Mac OS X it's in /usr/bin/true, while on my Debian system it's /bin/true, defeating the purpose of making this path independent.
I considered a few no-ops, like /bin/cat (but that would then consume stdin) or /bin/echo -n, but there may be cases in which these can't be relied on either, so I figured that just keeping it simple but relying on the location of make was the better option.
Sure, you can do that. I didn't because it's (a) longer (and I was trying to do some minor golfing to keep it under 80 characters) and (b) doesn't have any stronger of a guarantee that it will be located in /usr/bin than make does.
There's more than one way to do this. It's just a silly hack; I decided to keep it simpler as the other alternatives didn't seem strictly better.
Nope, there are systems in which it's in /bin/env, though you have to go fairly exotic before you find one that doesn't at least have a symlink in /usr/bin. I don't believe POSIX says anything about it
I tried this out in my (wacky homebrew) shell, and it didn't work (ENOEXEC). Then I tried it in bash and it did. Turns out, this will only work when started with execvp, not when started with execv. All of the GNU adverbs I tried seem to get this right (nice, xargs, nohup), but I wouldn't be surprised to stumble across this issue later somewhere.
I'm pretty sure I've seen a case in which a particular script worked when called directly from Bash, but not when invoked by other things like xargs or nohup, because Bash actually will execute scripts under itself, while execvp will execute it under /bin/sh which is Dash on Debian/Ubuntu systems.
In fact, it was even better than that; they had even used #!/bin/bash, but had whitespace before it, causing the shebang to just be treated as a comment and not the as an interpreter:
Looks like it's fairly standard for shells to have this behavior, and execvp() is intended to have the behavior of executing like a shell would, so searching the path to find the executable and then passing the result to the shell interpreter if the underlying execve() returns noexec. May be a feature to add to your wacky homebrew shell.
That's a lot less elegant than my version. Multiple lines? Using sed to filter out the extraneous lines? Hardcoding gcc rather than using the system CC via make? And it gets the arguments wrong, too.
They say "we'll pair you with another Ivy League student", but I wonder what they do to prevent alumni, professors, and staff from joining? Would people be as willing to use this if they knew that it didn't solely consist of students?
Hey! We filter out known alumni email addresses (e.g. alumni.princeton.edu) but there's no way for us to differentiate between non-students and students if they both have a "student" email address.
Alumni email addresses are sometimes filterable, due to a different domain, but faculty or staff generally aren't; at many schools, students, faculty, and staff get indistinguishable email addresses.
I considered trying to sign up as an alum to test it out, but decided that I don't really have any interest in chatting with random Ivy League undergrads even if just for testing purposes.
Thank you for the "currently" parenthetical! By the time I saw this, the tile had already been changed to "Io.js is one step closer to ARM64", and I really hate reading a bunch of comments about an inaccurate title without actually being able to see what it used to be.
I feel like one thing they could do to promote Firefox OS would be to make it possible to run Firefox OS applications on Android; create an installer/app store that would allow you to install them as if they were native apps, but they would be using a shared runtime.
That would really help to make it worthwhile to develop FxOS apps; actually having a large installed base of phones that they could be used on, in order to help bootstrap the ecosystem up.
> I feel like one thing they could do to promote Firefox OS would be to make it possible to run Firefox OS applications on Android; create an installer/app store that would allow you to install them as if they were native apps, but they would be using a shared runtime.
Good news! That already exists in Firefox for Android, it's called Firefox Marketplace, it works by packaging up the apps as apks, which means they can operate as native android apps with access to native device APIs.
as someone else noted you can already run firefox os apps on android. you can go to the marketplace inside firefox and install apps. It seems like a lot of them are non-english which gives me hope that this is taking off at least a little outside the usa (but of course only being fluent in English I can't really tell if these non-english apps are any good or not.)
For people in cities or inner suburbs, you may see it as a premium brand, as it does tend to be more expensive than the competition.
For people living in further out suburbs, exurbs, and rural areas, Verizon is pretty much a requirement. None of the other carriers have coverage that is nearly as good; you actually want your phone to work outside of a thin strip around the interstates, you buy Verizon.
You would need to have an increasing level of soy consumption in Japan for that to make sense as a suggested causal relationship.
Simply "they eat a lot of soy" and "their birth rate is declining" doesn't imply any kind of causation, if they were eating the same amount before it started declining.
Why? Moral vegetarians is a quite different topic, and there is an answer for this too. Current rates of population growth are unsustainable without animal food sources. So, the price would be lives of children and weak adults of poorest communities.
Most people I know who are moral vegetarians do not demand that the rest of the world be as well. They simply object to eating the flesh of animals themselves, or (for the vegans) eating any products derived from animals which did not consent.
You do also realize that another solution for unsustainable levels of population growth is to curb population growth, by better access to and encouragement to use birth control, right?
These topics are subtle and the current fashions among some social classes in some regions of the world cannot be considered as something more than mere fashions.
For example, that "obvious and easily observable health benefits of being vegan" are related to the avoidance of processed foods and heavily unbalanced diet, rather than avoidance of "animal flesh" or dairy products themselves. This is just the confirmation bias and similar factors at play.
Those, who have studied human physiology, not just cellular metabolism, which is also important, could tell that the problem is too complex to be dealt with by silly slogans like "avoid red meat". There are many subtle ratios involved, not just an ability of a particular enzymes to convert a particular molecular structure into molecules involved in the metabolism and support of the homeostasis, but the ratios among these processes. The balance is what is important. In other words, "substituting the protein sources", is not that simple as it seems.
There is no scientifically proven reasons to avoid dairy products, except for individual cases of lactose intolerance, while there is a consensus that the food industry is the cause of the problem to which veganism seemed to be a solution.
Tribal eating habits is a quite interesting topic, btw.
As for birth control, this is quite another topic, which, perhaps, cannot be discussed in this context. For some members of so-called "urban-middle-class" in some region of the world the policies of forced birth control are acceptable, while in other societies there are quite different reasons about how many children should a family have and why. And, of course, it is not for some "vegans" to decide what other people in other regions of the world should do.
Source? I believe that animal food sources are a vastly less efficient use of land and resources than plant food sources--the whole "20 pounds of grain to produce one pound of beef" thing. Certainly nutrients can be in short supply in a meat-free diet, but it's easy enough to get them from vegetable sources and add supplements.
To me the word wiki refers either to the original wiki at c2.com[1] by Ward Cunningham or the kind of organically grown community around a user editable website.
Do not let the word wiki in its name and the content being provided by users through a wiki engine fool you, wikipedia is not a wiki (for a variety of reasons) but this is a common misconception.
Let's just say that if openstreetmap had been called wikistreetmap and used a wiki engine, it would still be "a map of the world, created by people like you and free to use under an open license." and not a wiki.
So yes using wiki as a shorthand to refer to wikipedia is not only confusing but also wrong.
-edit-
meatball[2] is a wiki, consumerium[3] is a wiki
everything2[4] is not a wiki[5] and everything2 not being wikipedia[6] doesn't make wikipedia a wiki.
Wikipedia is estimated to be the sixth most-visited web site in the world, and is the only site in the top that is commonly referred to by the word "wiki".
You are free to complain about or dislike that, and to want people to broaden their horizons if they think of it as the wiki or as the default thing that "wiki" refers to, but you are not free to claim that most people, when they say "wiki" as a shorthand for a site, actually mean some other site, or that some other site which could be called "wiki" is more likely to be meant.
It does cause confusion. I use multiple wikis that are not Wikipedia on a daily basis. When someone just says "wiki", my first thought is that the sentence is not grammatically correct; it is like saying "encyclopedia says" or "book says", it's not grammatical without an article or other qualifier of which one you are talking about. My next thought is that they are referring to the original wiki, http://c2.com/cgi/wiki.
I have seen this usage become increasingly common, but I try to discourage it when I see it, because it does cause confusion, and if it catches on, could cause even more when trying to discuss other wikis as people may assume that you are talking about other Wikipedia affiliated sites, not other instances of the general category of wikis.
Actually, that's exactly the kind of question that StackOverflow wants to discourage; people just using it as requests for someone else to write their code for them.
First: even if it's true that SO wants to discourage people from asking questions where they're starting from scratch and haven't written any code themselves yet... it's still a terrible moderation, because the explanation doesn't communicate anything close to expressing that. It says the question is unclear. That's flatly false.
Second: is this really the kind of question SO doesn't want? Their privilege, if so, but in addition to being well-defined it's clearly content that more than a handful of people were interested in (at least 15 upvotes on the most popular answer, multiply it by the ratio of non-user visitors to user visitors). It's a programming question, it has a programming answer, and it certainly has instructional value as an elisp recipe beyond whatever intent the author had.
And as for whether it's lazy -- that's basically the charge here, right? -- I'm not sure I see a functional difference between someone asking a question like this and someone who has written a larger pile of code and is missing a narrow piece of knowledge to complete it. There's possibly arguably a contextual/rhetorical difference where in the latter situation we see the context which led to the question being asked and in the former we don't... but honestly, nobody who's fundamentally asking other people to just do their work for them is asking about text->html transformations in elisp, it's pretty easy to read between the lines and see that.
To underscore the point, let's just compare it to some other questions:
It's pretty easy to see what most of these much more popular questions have in common with the one we're talking about here -- as part of whatever these askers are doing, they know there's a capability embedded in a tool that's part of the environment. They just don't know how to bring it out. You could, of course, just tell them to go RTFM for awk, until they get something simple like deleting a line from a file when it matches a string you know, but then again, you could also tell people to go more carefully read the relevant documentation for most programming problems, and if you accept the question and the answer you've got relevant content people are looking for on the site and a recipe people can start learning more from.
The moderation works based on votes one one of a few pre-canned reasons from several different users. If enough users vote to close, the pre-canned response that the most voted for is what is listed. That means that it doesn't always exactly match the reason that the question was really closed, but it means that it's possible to give an approximate rationale for the close that was performed by several people, not a single person.
I have answered a lot of questions on StackOverflow. One of the worst type of questions is the "please, write this code for me" question. There are frequently lazy or incompetent programmers who just ask for code to do their job, along with students who are asking people to help them cheat on their homework. So many people on SO are very quick to downvote and close any such questions.
Now, there's a grey area. Asking how to do one specific task which is a small component of a larger program is different enough than asking someone to deliver a completed program to you that it's tolerated. Asking something like "how do I use this one facility in a language" is different than asking "please write this tool for me."
There's also just the fickleness of the crowd. Any site which is based on voting, like StackOverflow, Reddit, HN, and so on, can have some questions upvoted and some downvoted due to sheer bad luck, different sets of people looking at different sets of questions, and so on. Trying to expect that a large group will act in a coherent manner, when only a small subset of that group ever even sees any given question (and with strong bias, as different people follow different tags), is just going to set you up for disappointment.
> nobody who's fundamentally asking other people to just do their work for them is asking about text->html transformations in elisp, it's pretty easy to read between the lines and see that.
It's not "please write this code for me" question. Rather, it's "please, grep your ~/.emacs.d and paste defun that you wrote (or borrowed from someone) years ago". Elisp code lifecycle is different than usual code and it's reusability is much higher than other kinds of code. I have bits of Elisp in my config which were written in the '80ies, obtained very much in the same manner: by asking for it on mailing lists. The code is there, its discoverability sucks, which is why questions such as this are legitimate in case of Emacs, even if it would be different in case of other languages adn environments.
Not taking into account specifics of a particular domain - along with questions being judged by people who have no idea what is being asked, but feel the need to judge - was the very thing which made me leave SO.
No, this is not a good question for StackOverflow. You simply asked for someone to write code for you, which is not what StackOverflow is intended to be for. It is intended for help on a particular specific problem you are having with your own code.
It was a short well-defined question with given input and a specific output. Elisp isn't the most widely used language so coming up to speed could be time consuming. Someone else even starred it so they must have found it to be useful.
If I'd just ask to "Calculate someone's age in C#", that'd be a much better question?
It'd be interesting if they would just register something like shitpile.com, set up an instance of Stack Exchange on it, turn off the moderation game, and push closed and deleted questions there instead of disappearing them.
That would at least sort of be an experiment on whether all of the decisions they have made about what Stack Exchange sites are 'supposed to be' actually matter or not.
Are you saying that you can't find a point of view where it would be a more specific question? Because that's what I meant when I said 'arguably'.
Saying that you can find a point of view where it isn't more specific isn't really that interesting (to me) as a response to that. Hopefully the rest of my comment is enough to see that I was not particularly defending the SE status quo.
Anyway, I was just refering to the first sentence. The rest of your comment is an interesting proposal, though at this moment I don't have any thoughts on it worth sharing.
I am sure you could classify a fair number of SO questions as "asking someone to write code for you".
I have been down voted a number of times for "where to start with X (in order to do Y)" type questions - where I am in the same situation and don't have the time to read everything in the docs, to produce what is likely a few lines of code.
The SO response is along the lines that it will generate too many answers or opinions. They are usually closed without receiving any answer whatsoever. I have pointed this out to moderators, but they just post back links to meta pages.
And this exactly is the problem with SO. There is no good question for that site, the classification seems arbitrary and totally random. I don't participate in this site for a very simple reason - I have no idea how to ask a question that will be OK by SO rules.
(the fact that you can't be in any way contributing to the site until you asked enough questions to bump up your karma is another blocker)
It is not that difficult. I have asked many question and never had anyone close them. If you follow common sense and state the question clearly and specifically, you should be fine.
I sometimes vote to close questions, but it is always due to pretty obvious laziness like not actually asking a specific question ("Here is my code... please help me") or overly broad questions ("I'm trying to write an e-commerce web site. Can anybody point me in the right direction?")