2,544 karma · joined June 15, 2010
Your comment comes off as a little bit condescending and presumptuous. There's this underlying judgement about the relative worth of writing a Brainfuck interpreter and environment versus drinking in some bar in Guatemala or starting a company, like the latter is obviously a better use of time and energy. Aside from the fact that doing the things you mention aren't mutually exclusive with this little project, it's really tiring to hear (older) people constantly beat the drum of "you're young! go travel! drink!" on top of the "start your own company!" startup mantra. Maybe you wish you did more of those things when you were younger, or maybe you wish you were doing more of them now, and maybe I will wish the same thing when I'm older...
But they are absolutely not for everyone. I think it's disingenuous to just throw out "take that energy and try to build a company" as an alternative. Not everyone has it in them to do all the schlep work required to succeed at their own startup, so why assume this person hasn't considered it and chosen not to follow that path? Furthermore, I would personally prefer to tinker with a Brainfuck implementation than spend any amount of time in any bar, even it's in Guatemala or Colombia. I usually find them noisy and unpleasant, and I would find "partying the night away" to be a boring waste of time. But I would never suggest someone else shouldn't spend their time that way because that would be assuming a great deal about what's important to them.
Maybe this was just a little flip remark on your behalf, not meant to be taken seriously. I'm probably projecting a little bit, and reacting to something you may not have intended to imply. For that, I apologize again.
If you assume that all of the methods (getSponge, getTowel, wash, dry) do the same amount of "work", ie take the same amount of time to execute, then the first function takes 4d units of time (continuing to use d as the number of dishes). The second takes 2d+2 units of time. We define these as (mathematical) functions in terms of d, which compute the time spent for a given input size:
f(d) = 4d
g(d) = 2d+2
It's possible to prove that both of these function are O(d).The formal definition of O(n) is:
f(x) = O(n) if and only if there exists some constant c
and some value x0 such that, for all x > x0:
f(x) <= c * n.
It's a way to talk about the growth rate of functions, what people usually mean when they say some algorithm is O(n) is that the function calculating the runtime based on input size is O(n).This is pretty trivial to show with f and g above, pick c=5, x0=1.
Roughly, you can drop additive and multiplicative constants when computing the "big Oh" of a function. I'm leaving out an awful lot of formal mathematical details here, partly because I'm rusty, but also because all of this is much better presented elsewhere, in numerous algorithms textbooks and courses. (btw it's possible I've made a mistake in the above, for which I hope you'll forgive me)
Lots of people would recommend the big white book from MIT, but I'm fond of "The Algorithm Design Manual" which is less formal and rigorous, and thus perhaps a little better suited to professional software developers who are just brushing up.
http://ocw.mit.edu/courses/electrical-engineering-and-comput...
In pseudo-java-code:
void washDishes(Dish[] dishes) {
for(Dish d : dishes) {
Sponge s = getSponge();
s.wash(d);
Towel t = getTowel();
t.dry(d);
}
}
void washDishes(Dish[] dishes) {
Sponge s = getSponge();
for(Dish d : dishes) {
s.wash(d);
}
Towel t = getTowel();
for(Dish d in dishes) {
t.dry(d);
}
}
Maybe, in practical terms, there would be differences in efficiency, but those are exactly the kinds of constant factors big Oh is meant to abstract, and for the purpose of example, both of these are O(n) given input size (number of dishes) of n.I hesitated to post this comment, since it's kind of a "well, actually"[0], but unless I'm mistaken this example is fundamentally flawed.
Yes, I think so, or at least the common reaction is usually over-dramatized. I've observed this behavior in friends, colleagues, and in myself. When learning about someone's lack of knowledge, it's very common for the other party to react with "Really?! You don't know xyz??" I think 99% of the time the person saying this is not actually surprised, and does not actually need confirmation by asking again "You don't know xyz??" It's just a social tic ends up being kind of exclusionary and negative.
> Just tell participants that they may encounter people from a variety of backgrounds, and they should not assume that every understands what everyone else is talking about.
This is fine and well, and I'm sure the people running HS would agree with this, but tbh it is a little obvious sounding. The thing with avoiding "feigning surprise" is that some people (like myself!) might not even realize that they do this. After I read about this rule of theirs last year, I've been trying to cut down and was a bit saddened to realize how much I do it.
It's a pretty similar attitude to this comic, in the sense of adding a twist to the more general form the rule that you proposed. Recognizing that this is a positive opportunity for sharing some neat factoid instead of an opportunity to put someone down is not obvious, unfortunately.
To be completely honest, I'm a little skeptical given that the first page in the "Mythryl for SML programmers" highlights adding special-cases to the front-end to support printf: http://www.mythryl.org/my-Mythryl_printf.html I don't really miss printf in SML, although if I wanted it I think I would rather reach for this kind of type hackery instead: http://mlton.org/Printf
http://www.ciclops.org/view_event/191/The_Red_Rose_Of_Saturn
http://www.nasa.gov/mission_pages/cassini/multimedia/pia1494...
"Images with red, green and blue spectral filters were combined to create this natural-color view, which is what the human eye would see if we were there at Saturn."
Benjamin Pierce's Types and Programming Languages seems to be the gold standard of intro type theory, and definitely covers this notation and the math behind it, in a much more rigorous fashion than PLAI. It is a much deeper book though, so it doesn't get to type inference and Hindley Milner until later. I've read some of it and haven't actually gotten this far yet, but can say that it is a superb textbook, it's very well written and easy for an amateur to follow, as long as you're relatively comfortable reading and writing proofs. (but you don't need more math than your standard undergrad discrete math course)
You might also want to look at Lambda the Ultimate's Getting Started page, which has a wide range of suggestions covering more than just types, but programming languages in general.
http://lambda-the-ultimate.org/node/492
http://www.cis.upenn.edu/~bcpierce/tapl/
http://cs.brown.edu/~sk/Publications/Books/ProgLangs/2007-04...
Totally anecdotal, but this is really not the case for me. I have only dabbled in Haskell, and never really used it for a project from end-to-end, but have used Standard ML quite a bit in the last few months to write a lexical analyzer generator [0] and just recently spent a weekend and a half using OCaml.
There are a number of Haskell features and general design that I think are better than the MLs. While modules and functors are quite cool, I think typeclasses end up being more practical. Standard ML gets a lot of little things right that I think OCaml gets flat out wrong (mutable strings, throwing exceptions instead of returning 'a option), but Haskell seems to take it further, with a standard library that I can only describe as very tasteful. This is just my impression after reading half of Real World Haskell and doing a lot of dabbling but not a lot of real work, so I'm sure it's incomplete.
Haskell's syntax IS nicer than Standard ML's and OCaml's, but that is the least important thing IMHO. If there were an ML (strict, impure) with typeclasses and with as taseful design as Haskell at the edges, I would probably use that over Haskell, even if the syntax was ugly(ier). As it stands, I'm inclined to eventually switch to using Haskell, and just figure out how to deal with the other bits of it (laziness, purity), just so I can use typeclasses and the well-designed bits.
[0] In case you doubt how much ML I've written, the repo is on GitHub
Maybe, but sometimes you're stuck with crappy libraries or even crappy frameworks. The last time I had to really dig deep into (ie spend more than 30 mins reading) 3rd party code was when I was trying to figure out if a method in Android's WebView was synchronous or not. [0] Maybe the Android framework, or the WebView specifically is a "crappy library" (the documentation in this case was definitely crappy) but "not using WebView" or "not using Android" wasn't an option.
[0] http://stackoverflow.com/questions/10962150/understanding-an...
In some scenarios, this is a serious issue all by itself. My day-to-day work is mostly on Android, and eliminating nullable references altogether would eliminate some crashes, which are highly visible to the user.
1) Try eshell which allows you to use Emacs Lisp for shell scripting, as well as override some common programs to use Emacs instead (grep, man, etc). I'm someone who has never really bothered to learn shell scripting and am much more comfortable using Lisp, even Emacs Lisp which is sort of the crummiest of the popular Lisps (don't get me wrong I love Emacs) Obviously YMMV and if you know shell scripting this is a non-issue, but for me it comes down to being constantly surprised by the little bit of shell scripting I've had to do, and having Emacs Lisp work basically the way I expect (dynamic scoping, Lisp-2 and all)
2) Both eshell and M-x shell are not actually terminal emulators, so anything that requires a terminal emulator, like pagers, git log (ok this is a bad example since you should just be using magit, but anyway...) or some programs that update the terminal with their status act totally goofy and sometimes just break altogether. In this case, you want term-mode, which is a proper terminal emulator. Be sure to read up on the different modes as otherwise you'll get stuck inside that buffer ;) http://www.gnu.org/software/emacs/manual/html_node/emacs/Ter...
Hope this helps another Emacs novice... most of this I learned from here:
http://www.masteringemacs.org/articles/2010/11/01/running-sh...
And frankly, your nationalistic sign off makes me less inclined to believe you without references. "We are still the good guys" is kind of vapid.
http://blog.tanyakhovanova.com/?p=277
http://www.schneier.com/blog/archives/2013/04/nice_security_...
work on the code
use git gui instead of add --patch on the command line
use git stash -k on the command line
run tests suite
Git gui lets you pick individual lines much easier than `add --patch` does, and I find that wanting to have that available at my fingertips means I use it for non--patch adds too. Maybe this is an indication of some other "flaw" in my workflow where I'm generating a lot of changes that I don't want to commit yet, but I think it's common and inevitable when working on legacy code or in maintenance-mode. But even for new projects I use this because I'm usually cleaning up my work via --patch.Another nice alternative to `add --patch` is magit for Emacs which lets you select a region in a diff and add that. I find both of these (git gui and magit) to be much easier and faster to use than `add --patch` on the command line, which has a pretty clever interface given the limitations, but is really far from perfect (split often doesn't work with small hunks, which means you have to open it in an editor. which means Emacs, so I might as well just use magit)
I've tried to get colleagues to use a workflow like this, so they stop committing garbage like bad comments and logging.
In my experience and humble opinion, your generalization is often enough wrong that I would avoid it. I've met plenty of people who prefer GUIs for this or that task which they could script or shell circles around me. It really all boils down to taste and what you find to work for you. Git's command-line interface is badly enough designed that you shouldn't make anyone feel bad for using something different. (I say this as someone who loves Git very dearly)
That said, I DO believe that users who NEW to Git specifically should use the command line a bit while they are learning, since it helps with the vocabulary used everywhere to talk about Git, while some GUIs bury it behind a leaky abstraction.
However this law in Indiana does, http://www.in.gov/legislative/bills/2013/SB/SB0373.2.html
IANAL but this appears to make distribution of such recordings illegal:
Makes it unlawful recording of agricultural or industrial
operations, a Class A infraction, for a person, with intent to harass,
defame, annoy, or harm, to: (1) enter real property that is owned by
another person and on which agricultural operations or industrial
operations are being conducted; (2) take a photograph of or make a
video recording or motion picture of the real property, structures
located on the real property, or the agricultural operations or
industrial operations being conducted on the real property; and (3)
distribute the photograph or recording; without the written consent of
the owner of the real property or an authorized representative of the
owner. Many of these bills are explicit about not just targeting the people
who do the investigation but the people who distributed it, who
republish it. For instance, there was an investigation a couple of
years ago that at the same time the group, Mercy for Animals, was
conducting the investigation ABC news was following along with it,
aired the same footage, after they verified it, and it drew national
attention to this and criminal charges. Under these bills, in North
Carolina, for example, both the investigator and the journalist would
be wrapped up together.
http://www.onthemedia.org/2013/mar/01/states-consider-so-cal...I'm looking for more references now.
I agree with you that setting unreasonable or unrealistic goals is problematic. Although I personally stick to a 99% vegan diet, I've never been an abolitionist and I think setting reasonable goals and working towards them within the system is probably more productive, such as Temple Grandin's work.
Pushing for legislation like this doesn't make me very sympathetic towards the industry though.
I still think that most consumers of eggs (and meat, and milk) who have never seen a battery cage operation (or factory farm, CAFO, slaughterhouse, etc) would be surprised, if not horrified, and I suspect that this is the real motivation behind these laws and lobbying efforts.
The videos may seem troubling to someone unfamiliar with farming, said
Kelli Ludlum, the group’s director of Congressional relations, but
they can be like seeing open-heart surgery for the first time.
“They could be performing a perfect procedure, but you would consider
it abhorrent that they were cutting a person open,” she said.
Some of the behavior filmed is standard operating procedures, and they don't want that viewed by the otherwise ignorant public. The videos may seem troubling to someone unfamiliar with farming, said
Kelli Ludlum, the group’s director of Congressional relations, but
they can be like seeing open-heart surgery for the first time.
“They could be performing a perfect procedure, but you would consider
it abhorrent that they were cutting a person open,” she said.
While some of the abuses may be unusual, I suspect the truth is that they would prefer no one tape the regular day-to-day goings on at factory farms either.