Sunday, December 30, 2012

Visual Studio TODO Comments

Programs are complicated. When in development, many tasks need remembering. We track them in Visual Studio with TODO comments. These comments help organize our projects. We get the interface set up and gain a way to list to-do items in a central place.

Example

TODO comments allow you to tell Visual Studio to maintain a central list of tasks, which it reads from many different places in your code. The Task List is a panel or floating window in Visual Studio that will display all the TODO comments in your project. To open the list, go to View menu > Task List.

You probably have a lot of code that needs a lot of work. If you don't, then you need to write code that needs a lot of work. Here are some examples of TODO lines that Visual Studio will notice and put into its special Task Pane.

Example todo comments    //todo: fix dialog windows  //TODO: work on SQLCE guide  // Todo new screenshot

This will appear in your tasks pane as a separate task. Note that you have some flexibility with these tokens. The strings "todo", "TODO", and "TODO" all work equally well—Visual Studio's parser gives you a little bit of freedom.

Tip: Comments are used only at the source level of your program, not the compiled version of the program. The TODO comments noted here are parsed by Visual Studio in the IDE.

Summary

We looked at TODO comment syntax in the Visual Studio integrated development environment. You can go through your project and put TODO comments everywhere you need to do something. Also, there are a couple other predefined comment tokens you can use, called UNDONE and HACK.

Tip: Experiment and find what suits your style the best, so you can be as productive as possible—or as productive as you want to be.

Ref.:dotnetperls

Friday, December 28, 2012

Append Text in Text file using VB Script


Step 1:Create file in d: drive with name "test.txt"

Step 2:Create VB Script file and put below code in it

'---Code start Here---
Set data="test1"

Set oFSO =CreateObject("Scripting.FileSystemObject")

Set objFileToWrite = oFSO.OpenTextFile("d:\test.txt",8,true) '8 for Append

objFileToWrite.WriteLine(data)

objFileToWrite.Close

Set objFileToWrite = Nothing

'--End Here--


Thursday, December 20, 2012

Five questions every IT candidate needs to be prepared to answer

Interviewing isn't always easy, especially when it comes to technical positions. Interviewers want to know more about you beyond your technical abilities. While questions about your IT skills are inevitable, there are five more types of questions every IT candidate needs to be prepared to answer. Whether you're applying at a company that works with VoIP phones or one that deals with an e-Commerce site, your skills, thought processes, and fit with the company are at the forefront of the interviewer's mind.

1. How did you find out about the job and what about the position interested you?

