Monday, February 18, 2013

Choosing the Right Web Programming Model with ASP.NET

Choosing the right Programming model in ASP.NET, sometimes we do it without knowing anything just blindly, sometimes it's depends on our technology(architecture, model) preferences.

But it is always better to choose the right programming model with the evidences. I found a small  video explaining this very briefly, from Microsoft web site..

And this is the video link..

Cheers

Lakmal





Saturday, February 16, 2013

Localized Mobile Note Pad with Google Translation API


This idea is so much related to devices like Mobile phones, Tabs, Pads or may be for PCs and laptops. If you have used any of these devices mentioned, you may already have heard or even used the software application called “Note Pad”. There are different vendors; they provide these note pad applications with different features, Examples Note Pad comes with Windows Operating system, Note Pad++ and etc.
But for all of them, one thing is common that they all have to facilitate to manage (Create and Update) the notes. Even a basic note pad has many cool and advance features these days,
            1.  Line Numbers
            2.  Large Number of Encoding supports
              3. Word Wrapping
4            4. And more


Ok, I just took few minutes to give you a small introduction on Note Pads, but here my point is developing localized Note Pads, Especially for Mobile devices, Tabs, Pads and may be PCs and laptops . Most of our keyboards are English keyboards, but for some languages, they have these devices with localized keyboards, but for most, it’s not yet.
So use local language even with an English key board would be a great feature. But then we will face the problem of how you match English character or a word into the local language character or a word.
Google Translation API is the solution for this and Google is supporting this feature (translation) for large number of languages already and it’s being developing and improving day by day. Most importantly, if you use Google Translation API, then you will get latest translation facilities each time you use it. Means assume that you developed a note pad few months before, for Sinhala Language, and Google made number of updates few days back from today, I mean added few more words and etc, still you get these new words, since you call their Web API directly. If you know bit about Web Protocols; client applications should use the REST in calling this Web API.

To show you example for this, Google has this feature already implemented and hosted in their cloud. For Sinhala Version you can find from this URL - http://www.google.com/intl/si/inputtools/cloud/try/. (Just to make you update, Sinhala is the Language used by Majority of people in the country called Sri Lanka. To know about Sri Lanka, just Google it J. It’s a beautiful county, which you would love to see).



Just imagine, you can give this feature in Mobile, let your customers to send SMSs, Emails, or have notes, publish contents into Social Media in local language though a Mobile Note Pad, that would be great, isn’t it?. Not to wary about someone else has already implemented this or not, just try this with something unique, you will succeed surly. I bet you, most the languages, this has not been done yet. Just check Android Apps, IPhone App store, Windows mobile apps, or any other.

Little bit about Google Translation
Google Translation API is not a free Service, but it’s not very expensive service either. It’s just 20 dollars for 1 M characters. Just check the pricing here.


Cheers
Lakmal

Tuesday, February 5, 2013

Signing Assemblies..

Why we need to sign assemblies? hmm there are number of reasons that we need to sign assemblies, but it is not a compulsory task to do.

Signing assemblies make sure authenticity of it. Means once we have an assembly from the third party and assembly is signed, then it is assured we are getting the exactly same one that has been built by the the third party, which we are supposed to get it from. If assembly is not signed then it is not assured that no one has changed the assembly and built it again once it is delivered from the third that we are supposed to have it from.

Even though it is assured the authenticity of the the assemblies, still it is bit slow in loading singed   assemblies. And that force lots of the parties to not to sign assemblies in some scenarios. There are scenarios that we don't need to worry about singing assemblies.

Without singing assemblies we can notdeploy them in Windows GAC and GAC only accepts signed assemblies. So if you are going to deploy any of your assemblies in GAC, make sure you sign them with Strong names.

We know that we sign the assemblies with String Names, what is the meaning of this string named assemblies. Strongly named means that name is globally unique and there will not be one string name for two signed assemblies.

The next question is how .NET platform make sure these strong names for signed assemblies.

String Name = Name Text + Assembly Version + Culture Information + Public Key + Digital Signature

So this equation makes signed assembly's name strong. And these strong names ensure following feature of signed assemblies,


1. Strong names guarantee name uniqueness by relying on unique key pairs. No one can   generate the same assembly name that you can, because an assembly generated with one private key has a different name than an assembly generated with another private key.

2. Strong names protect the version lineage of an assembly. A strong name can ensure that no one can produce a subsequent version of your assembly. Users can be sure that a version of the assembly they are loading comes from the same publisher that created the version the application was built with.

3. Strong names provide a strong integrity check. Passing the .NET Framework security checks guarantees that the contents of the assembly have not been changed since it was built. Note, however, that strong names in and of themselves do not imply a level of trust like that provided, for example, by a digital signature and supporting certificate.

Signing assemblies can be done through Visual Studio or through the command line. But in any case at end of the day we use .NET SDK utilities. If you have already signed assemblies, there you can generate and give or give existing key file while you signing assemblies.

This singing is been done through a Certificate Authority and if you are using the built in Key Generation facility in the Visual Studio then you are using the Windows built in Certificate Authority. But instead of that you can use third party Certificate Authorities like Verizon for sign you assemblies.

Please following links for more information about signing assemblies,

http://msdn.microsoft.com/en-us/magazine/cc163583.aspx
http://msdn.microsoft.com/en-us/library/ms247123(v=vs.80).aspx
http://blog.codingoutloud.com/2010/03/13/three-ways-to-tell-whether-an-assembly-dl-is-strong-named/
http://msdn.microsoft.com/en-us/library/xc31ft41.aspx
http://msdn.microsoft.com/en-us/library/bb385180.aspx
http://stackoverflow.com/questions/3975723/c-why-sign-an-assembly
http://stackoverflow.com/questions/1197133/anything-wrong-with-not-signing-a-net-assembly
http://stackoverflow.com/questions/4725246/signing-net-assemblies?lq=1