Friday, January 7, 2011

Presentation – WCF Duplex Services

My first ever .Net Forum session was on 6th of January 2011. I would like to thank all who participated for that session. I appreciate the support given by Prabath and Wellinton for providing me with this opportunity. Finally I like to extend my gratitude to my team mates at IronOne technologies and my batchmates at UCSC for the encouragement.

1

IMG_0166IMG_0167 IMG_0168 IMG_0169

I hope you would encourage me with comments :)

Friday, February 12, 2010

LINQ with PredicateBuilder

When we query using dynamic linq it is tough to execute statements that contain LIKE keyword. LIKE statements in the StringBuilder (which is input to the LINQ quey as a parameter to the WHERE clause) always gave me errors.

But there is an easy solution provided by LINQKit which can be downloaded from http://www.albahari.com/nutshell/linqkit.aspx.

After referring it from the project you can implement a query with ‘Contains’ as described below

   1: var cusPred = PredicateBuilder.True<CustomerEntity>();
   2: if (!String.IsNullOrEmpty(cust.Name))
   3:     cusPred = cusPred.And(s => s.FirstName.Contains(cust.Name)


then the PredicateBuilder can be input to the linq query as given below
   1: IQueryable<Customer> query = (from c in db.CustomerEntities.Where(cusPred)
   2:                         join p in db.PolicyEntities on c.CustomerID equals p.CustomerID
   3:                         join u in db.UserEntities on p.SOCode equals u.SOCode
   4:                         join us in db.UsersInStructureEntities.Where(str.ToString())
   5:                         on u.UserId equals us.UserId                                                      
   6:                         select new Customer
   7:                                {
   8:                                  CustomerId = c.CustomerID,
   9:                                  FirstName = c.FirstName
  10:                                }).Distinct();
  11:                                                                  

Friday, January 22, 2010

Facebook Typeahead Input

The new fbml version which is 1.1 has included an Ajax Typeahead object as a FBML tag. So it is not necessary to create our own javascript to implement the typeahead object. You can implement the feature using a code like this

   1: <fb:fbml version="1.1">
2:Service Provider :<fb:typeahead-input name="serviceProvider" autocomplete="off" >
   3:     <fb:typeahead-option value="mob" >Mobitel</fb:typeahead-option>
   4:     <fb:typeahead-option value="dia" >Dialog</fb:typeahead-option>
   5:     <fb:typeahead-option value="tig" >Tigo</fb:typeahead-option>
   6:     <fb:typeahead-option value="hut" >Hutch</fb:typeahead-option>
   7:   </fb:typeahead-input>
   8: </fb:fbml>



After adding above code, the resulting input element will be like this

image

Wednesday, January 6, 2010

Disk Cleanup Wizard in Windows 2008

In windows 2008, it seams some basic windows features like disc cleanup wizard are  missing by default. To activate the feature you need to enable the “Desktop Experience” feature from the Server Management in Administrative Tools section

image

Sunday, December 20, 2009

Microsoft Desktop Optimization Pack

Recently I got an opportunity to participate 3 day training on MDOP held by Microsoft. In this post I will provide a brief introduction.

Microsoft Desktop Optimization Pack (MDOP) is a suite of solutions for common IT problems faced by organizations. MDOP consist of six different technologies that simplify the application management process. After the purchase of MDOP license it is possible to consume all of those six technologies and the cost of a CAL is very low.

This is highly recommended to large/medium enterprises where this technology will be a life saver for the IT department and for the enterprise users.

Following are the 6 technologies that form the MDOP suite.

App-V (Microsoft Application Virtualization)

This is the most important product of the MDOP. It has the capability of removing compatibility issues among the applications. As an example, we can’t execute Microsoft Office Word 97 and Microsoft Office Word 2007 together. But using App-v it is possible to achieve that task very easily. The secret behind the technology is that those applications are packaged with the OS components (e.g.: system services and configurations) and they are not shared with other apps in the runtime.

Another great feature of App-V is that it is possible to manage enterprise applications centrally. So application installation, updates and uninstallation can be done centrally.

Furthermore it is possible to create target audiences for the applications so unnecessary applications are not installed.

Another big advantage is that applications are streamed downed from the App-v server (in the first time and only the changes afterwards) and run on the client machine. So a connection to the App-v server is not required to run the application unlike in Terminal services where the application is run on the server.

Med-V (Microsoft Enterprise Desktop Virtualization)

Med-V is used to remove application to operating system compatibility issues. As an example we can’t run IE 6 on Vista. But using Med-V it is still possible to run those legacy applications latest Oss. It is achieved by installing those legacy applications on a VPC and hiding the guest OS background. So users can still see IE 6 on their Vista start menu.

Tuesday, December 2, 2008

Active Directory Membership Provider with Forms Authentication in MOSS 2007

ASP.NET 2.0 Provider model has introduced a set of rich features to store states using a layer of providers . So users are not needed to directly call to databases or active directory. Some of these Providers are SqlMembershipProvider, ActiveDirectoryMembershipProvider, SqlSiteMapProvider ..etc .

The ASP.NET 2.0 Provider model has built in a way that the main functionality of the system is separate from the data sources. It means we can easily change data sources without harming the logic by simply changing providers. ASP.NET Membership Provider works in a similar way where controls like logins and membership service talk to membership data sources through data providers.

MOSS 2007 can use Active Directory as the data source using the ActiveDirectoryMembershipProvider.You can establish forms authentication with AD using the following procedure

in the web.config add following LDAP connection string
   1: < connectionstrings> 
   2: < add connectionstring="LDAP://10.11.12.13/CN=MLEARNINGTEST,
   3:       DC=IRONONEMS" name="ADServices"> 
   4: </connectionstrings> 

After that provide information on the membership provider

   1: < membership defaultprovider="ADProvider"> 
   2:   < providers> 
   3:     < add name="ADProvider" 
   4:       type="System.Web.Security.ActiveDirectoryMembershipProvider, 
   5:       System.Web, Version=2.0.0.0, Culture=neutral,
   6:       PublicKeyToken=b03f5f7f11d50a3a" 
   7:       connectionstringname="ADServices" 
   8:       connectionusername="MLEARNINGTEST\Test" 
   9:       connectionpassword="****"           
  10:       attributemapusername="sAMAccountName"> 
  11:     </add> 
  12:   </providers> 
  13: </membership> 

provide above information in the web.config file of the Central Administration site as well.

Now go to Sharepoint Central Administration to include authentication provider details.

In Application Management section click on Authentication Providers and select the current web application. Click on the default provider and modify the authentication type to be Forms Authentication. Enable anonymous access and give the name of provider as ADProvider which we had entered in the web.config.

After that go to Site Collection Administrators and select the first administrators for the site from the domain specified in the ldap connection string of the ADProvider

This should switch on Forms authentication for your MOSS 2007 web application

Saturday, November 22, 2008

Recover Linux after installing Windows XP

Recently I had to repair windows xp due to some errors. But after the repair i found that i'm unable to log in to Debian because Grub boot loader is missing and instead grub windows boot loader has activated. I did some research and found out following process.

   1: sudo grub

Then grub> will appear

   1: find /boot/grub/stage1 

The reply was (hd0, 8) so i had to use them as parameters in later commands

   1: root (hd0,8) 
   2: setup (hd0) 
   3: quit 

Easy as that .. that did solve my problem