Knowing how you find the job posting, whether it was through a job board, their direct site or a referral could play a role in their decision-making process. Some companies will favor people who found the position directly (to the company's site direct from typing it in or from Googling the company name) over those who found it on a job board as it could indicate your willingness to work for their specific company versus any company. Don't talk about the great opportunity or how you plan to learn, though those great points. Instead, discuss how you see yourself fitting into this organization and this position, specifically. Specifics are key here.

2. What is the biggest IT challenge you have faced and how did you handle it?

Here, the interviewer is trying to see how you solve problems in a real life situation and the steps you take to resolve situations. If you made mistakes, be honest. Everyone faces a challenge at one point or another.  Explain what you learned from the experience and how the new knowledge has helped you perform better moving forward. Your response to the situation and this question should be reasoned out with data, not emotions.

3. Given this problem (based upon job requirements), what solution would you provide and why?

While this may not be the exact question you're asked, often times recruiters and HR managers who are interviewing for an IT position want to see how you perform under pressure. They want to understand your thought process when it comes to decision-making and problem-solving as well as gain more insight into your technical skills that directly relate to the position. Respond exactly as you would if the problem were right in front of you, noting where you excel and where you may need team collaboration with another member of the tech team.

4. Tell me about a time you knew you were right, but still had to follow directions or guidelines.

In life, it's important to be able to both lead and follow. The workplace is no different. Often times, new IT candidates don't realize the number of people they will need to work with at a company. This question is asked because the interviewer wants to see how well you work with colleagues, clients and managers. Were you able to address the situation at the appropriate time - whether it's over the phone, in a meeting or face-to-face - and did you what needed to be done while staying positive and working with others?

5. What questions do you have for me?

Interviewers shouldn't be doing the majority of the talking–an interview is a conversation. When the interviewer gives you the opportunity to ask a question, be prepared with three to four questions to ask. One or two may have already been covered, so have a few extra handy. Ask a question about the business that ties back to something you came across on their website or in the job posting, the company culture, or their personal experience at the company. Not only do interviews give them a chance to learn more about you, you have the chance to learn more about them.

When applying for a position as a part of an IT team, your technical skills will be talked about. However, they aren't the only thing that matters. Your ability to communicate well, work with others and solve problems are important. While an interview may not incorporate all these questions exactly, chances are you could be asked something similar. Be prepared with stories from your experiences and honest answers that indicate your spot as the best candidate.

Auto Refresh page using HTML Tag

Just Add below tag in “Head” tag  

 <meta content="10;" http-equiv="refresh" >

 

Content: set time in second

 

content

text

Gives the value associated with the http-equiv or name attribute

http-equiv

content-type
default-style
refresh

Provides an HTTP header for the information/value of the content attribute

 

Wednesday, November 14, 2012

The 5 Qualities of Remarkable Bosses



Consistently do these five things and the results you want from your employees--and your business--will follow.

Remarkable bosses aren't great on paper. Great bosses are remarkable based on their actions.

Results are everything—but not the results you might think.

Consistently do these five things and everything else follows. You and your business benefit greatly.

More importantly, so do your employees.

1. Develop every employee. Sure, you can put your primary focus on reaching targets, achieving results, and accomplishing concrete goals—but do that and you put your leadership cart before your achievement horse.

Without great employees, no amount of focus on goals and targets will ever pay off. Employees can only achieve what they are capable of achieving, so it's your job to help all your employees be more capable so they—and your business—can achieve more.

It's your job to provide the training, mentoring, and opportunities your employees need and deserve. When you do, you transform the relatively boring process of reviewing results and tracking performance into something a lot more meaningful for your employees: Progress, improvement, and personal achievement.

So don't worry about reaching performance goals. Spend the bulk of your time developing the skills of your employees and achieving goals will be a natural outcome.

Plus it's a lot more fun.

2. Deal with problems immediately. Nothing kills team morale more quickly than problems that don't get addressed. Interpersonal squabbles, performance issues, feuds between departments... all negatively impact employee motivation and enthusiasm.

And they're distracting, because small problems never go away. Small problems always fester and grow into bigger problems. Plus, when you ignore a problem your employees immediately lose respect for you, and without respect, you can't lead.

Never hope a problem will magically go away, or that someone else will deal with it. Deal with every issue head-on, no matter how small.

3. Rescue your worst employee. Almost every business has at least one employee who has fallen out of grace: Publicly failed to complete a task, lost his cool in a meeting, or just can't seem to keep up. Over time that employee comes to be seen by his peers—and by you—as a weak link.

While that employee may desperately want to "rehabilitate" himself, it's almost impossible. The weight of team disapproval is too heavy for one person to move.

But it's not too heavy for you.

Before you remove your weak link from the chain, put your full effort into trying to rescue that person instead. Say, "John, I know you've been struggling but I also know you're trying. Let's find ways together that can get you where you need to be." Express confidence. Be reassuring. Most of all, tell him you'll be there every step of the way.

Don't relax your standards. Just step up the mentoring and coaching you provide.

If that seems like too much work for too little potential outcome, think of it this way. Your remarkable employees don't need a lot of your time; they're remarkable because they already have these qualities. If you're lucky, you can get a few percentage points of extra performance from them. But a struggling employee has tons of upside; rescue him and you make a tremendous difference.

Granted, sometimes it won't work out. When it doesn't, don't worry about it.  The effort is its own reward.

And occasionally an employee will succeed—and you will have made a tremendous difference in a person's professional and personal life.

Can't beat that.

4. Serve others, not yourself. You can get away with being selfish or self-serving once or twice... but that's it.

Never say or do anything that in any way puts you in the spotlight, however briefly. Never congratulate employees and digress for a few moments to discuss what you did.

If it should go without saying, don't say it. Your glory should always be reflected, never direct.

When employees excel, you and your business excel. When your team succeeds, you and your business succeed. When you rescue a struggling employee and they become remarkable, remember they should be congratulated, not you.

You were just doing your job the way a remarkable boss should.

When you consistently act as if you are less important than your employees—and when you never ask employees to do something you don't do—everyone knows how important you really are.

5. Always remember where you came from. See an autograph seeker blown off by a famous athlete and you might think, "If I was in a similar position I would never do that."

Oops. Actually, you do. To some of your employees, especially new employees, you are at least slightly famous. You're in charge. You're the boss.

That's why an employee who wants to talk about something that seems inconsequential may just want to spend a few moments with you.

When that happens, you have a choice. You can blow the employee off... or you can see the moment for its true importance: A chance to inspire, reassure, motivate, and even give someone hope for greater things in their life. The higher you rise the greater the impact you can make—and the greater your responsibility to make that impact.

In the eyes of his or her employees, a remarkable boss is a star.

Remember where you came from, and be gracious with your stardom.



8 Qualities of Remarkable Employees



Forget good to great. Here's what makes a great employee remarkable.

Great employees are reliable, dependable, proactive, diligent, great leaders and great followers... they possess a wide range of easily-defined—but hard to find—qualities.

A few hit the next level. Some employees are remarkable, possessing qualities that may not appear on performance appraisals but nonetheless make a major impact on performance.

Here are eight qualities of remarkable employees:

1. They ignore job descriptions. The smaller the company, the more important it is that employees can think on their feet, adapt quickly to shifting priorities, and do whatever it takes, regardless of role or position, to get things done.

When a key customer's project is in jeopardy, remarkable employees know without being told there's a problem and jump in without being asked—even if it's not their job.

2. They're eccentric... The best employees are often a little different: quirky, sometimes irreverent, even delighted to be unusual. They seem slightly odd, but in a really good way. Unusual personalities shake things up, make work more fun, and transform a plain-vanilla group into a team with flair and flavor.

People who aren't afraid to be different naturally stretch boundaries and challenge the status quo, and they often come up with the best ideas.

3. But they know when to dial it back. An unusual personality is a lot of fun... until it isn't. When a major challenge pops up or a situation gets stressful, the best employees stop expressing their individuality and fit seamlessly into the team.

Remarkable employees know when to play and when to be serious; when to be irreverent and when to conform; and when to challenge and when to back off. It's a tough balance to strike, but a rare few can walk that fine line with ease.

4. They publicly praise... Praise from a boss feels good. Praise from a peer feels awesome, especially when you look up to that person.

Remarkable employees recognize the contributions of others, especially in group settings where the impact of their words is even greater.

5. And they privately complain. We all want employees to bring issues forward, but some problems are better handled in private. Great employees often get more latitude to bring up controversial subjects in a group setting because their performance allows greater freedom.

Remarkable employees come to you before or after a meeting to discuss a sensitive issue, knowing that bringing it up in a group setting could set off a firestorm.

6. They speak when others won't. Some employees are hesitant to speak up in meetings. Some are even hesitant to speak up privately.

An employee once asked me a question about potential layoffs. After the meeting I said to him, "Why did you ask about that? You already know what's going on." He said, "I do, but a lot of other people don't, and they're afraid to ask. I thought it would help if they heard the answer from you."

Remarkable employees have an innate feel for the issues and concerns of those around them, and step up to ask questions or raise important issues when others hesitate.

7. They like to prove others wrong. Self-motivation often springs from a desire to show that doubters are wrong. The kid without a college degree or the woman who was told she didn't have leadership potential often possess a burning desire to prove other people wrong.

Education, intelligence, talent, and skill are important, but drive is critical. Remarkable employees are driven by something deeper and more personal than just the desire to do a good job.

8. They're always fiddling. Some people are rarely satisfied (I mean that in a good way) and are constantly tinkering with something: Reworking a timeline, adjusting a process, tweaking a workflow.

Great employees follow processes. Remarkable employees find ways to make those processes even better, not only because they are expected to… but because they just can't help it.


9 Daily Habits That Will Make You Happier



These minor changes in your daily routine will make a major difference in your life and career.

Happiness is the only true measure of personal success. Making other people happy is the highest expression of success, but it's almost impossible to make others happy if you're not happy yourself.

With that in mind, here are nine small changes that you can make to your daily routine that, if you're like most people, will immediately increase the amount of happiness in your life:

1. Start each day with expectation.

If there's any big truth about life, it's that it usually lives up to (or down to) your expectations. Therefore, when you rise from bed, make your first thought: "something wonderful is going to happen today." Guess what? You're probably right.

2. Take time to plan and prioritize.

The most common source of stress is the perception that you've got too much work to do.  Rather than obsess about it, pick one thing that, if you get it done today, will move you closer to your highest goal and purpose in life. Then do that first.

3. Give a gift to everyone you meet.

I'm not talking about a formal, wrapped-up present. Your gift can be your smile, a word of thanks or encouragement, a gesture of politeness, even a friendly nod. And never pass beggars without leaving them something. Peace of mind is worth the spare change.

4. Deflect partisan conversations.

Arguments about politics and religion never have a "right" answer but they definitely get people all riled up over things they can't control. When such topics surface, bow out by saying something like: "Thinking about that stuff makes my head hurt."

5. Assume people have good intentions.

Since you can't read minds, you don't really know the "why" behind the "what" that people do. Imputing evil motives to other people's weird behaviors adds extra misery to life, while assuming good intentions leaves you open to reconciliation.

6. Eat high quality food slowly.

Sometimes we can't avoid scarfing something quick to keep us up and running. Even so, at least once a day try to eat something really delicious, like a small chunk of fine cheese or an imported chocolate. Focus on it; taste it; savor it.

7. Let go of your results.

The big enemy of happiness is worry, which comes from focusing on events that are outside your control. Once you've taken action, there's usually nothing more you can do. Focus on the job at hand rather than some weird fantasy of what might happen.

8. Turn off "background" TV.

Many households leave their TVs on as "background noise" while they're doing other things. The entire point of broadcast TV is to make you dissatisfied with your life so that you'll buy more stuff. Why subliminally program yourself to be a mindless consumer?

9. End each day with gratitude.

Just before you go to bed, write down at least one wonderful thing that happened. It might be something as small as a making a child laugh or something as huge as a million dollar deal. Whatever it is, be grateful for that day because it will never come again.



The dangers of accepting a counteroffer

Takeaway: You may think that getting and accepting a counteroffer from your company is flattering. You may have to think again.

It's pretty tempting to think you're quite the valuable commodity when your company offers you a higher salary to keep you from leaving to go work for another company. Not so fast, hot stuff. Here are a couple of things to think about before you accept that offer.

You will be looked on here on out as a bit of a traitor.

Sure, you ultimately decided to stay, but in your company's eyes, you made an effort to find another job. And you might have interviewed on a day you called in sick, or asked to leave early using some excuse.

It may be a little naïve, but to your managers, your loyalty can't be counted on. And if you were just using the other job offer as leverage to get what you wanted from your employer in the first place, it can be construed as a kind of blackmail. People don't tend to forget that kind of thing, especially when promotions opportunities come around.

Money won't solve your problems.

If you began looking for another job because you were unhappy for various reasons, you can be assured that a little bump in salary is not going to make those issues disappear.

You've burned a bridge with the company that wanted to hire you.

If you tell the manager of the second company who was making you an offer that you've decided to stay with your current company, he or she is going to take note. If you pulled the rug out from under them once, they'll be very sure not to give you the opportunity in the future.

Last thoughts

By accepting a counteroffer from your company, you could be changing the dynamics of your relationship forever. And the counteroffer could just be buying time for your company until they can find your replacement–someone they feel will be glad to be where you are.

Tuesday, October 23, 2012

SOLID design principles improve object-oriented development

People who are involved in the more rigorous, formal side of object-oriented (OO) development have a large number of various principles, or lists of principles to guide their development work. Recently, a reader asked me if I could write an article about the SOLID principles, and it seemed like a good idea.

SOLID is a set of five guiding principles that help developers design objects that are easy to maintain and use. Like many similar sets of principles in OO, SOLID is a guide not the goal. Let's take a look at each of the five principles.

S - Single responsibility principle (SRP)

SRP is the idea that objects should do one thing and one thing only. It is tempting to think this means that a class should represent an entire piece of business logic or data, but that is not quite correct. The idea is not to group all of the functionality that is related together, but all of the functionality that achieves the same goal together.

For example, if you have a class representing printer, putting all of the printer operations (getting toner levels, printing a page, getting an error message) in the printer class may make sense, but it is not really the right approach. Instead, you would put all of the functions related to printing in the same class, and all of the functions for reporting status in a class, and so on. You break the work down into small, digestible chunks. The payoff here is that you can make changes to a select piece of functionality without possibly affecting a ton of other items.

O - Open/closed principle (OCP)

This very simple idea is that classes can allow themselves to be extended but not modified. The source code for the original class should only be modified if a bug is found. The reason behind this is that changing the code will mean that everything depending upon it will need to be retested as well.

L - Liskov substitution principle (LSP)

LSP states that the subclass of an object can be used in place of the superclass without changing things like what the program does, whether it compiles, etc. For example, if class "elephant" is a subtype of class "animal," then you should be able to use "elephant" where you use "animal," and the "walk" method will still "walk" (even though the implementation may be different), the "numberOfLegs" property will still return the number of legs (though again, it may be a different number from the base class), the "eat" method will not throw any exceptions that it would not throw in the "animal" class, and so on. It is much easier to make changes and test when you follow LSP.

I - Interface segregation principle (ISP)

ISP dictates that interfaces need to have as little functionality in them as possible. This allows the consumer to only deal with the functionality they are concerned with, which reduces testing needs and the impact of changes to the system.

D - Dependency inversion principle (DIP)

With DIP, high-level objects are abstracted away from low-level objects. It is normal to think of the low-level objects as just being smaller pieces of a bigger one. For example, let's say that you want to query a database and fill a data set. The temptation is to pass in the database connection information to the data set and let it make the connection. Instead, you pass in a connection that is already configured, and in this way, the database can change without needing to retest the entire data set object.

J.Ja

Monday, September 24, 2012

10 tips for speeding up Outlook

If you've used Microsoft Outlook for a while, you know that it can slow down… way down. In fact, when not looked after, Outlook can become nearly useless. Fortunately, there are several things you can do to make Outlook not only usable, but significantly improved. And none of these techniques requires a single configuration change to your Exchange server (IMAP or POP3).

Of course, some of these suggestions might seem to have a bit more "'duh" factor than others. But you never know what level of skills you're dealing with, so we'll cover all the bases. In the end, you should have a much faster Outlook experience.

1: Update Windows

Many people don't realize that with Windows updates, the updates for Microsoft Office are also "hidden." But it's not just the Office updates that can help speed up Outlook. Make sure you allow the updates to happen. Why? There are times when Microsoft might update Exchange. In some cases, those updates can either break or cause problems with the communication between Outlook and Exchange. Or Microsoft might issue a patch to the application to resolve a speed issue or security hole.

2: Download complete items

When you connect Outlook with either IMAP or POP3, you should have Outlook set up to download the complete message (instead of just the header). If you do this, Outlook won't have to sync with the server every time you click on a new item (as it will already be in the data file.) How you do this will depend upon which version of Outlook you're using. But basically, you're looking for the setting Download Complete Item Including Attachments.

3: Archive your Inbox

I can't tell you how many times I see clients with thousands upon thousands (and in some cases tens of thousands) of emails in their Inbox. This can cause serious issues, especially when using PST files. Instead of just letting those Inbox folders grow to outrageous proportions, set up auto archiving so that your Inbox retains only a portion of those emails. I like to tell clients to keep the current and previous months' email in the Inbox and archive everything else. When you archive, you effectively create a new data file, so Outlook doesn't have to strain against the weight of an oversize PST or OST file

4: Use Cached Exchange Mode

If you use Cached Exchange Mode in Outlook, you effectively take the data file from the server (PST) and cache it on your local machine (OST). This can go a long way toward speeding up your Outlook experience because Outlook doesn't have to read its data file across a network. Instead, all it has to do is read the locally stored data file. This option (obviously) is available only when connecting Outlook with an Exchange server.

5: Compact your PST file

When the Outlook PST file gets out of hand, a built-in tool can keep the size of that file under control. One of the issues is that even when you delete email from your Inbox, the size of the PST file may remain the same. If you're using Outlook 2010, you can go to Account Settings | Data Files and select the data file to be compacted. Once you've selected the file click Settings | Advanced | Outlook Data File Settings and click Compact Now. Depending on the size of your data file, this process can take some time.

6: Repair your PST file

Scanpst is often my go-to tool when Outlook is acting off kilter. It will scan through your data file and look for data inconsistencies and errors. Here's the thing about Scanpst — it's not always the easiest tool to find. Do yourself a favor and search through your C drive to locate the Scanpst.exe file. Make note of its location (usually within the Office installation folder). But be forewarned: This tool can cause PST files to become unusable. Make sure you back up that data file before you start the repair tool. Fortunately, should Scanpst find errors, it will prompt you to make a backup before it attempts to fix the errors.

7: Cut down on the published and shared calendars

Yes, it's easy to publish and share your calendars with others. The problem is, the more you do it, the more drag you're putting on Outlook. The more data Outlook has to share and pull down from the Internet, the slower it will perform. Sure, it's fine to have one or two shared calendars (and even more if you have a lightning-fast data pipe). Just know that the more data you have to push and pull, the slower your connection will be.

8: Disable RSS

By default, Outlook will sync RSS feeds from Internet Explorer to the RSS reader in Outlook. If you have a lot of RSS feeds bookmarked in IE, that syncing could easily bring Outlook to a crawl. Disable this feature (if you don't use Outlook as an RSS reader) from within Outlook 2010 by going to Options | Advanced and then unchecking both options under RSS Feeds.

9: Disable add-ins

How many times have you installed some program only to find it installed something else behind your back? This can happen to Outlook as well as Internet Explorer. Sometimes those add-ins can cause major Outlook slowdowns. To find out what add-ins you have installed in Outlook 2010, go to Options | Add-ins. Select COM Add-ins from the drop-down and click the Go button. The resultant window will list all add-ins available to Outlook. Search through this list and uncheck any that might seem suspect.

10: Fix ShoreTel Windows 7 integration

If you use the ShoreTel Communicator, you might notice some issues when trying to open and use Outlook. The problem lies in an incompatibility issue between ShoreTel and Windows 7. The fix is simple. Open up the Task Manager and look for a process called Agent.exe. Right-click that entry and click Properties |Compatibility. Choose the Run This Program In Compatibility Mode For option and then select Windows XP (Service Pack 3).

Other tricks?

There's no reason why anyone should have to struggle with a bogged down Outlook that will have you pulling your hair out strand by strand. These tips should help you enjoy a much speedier and reliable Outlook experience.

Thursday, September 20, 2012

Beginning of SQL Server Architecture – Terminology

SQL Server Architecture is a very deep subject. Covering it in a single post is an almost impossible task. However, this subject is very popular topic among beginners and advanced users.  Here Anil Kumar who is expert in SQL Domain to help Pinal write  a simple post about Beginning SQL Server Architecture. As stated earlier this subject is very deep subject and in this first article series he has covered basic terminologies. In future article he will explore the subject further down. Anil Kumar Yadav is Trainer, SQL Domain, Koenig Solutions. Koenig is a premier IT training firm that provides several IT certifications, such as Oracle 11g, Server+, RHCA, SQL Server Training, Prince2 Foundation etc.


In this Article we will discuss about MS SQL Server architecture.

The major components of SQL Server are:

  1. Relational Engine
  2. Storage Engine
  3. SQL OS

Now we will discuss and understand each one of them.

1) Relational Engine: Also called as the query processor, Relational Engine includes the components of SQL Server that determine what your query exactly needs to do and the best way to do it. It manages the execution of queries as it requests data from the storage engine and processes the results returned.

Different Tasks of Relational Engine:

  1. Query Processing
  2. Memory Management
  3. Thread and Task Management
  4. Buffer Management
  5. Distributed Query Processing

2) Storage Engine: Storage Engine is responsible for storage and retrieval of the data on to the storage system (Disk, SAN etc.). to understand more, let's focus on the concepts.

