F# Deedle save Frame to MySql database - f#

Python Pandas has a nice "to_sql" function (link), I tried to find one for F# Deedle but cannot find any. Since I'm not familiar with MySql, writing a function to insert data from Frame is difficult for me.
Wonder if any package that provides similar "to_sql" function as Pandas. Thanks

Related

ArangoDB - how to import neo4j database export into ArangoDB

Are there any utilities to import database from Neo4j into ArangoDB? arangoimp utility expects the data to be in certain format for edges and vertices than what is exported by Neo4j.
Thanks!
Note: This is not an answer per se, but a comment wouldn't allow me to structure the information I gathered in a readable way.
Resources online seem to be scarce w/r to the transition from neo4j to arangodb.
One possible way is to combine APOC (https://github.com/neo4j-contrib/neo4j-apoc-procedures) and neo4j-shell-tools (https://github.com/jexp/neo4j-shell-tools)
Use apoc to create a cypher export file for the database (see https://neo4j.com/developer/kb/export-sub-graph-to-cypher-and-import/)
Use the neo4j-shell-tool cypher import with the -o switch -- this should generate csv-files
Analyse the csv-files,
massage them with csvtool OR
create json-data with one of the numerous csv2json converters available (npm, ...) and massage these files with jq
Feed the files to arangoimp, repeat 3 if necessary
There is also a graphml to json converter (https://github.com/uskudnik/GraphGL/blob/master/examples/graphml-to-json.py) available, so that you could use the afforementioned neo4j-shell-tools to export to graphml, convert this representation to json and massage these files to the necessary format.
I'm sorry that I can't be of more help, but maybe these thoughts get you started.

F# Dsl for simple expression?

I want to write a generic program to load data from text files or database to a table.
The transformation between the source and destination shouldn't be hard-coded. They may have the format of
ColA = Col1 + Col1 * 1.5
ColB = convert Col3 to date
These rules may need to be converted to SQL or C# code. Does F# already have some library to do these? Is F# the good language to implement it?
With so few specific details in your question, we can't really give you a good answer. But here are a few F# libraries that you might find useful for what you're trying to do:
FSharp.Data - Whether your incoming data is in SQL, CSV, JSON, or XML, there's a type provider that can parse it for you and let you write type-safe queries against it.
FParsec - Lets you easily write custom parsers, so that you can define your transformations in a custom DSL without too much effort. You mentioned custom DSLs in your title, so that's why I'm recommending FParsec. I've used it myself for exactly that purpose, and it was great.
That's about all the help I can give you until I know more details about what you're trying to achieve.

Pretty printing AST in Rascal

I am trying to pretty print an AST generated from
createAstFromFile(|cwd:///Java/Hello.java|,true);
Have I just missed how to do this in the documentation?
If you mean unparsing an AST (getting the Java code back) you will have to write something yourself.
If you however mean printing the AST structure nicely indented, we have iprintln exactly for this purpose.
Also, for large ASTs, the REPL might not like it that much, checkout our (as pf yet) undocumented Fast print functions in util::FastPrint. The fiprintln prints to the rascal output window, which is a lot faster.
No I believe the current release does not contains this feature. If you don't rewrite the AST, you can of course get the source by reading the location, as in:
rascal>import IO;
ok
rascal>readFile(ast#\loc)
str: ...
That only works when the weather is right.. The other solutions are:
to use string templates mapping the AST back to source (simplest)
map ASTs to the Box language and call the format function (most powerful and configurable)
a hybrid of the above
I seem to recall there is a function which maps back M3 ASTs back to JDT ASTs in Java and then calls the pretty print function of JDT, but it looks like it was discontinued. In other words, here are some TODOs.

how do i invoke Z3 Programmatically

Hi I am new to Z3 SMT solver. I know you can invoke Z3 programmatically by using relevant APIs. But I want to do the following things with Z3 SMT solver:
how can I feed Z3 with one input file programmatically?
how can I incrementally get the solution(s)?
For example:
while ((check-sat) returns sat)
get the assignments for all boolean vairables
Finally, how can I ask Z3 to save the results into one output file after solving the formula?
Any ideas or documents I can look at?
Thanks million!!!
The Z3 distribution contains several (programmatic API) examples.
examples/c/test_capi.c: many small examples using the C interface.
examples/dotnet/test_managed.cs: similar examples in C#
examples/maxsat/maxsat.c: MaxSAT procedures (in C) on top of the Z3 API.
examples/ocaml/test_mlapi.ml: examples in ML
examples/theory/test_user_theory.c: example showing how to implement an external theory (plugin).

Statistical functionalities of F# (or .NET libraries)

Is it possible for a person working with statistic to replace his specialized programs by F#? I'm thinking about SAS/SPSS mainly?
Any native support for it in F#?
I am not talking about the trivial things as standard deviation and the likes, but for example item-response modeling.
UPDATE : Dont't let the item-response modeling put you of! I don't even know it, just an example of things I know they do with SPSS to clarify it's about more advanced features.
Short : is there a way to use F# as your main statistical tool and replace SPSS all together?
Sadly, nothing comporable to combination of
R + PostgreSQL + Python/Java/Groovy/Scala/... + VisAD
Of course, there is nice http://www.codeplex.com/vslab instead of gnuplot
and some c# statistics code packaged in http://ta-lib.org/ http://www.alglib.net/
You can use R within F# with the type providers for R
see
http://blogs.msdn.com/b/dsyme/archive/2013/01/30/twelve-type-providers-in-pictures.aspx
and see
http://techblog.bluemountaincapital.com/2012/08/01/announcing-the-f-r-type-provider/
Here at BlueMountain we like to perform statistical analysis of data. The stats package R is great for doing that. We also like to use the data retrieval and processing capabilities of F#. F#’s interactive environment lends itself pretty well to data exploration, and we can also easily access our existing .NET-based libraries. Once we are done, we can build and release production-supportable applications.
Here is something maybe-useful:
http://fsmathtools.codeplex.com/
or
http://mathnetnumerics.codeplex.com/

Resources