Shashwat's profile Shashwat Chan...PhotosBlogListsMore Tools Help

Shashwat Chandra

Occupation
Location
[Microsoft Certified Proffesional Developer]

I am a dedicated Microsoft Proffesional
The views expressed on this weblog are mine and do not necessarily reflect the views of my employer.
Thanks for visiting! Do give some comments.
Please wait...
Sorry, the comment you entered is too long. Please shorten it.
You didn't enter anything. Please try again.
Sorry, we can't add your comment right now. Please try again later.
To add a comment, you need permission from your parent. Ask for permission
Your parent has turned off comments.
Sorry, we can't delete your comment right now. Please try again later.
You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
Complete the security check below to finish leaving your comment.
The characters you type in the security check must match the characters in the picture or audio.
No namewrote:
I admire Shash's knowledge in his domain. he has shown his abilties in past and proved that he is a big achiever.
I wish him all the success. Keep it up buddy
Oct. 11
No namewrote:
Shash has struggled a lot for good knowledge but finally he is the source for all now. The information here is very useful. Just give yourself time to read it.
 
Thanks
Manish
Oct. 10

My Search Engine

Photo 1 of 8
More albums (1)

Shashwat Chandra

June 07

SPUtility.SendEmail vs. SmtpClient.Send

When there is requirement  to send email in SharePoint , developers usually use

                           

                          Microsoft.SharePoint.Utilities.SPUtility.SendEmail(web, false, false, emailId, MailSubject, htmlBody);

 

due to the fact that this class automatically uses the default SMTP configuration settings of the SharePoint.

                           

Developers avoid using System.Net.Mail.SmtpClient class to send emails because they need to have the SMTP configuration before using this class. However they can use the below code snippet to automatically detect the SMTP settings with the help of SPWebApplication.

 

                            System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();

                            message.IsBodyHtml = true;

                            message.Body = html;

                            message.From = new System.Net.Mail.MailAddress(SPContext.Current.Site.WebApplication.OutboundMailSenderAddress);

                            SPOutboundMailServiceInstance smtpServer = SPContext.Current.Site.WebApplication.OutboundMailServiceInstance;

                            System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(smtpServer.Server.Address);

                            message.To.Add(emailId);

                            message.Subject = "Test";

                            smtp.Send(message);

 

 

A major drawback of using SPUtility.SendEmail is of its character limitation of 2048 per line which strips out the content of the Email after sending while System.Net.Mail.SmtpClient does not have  any such limitation.

December 05

Useful RegEx Patterns

Here is the list of Daily useful regex patterns.
 
