Is there a good date/time API available for Scala? [closed] - datetime

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for something akin to JodaTime or JSR 310 for Scala that leverages nice Scala features such as operator overloading and doesn't rely on implicit conversions (I have an irrational fear of implicit conversions).
I'm aware of http://github.com/jorgeortiz85/scala-time, but it just pimps JodaTime with implicits.

There's nothing wrong with implicit conversions. Even if a Java library wasn't used for the underlying logic, any sensibly designed pure Scala library would still use implicits, allowing you to write expressions such as 5.days + 3.minutes.
Not all implicits are created equal either, an implicit converting to a very specific type that you have full control over is almost certainly safe .
As others have already stated, such conversions will be optimised away in most cases, especially with escape analysis turned on, so don't let them worry you!
Until JSR 310 is finalised, joda-time is the best you're going to get.
Other than the need to follow Java naming conventions and a lack of operator overloading, joda-time is already a very good fit for idiomatic Scala. The design is very functional in nature, especially the way it embraces immutablity, so scalaj-time is actually only a very thin wrapper around the library.
You also get the benefit that scalaj-time can be easily upgraded to use JSR 310 when it's available, so it'll be much less painful to migrate your code at that time.
Since 2.8, scala-time has been renamed scalaj-time: http://github.com/scalaj/scalaj-time

Related

