Mono can make your day.
This is a topic that many of us mono developers know really well. but many of you might be new to mono or maybe even just merely fans of mono. Maybe you syndicate mono’s monologue feed but never really have had a chance to use it, but because its .NET related, its interesting. These tips might interest you.
Even though you might not plan on using Mono in its entirety, parts of Mono can help you with your .NET development. From a evangelist respect, I would love everyone to use Mono, but being a developer I know that isn’t always possible. Fear not, you might still be able to use Mono to speed your time to market, solve some of the issues you might be having, and more conventionally help you understand where you might have portability issues in the future.
Use Mono’s source as reference guide
First off, its good to know where you can see the mono class library source. The best way to view the source online without downloading is using the SVN viewer. Bookmark this url: http://svn.myrealbox.com/viewcvs/trunk/mcs/class/.
Even though our class libraries don’t work 100% exactly the same as in .NET, we modeled them to match .NET as close as we possibly could. If you know C#, they are easy to understand in most cases, and sometimes its more useful looking at the source code to see what a function returns, then to poking around in the MSDN docs when something isn’t specific enough and just testing things over and over takes to much time.
One example where I found this useful today is when I had an error in some 3rd party code that ran peek on a stream reader to see if there was any data to be read. Simply reading the source I noticed that really it just checks the Stream.CanRead property and since peak would return a char and the stream defaulted to UTF8 and since the byte value it was reading didn’t exist in the UTF8 encoding, it would crash.
Mono’s Secuirty and LDAP libraries
If you need more then what System.Secuirty and System.DirectoryServices offer you, you can use our Mono.Secuirty and Novell’s LDAP assemblies in your app. They are written in C# and copy nicely being CLI compliant and all, so they run on .NET without issue.
Use Mono class libraries to supplement missing APIs in Windows CE .NET
While I haven’t done this, if you really need something that isn’t offered in the CE edition of .NET, then mono’s implementation might be exactly what you need. Our class libraries are writen in C#, we try to minamize as many calls to native functions as possible (doesn’t help when we want to keep things portable). All you need to do is strip out what you need and refactor it in to your source.
Oh did I mention that Mono’s class libraries are released under the MIT/X11 licence? MIT/X11 is one of the most liberal licences out there. That means you can almost do anything you want with the source without risk of any licence clause stopping you.
Monodis
This is a small one. It’s our version of ildasm. I found that it can break down assemblies to IL a bit clearer then ildasm. One of the great uses is when you run into some library in-lined with some hack to prevent ildasm from working, monodis sometimes still works.
Broken/Missing feature in your favorite ASP.NET control?
This happened to me a few times. You want that DataGrid or DataList or Calendar object to do something it just doesn’t have the power to do. What do you do? You take the version in Mono’s System.Web namespace, change it, and compile and enjoy.
For example, lets say you want a 14 day calendar or a calendar that shows 14 days in a row? Simply snatch the code (http://svn.myrealbox.com/viewcvs/trunk/mcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs?view=markup), make the few changes you need, and enjoy! You just saved yourself a ton of time hacking something yourself.
Managed.Windows.Forms
Our System.Windows.Forms stack is completely written using System.Drawing/GDI+ (makes it very portable). One of the advantages is that the controls we wrote can be modified and refactored with little effort into MS.NET. Let’s stay you want a text box that does all sorts of colors, or you want a rich text box that supports some crazy feature (like shadowed text or something). Just like the asp.net control example above, you can strip out what you want and make it happen, in a fraction of the time.
Mono Tools for Visual Studio
My good friend Paco Martinez is the Win32 king. He has put together a number of projects that integrate with Visual Studio to help you check your code against mono as you develop. You can see most of his packages on Novell Forge here and here. His tools are a must have.
XSP
Simply, because its better then Cassini for a standalone ASP.NET server. Also the licence allows for distribution, so you can package your ASP.NET up for people to run on machines without IIS and not have to worry about restrictions or limitations compiled in. XSP is also the back end to our mod_mono module for apache, so you are not using a diluted version.
Mono’s Debugger
Ok.. It’s not visual studio. But many people who are used to gdb or any other command line debugger, may find its familiar and useful.
Complete Control
This really isn’t a tip but an example. I’m personally aware of one company that has taken and extended Mono’s web-service stack into their own code to improve compatibility with Java and write in support to expose and consume methods with XML-RPC in the same layer.
Mono can be an invaluable tool. I know it has been for me over the last couple of years in my own development.
Tags: Mono & .NET, Personal
May 23rd, 2006 at 5:38 pm
Your tips are very usefull for beginners … it sure makes me want to try Mono
May 23rd, 2006 at 7:44 pm
Very well written post. I enjoyed it.
May 23rd, 2006 at 8:29 pm
a
May 24th, 2006 at 7:21 am
I have been closely following Mono ( on a daily basis ), for almost two years now. It certainly fills a real and unique need.The monkey is evolving very well
May 24th, 2006 at 9:29 am
The trick with Microsoft’s MSDN libraries is to use the help browser that comes with the Visual Studio family. It is fast, adaptive and extremely usable. No open source IDE has anything that comes even close. (Which is a shame because I use only the open source IDEs.)
June 7th, 2006 at 5:27 am
Nice article, Zac. You should probably post this at www.dzone.com, a digg-like site specifically for developers.
May 11th, 2008 at 5:39 pm
I’m really impressed with your blog on bowling tips.It’s a great discovery for me to learn more about this great sport.Since being a bowler since 2001 I seem to average about 205 for each bowling league.
I’m learning day by day but, bowler basics is really what most new bowlers are looking for not to mention correcting bowling faults.
Hear are some ,I found at this cool new bowling tips website.
1) TOO HIGH A BACKSWING
I’m always surprised at how often I see this occur, especially among women bowlers. Don’t let the backswing ever get be- yond shoulder height. Don’t force it to the level pictured here —it’s sure to result in faulty timing.
2) DROPPING THE BALL
Get the ball over the foul line; reach out with it. There are two reasons for this problem: either your timing is off, or it is simply a case of your ball not fitting you properly.
3) POOR FOLLOW-THROUGH
Many bowlers I’ve seen seem to do everything well, until they release the ball. Then they go into a poorly executed follow-through. Here’s one example—not keeping down; pulling up at the finish. You can overcome this by keeping your head down and your eyes on the target.
4) BAD FINISH
Here’s a problem on the fol-low-through; in fact, it’s no follow-through at all. Be sure to continue the arm on its natural upward motion after the ball has left your hand. Many pro stars continue the motion until their hand reaches the height of their head. Try it. It could be a great help to you.
These are just a few good bowling tips for new bowlers entering the sport.I hope that, I added some value to your blog with these winning at bowling tips and if not that’s ok.I ment no harm!
Just incase your interested in you can visit the site yourself,I hear they have a really cool affiliate program.
www.winningatbowling.com