If you follow this blog you know that I appreciate screencasts as a way of learning.
I've been cooking a side-project that aims to ensure that the programming screencasts I find useful would get a wider reach, as well as keep me up to date.
While it's mostly Ruby, RubyOnRails and iPhone related so far, I intend to broaden what's in there with more .Net content (including IronRuby, IronPython, F# and more).
So first I hope some of you will find this useful - and if you have interesting screencasts sources related to the .Net world, I'm all hears :)
I've been looking for resources to implement custom languages and AST manipulation on top of the DLR recently, as part of my data processing work with a customer.
If you're into this, you should definitely have a look at the Sympl language sample (see Sympl.doc).
This document was accompanied by this message, posted by Curt Hagenlocher on behalf of Bill Chiles to the IronRuby core list:
There's a new DLR sample to which I wanted to draw folks' attentions.
There is a small language implementation sample, implemented in both
IronPython and C#, with an accompanying walkthrough document. The code
is now on the DLR Codeplex site under ...\Languages\Sympl, and the
document is on the "Documents and Specs" page which you can get to from
the list of links on the home page. Under the Sympl directory is also
an examples directory with some code written in Sympl, which all runs
when you execute Main in program.cs. The code and document will be in
zip files we will produce to go along with the VS Beta1 release coming
Sympl demonstrates how to implement a very simple language using the
Dynamic Language Runtime (DLR) as it ships in .NET 4.0. The goal is to
make you aware of how to get started building a language on the DLR.
Sympl does not show production quality rich .NET interoperability and
binding logic. It does walk you through the following:
* Using DLR Expression Trees (which include LINQ Expression Trees v1)
for code generation
* Using DLR dynamic dispatch caching
* Building runtime binders
* Building dynamic objects and dynamic meta-objects
* Supporting dynamic language/object interoperability
* Very simple hosting with application supplied global objects
* Basic arithmetic and comparison operators with fast DLR dispatch
* Control flow
* Name binding within Sympl
* Method and top-level function invocation with fast DLR dispatch
* Very simple .NET interoperability for runtime method and operation
* Using the DLR's built-in COM binding
* Assignment with various left-hand-side expressions
Sympl does not yet demonstrate using any Codeplex-only DLR code such as
the DefaultBinder, the faster and nicer .NET reflection trackers
(Sympl's is painfully slow and simple), or the common DLR hosting (yet).
A few caveats on the documentation. First, the walk through document
still needs some polishing, but I wanted to get it out to people. Feel
free to send me comments or ask questions. Second, the document refers
to a couple of other documents on our Codeplex site, but we haven't
updated some of them since DEC 08. Those will be updated in the next
couple of weeks. I think the sympl.doc walkthrough is very readable on
its own and has all the relevant code snippets included in it as well.
Lastly, while the example is overall reasonably simple, it does
demonstrate all the basic concepts of building a language on the DLR
with explanations, and therefore, is quite long. However, the document
unfolds in the same way the Sympl language implementation evolved, so it
progresses well for incrementally increasing your awareness of how to
build a language on the DLR.
Hope you enjoy and find this code and doc helpful!
Have a pleasant and instructive reading (and thanks to Curt and Bill for sharing this).
Today I'm sharing bits of code that we found useful while working on Windows Forms UI code with my customer.
In .Net, the "BackgroundWorker":http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx provides a nice way to handle out-of-UI thread work while being able to report some progress on the UI side.
Sometimes though, we felt that we wanted something more flexible for our needs, and came up with that:
The reverse is also possible:
You'll notice that we don't pass arguments nor return value unlike other kind of sugars for that (see resources below).
That's because we use lambda's all over the place for that, so what would be parameters and return values can be accessed in the lambda's parent scope directly.
That's what works for us. Now to you: what kind of sugar do you use when dealing with threads in Windows Forms ?
A few links that you may find useful if you target this kind of subject:
* "old yet very detailed informations on Invoke/BeginInvoke stuff":http://weblogs.asp.net/justin_rogers/pages/126345.aspx
* the "BackgroundWorker":http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx provides convenient sugar to handle cancellable worker thread, with ability to report progress
* "Safe ControlInvoke with Lambda's":http://dotnet.org.za/virtualstaticvoid/archive/2009/01/24/safe-controlinvoke-with-lambda-s.aspx covers a larger number of cases than what's presented here
* "Delegate Marshaler":http://thevalerios.net/matt/2008/07/controlinvokerequired-delegatemarshaler-and-anonymous-methods/ - another way of handling these
* "Safe, Even Simpler Multithreading in Windows Forms 2.0":http://www.mikedub.net/mikeDubSamples/SafeReallySimpleMultithreadingInWindowsForms20/SafeReallySimpleMultithreadingInWindowsForms20.htm - pretty good introduction to UI threading
* "Magic":http://gist.github.com/thbar/magic/tree/master - an IronRuby gem focusing on making it easier to create WPF, Silverlight and Windows Forms stuff from IronRuby (more on that later)
Pour ceux qui seraient intéressés, une rencontre du Scrum User Group (SUG) a lieu le 11 février (près du métro Bonne Nouvelle à Paris). J'y serai, sauf imprévu majeur.
Il s'agit d'une "rencontre informelle et (d') échanges sur Scrum, l'Agilité et bien sur la vie du SUG".
J'ai découvert l'existence de ce "SUG" après être devenu Certified Scrum Product Owner (merci Mike Cohn, formateur absolument fantastique), en explorant les ressources disponibles sur le site de la Scrum Alliance.
Au passage, Meetup.com est un outil bien réalisé et pratique pour organiser ce genre de réunions.
Peut être à la semaine prochaine si vous y êtes!
Since last year I've been watching more and more screencasts. By screencasts I mean short videos, usually one hour long, focusing on one specific technique. I found that screencasts are an amazing way to get up and running on a given topic. I thought I would share this here.
I currently know about two great publishers (please comment if you know others).
"PeepCode":http://peepcode.com/ is a place with a lot of Rails and RSpec related-content, but you will also find things that could be relevant to .Net, depending on what you're currently experimenting:
* "Ajax with Prototype.js":https://peepcode.com/products/ajax-with-prototypejs
* "Benchmark with httperf":https://peepcode.com/products/benchmarking-with-httperf
* "Git":https://peepcode.com/products/git - if you're into decentralized version control
* "CouchDB":https://peepcode.com/products/couchdb-with-rails - CouchDB is a nice document oriented database; great to handle semi-structured data for instance.
These screencasts are priced at 9$ each (at time of writing).
"The Pragmatic Programmers":http://www.pragprog.com/screencasts also propose a series of screencasts, including episodes on "Erlang in practice":http://www.pragprog.com/screencasts/v-kserl/erlang-in-practice or "Writing your first iPhone application":http://www.pragprog.com/screencasts/v-bdiphone/writing-your-first-iphone-application.
h3. Yourself as an internal publisher
Finally, some "friends of mine":http://clt-services.com/ have "started using screencasts inside their company to share knowledge":http://evolvingworker.com/2008/10/13/using-screencasts-to-share-knowledge-inside-a-company. I believe it is a very interesting practice.
Do you know other interesting screencasts publishers ? Please comment!
Here's an interesting code extract from the Tech Ed 2008 feedback by John Lam:
Sweet - and something I would not be surprised to see widely used in another couple of years. See you then!
I struggled a bit while preparing my Silverlight and IronRuby article for the french magazine Programmez so I'll share those tips here.
Here are the required elements to achieve step-by-step debugging when working in IronRuby Silverlight:
- Visual Studio 2008 RTM (trial version is ok)
- Silverlight 2 Visual Studio Tools - available here (you'll have to uninstall any already installed Silverlight runtime or SDK first)
- Grab the latest dlls from the Dynamic Silverlight SDK and place them under your app folder (or under the chiron /bin folder)
Then add the following to your html file:
<param name="initParams" value="debug=true, reportErrors=errorLocation" />
To actually debug, here are the required steps:
- open your ruby file in Visual Studio
- enable the breakpoint
- attach the debugger to your browser window process
- go back to the browser and hit F5
Here's a screenshot:
(many thanks to Jimmy Schementi for helping out on the ironruby-core list).
I've been playing around a bit with the SDK and start to like it. Although pretty basic for the moment, it's functional and let you write and run IronRuby or IronPython Silverlight applications locally.
Typical development steps include the creation of three files:
* the xaml manifest
* the html file
* the code file (app.rb, app.py ... )
Once these files are ready, use the following command line to run the Chiron dev server (coming with the SDK) which packages things as a XAP module seamlessly:
Detailed information can be found on the Silverlight Quickstart page.
h3. An introduction to IronRuby (french readers only)
As as sidenote, french readers may want to check out my introduction to IronRuby on developpez.com.
(via le web pédagogique)
Une news un peu "hors-topic" toutefois c'est suffisamment intéressant pour que je veuille en informer les autres bloggeurs DNG et nos lecteurs assidus!
Si vous connaissez le mind-mapping ou que vous souhaitez découvrir un logiciel pratique pour acquérir cette technique, l'éditeur MindJet offre une license gratuite de son logiciel MindManager 7 aux bloggeurs francophones actifs (voir ici pour toutes les informations).
Attention c'est une offre limitée au 31 mars 2008.
Si vous ne connaissez pas le mind-mapping, vous pouvez en apprendre davantage ici et voir les usages concrets que j'ai pu en faire ou découvrir son utilisation pour générer des données de pilotage d'une application informatique.
A few things I want to share tonight:
h3. Want to work on dynamic languages at Microsoft ?
First John Lam announced that Microsoft is recruiting on the dynamic language side:
We have five open positions as of today. We need devs for IronRuby, IronPython and F# and testers for IronRuby and F# (the links to the F# jobs will appear soon).
If you are interested, contact John through his blog.
h3. I'm sharing articles on a new "generalizing-specialist" blog
A few weeks ago, I've started a new blog where I share *learning content with software developers*. It's not tied to a particular technology.
What you will find there: articles, how-to's, beginner's guides. No news.
I'll continue to blog about DotNet news here.
h3. IronRuby with Silverlight soon to come
I believe we'll get a release of Silverlight with IronRuby enabled at Mix08...
Be sure there is going to be a lot of funny stuff written with this when it will be out.
h3. Mike Gunderloy 301 redirect
I've been a fanatic reader of Mike Gunderloy's LarkWare news for years. Now he has decided to focus on Rails, Merb and other technologies.
I warmly recommend his new blog A Fresh Cup.
Even if you're not focusing on Rails, you'll find plenty of useful links in his daily cup of links.
h3. A tiny IronRuby sample
To close this post, here's a sample of code I want to share. I wrote it while preparing an IronRuby article for the french magazine Programmez:
class System:: Drawing::Bitmap def set_pixel_clip(x,y,color) set_pixel(x,y,color) unless (x<0 or y<0 or x>=width or y>=height) end end
(forget about the extra space before Drawing - if I remove it this blog draws a smiley)
Here although the Bitmap class is sealed, we're able to add a method to it to handle a convenient scenario (I believe it's using the "extension methods" ). The existing SetPixel method is automatically "rubynised" to set_pixel, as well as the Width and Height properties.
The more I work with IronRuby, the more I like it!
That's all for now. Back to feeding the baby!
Hello dear readers,
I'd like to introduce a blog I've started recently.
It's called the Evolving Worker. The idea here is to share tools and methods about how to ease our day at work.
I hope this new blog will be useful to you, your friends and colleagues.
Happy new year and thanks for reading !
I've just started blogging about it and will likely blog more about it in the next few weeks: Rake gives you a tremendous power when it comes to automating tasks for any kind of applications, including DotNet applications. For those DotNet applications, I only delegate the compilation step to MsBuild. All the rest is handled through Rake itself, which may do the job itself and/or delegates stuff to other binaries (things like wget, winscp, unzip, gunzip, putty).
I usually setup a CruiseControl.Net instance when I start a DotNet project. When I started using Rake, I wanted to be able to call Rake from CruiseControl.Net.
Here's an extract of a working ccnet.config file calling Rake. You'll notice that the paths are absolute to ensure it doesn't rely on a PATH variable, which cause troubles when CCNet is running as a service.
You can call as many Rake tasks as you like on the same row. Properties (key=value) can be passed along, and retrieved later in the Rakefile using ENV['key'].
h1. What is Pimki ?
I like Pimki because it's a lightweight wiki, easy to setup, and quite straightforward to use. I'm using it to mix technical and non-technical teams knowledge, operational procedures, write-ups, internal blogging. It works very well in my typical configuration (10 to 25 users on a daily basis).
I've been installing it a couple of times, so I thought I would share some possible steps to install it.
h1. Getting Pimki up and running
* install ruby (one click installer, http://rubyforge.org/projects/rubyinstaller/)
* install cygwin (http://www.cygwin.com/, setup.exe), including the Admin/cygrunsrv package
* install pimki with: gem install pimki --include-dependencies
* configure pimki to run as a service using this command line
Of course you have many other possibilities to run something as a service under windows. I found out that Cygwin has been very reliable for that purpose (it never failed once since I installed it), althought it can seem a bit overkill at first sight.
h1. Setting up a back-up
The data which comes in quickly becomes valuable, so you'll want to set up a back-up.
Once you have Ruby, you also get Rake, which I'm using a lot to achieve reliable scripting (unlike dos commands, error handling is implicit; and reusability is a lot better).
Given the fact that Pimki stores its data as 'snapshots' on the disk (using an in-memory ORM), the backup is very easy to write.
Next step is to automate the task: I just plug it in one of my favourites continuous integration server which is usually already in place for the development (or one can use any other scheduling system).