Posts Tagged “open-source-software”

Follow


Using gists in your blog? Embed them into your feed

  

I love using github gists for code snippets on my blog. It has many pros, especially how easy it becomes for people to comment and suggest improvements, via the github mechanisms we all love.

There are however two drawbacks that people commonly refer to with regards to using gists that way: - Since the content of the code is no longer part of the post, it is not being indexed by search engines, and
- Since the content of the code is not part of the post, and since the embedding mechanism is JS based, people who consume the blog via the feed and use feed aggregators that does not run javascript (most of them don’t), will not get the contents.

My answer to the first one is simple. I don’t really care. Not that I do not care about SEO, just that I do not need to have my post indexed and tagged under a bunch of irrelevant reserved words and common code. If the snippet is about using an interesting component ABC, I will mention that said ABC in the post content outside of the snippet, problem solved.

The latter is more interesting. I used to manually add a link to the gist page whenever embedding one, but it is not a very fun thing to do.

So, in order to overcome this, I wrote a small code snippet (yey) that upon saving a post (or updating it), will look for gists embeds, grab the gist source from github, stick in into the post as a “ContentForFeed” and serve with a link to the gist page, just for the fun of it.

And the code for it (it’s a hacky c#, but easily translatable to other languages, and/or to a cleaner form)

Have fun reading snippets

Windsor 3 is here

  

See the announcement and grab the latest beta bits.

http://groups.google.com/group/castle-project-users/browse_thread/thread/632ef8b47395736b

What’s new?

http://docs.castleproject.org/Default.aspx?Page=Whats-New-In-Windsor-3&NS=Windsor

Major kudos to Krzysztof Koźmic for running the Windsor show so smoothly.

btw – a new design to the castle project website is about to be launched. It looks awesome! I’ll update once its out

Official c# driver for MongoDB from 10gen

  

The announcement is on the users list - http://groups.google.com/group/mongodb-user/browse_thread/thread/62b071549a95dd4a?hl=en

 

Until now the two offerings were Norm and mongo-csharp, both are excellent OSS projects with lots of contributions and very nice velocity. My concern there was always that although there is definitely a place for more than one flavour, as usage patterns and even personal taste differ and pleasing everyone in a single product is impossible (see on rubyland for e.g., – there are MongoMapper, and Mongoid, and there are even some more, less-widespread ones). The major difference is that since the core of the ruby driver is maintained in a single location (and backed by paid-developers thx to 10gen), the things that are the same across (mainly BSON, client-server setup, connection management) are not duplicated, so we get a fully featured, very robust, tested by many core, and it gets out very fast.

On the c# side of things, the implementation of replica-sets in the client took some time to emerge after the official support on the server side was out.

 

So, it is an exciting announcement for the .NET community. I hope that the current drivers will know to adapt the drivers to use the official core.

Can anyone link to a proper download of the latest Stack Overflow dump?

  

Please drop me a line through the comments, email, or whatever. The torrent thing does not work for me I’m afraid

Support Castle Project – one click away !

  

We’re going for a Castle ad on stackoverflow.

 

How can you help? hop on meta.stackoverflow.com at http://bit.ly/9eNHig, and upvote Castle.

 

thx

 

 

huge kudos to Stackoverflow for doing this, and to Mauricio Scheffer for setting us up

What’s new in Monorail 2.0

  

During the long, long time it took to get from 1.0RC3 to 2.0, many things have changed, and many things were added. I probably won’t cover it all in this post, and I’ll probably forget a few things that I got so accustomed to use (I have always used trunk versions, even way before I became a committer).

 

  Programmatic config If (like me) you do not like putting stuff in config files that the operations team do not care about, you can now run a Monorail application without the Monorail section in the web.config file.

How?  you’d need your Global class to implement IMonoRailConfigurationEvents.

e.g. from many of my websites: (I’m configuring AspView as view-engine)

public void Configure(IMonoRailConfiguration configuration) { configuration.ControllersConfig.AddAssembly(Assembly.GetExecutingAssembly()); configuration.ViewEngineConfig.ViewPathRoot = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Views"); configuration.ViewEngineConfig.ViewEngines.Add(new ViewEngineInfo(typeof(AspViewEngine), false)); }

you can setup many optional things that way. e.g.:

// configue jquery as the validation engine configuration.JSGeneratorConfiguration.AddLibrary("jquery-1.2.1", typeof (JQueryGenerator)) .AddExtension(typeof (CommonJSExtension)) .ElementGenerator .AddExtension(typeof (JQueryElementGenerator)) .Done .BrowserValidatorIs(typeof (JQueryValidator)) .SetAsDefault(); // configure url extensions configuration.UrlConfig.UseExtensions = false;

delve into the intellisense on the IMonoRailConfiguration interface to find more

  Return binders The example speaks for itself:

``` public class State { public string Code { get; set; } }

[return: JSONReturnBinder] public State[] GetStates() { // fake code for the sake of the demonstration return new[] { new State { Code=“CA” }, new State { Code=“WA” } }; } ```

will render the JSON representation of the given State array

  New routing engine see http://www.castleproject.org/monorail/documentation/trunk/advanced/routing.html

and http://kenegozi.com/blog/2009/02/10/monorail-routing-and-the-homepage-routing-rule.aspx for setting a homepage route

  RescueController A rescue controller will take care of exceptions that have happened during an Action.

You’d create your rescue controller, implement IRescueController, inherit from SmartDispatcherController, and setup the rescue controller in the RescueAttribute on the regular controller.

see more here: http://www.castleproject.org/monorail/documentation/trunk/usersguide/rescues.html

  AspView The C# based view engine became a first class citizen in Monorail. There has been many improvements there during the time, which deserve a separate post perhaps. meanwhile you can look at the aspview tag on this blog: http://kenegozi.com/blog/Tag/aspview.aspx

 

I can’t think of more stuff right now, so ping me if I forgot anything.

Monorail 2.0 – why the hell did it take so long

  

Being an Open Source project, with very good test coverage and a very active development, most users that actually run Castle bits in production were running off of trunk anyway.

 

The trunk is very stable, and the act of “release” should have simply been tagging any single commit to trunk as the 2.0 RTM.

 

However, we felt that we wanted some more stuff to justify a release – like updating the documentation, re-doing samples and Visual Studio integration packages, etc.

That lead us to a halt, as active committers did not use neither integrations nor samples, and same for the documentation. My personal stand was (and still is) that if someone wanted an official release so badly, then that one should contribute toward this, either with time and work, or with sponsorship money to buy this time and work.

 

No one did.

 

A few attempts at these parts was taken, but none concluded.

 

Meanwhile the project grew more and more, and parts of it became mandatory dependencies to various mainstream projects (such as NHibernate), while Windsor became more and more adopted as an IoC container of choice for many people.

Getting to a single point of approval across the board for the whole castle stack, without breaking third-party projects that depends on parts of Castle, became very difficult.

  Breaking apart In order to allow a manageable release process, the project was broken down to its parts. Now we have the four main projects, released on their on, with depending projects using compiled releases of the others.

The main projects are:

More details can be found on the projects page of castle’s website

 

An all-trunk builds can be retrieved with the aid of the horn-get project.

  So why is Monorail last? The reason is rather simple. Monorail depends on almost any other part of the stack. It even has subprojects such as ActiveRecord’s DataBinder (ARDataBind) which depends on ActiveRecord, and a WindsorIntegration project which depends on the IoC stack.

As a result we had to wait to get releases for all other projects.

  What’s next? I still have no idea. There are a few discussions going on about that (such as this one on the new roadmap), and you are all welcome to join the debates.

Monorail 2.0 is out

  

After a long huge wait, finally Monorail 2.0 is out, get yours from  https://sourceforge.net/projects/castleproject/files/

 

HUGE thanks to John Simons and the rest of the Castle project committers, plus the rest of the good people that have supplied us with patches, bug fixes, and whatnot.

 

This move somewhat concludes the move from the old 1.0RC3 release from 2007, to the new releases of the Castle stack about two years afterwards.

 

I’m going to follow up with a couple of “what’s new”, “how-to upgrade” and “why the hell did it take so long” posts soon, so keep watching.

Quick scripting – Boo to the rescue

  

Today I needed to run a SQL script that sat in a 1.4Gb text file.

It includes the schema creation, plus a massive amount of INSERTs, all for a project I need to complete in order to get my Bachelour’s degree from uni. The amount of data is due to the fact the it’s an Advanced DB seminar, and I’m demo-ing DB related stuff, so size matter.

 

Anyway, the script was lacking the “use DBNAME” at it’s top. and since the file was too large to open up in the Management Studio, I wanted to OSQL it. I just needed a way to add the “use” statement at it’s top.

 

Quick and dirty boo script to the rescue (add.boo):

``` import System.IO import System.Text

r = StreamReader(‘openu.sql’) w = StreamWriter(‘new_unicode.sql’, false, Encoding.Unicode) w.WriteLine(‘use openuni’) l = r.ReadLine() while (l != null): w.WriteLine(l) l = r.ReadLine() w.Flush() w.Dispose() ```

 

Running it with

booi add.boo

 

And executing with

OSQL -E -i new_unicode.sql

 

Who needs powershell …?

Stuff from the Monorail presentation

  

Here is the promised presentation from the talk I gave yesterday, for the Web Developers Community at Microsoft offices in Ra’anana.

The sources for the demo I showed are hosted on github. If you’re not using git (and you should give it a try if that is the case), you can grab a zip of the latest snapshot from that site (there’s a ‘download’ button). Git is worth using if only for the great service given by github.

http://github.com/kenegozi/monorail-aspview-demo/tree/master

As for the slides - I tried using scribd and SlideShare, both attempts ended up not too well. I’ll try to get a better format later on.

I’d like to thank Noam King, the organiser of the WDC group, for having me as a speaker. I’d also like to thank Damien Guard who have created the Envy Code R font which I used during the presentation.

Monorail usage poll

  

Following my last post, I’ve put up a quick poll for trying to grasp some knowledge about the way people are using (or not using) MonoRail.

It’s not complete, and there will be further polls as I can already think of questions I have for the community, that did not make their way to this poll, and are very important imo.

So, if you care for the future of MonoRail, please do spare some moments to fill in the poll. Be nice and write down your feelings, pain-points and general rants in the text areas. I won’t be offended by anything.

No personal details will be published (at least not deliberately - and I don’t believe anyone will hack into the lousy SQL server it’s stored on).

so, without further ado, I give you the poll:

http://kenegozi.com/monorailpoll.html

Introducing Monorail Project

  

From the mailing list:

… the PMC decided to make a few changes to the Castle Project:- Projects will be split- Each project will have a leader (positions open to any committer)By that we intent to fix our release debt. as having each project running individually allow us to release and document each one of them without dragging/waiting for others.

We still haven’t decided how to solve dependencies and such, but with time I’m certain we’ll be able to come up with solution that will benefit the community.

ah, and I have been the one appointed as Project Leader for Monorail.

Quoting again from the mailing list:
We would expect from the leaders to oversee the development (near and long term), set up goals, roadmaps, coordinate the documentation effort and release it.

So my main effort now will be to push a Monorail 1.0 RTM release out of the door. There are many things that need be done before this comes true as in terms of the non-code aspects (like docs, wizards, etc.), Monorail is not as ready as ActiveRecord for example.

I will be posting some specific requests for help on the various tasks that will need to be done. I hope that with the aid of the community, we will have a release soon-ish.

Single and looking

  

explanation (before the wife kills me): I have some free time in the coming months, so I’m looking for interesting consulting gigs.

So, if you’re in a company / dev team, and looking for some help with Castle (Windsor, MonoRail), NHibernate, or general information system design and architecture advices or training, setting up build and test environments, or any other of the things I rant about in this blog, then I’m your guy.

I also do web-client ninja work, dancing the crazy css/html/javascript tango (jQuery: yes, Ms-Ajax: no)

I currently live in Israel, but I’m fine with going abroad for short terms if you’re an off-shore client.

you can contact me at “ken@kenegozi.com”

OSS Licensing - terms and concepts

  

This is the first post on open source software licensing series. you can find the primer here.

I’ll start with covering the concepts that I’ll use in the following posts:

OSI (Open_Source_Initiative) A bunch of dudes who deal with the approval of open source licenses, according to their …http://en.wikipedia.org/wiki/Open_Source_Initiative

The use of OSI Approved licenses is advocated, in order to simplify the whole OSS licensing things.

OSD (Open Source Definition) Look at the linked wiki page. In short, any license that conforms to the principals in this definition is considered an open source licensehttp://en.wikipedia.org/wiki/Open_Source_Definition

Copyleft A license that requires any code that uses it’s covered software, to also apply the same (or similar) license. Also known as “Viral licensing”.

http://en.wikipedia.org/wiki/CopyleftThere are different flavours of Copyleft:

Strong Copyleft Every thing that’s using the software, either in binary or source form, becomes infected. Say you write application A, and reference dll B which is licenses with a Strong Copyleft license, then your application A must retain the same license as B.The only way to avoid being infected is to use the library without linking, such as by calling it through a command line call and parsing the output, or calling the library as an external service through web etc.Example for a Strong Copyleft license: GPL Weak Copyleft Only derivative works must retain the same license. Normally you should be able to reference a binary of a Week Copyleft licensed library, and use your license of choice (as “Code that uses the library”)Examples for Weak Copyleft licenses: LGPL, MPL (Mozilla Public License), Ms-PL (Microsoft Public License)

Non-Copyleft licenses that are not viral, thus are not infecting a client code using them.Examples: BSD (Berkeley Software Distribution), MIT and ASL (Apache Software License)

GPL compatibility Since GPL is a Strong Copyleft license, it requires that every code which uses a GPL-ed library must become GPL. The obvious thing here is that a software without any open-source distribution cannot be used in a GPL-ed library. There are even some open source licenses that cannot be used with GPL due to restrictions in their licenses. Any open source license that allow licensed software to be used with GPL (that is - to be re-licensed as GPL) is said to be “GPL Compatible”

An example for a non GPL compatible OSS license is IBM’s CPL

On Open Source Software Licensing

  

I happened to discuss Open Source licensing with a few peers lately, and being an active OSS user and committer, they’ve asked me to write down my take on the matter.

It took me a little while to get down to it, but like many other things, doing stuff incrementally seems to be the best option.

I’ll try to cover the popular licenses. and those I have an opinion about.

disclaimer: I am not a legal advisor. I have never went to any law school, and the opinions in this series is based only on common sense and my ability to read English.

The first post in the series is OSS Licensing - terms and concepts


Follow @kenegozi