F#
-
This is something I've been meaning to attempt for a while, and have finally been spurred to do it by next week's AU Virtual session on F#. Not that I expect to have time to present this during the session (60 minutes is already feeling way too short for the material I want to cover), but I at least wanted to have this working so I could present with a touch more authority. 🙂 In last year's session we used Asynchronous Workflows to improve the performance of IO-bound operations, such as retrieving multiple RSS feeds and displaying the results in…
-
I've been toying for some time with the idea of writing some code to turn AutoCAD into a Spirograph, a device which I'm sure fascinated and inspired many of you as children (just as it did me). I chose to write the application in F# for a couple of reasons: this type of task is fundamentally mathematical in nature – so a functional programming language should be well-suited to the task – and I needed to dust off my F# skills in time for my F# class at AU. Searching the web I came across this helpful post providing some…
-
Seeing Jeremy's post from Friday, I decided to give you a quick update of where I am with my own preparation for this year's Autodesk University. I'm delivering two sessions, this year: CP9214-1 AutoCAD® .NET – Developing for AutoCAD Using F# CP208-1 AutoCAD® .NET – Developing for AutoCAD Using IronPython and IronRuby So yes, it seems as though I'm carving out a niche for myself as "the quirky languages guy". 🙂 The first one of these is actually a virtual session, and will be broadcast twice during the week of AU. It's one I presented already, last year, and here…
-
I recently stumbled across this post which inspired me to do something similar in AutoCAD (the fact that both posts cover Fibonacci spirals and use F# is about where the similarity ends - they do things quite differently). Fibonacci spirals are an approximation of the golden spiral, which for old timers out there will be reminiscent of the AutoCAD R12 (it was R12, wasn't it?) design collateral - the same as this one from AME 2.1 - which I still find cool after all these years. 🙂 The first thing was to create a function that returns a portion of…
-
Back at the beginning of the year I launched a programming contest for using F# with Autodesk products. A few months ago I introduced one of the winning entries showing how to use F# to implement Overrules in AutoCAD 2010. Now I've finally got around to unveiling the second winning entry. And the winner is… drumroll… Nada Amin, who entered her Master of Engineering project which uses F# with AutoCAD. Here is a description of the project from the MIT website: Micado: an AutoCAD plug-in for programmable microfluidic chips Programmable microfluidics, using multi-layer soft lithography, are lab-on-chip systems that can…
-
This post is one of the winning entries of the F# programming contest started at the beginning of the year. It was submitted by an old friend of mine, Qun Lu, who also happens to be a member of the AutoCAD engineering team, and makes use of a new API in AutoCAD 2010: the somewhat ominously-named Overrule API. The Overrule API is really (and I mean really, really) cool. Yes, I know: another really cool API in AutoCAD 2010? Well, I'm honestly not one to hype things up, but I do have a tendency to get excited by technology that…
-
I've been meaning to play around with the Python language for some time, now, and with the recent release of IronPython 2 it seems a good time to start. Why Python? A number of people in my team – including Jeremy Tammik and the people within our Media & Entertainment workgroup who support Python's use with Maya and MotionBuilder – are fierce proponents of the language. I'm told that it's an extremely easy, general-purpose, dynamic programming language. All of which sounds interesting, of course, although I have to admit I'm less convinced of the importance of the dynamic piece: I've…
-
There are just a few days left before the February 28th deadline of the F# programming contest. Thanks to those of you who have already submitted entries! At least one potential prize is still up for grabs - beyond those I've ear-marked for existing entrants - so if you're working on something and plan on submitting it in the next week or two (even if you won't be able to meet the original deadline for the actual submission), then please let me know by email. If you haven't notified me by Saturday that you have something in the works then…
-
As promised in the last post, we're now going to look at how to change the code to make the colour averaging routine work in parallel. The overall performance is marginally better on my dual-core machine, but I fully expect it to get quicker and quicker as the number of cores multiply. To start with, though, here's the modified "synchronous" version of the code - as I went through making the code work in parallel, I noticed a bunch of general enhancements that were applicable to both versions. Here's the updated F# code: // Use lightweight F# syntax #light…
-
A friend and esteemed colleague asked - very validly - why I decided to use circles on a grid to display the results of a mathematical function in this last post, rather than using a linear object of some kind. Well I did, in fact, have a plan in mind... 🙂 This post extends the concept, introduced in that post, of displaying data in a grid of solid-hatched circles. This post focuses on importing a bitmap image from a file, pixelizing the contents and using the "averaged" pixel colours to modify our grid. The idea actually came to me during…