Computer Science Experimentation

Monday, April 8, 2013

AlgLib Examples with F#

This post presents same examples of AlgLib (http://www.alglib.net/) using F# interactive.
The examples are in the same script file.
For now, the examples include an ODE Solver and a Nonlinear System of Equations Solver.

ALGLIB is a cross-platform numerical analysis and data processing library. It supports several programming languages (C++, C#, Pascal, VBA) and several operating systems. ALGLIB features include:
  • Linear algebra (direct algorithms, EVD/SVD)
  • Solvers (linear and nonlinear)
  • Interpolation
  • Optimization
  • Fast Fourier transforms
  • Numerical integration
  • Linear and nonlinear least-squares fitting
  • Ordinary differential equations
  • Special functions
  • Statistics (descriptive statistics, hypothesis testing)
  • Data analysis (classification/regression, including neural networks)
  • Multiple precision versions of linear algebra, interpolation optimization and others algorithms (using MPFR for floating point computations)
You can find the document with all tests, script and source code at :
https://skydrive.live.com/redir?page=view&resid=BDC87EF39B001785!4127&authkey=!APhhhblU-qv1InQ

 

Sunday, March 24, 2013

Redis REST with WCF




This blog presents a Redis REST server using Microsoft Window Communication Foundation (WCF).
The servers is written in F#.
The server is tested with a Web browser HTML/javascript example.
The security features is not included yet and it will be address in future blog.
Redis for Windows is available for download from Microsoft Open Technologies Inc. at  https://github.com/MSOpenTech.. 
The Redis server was started using redis-server.exe at a command prompt window. 
The tests were performed using F# interactive inside Visual Studio Express 2012 for Web.
The Redis .NET driver used was from http://code.google.com/p/booksleeve/
You can find the document with all tests, script and source code at :
https://skydrive.live.com/#!/view.aspx?cid=BDC87EF39B001785&resid=BDC87EF39B001785%214093&app=Word

Thursday, March 21, 2013

Redis tests with F# using booksleeve driver

This document reports results related to testing Redis in Windows with F# and more specifically with F# interactive.
Redis for Windows is available for download from Microsoft Open Technologies Inc. at  https://github.com/MSOpenTech.. 
The Redis server was started using redis-server.exe at a command prompt window. 
The tests were performed using F# interactive inside Visual Studio Express 2012 for Web.
The Redis .NET driver used was from http://code.google.com/p/booksleeve/ .

The tests were based on the C# test examples from http://code.google.com/p/booksleeve/source/browse/#hg%2FTests .

You can find the document with all tests, script and source code at :
https://skydrive.live.com/#!/view.aspx?cid=BDC87EF39B001785&resid=BDC87EF39B001785%214090&app=Word

Monday, December 31, 2012

MongoDB tests with F#

 
 This post reports several results related to testing MondoDB for Windows with F# and more specifically with F# interactive 
 
MongoDB for Windows is available for download from 10gen Inc. at  http://www.mongodb.org/downloads.   
 
The MongoDB server was started using mongod.exe at a command prompt window.  
 
The tests were performed using F# interactive inside Visual Studio Express 2012 for Web 
 
The documents uses MongoDB .NET driver supported by 10gen Inc. and documented at  http://www.mongodb.org/display/DOCS/CSharp+Language+Center. 
 
The tests were based on the C# examples at http://www.mongodb.org/display/DOCS/CSharp+Driver+Tutorial. 

Friday, November 23, 2012

Using NoSQL/Redis in Windows with F#


Celso Axelrud 
11/23/2012 
 

(Also available as Skydrive MSWord at https://skydrive.live.com/#!/edit.aspx?cid=BDC87EF39B001785&resid=BDC87EF39B001785%211518&app=Word&nd=1)

 
This document reports results related to testing Redis in Windows with F#.  
 
Redis for Windows is available for download from Microsoft Open Technologies Inc. at  https://github.com/MSOpenTech.  
 
The Redis server was started using redis-server.exe at a command prompt window. 
 
The tests were performed using F# interactive inside Visual Studio Express 2012 for Web. 
 
The Redis .NET driver used was from ServiceStack (https://github.com/ServiceStack/ServiceStack.Redis ) and downloaded from https://github.com/ServiceStack/ServiceStack.Redis/downloads . 
 
The following script shows the tests:
 
// Redis - example from 
//C:\opentech\ServiceStack.Redis-master\ServiceStack.Redis-master\tests\ServiceStack.Redis.Tests\Examples\TodoApp.cs 
// System 
open System 
open System.Collections.Generic 
#r "C:\opentech\ServiceStack.Redis-v3.9.28\ServiceStack.Common.dll" 
#r "C:\opentech\ServiceStack.Redis-v3.9.28\ServiceStack.Interfaces.dll" 
#r "C:\opentech\ServiceStack.Redis-v3.9.28\ServiceStack.Text.dll" 
#r "C:\opentech\ServiceStack.Redis-v3.9.28\ServiceStack.Redis.dll" 
open ServiceStack.Common.Extensions 
open ServiceStack.Text 
open ServiceStack.Redis 
  
type Todo= {mutable Id:int64; mutable Content:string;mutable Order:int;mutable Done:bool} 
let redisClient = new RedisClient("localhost") //6379 
redisClient.FlushAll();; 
let redisTodos = redisClient.As<Todo>();; 
(*> val redisTodos : Generic.IRedisTypedClient<Todo> *) 
let todo= {Id=redisTodos.GetNextSequence();Content = "Learn Redis";Order = 1;Done=false};; 
(*> val todo : Todo = {Id = 1L; 
Content = "Learn Redis"; 
Order = 1; 
Done = false;} *) 
redisTodos.Store(todo);; 
let savedTodo = redisTodos.GetById(todo.Id);; 
(*> val savedTodo : Todo = {Id = 1L; 
Content = "Learn Redis"; 
Order = 1; 
Done = false;} *) 
let allTodos = redisTodos.GetAll();; 
assert(allTodos.Count=1);; 
[for i in allTodos -> i.Content];; 
(*> val it : string list = ["Learn Redis"] *) 
savedTodo.Done <- span="span">true;; 
redisTodos.Store(savedTodo);; 
let savedTodo2 = redisTodos.GetById(todo.Id);; 
(*> val savedTodo2 : Todo = {Id = 1L; 
Content = "Learn Redis"; 
Order = 1; 
Done = true;} *) 
redisTodos.DeleteById(savedTodo.Id);; 
let allTodos2 = redisTodos.GetAll() 
assert(allTodos2.Count=0)