3,924 reputation
21649
bio website connjur.uchc.edu
location Connecticut, USA
age 27
visits member for 2 years, 10 months
seen yesterday

I work in a scientific computing group on the CONNJUR project, providing open-source software for NMR (Nuclear Magnetic Resonance) spectroscopy.

Check out some of my work on github:

  • NMRPyStar: an API for accessing archived NMR data files in the NMR-Star format used by the BMRB.

  • Miscue-js: validation of JSON files to deal with obnoxious and tricky interoperability issues such as number overflows and duplicate keys

Some technologies that I've used and like:

  • Python
  • git
  • Javascript
  • Haskell
  • Java
  • MySQL

Apr
15
revised Design Pattern: Algorithm varies according to the input arguments
added 5 characters in body; edited tags
Apr
15
comment Design Pattern: Algorithm varies according to the input arguments
How does this answer address the other part of the question -- "Every combination of arguments needs different algorithm"?
Apr
15
answered Design Pattern: Algorithm varies according to the input arguments
Apr
14
comment Evaluation order of expressions in Clojure?
For observing evaluation of lazy seqs, something like (def my-observable-seq (map (fn [x] (println x) x) my-lazy-seq)) is great. Disclaimer: I probably wouldn't use it in real code.
Apr
11
comment Functions returning either “OK” or “error message” instead of procedures
"Anytime an instruction breaks the expected flow of execution, you expect an error to be thrown" -- this is totally arbitrary and subjective. I expect that different programmers would have different expectations.
Apr
10
comment Picking a card from a shuffled deck
@RobbieDee the place where you generate the random value is impure (since presumably you want it to be actually random, which means it'll depend on some outside state), but where you use it is pure. So in your main function, generate a random value. But then pass it as a simple parameter wherever you want to use it.
Apr
9
answered Types of unit tests based on usefulness
Apr
9
comment Picking a card from a shuffled deck
@RobbieDee yeah, make sure that your shuffle function is pure. Then it's easy to test and to play with in ghci. You can always use pure stuff from evil code, but you (generally) can't do something evil without becoming evil yourself! (evil = using IO, pure = not using IO)
Apr
9
revised Picking a card from a shuffled deck
added 476 characters in body
Apr
9
comment Picking a card from a shuffled deck
BTW, do {xs <- myAction; print xs} is better written as myAction >>= print.
Apr
9
revised Picking a card from a shuffled deck
rolled back to a previous revision
Apr
9
answered Picking a card from a shuffled deck
Apr
8
revised Ensure that each class has only one responsibility, why?
deleted 20 characters in body
Apr
7
comment Ensure that each class has only one responsibility, why?
I think that you should add that to your answer.
Apr
7
revised Ensure that each class has only one responsibility, why?
deleted 81 characters in body
Apr
7
comment Ensure that each class has only one responsibility, why?
I don't think the points made here are justified. In particular, how do you avoid zero-sum games where simplifying a class causes other classes to become more complicated, with no net effect on the code base as a whole? I believe @Doval's answer does address this issue.
Apr
7
comment Why is Today() an example of an impure function?
Great answer as always, but it doesn't explicitly cover immutable free variables. They're not an input to the function -- not passed as a parameter -- but the function depends on them even if it's still referentially transparent.
Apr
6
comment Are monads a viable (maybe preferable) alternative to inheritance hierarchies?
@RobY sorry, but I feel that your comments contain too many unsound premises for me to helpfully respond. I would suggest 1) reading up on these topics, and 2) doing tons of examples. Make sure to cover algebraic data types, functors, applicatives, and of course monads. Also, a warning: be careful about "blurring" the definition of monad: if you're going to change the definition, is it really worth calling it a monad anymore? If some pattern or data type is useful to you, use it, but if it's not a monad, calling it so will likely confuse other people.
Apr
6
revised Are monads a viable (maybe preferable) alternative to inheritance hierarchies?
added 42 characters in body
Apr
6
comment Are monads a viable (maybe preferable) alternative to inheritance hierarchies?
@RobY You're welcome! By the way, if you haven't heard of it before, I recommend LYAH as it's a great source for learning monads (and Haskell!) because it has tons of examples (and I feel that doing tons of examples is the best way to tackle monads).