When we talk about any database in SQL server, there are 2 types of files that are created at the disk level – Data file and Log file. Data file physically stores the data in data pages. Log files that are also known as write ahead logs, are used for storing transactions performed on the database.

Let's understand data file and log file in more details:

Data FileData File stores data in the form of Data Page (8KB) and these data pages are logically organized in extents.

Extents: Extents are logical units in the database. They are a combination of 8 data pages i.e. 64 KB forms an extent. Extents can be of two types, Mixed and Uniform. Mixed extents hold different types of pages like index, system, data etc (multiple objects). On the other hand, Uniform extents are dedicated to only one type (object).

Pages: As we should know what type of data pages can be stored in SQL Server, below mentioned are some of them:

  • Data Page: It holds the data entered by the user but not the data which is of type text, ntext, nvarchar(max), varchar(max), varbinary(max), image and xml data.
  • Index: It stores the index entries.
  • Text/Image: It stores LOB ( Large Object data) like text, ntext, varchar(max), nvarchar(max),  varbinary(max), image and xml data.
  • GAM & SGAM (Global Allocation Map & Shared Global Allocation Map): They are used for saving information related to the allocation of extents.
  • PFS (Page Free Space): Information related to page allocation and unused space available on pages.
  • IAM (Index Allocation Map): Information pertaining to extents that are used by a table or index per allocation unit.
  • BCM (Bulk Changed Map): Keeps information about the extents changed in a Bulk Operation.
  • DCM (Differential Change Map): This is the information of extents that have modified since the last BACKUP DATABASE statement as per allocation unit.