Pattern Description Examples Incorrect Correct
^[\w-'\.]{2,128}$ Allows word characters [A-Za-z0-9_], single quote, dash and period must be at least two characters long and less then 128 Username Shashwat!- Shashwat
^.*(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[`~!@\$%\^\&\*\(\)-_\=\+\[\{\]\}\\\|;:',<\.>/?]).*$ The password must be longer and contains at least one uppercase, one lowercase, one numeric, and one symbolic character. Password sh S0hash+wat
^[a-zA-Z-'\.\s]{2,128}$ Allows alphabetical chars, single quote, dash and space must be at least two characters long and caps out at 128 Name, City Name Shashwat! Shashwat,
Shashwat Chandra,
Shashwat K Chandra,
Shashwat k’ Chandra
 
\d{1,3}.?\d{0,3}\s[a-zA-Z]{2,30}(\s[a-zA-Z]{ 2,15})?([#\.0-9a-zA-Z]*)? A Series of digits (Potentially containing punctuation), followed by the series of characters representing the street name and then potentially a type of street and unit number  Address 45-50!!! South Lake Road 123 Main St., 
2nd Ave Bell Street,
 45-50 South Lake Road #8
 
^(\d{5}-\d{4}|\d{5}|\d{9})$ Allows 5 digit, 5+4 digit and 9 digit zip codes. Must be at least two characters long and caps out at 128(database size). Zip Code 900341, 90034-1234
^[01]?[- .]?(\([2-9]\d{2}\)|[2-9]\d{2})[-.]?\d{3}[- .]?\d{4}$ Allows phone number of the format: NPA = [2-9][0-8][0-9] Nxx = [2-9][0-9][0-9] Station = [0-9][0-9][0-9][0-9] US Phone Number 617/555/1212 1-617-555-1212, (617) 555-1212
^((4\d{3})|(5[1-5]\d{2})|(6011))-?\d{4}-?\d Optional dashes between group of numbers Credit Card Number, Visa, and Passport Number etc 1234567890 4444-1234-5678-9900
^\d{3}[-]?\d{2}[-]?\d{4}$ Allows SSN's of the format 123-456-7890. Accepts hyphen delimited SSN’s or plain numeric values. SSN 123-456 123-45-6789, 987654321
^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$ Allows common email address that can start with a alphanumeric char and contain word, dash and period characters followed by a domain name meeting the same criteria followed by a alpha suffix between 2 and 9 character lone Email Address shashwat_c@hotmail shashwat_c@hotmail.com
^^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_=]*)?$ Allows HTTP and FTP URL's, domain name must start with alphanumeric and can contain a port number followed by a path containing a standard path character and ending in common file suffixies found in URL's and accounting for potential CGI GET data URL http://= http://shashonline.spaces.live.com
^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ Allows four octets of numbers that contain values between 4 numbers in the IP address to 0-255 and are separated by periods. IP Address 300.300.300.300 192.168.0.1
^[A-Za-z]+$ Allows one or more alphabetical characters. This is a more generic validation function. AlphaText    
^[A-Za-z0-9]+$ Allows one or more alphabetical and/or numeric characters. This is a more generic regex patterns. AlphaNumericText    
/[+-]?\d+(\.\d+)?$ Allows one or more positive or negative, integer or decimal numbers. This is a more generic regex pattern. NumericText    
November 05

Create your own Tabbloid

 
tabbloid-from-hp
 
One way is to help people create more materials that are “print worthy”. Tabbloid from HP is one such project. Tabbloid promises to create a personal magazine out of all your favorite feeds and then deliver it to you as a neat PDF - something that is print-worthy. If a small percentage of people who receive these personal magazines print them, HP would be happy.
 
~ShashLight bulb
 
January 22

.NET Source Code Available for Debugging

The source code for several key .NET libraries is now available for debugging purposes. They are not "open source" in the sense you can do anything you want with them, instead there is a strict "look but don't touch" license known as the Microsoft Reference License. Even still, they should be an immense resource to .NET developers.

Scott Guthrie announced that Microsoft intended to release the .NET source code back in October. Since then we have not heard much with everyone's attention split between Visual Studio 2008 and the various post-release libraries still under development.

The source code is only available via Visual Studio 2008's integrated debugging features, and then only for the paid SKUs. Hobbyists using VS Express or a third-party editor will not be able to download the files.

Once you follow the instructions in Shawn Burke's Blog, stepping through Microsoft's source code is just as easy as looking at you own. You can also look at the source code directly for classes you have already seen, but this requires digging through the symbol cache.

The namespaces included in the initial release are

  • System
  • System.CodeDom
  • System.Collections
  • System.ComponentModel
  • System.Data
  • System.Diagnostics
  • System.Drawing
  • System.Globalization
  • System.IO
  • System.Net
  • System.Reflection
  • System.Runtime
  • System.Security
  • System.Text
  • System.Threading
  • System.Web
  • System.Web.Extensions
  • System.Windows
  • System.Windows.Forms
  • System.Xml
October 18

10 types of techies…

10 types of techies… and how to manage them

 

It’s wrong to stereotype people. It isn’t wrong, however, to recognize classifications of the team members you deal with every day. Many of the types of techies identified below may seem familiar to veteran IT managers. My ideas on how to work effectively with each type follow the descriptions.

This information originally appeared in the article “Tame these 10 types of techies,” by Patrick Andrews.

#1: Human Bottleneck

These techies either demand to do all the coding, or never finish their work, or both. Impress upon them that quality is often the opposite of perfectionism. Also, feed them small, well-defined tasks and praise any competent output that is on schedule.

#2: Bright Green

These straight-out-of-college developers like the new, cool technology. They tend to over-engineer by exploiting all the bells and whistles of the development environment — even when it’s inappropriate. These green techies often rely on their planet-size intellects to help them get back on schedule in predelivery all-nighters. Introduce them to colleagues who recently were Bright Green but learned the hard way to focus on deliverables.

#3: Tried-But-Untested

The mantra of these techies is, “Hey, we’ve got a whole testing team, why should I worry about checking my code?” It’s a guarantee that these specimens will cause you grief, so it’s essential to pull them up short. You’ll be doing them a favor in the long term.

#4: Techno-Babbler

Their code doesn’t work because they “need” something. These techies spend too much time in newsgroups and fail to realize that overusing jargon is not a sign of adulthood. Require these techies to give an acronym-free, from-first-principles explanation of project results to management.

#5: User-Loser

These techies consider many client questions stupid and deem the client worthy of a verbal flame. This often leads to the client not doing business with your company in the future. If your developers have contempt for “suits,” try introducing a “dress-up Wednesday” — and keep them away from outside phone contact.

#6: Task Farmer

As your self-appointed deputy, this type of techie assumes that the project plan is only a guideline and that it’s acceptable for team members to swap roles and tasks without asking you. Clarify that although their suggestions are welcome, you’re the one who carries the weight of the project.

#7: Under the Radar

This colleague has a tendency to generate maximally obscure code. This is usually a way to hide inelegance of implementation and to secure employment by preventing any other developers from working on his or her input. A curative strategy is to make the techie responsible for technical mentoring of a demanding Bright Green team member.

#8: Winging-It Commander

This type of techie’s curriculum vitae says they’re proficient in Java, SQL, and Perl, but their lines of code are sparse and curiously primitive. This techie will also place unusual demands on other team members to help “debug” their deliverables. Projects can’t accommodate this level of on-the-job training. Encourage team members to be honest about their technical comfort zones by offering them appropriate training opportunities.

#9: Prima Donna

These characters simply won’t tackle mundane tasks. And if you suggest that they have to adapt existing code, there’s always a performance of operatic proportions. Make it clear that they’ll work for the technical author for a month if this nonsense persists.

#10: Gender Agenda

Some developers have trouble working for, or even alongside, colleagues of the opposite sex. Challenge their assumptions by introducing them to a cross-section of your most accomplished colleagues.

Project managers don’t have time to conduct therapy sessions in the course of an already-demanding project. All you can do is recognize team members’ specific ongoing issues and ensure that they don’t damage the work in progress.

 

Microsoft Security Content

Loading...Loading...

Microsoft Architecture Center

Loading...Loading...

C# Corner

Loading...Loading...

Infoq

Loading...Loading...
Loading...