In C# the defaut access level for members in classes and structs is "private".
There is no need to pepper the source code with "private" everywhere. It only introduces noise and makes your code more difficult to read.
Posted on 28 Sep 2008
Chris Anderson is wearing a Mono T-Shirt on this PDC interview and IronRuby.com is hosted on DekiWiki, a Mono-powered Wiki site.
This is clearly awesome.
In other news, the awesome hackers at Imendio have officially released Gtk+ for OSX packages.
Posted on 24 Sep 2008
Funkists, why does System.IO.Stream not have a CopyStream method, it seems like everyone ends up implementing this.
Discuss.
Posted on 24 Sep 2008
Kudos to Ben and the rest of the Captcha team.
Today I downloaded the binaries for reCaptcha.NET for a web page that I was setting up and it worked out of the box. No recompiles necessary:
<recaptcha:RecaptchaControl ID="recaptcha" runat="server" Theme="red" PublicKey="YourKey" PrivateKey="YourOtherKey"/>
Posted on 17 Sep 2008
I just found out about encfs, a user-space encrypted file system that runs on top of FUSE.
To use it, just type:
$ encfs ~/.encryptedstorage ~/secure
And follow the directions. You then will have a ~/secure directory where you can stash all the material that you would not want to become public if you were to lose your laptop.
But it gets better than this. You can use sshfs to store files on a remote server, and then use the sshfs-backed file system as your encrypted storage, you can then keep your files stashed on a remote server, completely encrypted.
Posted on 16 Sep 2008
Hey folks, it is that time of the year when we are looking to hire some developers to work on Mono.
We are looking for people with experience in Linux, with experience building software from source code and good C# or Java skills. Experience with ASP.NET and ADO.NET is a plus.
The positions this time are only available in Boston, if you are interested, send me an email.
Update: we have filled this position.
Posted on 15 Sep 2008
There is a cool hack that we want to introduce in Mono that would allow a remote process to debug a examine data in a running Mono instance. The hack uses the embeddable compiler.
The proposed extension to Mono would use a socket on /tmp/mono-USER/.mono-PID created by the Mono process and set the permissions to read/write for the owner and nothing for the group or other users.
What can go wrong security-wise with the above setup? What should we check that is not immediately obvious?
So far:
Posted on 15 Sep 2008
The csharp interactive shell and the embeddable compiler hacks could only have been possible thanks to the work that Marek Safar has put into implementing C# 3.0, cleaning up the compiler and laying down the foundation for a reusable compiler.
Some time ago, our regression test suite for the compiler was taking 20-30 minutes to run. Marek refactored the compiler so that we could reuse the same instance without launching a new process for each of our 1,500 individual tests.
Without Marek's dedication and love for the compiler, we would never have gotten here.
Posted on 11 Sep 2008
Hello Internets and C# Lovers!
After the C# Interactive Shell started working, it became obvious that we now had C#'s eval and that it would be incredibly interesting to enable people to embed a C# Eval in their application.
I did a little bit of refactoring on the codebase last night, and now we expose a few methods that allow developers to evaluate C# expressions and statements dynamically.
Usage is very simple, you must reference the `gmcs.exe' assembly, this contains the C# Eval, then you invoke the CSharpEvaluator.Evaluate method, and get the results back.
The following is a small command line calculator that takes C# expressions:
using Mono.CSharp; using System; class MyCalculator { static void Main (string [] args) { Console.WriteLine (CSharpEvaluator.Evaluate (args [0] + ";")); } }
Compile the above, and execute:
$ mono calculator.exe '1+2' 3
There are a number of overload methods for Evaluate that give more control over how things are evaluated. The csharp command is now written entirely using the CSharpEvaluator API. The code is now pretty simple: pretty printing of values, dealing with partial input, loading startup files (if any) and import the default namespaces.
A few uses that come to mind:
The four or five public methods of the API are documented in the source using C# doc tags. When Mono 2.2 goes out, we will publish docs for them.
As we announced back in April, Mono's C# compiler is now licensed under the MIT X11 license, so you can embed at will.
Joe Shaw mentioned a few days ago that it would be nice to support something like Twisted's Manhole where your application is listening on a port and then you can connect to it and debug it. It should take a dozen lines to write it, but I am heading out for dinner now.
But if I were to do it, I would probably make the csharp command (all 240 lines of it) support a --server command line option and have it connect to the server and send strings over the wire instead of executing locally. That way you get to use the awesome getline.cs command line editor and history locally and let the server run the code.
To enjoy this hack, you have to either wait for Mono 2.2 or install Mono from SVN, all of the code is checked in.
Since it was not obvious, we do support C# 3.0, which includes the entire LINQ stack in the above expression evaluator:
using Mono.CSharp; using System.Collections; using System; class X { static void Main (string [] args) { Evaluator.Run ("using System; using System.Linq;"); bool ress; object res; string s = Evaluator.Evaluate ( "from x in System.IO.Directory.GetFiles (\"/etc\") where x.Length < 10 select x;", out res, out ress); foreach (var v in (IEnumerable) res){ Console.Write (v); Console.Write (' '); } } }
The above uses a LINQ expression, and this is the result in my system (files whose full pathname is less than 10 characters):
/etc/motd /etc/mtab /etc/raw /etc/rpc
Posted on 10 Sep 2008
Hello Internets!
Some very good news: As part of the ongoing discussion on the MS Limited Permissive License, I was doing some Google searches on it and came across the Enterprise Library 4.0 release.
Enterprise Library was a project that came out of the Patterns and Practices group at Microsoft, and they had historically used licenses that were not open source friendly. This new release is now licensed under the terms of the open-source friendly MS-PL license.
In the past, various people have asked us to implement an open source version of it, so they could use those building blocks on Unix with Mono. We never had any spare cycles to look into this, so the blocks provided by Enterprise Library were always beyond Mono users.
As it turns out, since May 2008 it has been possible to use the library with Mono on non-Windows platforms.
Now all there is left to do is to package it in a convenient form.
Posted on 09 Sep 2008