Log File: It also known as write ahead log. It stores modification to the database (DML and DDL).

  • Sufficient information is logged to be able to:
    • Roll back transactions if requested
    • Recover the database in case of failure
    • Write Ahead Logging is used to create log entries
      • Transaction logs are written in chronological order in a circular way
      • Truncation policy for logs is based on the recovery model

3) SQL OS: This lies between the host machine (Windows OS) and SQL Server. All the activities performed on database engine are taken care of by SQL OS. It is a highly configurable operating system with powerful API (application programming interface), enabling automatic locality and advanced parallelism. SQL OS provides various operating system services, such as memory management deals with buffer pool, log buffer and deadlock detection using the blocking and locking structure. Other services include exception handling, hosting for external components like Common Language Runtime, CLR etc.

I guess this brief article gives you an idea about the various terminologies used related to SQL Server Architecture. In future articles we will explore them further.

Guest Author 

The author of the article is Anil Kumar Yadav is Trainer, SQL Domain, Koenig Solutions. Koenig is a premier IT training firm that provides several IT certifications, such as Oracle 11g, Server+, RHCA, SQL Server Training, Prince2 Foundation etc.

Reference: http://blog.sqlauthority.com

Tuesday, September 18, 2012

Web Application Projects versus Web Site Projects in Visual Studio

