Bad Naming Conventions but here is F# Lib being called by C# Console Application

by Lord Cod3n 31. March 2009 05:32

I wrote a quick application to see how it it was to call an F# lib from C#.  The hardest part was figuring out where the Microsoft.FSharp.Core lib was (It is in Program Files\FSharp directory).  Take a look at the sample a let me know what you think.

ConsoleApplication1.rar (43.27 kb)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

F# and Cool Findings

by Lord Cod3n 31. March 2009 03:42

So I found the video below and began playing with some of the code in it.

http://channel9.msdn.com/pdc2008/TL11/

I am very impressed with F# and planning to see how I can work it into my tool box.  Here is some sample code that goes to Yahoo, pulls down a csv, and parses it.  The syntax, once you are familiar with it, is very easy to read.  So much work with so little code, in my opinion, and it does a lot,  You tell the complier what you want, not what to do.  Here is the code:

#light
open  System.Net
open System.IO
let loadPrices ticker =
    let url = "http://ichart.finance.yahoo.com/table.csv?s=" + ticker + "&d=2&e=31&f=2009&g=d&a=2&b=13&c=1986&ignore=.csv"
    let req = WebRequest.Create(url)
    let resp = req.GetResponse()
    let stream = resp.GetResponseStream()
    let reader = new StreamReader(stream)
    let csv = reader.ReadToEnd()

    let prices =
        csv.Split([| '\n' |] )
        |> Seq.skip 1
        |> Seq.map(fun line -> line.Split([| ',' |]))
        |> Seq.filter(fun values -> values |> Seq.length=7)
        |> Seq.map(fun values ->
            System.DateTime.Parse(values.[0]), float values.[6])
    prices
open System.Windows.Forms
let grid(prices:seq<System.DateTime * float>)=
    let form = new Form(Visible = true,TopMost = true)
    let grid = new DataGridView(Dock = DockStyle.Fill,Visible = true)
    form.Controls.Add(grid)
    grid.DataSource <- prices |> Seq.to_array

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Silverlight 3 and Prespective 3D

by Lord Cod3n 27. March 2009 05:45

I was very excited about Silverlight 3 even before I watched some of the sessions at MIX 09.  I did find something interesting out about SL3 uses  something called perspective 3d.   I believe perspective 3D is not true 3D but  a visual trick to makes 2D object look like they are in 3D space. It is still pretty cool to see. I will be blogging a ton more as I get deeper into the new features.  Coden Enterprises is strong and helping to move companies to adopt these ground breaking technologies.

I am giving two presentation this weeked for the Boise Code Camp.

1.  Building Business Applications with Silverlight 2.  I am going to cover the SilverlightFX framework from  Nikhil Kothari his blog can be found here:  http://www.nikhilk.net/

2.  Silverlight 3.  This is going to be more about what I absorbed since mix 09 last week.

This framework is awesome and you should look into it.  It has cool effects transitions and commanding behaviors.

Happy Coding

Bill

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

William Moore is the lead Software Architect and Technologist for Coden Enterprises. He has more than a decade of software development experience primarily Microsoft Platforms.  William enjoys the full gamit of coding everything from the UI down to the database.

Most comments

Page List