Silverlight Blog Sites

 

These are a couple of really good blog site's for Silverlight.

http://timheuer.com/blog/
http://silverlightforbusiness.net

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

WCF Service hosting

When hosting a WCF web service remember to set up a client access policy file. As a Silverlight
call will require this file for security purposes. In iis you just need to add it to the root folder of
the web site.

 Example File

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="*">
        <domain uri="*"/>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

 File Name:  ClientAccessPolicy.xml

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SharePoint User From ID

Finding a user object from a user id.

using (SPSite site = new SPSite("http://localhost/")){ 
    using (SPWeb web = site.AllWebs[0])  {     
    
SPUserCollection userCollect =  web.AllUsers;
     SPUser user = userCollect.GetByID(3);
 
   }
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Search AD by Email

This code snippet allows you to search Active Directory for a given email address and
returns you the coresponding user object.  

String email = testUser@dev.lan; 

DirectoryEntry LdapConnection = new DirectoryEntry(); 
DirectorySearcher search = new DirectorySearcher(LdapConnection); 
search.SearchScope = SearchScope.Subtree; search.Filter = "(proxyaddresses=smtp:" + email + ")"; 
SearchResult result = search.FindOne();  

if
(result != null)
  { 
DirectoryEntry deDirEnt = result.GetDirectoryEntry();
  
Console.WriteLine("Address Found");
 
DirectoryEntry d = deDirEnt.SchemaEntry;
 
}
  else  { 
Console.WriteLine("Address not found!");
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Send Email Using SharePoint

By using the SPUtility class you can send emails from within SharePoint. The class
will take your default SharePoint email settings and send the email. 

bool sent = SPUtility.SendEmail(<WEB>, false, false, <EMAILADRESS>, <TITLE>, <BODY>);

Currently rated 3.0 by 1 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Ajax Partial Rendering

When programming a web application you should consider partial rendering as the middle ground to fully fledged Ajax apps. My personal opinion is that Ajax makes life a lot easier for the user and here
I am going to show you how to add Ajax partial page rendering.

ScriptManager
The script manager manages all client side scripts that Ajax uses. By adding the script manager control to your web page you are adding the scripts that are needed to support Ajax.
These scripts are used to support partial rendering and the script manager takes care of the partial rendering cycle for you using these scripts.


Note:
You can only have one script manager to a page if you wish to add script to the same script manger use the ScriptManagerProxy.

UpdatePanel
Update panel is a section that gets updated when any of its controls cause a post back. You can have multiple update panels.

Partial Rendering
Partial rendering is when an event is fired from an update panel registered control. The script manager will take over from the post back life cycle at a
certain stage and use the xmlhttpRequest object to execute and retrieve data from the server side and display that data in the update panel area by using DOM or DHTML.
So the entire page is not being posted back and the user just experiences an asynchronous update.

XMLHttpRequest example

var request = new XMLHttpRequest();
request.open("GET", url, false);
request.send(null);
if (!request.getResponseHeader("Date")) {
    var cached = request;
    request = new XMLHttpRequest();
    var ifModifiedSince = cached.getResponseHeader("Last-Modified");
    ifModifiedSince = (ifModifiedSince) ?
      ifModifiedSince : new Date(0); // January 1, 1970
    request.open("GET", url, false);
    request.setRequestHeader("If-Modified-Since", ifModifiedSince);
    request.send("");
    if (request.status == 304) {
        request = cached;
    }
}


Partial Rendering Example
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
   
</ContentTemplate>
</asp:UpdatePanel>

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SubSonic Grid Generator


SubSonic provides a tool that enables the user to auto generate grids with editable forms.
These tools are amazing please take a look.

http://www.codeplex.com/subsonic

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

MOSS Query

Found an amazing tool to build queries for MOSS.

http://www.codeplex.com/SharePointSearchServ/

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Opensource CMS is better?

On more than one occassion, I get into argument with people supporting OpenSource / FSF software. Its not that I do not approve of Free software.. on the other hand I am quite an enthusiastic supporter of sites such as SourceForge, CodeProject, CodePlex and Google Code. Its the attitude of the people I talk with, that gets to me... they seem to think that just because the software is free, it is automatically better than any paid software. Worse are the allegations that because the code is community supported, it automatically makes them more stable and robust. One such similar debate that I recently had was a comparision of Sharepoint with an Open Source CMS. The person's theory was that many corporations were now using this product, it automatically made the product the best choice. I am yet to see a major corporation to completely replace their commercial software with open source alternatives. Open source is an attractive solution to small scale businesses whose budget is highly constrained. Even if that were the case, in this particular argument it had no strength simply because comparing an Open Source CMS with Sharepoint is jus plain wrong. While sharepoint can perform the duties of a CMS (and quite reliablely I might add) it is much more than just a CMS. Sharepoint is a set of services or rather a framework of services which are designed to perform a number of tasks including that of a CMS. An OpenSource CMS, or atleast the ones I have had the opportunity of seeing are more user oriented in terms of their backend administration. They have a clean and easy to use backend to simplify things for an administrator who doesn't have any experience in dealing with code and such complexities. Sharepoint on the other hand is more like clay .. you can mould it into whatever you want. You can even develop a user friendly administrative backend for a custom web service that you have just developed. You can integrate your existing services with more Microsoft products such as Dynamics and manage all your Microsoft Office documents. Can any other open source CMS claim to do all of this? I haven't seen one yet. Sharepoint Services also consists of Search Server, which allows you to build your very own personalized search engine for documents and such.  

Furthermore support is a major issue in open source software. If something goes wrong, then there is no single place where you can go to resolve the issue. With microsoft, all it takes is one single email for help to their support help desk. Many people claim that there are one too many bugs with Microsoft products. Again, if there is a bug, Microsoft promptly issues a fix to the problem. With the open source community there is no set deadline for fixing issues. The developer might be on an idefinite hiatus from development while you are stuck with a broken service/product which is affecting your clients or your own business. Atleast with Microsoft most of the bugs are documented. With open source software there might be issues which have been found but no one has reported yet. If there is a bug in a service I am making use if, I would atleast like to know that is exists so that I can possibly work around it while a fix is being developed.. with open source there is no such possibility unless the developers can come up with a fix or a solution to workaround the problem. Sure other contributors can make suggestions, but how do you trust an uncertified unknown stranger giving you advice to fix a critical service instrumental to your business or to your customer?

 I am not trying to say OpenSource software is not good enough. I am just trying to say that a comparision between an open source CMS and sharepoint is really not fair since Sharepoint is so much more than just a simple CMS. Its purpose is so much more different than that of a CMS.  They both have their advantages and their disadvantages and they are more or less suited to rather specific situations in my opinion. 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Secrets

We all have secrets at one point of time or the other in our lives. And now we use computers to hide these secrets of ours. As encrypted files protected with passwords, hidden drives, pen drives. Cryptography seems to have made things so much more easier. Its strange than whenever someone says cryptography, everyone thinks of a modern computer with scrolling lines of codes and cryptic passwords...the truth is, cryptography has been around us for thousands of years. Atbash and Caesar's algorithms are two of the more famous examples. These are simple substitution and transpositional algorithms.

Cryptography was used extensively during World War II, with a plethora of code and cipher systems fielded by the nations involved. In addition, the theoretical and practical aspects of cryptanalysis, or codebreaking, was much advanced. Probably the most important cryptographic event of the war was the successful decryption by the Allies of the German "Enigma" Cipher. The first complete break into Enigma was accomplished by Poland around 1932; the techniques and insights used were passed to the French and British Allies just before the outbreak of the War in 1939. They were substantially improved by British efforts at the Bletchley Park research station during the War. Decryption of the Enigma Cipher allowed the Allies to read important parts of German radio traffic on important networks and was an invaluable source of military intelligence throughout the War. Intelligence from this source (and other high level sources, including the Fish cyphers) was eventually called Ultra. A similar break into an important Japanese cypher (PURPLE) by the US Army Signals Intelligence Service started before the US entered the War. Product from this source was called MAGIC. It was the highest security Japanese diplomatic cypher. For Japanese Naval cyphers see JN-25.

Modern computers have given us the ability to come up with more complex methods of encrypting data. Blowfish, DES/3DES, AES are examples of some of the encryption methods which are in use today. Quantum cryptography has gained popularity in the recent past few months. Quantum cryptography, or quantum key distribution (QKD), uses quantum mechanics to guarantee secure communication. It enables two parties to produce a shared random bit string known only to them, which can be used as a key to encrypt and decrypt messages.

An important and unique property of quantum cryptography is the ability of the two communicating users to detect the presence of any third party trying to gain knowledge of the key. This results from a fundamental part of quantum mechanics: the process of measuring a quantum system in general disturbs the system. A third party trying to eavesdrop on the key must in some way measure it, thus introducing detectable anomalies. By using quantum superpositions or quantum entanglement and transmitting information in quantum states, a communication system can be implemented which detects eavesdropping. If the level of eavesdropping is below a certain threshold a key can be produced which is guaranteed as secure (i.e. the eavesdropper has no information about), otherwise no secure key is possible and communication is aborted. The security of quantum cryptography relies on the foundations of quantum mechanics, in contrast to traditional public key cryptography which relies on the computational difficulty of certain mathematical functions, and cannot provide any indication of eavesdropping or guarantee of key security. Quantum cryptography is only used to produce and distribute a key, not to transmit any message data. This key can then be used with any chosen encryption algorithm to encrypt (and decrypt) a message, which can then be transmitted over a standard communication channel. The algorithm most commonly associated with QKD is the one-time pad, as it is provably secure when used with a secret, random key.

However we are decades away from an actual implemention of quantum cryptography in real life. But for now, there is way to simulate a quantum key distribution network using the .NET framerwork. Further information can be found here

http://info.fernandolucas.es/drupal/node/12

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

 

Dilbert of the day