Interesting! I have the opposite experience. I've gone on a bunch of very low-carb diets, maybe ten at this point (not sure if they were exactly ketogenic or not), and I've enjoyed them. But every time I try low-carb, my sleep gets extremely light (I'll wake up 3 or 4 times a night), I sleep a couple hours less than normal, and I get weirdly vivid dreams. It's always the weird sleep that makes me quit the diet.
HN user
happy4crazy
github.com/cqfd
It's analogous to the real and imaginary parts of a complex number. Does it makes sense to add a real number and a purely imaginary number? Aren't they different kinds of things? Yes, and yes!
I personally don't find the "bits"y explanation of entropy/cross-entropy/KL etc. to be all that intuitive; as fundamental as it may be, I don't think about compression/encodings all that often. I've always preferred the "surprise" interpretation: http://charlesfrye.github.io/stats/2016/03/29/info-theory-su...
In short: given some event of probability p, -log p = log 1/p is its "surprise". (If p = 1, log 1/1 = 0, so zero surprise; as p -> 0, the surprise gets bigger and bigger; and the surprise for two independent events, p = p1 * p2, is the sum of their individual surprises: log 1/(p1*p2) = log 1/p1 + log 1/p2.)
The entropy of a distribution is its average surprise: Sum/Integral of p log 1/p.
KL(p || q) is your excess surprise if you think something's distribution is q but it's actually p: Sum/Integral p (log 1/q - log 1/p). The KL divergence is always non-negative because surely if you think the distribution is q but it's actually p, on average you're going to be more surprised than someone who knows it's p.
Hard to say if it's worth the effort, but I've taught myself enough French to read classics (e.g. Hugo, Déscartes, Tocqueville), and it really is an immense pleasure. I imagine I'll get a kick out of it for the rest of my life.
I've been teaching myself French (from scratch) for the past two years. I read nearly as well as I do in English, and I listen well (some slangy television dialogue is still a bit tough).
Some things that have worked for me:
0. Goes without saying, but consistent effort. I've done at least a little French every day for the past two years.
1. Reading a lot. I started with the Harry Potters and now read for pleasure pretty much exclusively in French.
2. Reading on a Kindle. Instant dictionary lookup! This is such a big efficiency boost that I think that reading physical books is simply a mistake.
3. Listening a lot. I listen to about an hour of French podcasts/youtube channels a day.
4. Studying grammar. I mainly study grammar when I run into something tricky while reading, but I really do study.
5. Flashcards. I've only started making them in the past month or so, but yes, they really do work. I feel silly for not realizing that sooner. I highlight interesting words/expressions as I read and periodically dump them onto index cards.
For another resource, Alan Macdonald has some nice videos that accompany his books, "Linear and Geometric Algebra" and "Vector and Geometric Calculus": https://www.youtube.com/channel/UCymE67THrWoeTABxzJm1wdg/pla...
My favorite Pynchon name is Carmine "Two-Ton" Torpidini, from Vineland.
I like to think of a functor/applicative/monad f a as being "more or less" an a.
For example, take a list of Strings. It's "more or less" a single string, it just hasn't made up its mind yet :) When you say fmap reverse myStrings, you're saying: yeah yeah, I know my string hasn't made up its mind yet, but just reverse it. So you reverse all the possibilities. When you say
(++) <$> myStrings <*> yourStrings
you're saying: yeah yeah, I know my string hasn't made up its mind yet, and neither has your string, but just concatenate them. So you concatenate all the pairwise possibilities. The monad stuff says you can do control flow: (yeah yeah), but if my string is this long, and your string is a palindrome...Promises: A Promise Int isn't an Int, but eh, it's more or less an Int. Just as you can add 1 to a regular Int, you can fmap (+1) promisedInt. Just as you can replicate 3 'a' to get "aaa", you can
replicate <$> promisedInt <*> promisedChar
to promise some repetitive String. (And presumably promisedInt and promisedChar will resolve themselves in parallel!) The monad stuff: if this promised Int ends up being prime, then...Parsers: A Parser Int (something that can gobble up a string and produce an Int) isn't an Int, but (in some contexts, if it's helpful) you can think of it as being more or less an Int. Saying fmap (+1) intParser says make a parser that parses whatever intParser does, and then adds 1 to the result. Doing
replicate <$> intParser <*> charParser
makes a parser that tries to parse an Int, and then a Char, and then gives you a repetitive String. Monad stuff: if I parse a prime number, then...Functions that take some fixed argument type, say Float. A Float -> String isn't a String, obviously, but it's more or less a String :) It's just missing a Float. If I say fmap reverse justNeedAFloatToBeAString, I'm making a new function will take a float and then reverse whatever you get by feeding it to justNeedAFloatToBeAString. If I
(++) <$> almostAString <*> almostAnotherString,
I'm making a new function of type Float -> String that feeds a Float (the same Float) to both subcomputations and then concatenates their results. Monad stuff: if this almost-Int ends up being prime...Functor says you can treat a single f a as more or less a single regular a. Applicative says you can treat any number of f a values as more or less any number of regular a values. Monad says you can do control flow with f a values as if they were regular a values.
Hakan Calhanoglu's absurd free-kick from near the half-field line has to rank up there with Roberto Carlos's: http://www.highlighthub.com/hakan-calhanoglu-scores-amazing-...
Neat, I was just wondering about this. I'm using the same idea with core.async channels in ClojureScript to parse the BitTorrent peer protocol[0], but I wasn't sure how to describe it.
[0] https://github.com/happy4crazy/ittybit/blob/master/src/ittyb...
Here's what I want: "Study Grouper". Grouper but you go do something educational, e.g. a wine class, cooking class, dance class, amateur astronomy class, painting class...
If you'd like to read a deep investigation into writing styles, let me suggest Clear and Simple as the Truth[0]. Steven Pinker discusses the book in a fun talk on communicating science[1].
[0] http://classicprose.com/ [1] http://video.mit.edu/watch/communicating-science-and-technol...
Can you expand on the CanBuildFrom travesty?
(It seems like you've got interesting things to say, but you're being a bit strident. It bums me out that Scala discussions on HN take such a heated tone.)
Pinker references the book Clear and Simple as the Truth at the end of his talk. It's one of my favorites: http://www.amazon.com/Clear-Simple-Truth-Writing-ebook/dp/B0...
I'm not remotely qualified to comment on the content, but I was very lucky to have Nima as a professor in college. He was an incredibly exciting lecturer--he practically glowed with intellectual energy.
Yes! I was just telling my coworkers how these interviews sound like they're lifted straight from American Psycho.
Be sure to check out Pierce's new book, Software Foundations[0], which is available for free online. Learning how to use Coq is quite an amazing experience.
Haha, this is really fun :)
I'm looking forward to exploring your blog.
We don't address this in the post, but adding :while conditions is quite a fun challenge.
This is the best I could come up with (in Emacs Lisp): https://gist.github.com/4356261 . It's rather hacky :D
Darius Bacon (abecedarius) came up with a beautiful alternative formulation that handles :while conditions seamlessly. Here's my port of his idea into Emacs Lisp: https://gist.github.com/4380866
I'd be very happy to see other versions :)
Your guide was indeed very helpful when I was getting to know Emacs. Thanks!
I haven't. Oddly, I find that the Vim and Emacs parts of my brain are completely separate. When I open Vim, my fingers do Vim stuff, and when I open Emacs, my fingers do Emacs stuff.
This is my experience exactly. I was a long-time, very fast Vim user, but I wanted to play around with Proof General, an Emacs mode for using proof assistants like Coq[0]. Emacs slowly cannibalized my Vim usage from there: I started using it for Clojure, and was amazed that M-. would hop me into Clojure source. Then I started using it for Erlang, and then I started taking all my notes in org-mode. It wasn't until I was already pretty comfortable in Emacs that I learned about the C-h commands.
For pure text surgery, I'm still significantly faster in Vim. But the fact that Emacs is so explorable/discoverable is just so fun!
That's my favorite too :)
If you're on a Mac (pre 10.8, which unfortunately messes things up), I recommend biting the bullet and reinstalling gdb. The process is a bit annoying[0], but tui mode is worth the effort.
That post was one of the things that inspired me to start tinkering with gdb. Very cool stuff.
Hacker School agrees--we have two copies in our library :)
This describes my experience being in batch[0]. I came in with relatively little professional programming experience, but lots of energy.
In addition to learning a ton and meeting some great friends, I also got a great job at Venmo right after the session ended.
I was in batch[0], and would say yes. If you can swing the time off, Hackerschool would be an incredible experience. Nick, Dave, and Sonali are some of the nicest people I've ever met--they were born to do this. They attract similarly awesome people to the program, so Hackerschool's vibe is as good as it gets: smart, friendly people doing nothing but help each other learn.
I'm also in the interested-onlooker camp, but I think this is an example of a variable denoting a computation rather than a value. It's a Haskell version of an exercise in SICP:
> p = p
> if True then "I'm the value of this expression" else p
I would love it if someone would help me phrase this more precisely: the variable p doesn't really have a value, in the sense that evaluating it fully will never finish; it's bottom, the non-terminating computation.
I was a physics major in college and got into programming a couple years ago.
In my experience, of the hard sciences, CS is by far the most amenable to self-study. CS isn't easier, whatever that might mean, but CS is amazingly inviting: if you've got a computer and a textbook budget, you can learn some really neat stuff. So don't despair; get studying!