OAuth C# (very) Basic Library

I know it took me a while (sorry) but I had a couple things on my plate.

At first I wanted to release a more complete integration of OAuth within ASP.NET, but that will have to wait to the next time frame I can allocate to work on this.

In the meantime, there is some basic C# code in the OAuth code repository which generates the OAuth signature, which is the most complicated thing to implement in the spec (not that it’s that difficult to implement :-) It’s actually quite easy).

To use the C# code, simply do this (based on the samples in the spec):

using OAuth;

OAuthBase oauth = new OAuthBase();

Uri url = new Uri(“http://photos.example.net/photos?file=vacation.jpg&size=original”);

string signature = oauth.GenerateSignature(url, “dpf43f3p2l4k3l03”, “kd94hf93k423kf44”, “nnch734d00sl2jdk”, “pfkkdhi9sl3r4s00”, “GET”, oauth.GenerateTimeStamp(), oauth.GenerateNonce(), OAuthBase.SignatureTypes.HMACSHA1);

After that you can concatenate the relevant query parameters as well as the signature value to the URL and use it.

If you have a different timestamp and/or nonce generation method, you can inherit and override these methods.

If you require a different hashing algorithm other than the default HMAC-SHA1 or the PLAINTEXT (which MUST be used with a secure communication channel such as HTTPS) you can use the “GenerateSignatureBase” method to generate the signature base string and then call “GenerateSignatureUsingHash” passing the signature base and the hash algorithm you are using.

That’s about it. I’ll update when I’ll have some more integrative code.

Google Israel – Where Art Thou in the Development Community?

I know that Google‘s original Googleplex at Mountain View is very active for non googlers. There are frequent open lectures there and they host a bunch of other things like Summer of Code (well, not always host, but sponsor and make sure people know about it) and Google Developer Day (which is happening at 10 different locations worldwide, but NOT in Israel).

I know there are suppose to be two development centers in Israel, one in Haifa (which I know is located in MATAM cause you can see it from road #2 leading from Tel Aviv to Haifa near Intel and Microsoft Haifa) but I have no idea where the other development center in Israel is located, other than the fact that its suppose to be in the Tel Aviv area.

I don’t know how active Google is in the development community in other countries besides the US but I think that Google Israel (and the rest of Google) as well as the rest of the development community in Israel will benefit if they’ll open up a bit and become a major player in the development community.

Microsoft Israel figured this out a long time ago and there are quite a few communities (warning: Hebrew link) that meet once a month. There is also at least one full time Microsoft employee (at least that I know of) that is logistically leading this effort and making sure everyone stay happy and use MS products. I don’t even talk about the big events Microsoft Israel holds at least once a year to show off new things and to educate people about the new technology.

I guess this effort paid off since most of the companies developing in Israel today (and quite a few startups, even in the web 2.0 arena) are using Microsoft technologies and not Open Source products and technologies.

If Google Israel (hopefully the R&D part) will open up a bit and start hosting lectures and events in Israel, the same way the original Googleplex (and possibly other Google centers around the world, I don’t really know) does, the Israeli development community may gain a valuable player that can educate people about the usage of Open Source development environment, products and solutions.

It can become a driving force that can change how the Israeli development community looks and acts.

I’m not saying there is no open source community and activity in Israel. There is quite a few. Heck, even PHP (from v3 I think) is in part Israeli and Zend (the company behind PHP which supports its development) is in Israel. There are more than a few Linux kernel hackers that I know of that contribute on a daily basis to the Linux kernel and other sub systems and more than a few companies that base their products on open source products and give back to the community in the form of patches, fixes and features.

What I am saying is that having a major player that can concentrate the efforts and help cultivate and educate the development community in Israel on things other than Microsoft and Microsoft Technologies can have a major effect on the Israeli development community and there is no better time than now.

If one of you Israeli Googlers are reading this, you are more than welcome to comment or even comment privately directly to me.

Of course, I might be imaging all of this but some quick Google searches didn’t put anything up in an obvious way.

Speaking of development and the development community, since MS already has a development center in Israel (and is creating additional ones besides the one in Haifa) and Google has 2 development centers in Israel, where is Yahoo? I guess that’s something for another post :-)

Yedda Twitter .NET / C# Library

This is a bit of shameless promotion but I think it’s worthwhile never the less :-)

One of the things I did lately on my day job (Yedda) was to integrate it with Twitter (check the integration here and add Yedda as your friend!).

Yedda is all about sharing and us sharing things like code with the rest of the world is no exception.

So, without further due, I’m proud to present the Yedda Twitter .NET / C# Library (you will see that it’s more of wrapper than a library… really ;-) ). The post about it in our Dev Blog is here and the details, source and binary are here.

The code is free as in beer and is provided on a “AS IS” basis.

If you have questions about the library, Twitter, C#, .NET, the API, the meaning of life etc, feel free to ask on Yedda.

Mono hosted inside SecondLife

I just read on the official Linden Blog that they have completed an initial version of hosting Mono within SecondLife.

What they have done is to compile the Linden Scripting Language (LSL) into Intermediate Language (IL) code and they automagically gain all the advantages of the .NET Runtime – Just In Time (JIT) compilation, advanced Garbage Collection and, hopefully, the ability to extend SecondLife with other .NET supported langauges (though that’s a personal wish ;-) having .NET so close to me – my Advanced .NET Debugging blog)

It seems the results are promising:

“The initial figures look good, with Mono executing LSL scripts between 300 and 500 times faster than the current LSL interpreter.”

Mono is an open source implementation of the .NET runtime as well as a C# compiler and some of the .NET Framework stack (including stack of its own free of patents and copyrights). It’s supported on Mac OSX, Linux and Windows, which makes it ideal for SecondLife since these are the 3 major platforms it is used by.
I wonder if they’ll use Mono throughout the SecondLife Viewer, or chose to use/host Microsoft’s .NET Runtime on Windows (which in some senses is far more advanced than Mono but only limited to Windows).

Having SecondLife tied to .NET on Windows will require everyone to get the .NET framework, while Mono can be compiled into (or linked) and be distributed with the normal SecondLife client (though I don’t think that should be a major problem).

Not having to learn yet another scripting language will greatly enhance the ability for everyone to enhance and create a better, more interesting and innovative SecondLife. That’s why it should be very important to be able to extend SecondLife without using LSL and using the full blown power of .NET and all of the .NET supported languages.
I’d be more than willing to help out, if needed (or at least checked into their source repository) :-).

AJAX

Its nice to see that MS has finally concluded that AJAX is a technology that is worthy of getting frameworktized into the .NET Framework :-)

If you don’t want to wait for “Atlas” and you need to use this technology in .NET Framework 1.1 I would like to suggest Ajax.NET written by Michael Schwartz.

It’s well designed and written piece of software which is now even open sourced (Thanks Michael!).

I’m sure MS will borrow a few things from it for “Atlas”.