Compile mono on Debian

Mono enables you to run .Net program on almost every operating systems and my second favorite one is Debian/Linux (my first one is Windows as you can guess). You need to get some tools: apt-get install subversion make automake autoconf python gcc g++ libtool pkg-config bison libxml-perl gawk Get the SVN repository (very slow): mkdir ~/mono cd ~/mono svn co svn://anonsvn.mono-project.com/source/trunk/mcs svn co svn://anonsvn.mono-project.com/source/trunk/mono svn co svn://anonsvn.mono-project.com/source/trunk/libgdiplus #svn co svn://anonsvn.mono-project.com/source/trunk/gtk-sharp If you don’t have any mono on the system: ...

March 2, 2009 · Florent Clairambault

DOL – Delete Oldest Logs

This is a little program I made some time ago because I had some problems with some log files I generated. I didn’t know how big they would end up and I had a limited disk space. As you can guess, it can be used for any files. So I could have called it “DOF * Delete Oldest Files”. The idea of this tiny .Net program is to delete the oldest logs first. It scans every files and delete as many files as required to reach its objectives. ...

February 25, 2009 · Florent Clairambault

Sharepoint – Clean a huge Document Library

I recently had to clean a huge (113 000 rows) document library. The first question that must come in mind is : Why was it so big ? Well, someone thought it was beter to store data in lots of XML files instead of in a classic list. The second question is: How ? First, you have to understand that you can’t use a DeleteAll() method, it doesn’t exist. You must fetch data by little packet of rows. If you try to get everything, you will have a OutOfMemoryException. ...

February 20, 2009 · Florent Clairambault

SharePoint: What Should I Dispose?

When starting with SharePoint development, a common question is “Which objects should I dispose?”. This is crucial because SharePoint leaks approximately 1 MB of memory per undisposed IDisposable object. For components like menus, this can quickly add up to 10 MB per page load. While the MSDN documentation provides comprehensive guidance, here’s the quick answer: In your WebPart, dispose of all SPWeb and SPSite objects except: SPContext.Current.Site SPContext.Current.Web SPContext.Current.Site.RootWeb For Features, dispose of all SPWeb and SPSite objects except those provided in your “properties” variable. ...

February 17, 2009 · Florent Clairambault

Automatic error reporting in PHP

I edited this page on the 21 March 2010 because a lot of people seem interested and the code as since improved ! PHP has a pretty interesting feature, you can define a callback method to “catch” any error “thrown” in your code. And I’m sure most of you don’t use it. It’s really usefull when you want to make sure to detect error before any user reports it (which can takes time). This is all about avoiding to demolish with some lame errors your “user experience”. ...

February 15, 2009 · Florent Clairambault

Insert SVN version and Build number in your C# AssemblyInfo file

Software version number is quite important. It helps you track what versions have your users when they report something. And when it’s linked to an SVN version number, it’s even better. Well, with MSBuild Community Task, you can easily automatically generate smart version numbers, you have to: Download MSBuildCommunityTasks Make sure your “svn.exe” binary is in C:\program files\subversion\bin Add this at the end of your .csproject file : 2011-07-02 update: As given in Markus comment, this code is a much better option: ...

February 3, 2009 · Florent Clairambault

Writing in English

I’ve decided to start writing about my technical work and projects in English. While I’m comfortable reading English, I want to improve my writing skills. Feel free to provide feedback in the comments. Traduction : Je compte me remettre à écrire mais en anglais pour changer. blr_date: 2010-02-09 bw_readability_score_flesch: 76.5 bw_readability_score_coleman: 8.6 bw_readability_score_gunning: 8.3 bw_readability_score_smog: 6 bw_readability_score_ari: 4.6 bw_word_count: 93

December 27, 2008 · Florent Clairambault

Improving .NET Network Performance with Kernel Events

I recently rebuilt our TCP/UDP network server library to handle high-load scenarios. The initial thread-per-client approach worked but hit memory limits at around 3,000 simultaneous connections. The solution? Kernel events. Using IOCP (Windows), epoll (Linux), and kqueue (FreeBSD), we let the kernel notify our program when new data arrives instead of polling. With a 128-byte pre-allocated buffer and some BeginReceive calls, the changes were minimal. The results exceeded expectations: from a 10,000 connection target, we achieved 60,000 simultaneous connections with near-zero CPU usage and instant response times. This proves Mono/.NET’s capability for high-performance network servers. ...

November 2, 2008 · Florent Clairambault