Ref.: MSDN


In Visual Studio you can create web application projects or web site projects. You create or open a web application project by choosing New Project or Open Project in the Visual Studio File menu. You create or open a web site project by choosing New Web Site or Open Web Site in the File menu.

Each type of project has advantages and disadvantages, and it is helpful to understand the differences between them in order to select the best project type for your needs. You must select the appropriate project type before you create a project, because it is not practical to convert from one project type to the other.

Note Note

For some scenarios, you do not have a choice. For example, if you want to create an ASP.NET MVC application, you must use a web application project.

This topic contains the following sections:

Scenarios


Scenarios in which web application projects are the preferred choice include the following:

  • You want to be able to use the Edit and Continue feature of the Visual Studio debugger.
  • You want to run unit tests on code that is in the class files that are associated with ASP.NET pages.
  • You want to refer to the classes that are associated with pages and user controls from standalone classes.
  • You want to establish project dependencies between multiple web projects.
  • You want the compiler to create a single assembly for the entire site.
  • You want control over the assembly name and version number that is generated for the site.
  • You want to use MSBuild or Team Build to compile the project. For example, you might want to add prebuild and postbuild steps.
  • You want to avoid putting source code on a production server.
  • You want to use the automated deployment tools that are available in Visual Studio.

Scenarios in which Web site projects are the preferred choice include the following:

  • You want to include both C# and Visual Basic code in a single web project. (By default, a web application is compiled based on language settings in the project file. Exceptions can be made, but it is relatively difficult.)
  • You want to open the production site in Visual Studio and update it in real time by using FTP.
  • You do not want to have to explicitly compile the project in order to deploy it.
  • If you do precompile the site, you want the compiler to create multiple assemblies for the site, which can include one assembly per page or user control, or one or more assemblies per folder.
  • You want to be able to update individual files in production by just copying new versions to the production server, or by editing the files directly on the production server.
  • If you precompile the site, you want to be able to update individual ASP.NET web pages (.aspx files) without having to recompile the entire site.
  • You like to keep your source code on the production server because it can serve as an additional backup copy.