Writing manpages in 20XX [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I wrote a program, and I'd like to write a manpage for it.
I started to learn Groff, and I really find it awful. The man macros are difficult to understand, difficult to use, and a real obstacle to productivity. The mdoc macros add a nice "semantic" extension, but they still suffer of limitations which make it incredibly hard. The resulting "code" is poor in maintainability.
Of course I know I can convert any modern markup language (say Markdown) into manpages via pandoc, but I dislike the result, and I'm not that fond of adding pandoc as dependency of my project, anyway.
Is there a way to obtain a decent manpage from a reasonable markup language?
I write manpages for the bash and ruby scripts I write.
I format them in markdown, which is a popular and simple text format.
Then I use a ruby gem called ronn to process the markdown into groff format with man macros. Ronn can also output html from the same markdown source.
OP here. After checking some alternatives, I decided to go for Asciidoc.
There are many alternatives indeed. For example, check this other question.
I also realized that there's no good answer to this question, given the fact that many tools can be used, and in the end it is just a matter of taste :)
I'll just vote for closing my own question (if anything it will remain as reference).

Isabelle/HOL tutorial/documentation needed [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am looking for freely available and good quality tutorials and documentation for Isabelle2013/HOL (aside of the obvious ones after Google-ing and digging a bit). Could you please recommend some?
Some documents that may help get you started:
The previous de-facto tutorial was A Proof Assistant for Higher-Order Logic by Nipkow, Paulson and Wenzel. This document provides an introduction to Isabelle/HOL as a functional programming language as well as a guide as to how to use most of the common proof mechanisms available in Isabelle/HOL. It is a good starting point;
A newer tutorial is Programming and Proving in Isabelle/HOL by Nipkow. It covers some of the same material as the previous document and is not quite as in-depth, but uses more modern techniques of carrying out proofs in Isabelle/HOL. It may be useful as a "quick-start" to Isabelle/HOL.
The freely available book Concrete Semantics by Nipkow and Klein provides an introduction to Isabelle/HOL in the context of performing proofs on programming languages. If your interest in Isabelle/HOL is to do with program verification, this book would be a good start.
Is general, most (but not all) good reference guides are linked to from the Isabelle documentation page itself. watch out, however, as some of the documents there are quite old and unlikely to be relevant any longer, (though such documents have been tagged as such).
There are also a plethora of slides and lecture notes available of the web, such as UNSW or the University of Edinburgh, but these are probably better used as a supplement, as they often lack context and important details which are provided in the lectures.

Generic applet style system for publishing mathematics demonstrations? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Anyone who's tried to study mathematics using online resources will have come across these Java applets that demonstrate a particular mathematical idea. Examples:
http://www.math.ucla.edu/~tao/java/Mobius.html
http://www.mathcs.org/java/programs/FFT/index.html
I love the idea of this interactive approach because I believe it is very helpful in conveying mathematical principles.
I'd like to create a system for visually designing and publishing these 'mathlets' such that they can be created by teachers with little programming experience.
So in order to create this app, i'll need a GUI and a 'math engine'. I'll probably be working with .NET because thats what I know best and i'd like to start experimenting with F#. Silverlight appeals to me as a presentation framework for this project (im not worried about interoperability right now).
So my questions are:
does anything like this exist already in full form?
are there any GUI frameworks for displaying mathematical objects such as graphs & equations?
are there decent open source libraries that exposes a mathematical framework (Math.NET looks good, just wondering if there is anything else out there)
is there any existing work on taking mathematical models/demos built with maple/matlab/octave/mathematica etc and publishing them to the web?
You might want to look at Wolfram demonstrations, and at the mathematica web player. This lets you take a Mathematica file and run it from a browser, and the demonstrations site already has thousands of demonstrations.

Is there an alternative to MKS Yacc that supports "selection preference syntax" or something very similar? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
MKS Yacc supports a notation which their web site calls "selection preference syntax". It isn't illustrated, but it consists of a token in square brackets, optionally with a caret, and it indicates that a particular token is required to follow, or is required not to follow, the rest of the rules:
non_terminal: TOKEN1 non_terminal2 TOKEN2 [TOKEN3]
non_terminal: TOKEN1 non_terminal2 TOKEN2 [^TOKEN3]
(I'm not clear whether the bracketed item can be a non-terminal. The code I've seen using the notation always uses a token or a couple of space separated tokens, and never a non-terminal.)
Is anyone aware of an alternative Yacc-compatible system (preferably open source) that provides the same support (notation can differ - functionality can't), running on Unix or Linux machines, preferably available in source format?
(MKS Yacc also provides some flexibility in handling errors and adjusting the error behaviour. One way in which that can be used is to treat keywords as identifiers when they are encountered in a position that makes no sense when they are treated as keywords. I was able to retrofit that into byacc - Berkeley Yacc - but I haven't spent enough time working out how to handle 'selection preferences'.)
See also: Has anyone used the "selection preference" mechanism provided by MKS Yacc?
Just for completeness, since I linked this in the answer to your other version, there appears to be a product from Thinkage called YAY, which is yacc-like and supports the selector syntax. They're in Kitchner and apparently closely associated with MKS, but from the website they also appear to be responsible for MKS's documentation, so maybe if all else fails you can call them as ask what the hell they meant by these selection preferences. ;-)

Coming to Ocaml from Ruby, Lisp, Haskell, and Erlang [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I've been reading about Ocaml's consistent speed, rapid prototyping ability, and excellent memory management, and decided to take it up.
As I've already got Ruby, *lisp, Haskell, and Erlang under my belt, I'm interested specifically in what KISS-violating features I should look out for in Ocaml.
If you've started Ocaml with a background in the above languages, what was the most frustrating thing to grok? How did you get around this difficulty? What analogies helped you get into the flow of the language?
I'd also be interested in knowing whether you have done more than simply learn Ocaml, and have actually converted to it for a large percentage of your coding problems.
I found an excellent resource on Ocaml and its relation to most other languages: http://www.soton.ac.uk/~fangohr/software/ocamltutorial/lecture1.html
Not only does it explain the why, it also explains many of the little quirks likely to snag you as you begin.
Ah, I found a cheatsheet highlighting almost all of its syntactic weirdnesses.
I have heard the APress Practical OCaml is awful as well.
Introduction to Objective Caml is excellent and specifically addresses a few anti-KISS gotchas, such as ways the type-system can be unforgiving.
Coming to OCaml from a C++ background, I found replacing classes with variant types to be the hardest transition (and it was easy!).
There is a book about Ocaml "Practical Ocaml" it's not a really good book, but at least for getting started it's good enough. It's a quite practical language, which unfortunatly a "strange" syntax. If you like to see some "real" Ocaml then just look at the Shootout pages.
Regards
Friedrich

Resources