Wednesday, March 25, 2009

Application for Job Sample

Mr. [Name],
[Designation],
[Organization  Name],
[Address]

 

Dear Sir,

I am very pleased to respond to your advertisement for a [Post Name] as advertised in [NewsPaper Name] on the [Publish Date]. As you will note from my enclosed resume, I have experience with a wide range of programming languages through academic projects and employment.

I have demonstrated excellent people skills in addition to strong writing and analytical skills. I believe my education, skills and experiences fit your requirements, and I am confident my skills would be an asset to your Organization.

I am available to meet with you at a time that's convenient to you. Please contact me to set up a time. I look forward to hear from you soon.

Sincerely,

 

[Applicant name]

[Applicant Address]

Mob #[00000000]




modify the above applicaation according to your post and experience.


Tuesday, March 24, 2009

Encrypting QueryStrings with .NET

Once upon a time in the tech world, obscurity was security - this being most true in the early years of the industry, when there were gaping holes in privacy policies and confidential client information was bandied about from site to site without a care as to who actually could read the information.

With the new Cryptography classes in .NET, there's absolutely no excuse for not hiding even the most innocuous user data. If you ever need to 'piggy-back' information from one web page to another, whether it is within a POST or a GET parameter, you're passing clear information that anyone can sniff - and that's a bad thing.

If you're not going to use a session variable for storing end user information, you're most likely going to keep some sort of State by passing the information to a cookie or push it around with GET/POST parameters. If you're passing around any sort of ID or user information like their name, it's better to err on the side of caution and encrypt the information.

GET Vs. POST

A POST parameter keeps the information out of the URL, but it can still be sniffed quite easily as it passes in clear text across your network or the Internet. Using POST will keep the mere curious at bay, as the information is not contained in the URL - but this will not stop someone determined to snag out your data.

A QueryString parameter passes information within the site's URL. Why would you even use a QueryString? Well, maybe you need to let your user bookmark a particular page, or maybe you have to refer directly to a page in a URL via a link - you can't do either if you're using POST. A QueryString puts data in the URL for the entire world to see, so if you don't know if the end user is malicious, I'd think hard about using a QueryString for anything but site-related information.

Be smart and encrypt any and all data you're moving around from page to page, especially if that information could be used maliciously. You may trust your users, but you still need that extra level of security that clear text GET/POST data doesn't provide.

Imagine this scenario - you've been passing the customer's ID in the database around in a QueryString, in a URL that looks like this:

http://yoursite.com?cust_id=29

You know what a user is going to do? Switch that 29 to a 30 or 12 or some other number, and if you're not checking for invalid requests, you'll be dishing up some other customer's data.

Enter Encryption

What I was looking for was a quick way to encrypt and decrypt parts of a QueryString - it had to be on the fly, quick and dirty.

I chose Base64 because it wouldn't throw bizarre characters in my QueryString that I couldn't pass around… Little did I know that I'd hit a snag while passing around my encrypted QueryString - Apparently, the Request.QueryString object interprets the '+' sign as a space! So, with a quick Replace function slapped on my decrypt string, no harm, no foul.

Symmetric Key

The whole trick to this working is that the QueryString is encrypted and decrypted with the same private key. This is the secret key - if anyone gets a hold of your key, they can decrypt the data themselves, so keep it a secret!

We're going to use a hard-to-crack 8 byte key, !#$a54?3, to keep parts of our QueryString secret.

Let's Walk through the C# portion of the code:

Notice our two functions that abstract the dirty work that our Encryption64 class. The first, encryptQueryString, is used to encrypt the value of a QueryString. The second, decryptQueryString, is used to decrypt the value of an encrypted QueryString.

public string encryptQueryString(string strQueryString) {     ExtractAndSerialize.Encryption64 oES =          new ExtractAndSerialize.Encryption64();     return oES.Encrypt(strQueryString,"!#$a54?3"); }  public string decryptQueryString(string strQueryString) {     ExtractAndSerialize.Encryption64 oES =          new ExtractAndSerialize.Encryption64();     return oES.Decrypt(strQueryString,"!#$a54?3"); } 