Summary of Differences


The following table summarizes the main differences.

Area

Web application projects

Web site projects

Project file structure

A Visual Studio project file (.csproj or .vbproj) stores information about the project, such as the list of files that are included in the project, and any project-to-project references.

There is no project file (.csproj or .vbproj). All the files in a folder structure are automatically included in the site.

Compilation

  • You explicitly compile the source code on the computer that is used for development or source control.
  • By default, compilation of code files (excluding .aspx and .ascx files) produces a single assembly.
  • The source code is typically compiled dynamically (automatically) by ASP.NET on the server the first time a request is received after the site has been installed or updated.

You can precompile the site (compile in advance on a development computer or on the server).

  • By default, compilation produces multiple assemblies.

Namespaces

Explicit namespaces are added to pages, controls, and classes by default.

Explicit namespaces are not added to pages, controls, and classes by default, but you can add them manually.

Deployment

  • You copy the assembly to a server. The assembly is produced by compiling the application.
  • Visual Studio provides tools that integrate with Web Deploy (the IIS web deployment tool) to automate many deployment tasks.
  • You copy the application source files to a computer that has IIS installed on it.
  • If you precompile the site on a development computer, you copy the assemblies produced by compilation to the IIS server.
  • Visual Studio provides tools for deployment, but they do not automate as many deployment tasks as the tools available for web application projects.


Project File Structure


Web application projects use Visual Studio project files (.csproj or .vbproj) to keep track of information about the project. This makes it possible to specify which files are included in or excluded from the project, and therefore which files are compiled during a build.

