Example in Clojure: https://github.com/clojure/test.check
602 karma · joined November 15, 2013
Example in Clojure: https://github.com/clojure/test.check
(defn sentence [mapping]
(->> :start
(iterate #(pick-next-word mapping %))
next
(take-until #(= (last %) \.))
(clojure.string/join " ")))
There is no loop, and it almost reads like English: "Using :start as a departure point, iteratively pick the next words until you find one that ends with a dot. Join all the words generated so far with spaces."Small catch: take-until is not yet in clojure.core, however it's easy to add to your utility toolbelt and there's already an issue open for it http://dev.clojure.org/jira/browse/CLJ-1451
"If paredit is not for you, then you need to become the sort of person that paredit is for. -Phil Hagelberg"
* it is easier to find tiny (and thus cheaper) housing in Paris, since the standards of comfort are lower. For people who want a simple shelter and spend most of their time outside, it can frustrating to look for housing in SF.
* public transit is everywhere in Paris and most areas inside the city are safe, whereas in SF people tend to choose from a small subset of neighborhoods. Cars are unnecessary - they generally create more problems than they solve.
(defmacro pep448 [f & args]
(let [unpack? #(and (list? %) (= (first %) '$))]
`(apply ~f (concat ~@(map #(if (unpack? %) (second %) [%]) args)))))
which can be used like this: (pep448 + ($ [2 3]) 4 ($ [5 6 7]))
=> 27
A bit verbose, so you probably wouldn't do it this way in real life. Thankfully there are generally easier and more elegant ways to handle this kind of situation.I'm right in the middle of the John DeFrancis series (just started Intermediate Chinese Reader volume 2). These books seem to be almost forgotten and I haven't found any modern equivalent, so I was starting to feel slightly lonely in my quest for Chinese reading fluency :) I started them after trying
* regular flashcards: not very effective for me, as all the accumulated knowledge would disappear very quickly after I stopped practicing
* "modern" graded readers: they're nice, but far less structured than the DeFrancis' series, and they often stop at a beginner/intermediate level.
What's truly unique about the DeFrancis' series compared to other graded readers is that the texts are adapted to the vocabulary lists, rather than the other way around. Therefore characters and compounds can be introduced logically, in a coherent manner: for example each new character comes with a cluster of words that use this character, making the whole much easier to remember. The downside is that the texts often feel contrived and boring, but if you're serious about learning to read it feels much more effective and gratifying on the long term. The approach used by most other readers is to start from a simple and enjoyable story, and then adding a glossary containing the more advanced words in the story. But although the story itself is more natural and enjoyable for the reader, the vocabulary itself is much harder to remember.
It would be awesome if someone was willing to put in all the hard work it took to craft the DeFrancis' series, and write something similar with a more modern and less academia-focused content.
I don't know much about the Excel environment and ClojureCLR so I don't know if it's feasible at all.
For development, the most fantastic tool that I know of in this space is debuggex. Here is an example with roman numbers:
More context here: http://stackoverflow.com/questions/1050222/concurrency-vs-pa...
Git branches are pointers to commits. For example I can move the pointer to a commit to point to the previous commit instead. But the commit which was previously being pointed to is still there. However when I say that I reset a branch to a previous commit, I get the feeling that the branch was "cut", and so that the commit was lost - which is not the case.
This is why using the name "bookmark" is better in my opinion. Not because I'm used to it (I've used git much more than mercurial), but because it's a better representation of what is actually happening.
Having been in that exact situation before, I wouldn't complain too specifically about Stanford's master in CS. That department makes it really easy to get a TA/RA (I'm comparing with my friends in less trendy fields of study), and while they represent a non-negligible amount of work, I think they are perfectly manageable at the graduate level. So while it's not financial aid, it actually makes it possible to go through the whole program with a positive net balance. Now I understand that the absence of guaranteed funding can feel scary for many, although the current state of the job market should greatly reduce their fears.
some real-world programming languages don't have undefined variables :)
Actually it's not. Looking at what is on Github, it seems that the project is mainly about bridging a few open-source modules (kaldi, sphinx, pocketsphinx, openephyra) together to make an end-to-end system. So if you want to contribute, you can always work on improving one of the base modules (that handle things like speech recognition, question answering, etc).
Rust can cross-compile, at least for a limited set of targets (see https://github.com/npryce/rusty-pi/blob/master/doc/compile-t... for an example)
The main pain point for the moment is that you need to build the cross-compiler yourself (which takes a while), and since the language changes every week, you have to recompile the cross-compiler every time.
> Unlike a shell redirect, sponge soaks up all its input before opening the output file. This allows constructing pipelines that read from and write to the same file.
Does anyone know of interesting initiatives out there to build an open repository of mathematical proofs?
I'm wondering why it's not more widespread. My (small) bank has been providing me a unique card number for every purchase for at least the last 5 years, and they're not usually on the cutting edge regarding banking technology. You can also give a maximum amount that can be withdrawn on the card, and once someone has withdrawn money using that number, no one else can do it.
I've no doubt there has been many talented programmers for decades, but what about open-sourcing these "in house" libraries if they are so great, to avoid countless other programmers the need to reinvent the wheel? I think it would be more constructive than bashing Facebook for being late to the party.