D language

This is just a very short post about this language I recently discovered : the D language. As described on its little website : “D is a systems programming language. Its focus is on combining the power and high performance of C and C++ with the programmer productivity of modern languages like Ruby and Python. Special attention is given to the needs of quality assurance, documentation, management, portability and reliability.”. It has most of the features of the java and the C# (best language ever), but it is fully compiled (no JVM or JIT stuff). ...

February 25, 2010 · Florent Clairambault

SPSecurity.RunWithElevatedPrivileges

If like me you’re wondering what exactly does SPSecurity.RunWithElevatedPrivileges, this is what I understand of it : SPSecurity.RunWithElevatedPrivileges( () => { using( var newSite = new SPSite( site.Url ) ) { // your stuff } }); Is equivalent to : using( var newSite = new SPSite( site.Url, site.SystemAccount.Token ) ) { // your stuff } So if this is just to open an elevated privilege SPSite, it will be equivalent. But if you do some more complex things, as soon as you load a new SPSite it will open it with the original UserToken. And you lose…

February 22, 2010 · Florent Clairambault

C# .Net : How works automatic assembly versioning

When you choose to automatically generate a new version of your assembly at compilation, you have to set in the AssemblyInfo.cs file, this line : // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.*")] But what do these automatically generated numbers mean ? Well, chances are you don’t care. But one day after using this features for years I decided that I would. ...

February 21, 2010 · Florent Clairambault

Threads and Sharepoint

When you are using threads on sharepoint, you should take care of some little things : The method used to launch the thread must have the “[STAThread]” attribute, it avoids some huge memory leaks. If you need to use an SPSite from the calling site, you should copy its URL and UserToken to build a new SPSite in the new thread. If you’re not using that “design pattern”, things will get really wrong. And of course you should dispose any sharepoint SPSite (SPWebs come from SPSite) allocated within the thread.

February 20, 2010 · Florent Clairambault

FBSL – Freestyle Basic Script Language

I met Gerôme Guillemin at work (well yes his personal page is totally outdated, he now has long hairs). He invented and supported FBSL, its surrounding development tools and some sample programs. What is quite amazing with this script language is that it only requires a simple 450 KB exe file to run the FSBL scripts and all scripts perform very well (even with the OpenGL samples). The executed programs look like they are some native Win32 applications. I’d say it’s the perfect language for basic style languages addicted programmers. ...

February 18, 2010 · Florent Clairambault

Rue Du Fric

_ For my english readers, you’re out of luck, this is a french-only post because it’s about a french online game : Rue Du Fric (can be translated to “street of money”, or maybe “street of gold”). But you can still have a look at the game if you’re interested. _ Le jeu Rue Du Fric développé par la jeune startup BeeMoov est un jeu 100% javascript + AJAX. Il est très bien fini, il repose sur un univers extensible “à l’infini” au fur et à mesure de l’arrivée de nouveaux joueurs et de l’occupation des sols. Vous pouvez acheter du terrain, placer des maisons dessus, gagner de l’argent, vendre et acheter des biens aux membres ou aux enchères, emprunter de l’argent à la banque et tout ça en interagissant en continu avec les autres. ...

February 16, 2010 · Florent Clairambault

Dirty WordPress APC caching

One or two weeks ago, I made a simple AB benchmarking test on a PHP site I built, it was ok. Then I did the same test on this blog and well… It was freaking slow… On 100 pages with 10 concurrent access, it took 3.5 to 10s to render. Well, I thought I should remove all these plugins I installed to make me and my blog famous (they didn’t perform well). It reduced the generation time by something like 100 ms. ...

February 13, 2010 · Florent Clairambault

WordPress with APC

I updated APC from 3.0 to 3.1 because it totally locked my webserver, it was making it accept HTTP connection but never give any reply. I had some problem accessing the WordPress 3.0 (latest SVN version) admin interface after that upgrade : Fatal error: Call to undefined function wp_dashboard_setup() in /home/sites/clairambault.fr/florent/wp-admin/index.php on line 15 the bad line is : require_once(ABSPATH . 'wp-admin/includes/dashboard.php'); I just found out here it was because I activated APC with the “apc.include_once_override” option set to 1. If you encounter the same problem, just set it to 0 or change the include by something without the ABSPATH constant like for instance : ...

February 12, 2010 · Florent Clairambault

Add a circle overlay to Google Maps API v3

There’s a better alternative : Demo Documentation I only leave the code as it is for people interested in extending the google maps javascript framework. As you might not know, google doesn’t give a circle overlay with its Google Maps API. With the V2 version, someone published it. As it wasn’t available anywhere (at least I could not find it), here is the V3 version of this app. For my little tests, I added some methods : setCenter, setCircleRadius, ...

February 9, 2010 · Florent Clairambault

Redirect port on Linux

Sometimes, you just need to redirect a port on Linux. The solution I could find is to add an entry into xinetd. Here is a sample /etc/xinetd.d file I have, it just redirects the 587 (tcp) port to the 993 port of gmail’s servers. I have to do this because Virgin Mobile France blocks the 993 tcp port. If you’re in the same situation, you can use my server to access you gmail IMAP access. You just have to set the server name to “webingenia.com” and the port to “587”. ...

February 8, 2010 · Florent Clairambault