After going through a couple blog articles on F# access to different database engines, I wondered what’s the best database engine/access for F#?
I use NHibernate and SQL Server on a daily basis from C#, so I naturally want to use NHibernate from F#. After some quick googl…research, I found this great article on how to setup F# to use NHibernate:
http://strangelights.com/blog/archive/2009/12/20/1650.aspx
I also came across an article on how to access MongoDB from F#:
http://codebetter.com/blogs/matthew.podwysocki/archive/2010/02/09/exploring-mongodb-with-f.aspx
After going through both and doing a couple quick spikes, MongoDB seems like a natural fit for F# and the functional way of life. Keep in mind, I’m new to functional programming and F#, so take this with a grain of salt and do your own research.
With F#’s parallel features, NoSQL database engines (MongoDB, CouchDB, etc) seem like a perfect fit. Large distributed data stores, asynchronous parallel processing, data stored as key/value pairs/objects, you get the picture.
It would be great to hear from anyone who’s used either with F# and your experiences. For now, I’m going to do some prototyping down both paths to see where what comes out the other side.
Posted in Data, F#.
By Chris Roland
– March 6, 2010
I was reading through my most recent book addiction purchase (Programming F#) and I came across something I thought was interesting.
The (=) operator, basically in any other language assigns something to another thing, but in F# it’s actually a comparison operator. In C# (==) is used for comparison and (=) is used for assignment. If you forget the second (=), you can create a fun bug, for example:
bool canDoSomething = false;
if (canDoSomething = true)
{
DoSomething();
}
In this example the if statement is assigning true to the canDoSomething variable, which evaluates to true if the assignment is successful.
The if statement should really be:
if (canDoSomething == true)
In F# you “assign” using the let statement:
let canDoSomething = true
Moral of the story is, if you program in F#, it’s easier to avoid this bug. However, watch your step when going from F# to another language.
For a little bit more information, check out this list of F# arithmetic operators:
http://msdn.microsoft.com/en-us/library/dd469493%28VS.100%29.aspx
Posted in F#.
By Chris Roland
– March 3, 2010
The Capital Asset Pricing Model (CAPM) is a way to determine the rate of return for an asset, a single stock or the entire portfolio.
I wanted to see how this would be calculated in F#, so here you go, enjoy:
let capm (beta:float) (y:float) (z:float) = y + (beta * (z - y));;
Posted in F#, Finance.
By Chris Roland
– January 30, 2010
I’m really excited about 2010. Things are changing and I’ve never felt more sure about the direction of my career and personal life than I do now. So to kick things off, I’m posting a list of my 2010 goals and I’ll track them through out the year with the 2010Goals category.
The goal criteria is, it needs to be measurable and attainable within 2010.
-
List and read every book I’ve purchased that I still own
This is a challenging goal because I have a ton of books I still need to finish or read. I love books and when I find a good one, I buy it. The problem is I pushed off reading a bunch of them, telling myself I would read them later. This goal will insure I finally get to them.
-
Build a hobby robot with my son
I’m into hobby robotics and my son loves robots as well. He seems to be into building things and this would be a perfect project for both of us. Maybe it will help pick up toys
-
Teach my kids the abacus
The abacus is amazing and it’s proven to improve mental capabilities, plus it’s easy and fun. If you want to know more, just do a search for abacus on YouTube.
-
Give at least 5 presentations for any .NET based event or user group
I enjoy speaking about technology I’m passionate about. The challenge is I don’t speak enough and I should. So even though I set this goal at 5 presentations, I hope to do more based on time, availability, etc.
-
Take an active role in the .NET community
I need to become more active in the community, so this goal translates to, obtain a position within a .NET user group. I will contribute to the community in many other ways, however this will insure I consistently provide support to the community through out the year.
-
Read at least 2 books on mortgages or home loans
I recently became employed by Quicken Loans and this goal is to help me understand that domain and industry.
-
Become a MCPD (Microsoft Certified Professional Developer)
I find they are a great way to define and drive the direction of my career. The technology landscape is continually changing and I need to insure I do as well.
-
Take at least 2 general education courses for college
I need to get this party started. I’m looking forward to taking a ton of math, finance and business classes, however I need to start with my gen eds.
-
Get more F# in my life
Almost forgot this one, but this year I’m going to get more F# in my life. I’ve had a small taste of functional programming and I want more. Also, F# seems to be the coming up language of choice for developing finance solutions.
Posted in 2010Goals.
By Chris Roland
– January 3, 2010
I’m currently working on an ASP.NET MVC project and I’m using LINQ to SQL to manage my data. One of the fields I’m working with is stored as a MONEY data type in SQL Server. I wanted to find the best CLR data type to use when I mapped the field in my LINQ Data Context. After some researching I came across a great MSDN article showing what types to use when mapping back to the database with LINQ. There is even an awesome grid showing the best types to use and the expected data loss.
Here is the link:
http://msdn.microsoft.com/en-us/library/bb386947.aspx
Posted in Data, LINQ, SQL Server.
By Chris Roland
– November 27, 2009
Here is a quick tip on how to remove elements with empty values. All you have to use is the array_filter($myarray) function. Here is an example.
$myarray = array();
$myarray[] = 1;
$myarray[] = '';
$myarray[] = 'a';
print_r($myarray);
Array
(
[0] => 1
[1] =>
[2] => a
)
When you use array_filter() this is what you get:
$myarray = array_filter($myarray);
print_r($myarray);
Array
(
[0] => 1
[1] => a
)
Of course you can use array_filter with a callback function to intelligently remove elements, but if you just want to remove empty values, this is the best way.
Posted in PHP.
By Chris Roland
– November 25, 2009
After going through the Oxite hosting issue on Godaddy, I decided to look into the hosting issue further. Basically with Godaddy, unless I had a VPS with them, hosting Oxite is a bunch of hoops I don’t want to jump through just to get a blog going. So, to give Oxite a fair chance I’m going to get a hosting account with Discount ASP.NET, who I hear has great support for ASP.NET.
Posted in ASP.NET, Oxite, Web.
By Chris Roland
– November 16, 2009
Time for another GiveCamp. This time it will be in Grand Rapids at the YMCA. I’m looking forward to this event and being able to help non-profits in any way I can. I’ll try and keep the posts coming during the event, you may see a couple 3AM posts, you were warned
The GR GiveCamp organizers setup Assembla for us to use during the event for task tracking, document management, etc. This will be cool, since everyone will be using the same system to track everything.
Well, I’m off.
Posted in Events.
By Chris Roland
– November 13, 2009
Looking good as in tasty, yummy, delicious. Not as in, hey nice hair or where did you buy that shirt.
I’m a Qt kind of guy when it comes to OSS GUI frameworks and really Qt is more than that. However lately I’m spending some of my time in PHP. I really enjoy developing in PHP and I’m always trying to find new and fun ways to use a language I spend time in. Since PHP is primarily a web development language, I wanted to see what libraries/frameworks were out there to support desktop application development with PHP.
I looked at PHP-Qt, however I feel that project still has a ways to go before I can start using it. Keep in mind, I work on a Windows box all day and I didn’t want to have to jump through the cygwin hoop. I think they will have good support for Windows soon, but I want something that I can use now.
I did some more research and came across the PHP-GTK project. The first thing I look for in a framework project is the documentation. I was surprised to see the amount of documentation and with some code samples. The docs are not perfect, but they provide me with what I need.
Demos are the second thing I look for. I want to see how it will work, how the code is compiled/ran and if I can run it on my system. Within a couple minutes of unzipping a folder, I was up and running.
So, if you are a PHP developer looking to develop a desktop application, I would consider taking a look at PHP-GTK.
Posted in PHP, PHP-GTK.
By Chris Roland
– November 7, 2009
If you want to add a module directly into an article just follow the steps below:
-
Enable the Content – Load Module plugin
Go to the Extensions->Plugins Manager section and enable the ‘Content – Load Module’ plugin.
-
Enter a unique position name for your module
Go to the Extensions->Module Manager, select your module and enter a unique position in the Position field in the Details section. For example mod_mymodule.
-
Enter the loadposition tag into the article
Edit the article you want to put the module in and enter the {loadposition positionname} tag
For example {loadposition mod_mymodule}
That’s it!
Posted in Joomla.
By Chris Roland
– November 5, 2009