For web site projects, all files in a folder structure are automatically considered to be included in the web site. If you want to exclude something from compilation, you must remove the file from the web site project folder or change its file-name extension to an extension that is not compiled and is not served by IIS.

An advantage of using project files in web application projects is the following:

  • It is easy to temporarily remove files from the site but still make sure that you do not lose track of them, because they remain in the folder structure. For example, if a page is not ready to be deployed, you can temporarily exclude it from the build without deleting it from the folder structure. You can deploy the compiled assembly, and then include the file in the project again. This is especially important if you are working with a source control repository.

An advantage of using folder structure without project files in Web site projects is the following:

  • You do not have to manage the project's structure exclusively in Visual Studio. For example, you can copy files into the project or delete them from the project by using File Explorer.

Compilation


For web application projects, you typically build the project in Visual Studio or by using the ASP.NET batch compiler on a computer that is not the production IIS server. All code-behind class files and standalone class files in the project are compiled into a single assembly, which is then put in the web application project's Bin folder. (The .aspx and .ascx files are compiled dynamically in a manner similar to what is done for web site projects.)

For web site projects, you do not have to manually compile the project. web site projects are typically compiled dynamically by ASP.NET (on both the development computer and the production IIS server). You can choose between batch compilation mode, which typically produces one assembly per folder, and fixed compilation mode, which typically produces one assembly for each page or user control.

Advantages of the compilation model for web application projects include the following:

  • You can use MSBuild to create a custom batch-compilation process.
  • It is easy to specify assembly attributes such as name and version.
  • Compiling in advance makes sure that users do not have to wait while the site compiles on the production server. (If the site is very large, dynamic compilation of a web site project might take a noticeable amount of time. Dynamic compilation occurs when a request for a site resource is received after an update to the site, and the request that triggers compilation might be delayed while the required resources are compiled. If the delay is unacceptable, you can precompile the site. However, then some of the advantages of dynamic compilation are lost.)
  • You have complete control over where you put code files in the project folder structure, and how you how classes in the project refer to each other. (Dynamic compilation requires that the source code for any classes that are used throughout the site must be in the App_Code folder. You cannot refer to a page or user control class from a class in App_Code.)

Advantages of the compilation model for Web site projects include the following:

  • You can test specific pages regardless of the state of other pages. This is because running an individual page does not require that the whole site compile successfully, only the page and any components it depends on, such as code in the App_Code folder or the Global.asax file. (In a web application project, if there are compilation errors anywhere in the site, you cannot create the assembly and therefore cannot test even the pieces of the site that compile.)
  • It is easy to update a Web site in production. You can update individual source code files on the production server without having to explicitly recompile the site. You can update individual files that are ready for deployment even if other files are not ready due to compile errors. You can also open the Web site on the production IIS server directly in Visual Studio and update the Web site in real time.
  • Precompiling to multiple assemblies can have a performance advantage in some scenarios. A typical example is a site that has many pages with lots of code written for them. Most of the pages are rarely requested and only some are used frequently. If you compile a site like this into multiple assemblies, the production server can load only the assemblies that are required for the current requests. If a page is not requested, its corresponding assembly is not loaded.

Note Note

There is no difference in performance between a web site project and a web application project. The only significant exceptions are the ones that have already been noted, and as a practical matter they apply only to very large sites. The first request to the web site might require the site to be compiled, which can result in a delay. And if the web site is running on an IIS server that is short on memory, including the entire site in a single assembly might use more memory than would be required for multiple assemblies.

Deployment


To deploy a web application project, you copy the assembly that is created by compiling the project to an IIS server. In contrast, to deploy a web site project, you typically copy the project source files to an IIS server.

Advantages of the deployment strategy for web application projects include the following:

  • You can avoid deploying source code to the IIS server. In some scenarios, such as shared hosting environments, you might be concerned about unauthorized access to source code on the IIS server. (For a web site project, You can avoid this risk by precompiling on a development computer and deploying the generated assemblies instead of the source code. However, in that case you lose some of the benefits of easy site updates.)
  • Deployment often involves other tasks in addition to copying assemblies or code to a server. For example, database scripts might have to run in production, and connection strings in the Web.config file might have to be changed for a production server. Visual Studio provides tools such as one-click publish that work with web application projects to automate many of these tasks. These tools are not available for web site projects.