If we wanted to encrypt our QueryString on our first page, we could do something like this:

string strValues = "search term"; string strURL = "http://yoursite.com?search="      + encryptQueryString(strValues); Response.Redirect(strURL); 

Inside our code-behind in our second page, we pass the contents our QueryString to a variable named strScramble. After that, we replace the '+' signs that our wonderful Request.QueryString has replaced with a space. We pass that string into our function, decryptQueryString, and retrieve the decrypted string.

string strScramble =  Request.QueryString["search"]; string strdeCrypt = decryptQueryString(     strScramble.Replace(" ", "+"));

Now we've decrypted the value of the QueryString, 'search', and we can do whatever we want with it. The end user is going to see a URL that looks like:

http://yoursite.com?search=da00992Lo39+343dw

They'll never be able guess what's going on in your QueryString, and if they try to fool around with it, there's no way to crack the code without knowing the Symmetric key. 

SQL SERVER - UDF - Get the Day of the Week Function

The day of the week can be retrieved in SQL Server by using the DatePart function. The value returned by function is between 1 (Sunday) and 7 (Saturday). To convert this to a string representing the day of the week, use a CASE statement.
Create  FUNCTION [dbo].[DayOfWeek](@dtDate DATETIME)
RETURNS VARCHAR(10)
AS
BEGIN
DECLARE @rtDayofWeek VARCHAR(10)
DECLARE @weekDay int
--Here I have subtracted 7 For keeping Sunday as the First day
-- like wise for Monday we need to subtract 2 and so on
set @weekDay = (Select ((DatePart(dw,@dtDate)+@@DATEFIRST-7)%7)) 

SELECT @rtDayofWeek = CASE @weekDay
WHEN 1 THEN 'Sunday'
WHEN 2 THEN 'Monday'
WHEN 3 THEN 'Tuesday'
WHEN 4 THEN 'Wednesday'
WHEN 5 THEN 'Thursday'
WHEN 6 THEN 'Friday'
WHEN 0 THEN 'Saturday'
END
RETURN (@rtDayofWeek)
END

SQL SERVER - Simple Use of Cursor to Print All Stored Procedures of Database

This task can be done many ways, however, this is also interesting method.

USE AdventureWorks
GO
DECLARE @procName VARCHAR(100)
DECLARE @getprocName CURSOR
SET 
@getprocName = CURSOR FOR
SELECT 
s.name
FROM sysobjects s
WHERE type ‘P’
OPEN @getprocName
FETCH NEXT
FROM @getprocName INTO @procName
WHILE @@FETCH_STATUS 0
BEGIN
EXEC 
sp_HelpText @procName
FETCH NEXT
FROM @getprocName INTO @procName
END
CLOSE 
@getprocName
DEALLOCATE @getprocName
GO

Just give this script a try and it will print text of all the SP in your database. If you are using Grid View for Result Pan I suggest to change it to Text View (CTRL+T) to read the text easily.

Reference : Pinal Dave (http://blog.SQLAuthority.com)

300 PhD positions at INRIA France

300 PhD positions available in 2009INRIA, France

A number of PhD Postions are open at INRIA for the young scientists in one of its research teams. Priority will be given to candidates with mobility background and to topics pertaining to the Institute's priority themes. You can apply if you have a degree in computer science, automatic control or scientific computing equivalent to the French research master.

Deadline : 04 May 2009

INRIA is at the leading edge of research and its scientific themes are innovative. You can meet there scientists of international stature or work with them. Novel ideas are considered with interest. INRIA maintains special relations with industry and fosters the emergence of startups founded by its research scientists (80 such companies founded in 20 years). At least 80 different nationalities are present at INRIA and activities are regularly organized in order to ease the integration of newcomers. The ambiance is relaxed and everyone can contribute to the social life of the community.

The details of the open PhD positions are available on INRIA website and the procedure to apply is also given on the website. Please follow the link below for further details:http://www.inria.fr/travailler/opportunites/doc.en.html
Discussion on current world issues,Sql Server Articals, donet Articalst