Advantages of the deployment strategy for web site projects include the following:

  • If you make a small change to a web site, you do not have to redeploy the whole site. Instead, can copy just the changed file or files to the production IIS server. You can also edit files directly on the production server. (Because a web application project's code files are compiled into a single assembly file, you must deploy the whole site even for small changes, unless the only change is to an .aspx or .ascx file.) 


Friday, September 14, 2012

RAID in Linux

From: NextStep4IT


The term RAID is an acronym for the phrase, Redundant Array of Independent Disks. RAID is a way of combining the storage available across multiple disks and supplying users a single, unified virtual device.
RAID can be used to provide:

  • data integrity
  • fault tolerance
  • improved performance
  • greater storage capacity

Hard disks are mechanical devices involving moving parts and unfortunately tend to fail over time. There are also physical limits to the speed at which data can be read and/or written to disks. RAID helps mitigate this risk by protecting data stored on hard disks and improving disk performance by writing the data to multiple
physical locations according to several different schemas, known as "RAID Levels". Furthermore, RAID can be provided by either dedicated, specialized hardware or by the operating system at a virtual layer.



Hardware RAID vs. software RAID?

Hardware RAID solutions exist that operate as dedicated devices, usually as PCI expansion cards or directly on the motherboard. The independent disks attach to the hardware interface. In a true hardware RAID, the operating system simply writes data to the hardware RAID controller which handles the multiplicitous reads and writes to the associated disks. Other so−called hardware RAIDs rely on special drivers to the operating system; these act more like software RAIDs in practice. With current technology, hardware RAIDconfigurations are generally chosen for very large RAIDs.

Additionally, some operating systems, including Linux®, provide RAID functionality within a software layer.RAID partitions are logically combined and a virtual device appears to higher layers of the operating system in place of the multiple constituent devices. This solution is often a high−performance and inexpensive alternative available for RAID users.

 

RAID levels

There are many RAID levels. It will be impossible to list them all here. Here we mention the most common & most important RAID types, all of which are fully supported by Linux.

 

RAID0 (Striping)

 

This level is achieved by grouping 2 or more hard disks into a single unit with the total size equaling that of all disks used.

Practical example: 3 disks, each 80GB in size can be used in a 240GB RAID0 configuration.

RAID0 works by breaking data into fragments and writing to all disk simultaneously. This significantly improves the read and write performance.

On the other hand, no single disk contains the entire information for any bit of data committed. This means that if one of the disks fails, the entire RAID is rendered inoperable, with unrecoverable loss of data.

RAID0 is suitable for non-critical operations that require good performance, like the system partition or the /tmp partition where lots of temporary data is constantly written. It is not suitable for data storage.

Usable Space in Raid level0 = (smallest disk) * (no. of disks)

RAID1 (Mirroring)

 

This level is achieved by grouping 2 or more hard disks into a single unit with the total size equaling that of the smallest of disks used.

 

This is because RAID1 keeps every bit of data replicated on each of its devices in the exactly same fashion, create identical clones. Hence the name, mirroring. Practical example: 2 disks, each 80GB in size can be used in a 80GB RAID1 configuration.

 

Usable space of Raid level1= smallest-disk

On a side note, in mathematical terms, RAID1 is an AND function, whereas RAID 0 is an OR. Because of its configuration, RAID1 reduced write performance, as every chunk of data has to be written n times, on each of the paired devices. The read performance is identical to single disks.Redundancy is improved, as the normal operation of the system can be maintained as long as any one disk is functional.

RAID 1 is suitable for data storage, especially with non-intensive I/O tasks.

 

 

RAID5 

 

This is a more complex solution, with a minimum of three devices used. Two or more devices are configured in a RAID0 setup, while the third (or last) device is a parity device. If one of the RAID 0 devices malfunctions, the array will continue operating, using the parity device as a backup. The failure will be transparent to the user, save for the reduced performance.

RAID 5 improves the write performance, as well as redundancy and is useful in mission-critical scenarios, where both good throughput and data integrity are important. RAID 5 does induce a slight CPU penalty due to parity calculations.

Usable Space for Raid Level5 = smallest-disk*(no of disk -1)

 

Linear RAID

 

This is a less common level, although fully usable. Linear is similar to RAID0, except that data is written sequentially rather than in parallel. Linear RAID is a simple grouping of several devices into a larger volume, the total size of which is the sum of all members. For instance, three disks the sizes of 40, 60 and 250GB can be grouped into a linear RAID the total size of 350GB.

 

Linear RAID provides no read/write performance, not does it provide redundancy; a loss of any member will render the entire array unusable. It merely increases size. It's very similar to LVM. Linear RAID is suitable when large data exceeding the individual size of any disk or partition must be used.

Now, move backup to tape or other server:

 

Nested RAID Levels

 

RAID0+1

 

Exapmle of RAID Level 0+1

 

RAID 0+1 (also called RAID01), is a RAID level used for both replicating and sharing data among disks.The minimum number of disks required to implement this level of RAID is 3 (first, even numbered chunks on all disks are built – like in RAID0 – and then every odd chunk number is mirrored with the next higher even neighbour) but it is more common to use a minimum of 4 disks.

 

The difference between RAID0+1 and RAID 1+0 is the location of each RAID system — RAID0+1 is a mirror of stripes although some manufacturers (e.g. Digital/Compaq/HP) use RAID0+1 to describe striped mirrors, consequently this usage is now deprecated so that RAID0+1 and RAID1+0 are replaced by RAID10 whose definition correctly describes the correct and safe layout, i.e. striped mirrors.

RAID1 + 0

RAID1+0, sometimes called RAID1&0 or RAID10, is similar to a RAID0+1 with exception that the RAID levels used are reversed — RAID10 is a stripe of mirrors.

Hard disks are mechanical devices involving moving parts and unfortunately tend to fail over time. There are also physical limits to the speed at which data can be read and/or written to disks. RAID helps mitigate this risk by protecting data stored on hard disks and improving disk performance by writing the data to multiple

ITWORLD
If you have any question then you put your question as comments.

Put your suggestions as comments