casinos

Posts Tagged ‘Tips and Tricks’

Life is about stopping September 11th, 2013

Vinod Kumar

I don’t regret the things I’ve done, I regret the things I didn’t do when I had the chance.

Earlier this week I was writing about happiness and some of the thoughts around that. In order to have a happy life, it is strange that we need to change a lot of things in our own self. This blog post is about calling out some of the things we need to STOP doing. Here is a quick list, not exhaustive though.

Don’t be afraid to stand for what you believe in, even if that means standing alone.

  1. Stop running from your problems
  2. Stop thinking you’re not ready
  3. Stop living in the past
  4. Stop being negative in your thoughts
  5. Stop trying to hold onto the past
  6. Stop lying to yourself
  7. Stop being idle
  8. Stop procrastinating
  9. Stop yourself from being distracted
  10. Stop spending time with wrong people
  11. Stop fear of failure
  12. Stop doubting
  13. Stop trying to be someone else
  14. Stop being scared to make mistakes
  15. Stop cursing yourself for old mistakes – move on
  16. Stop doing the same thing while expecting different results
  17. Stop making excuses
  18. Stop from saying “Yes” always
  19. Stop your anger before it becomes a danger
  20. Stop trying to buy happiness
  21. Stop expecting people to be perfect
  22. Stop exclusively looking to others for happiness
  23. Stop trying to compete against everyone else
  24. Stop being jealous of others
  25. Stop blaming yourself for doing the right thing
  26. Stop buying things which you will throw anyways
  27. Stop overloading your schedule
  28. Stop holding grudges
  29. Stop being defensive
  30. Stop being materialistic
  31. Stop holding back your reason to praise someone
  32. Stop letting others bring you down to their level
  33. Stop wasting time explaining yourself to others
  34. Stop trying to impress others
  35. Stop being lazy
  36. Stop getting away with “good enough” attitude
  37. Stop overlooking the beauty of small moments
  38. Stop trying to make things perfect
  39. Stop following the path of least resistance
  40. Stop spending mindlessly
  41. Stop blaming others for your troubles
  42. Stop worrying so much
  43. Stop focusing on what you don’t want to happen
  44. Stop being ungrateful

Being happy doesn’t mean that everything is perfect. it means that you’ve decided to look beyond the imperfections.

I am sure you will agree with some of these if not all. Do let me know if you agree with the above. What would be your top 3 which you liked and found striking?

Life is short, live it. Love is rare, grab it. Anger is bad, dump it. Fear is awful, face it. Memories are sweet, cherish it.

Continue reading...


 

Creating happiness for yourself September 9th, 2013

Vinod Kumar

For every minute you are angry you lose sixty seconds of happiness ― Ralph Waldo Emerson

Happiness2Happiness is a subjective topic and relative to individuals. Every time I meet someone, they want to improve happiness in their lives and they are completely confused. Happiness is a state of mind, it is how we perceive happiness to be. For me happiness is something you learn from inner contentment, learn from your childhood, learn from your schools hard times and assume from people around you via their inner wisdoms. As you define your inner happiness try to keep your mind open, raw, simple, insightful, directional and actionable.

In my opinion there is no point in keeping this thought abstract and elusive thing that it cannot be achieved. It should be something that is out there which we can achieve yet right now not part of our life’s journey today. We can work hard day-in-day-out but we might feel happiness as an evasive thing. It is critical for us to include happiness into our lives in what ever shape we deem as stress buster. As I said before, it is more of a state of mind.

Time you enjoy wasting is not wasted time.

Make life meaningful

Make everything that you do count. Don’t forget to give your best where you need to give your best. It is always about playing your strengths and making a world that you want to live in. Make meaning out of things that you do day-in-day-out.

Happiness is when what you think, what you say, and what you do are in harmony ― Mahatma Gandhi

Scale your Happiness

Virtually there is no scale to measure happiness. In continuation to last point, hold to your values that make you happy. The simplest way to increase your happiness levels is to gradually increase your reasons to be happy. One of the dangerous levels is to compare your happiness levels with others.

Happiness is not a “What if” analysis

Our happiness is a decision of the mind. Don’t keep doing things because it is expected of you, but do things because you want to do and it makes you happy.

Don’t put an yardstick of “What if” scenarios to get into a happy state. A typical example is, “I would be happy if I get <<>>”. Don’t make your state of happiness too materialistic. Happiness made with such ideas is like climbing a mountain. Finally after reaching the pinnacle, our eye looks at the next mountain. This is the constant vicious circle of death of running behind matter – not happiness.

Sanity and happiness are an impossible combination ― Mark Twain

Be your own director of life

If you need to take a picture, you need to point your camera in that direction. So if you need to happiness, you need to work in that direction. You need to be happy doing simple things. You need to find happiness from simple things (smile of your child, playing a game you loved for years, Eating food your grandmother etc).

Happiness is not something ready made. It comes from your own actions ― Dalai Lama

As I sign off, remember happiness is a personal thing and what happiness to you is not the way others see as happiness.

The happiest people don’t have the best of everything. They just make the best of everything.

Continue reading...


 

SSMS: T-SQL Debugger Shortcuts August 30th, 2013

Vinod Kumar

Earlier this year I wrote about SQL Server 2012: Debugger basics. I felt that post had a lot of fun in the new debugger features. Having said that, this post can be seen as an continuation to the previous post. Here I call out all the shortcuts available with SQL Server Management Studio when it comes to using Debugger features.

As I write this, I would also want to know how many of you have used the debugger feature in your environments?

Action

Shortcut

Start or continue debugging

ALT+F5

Show next statement

ALT+NUM

Implement the Run To Cursor command

CTRL+F10

Display the QuickWatch dialog box

CTRL+ALT+Q

Toggle breakpoint

F9

Enable breakpoint

CTRL+F9

Stop debugging

SHIFT+F5

Step into

F11

Step over

F10

Step out

SHIFT+F11

Delete all breakpoints

CTRL+SHIFT+F9

Display the Breakpoints window

CTRL+ALT+B

Break all

CTRL+ALT+BREAK

Break at function

CTRL+B

Display the Watch 1 window

CTRL+ALT+W, 1

Display the Watch 2 window

CTRL+ALT+W, 2

Display the Watch 3 window

CTRL+ALT+W, 3

Display the Autos window

CTRL+ALT+V, A

Display the Locals window

CTRL+ALT+V, L

Display the Immediate window

CTRL+ALT+I

Display the Call Stack window

CTRL+ALT+C

Display the Threads window

CTRL+ALT+H

Display the Parallel Stacks window.

CTRL+SHIFT+D, S

Display the Parallel Tasks window

CTRL_SHIFT+D, K

This is interesting because SQL Server Management Studio is based out of Visual Studio shell and hence many Visual Studio shortcuts work inside SQL Server Management Studio too as you can see above. Do let me know if I missed out on any of the interesting shortcut for debugger.

Continue reading...


 

SQL Server DATE and TIME formats August 26th, 2013

Vinod Kumar

This topic is very close to my heart when I talk with customers almost daily. Customers when working in applications have a constant doubt of what format to use. There is no one right method, but here is one suggestion I have for you. Use one consistent format throughout your application especially when you plan to store inside SQL Server. Don’t try to mix and match formats – this is because whenever you need to compare dates, you will be doing an explicit CAST or CONVERT function in all your WHERE clauses. So in this blog, let me bring out the list of formats and the sample output for your reference.

Date Format

SQL Statement

Output

MM/DD/YY

CONVERT(VARCHAR(8), GETDATE(), 1)

09/29/12

YY.MM.DD

CONVERT(VARCHAR(8), GETDATE(), 2)

12.09.29

DD/MM/YY

CONVERT(VARCHAR(8), GETDATE(), 3)

29/09/12

DD.MM.YY

CONVERT(VARCHAR(8), GETDATE(), 4)

29.09.12

DD-MM-YY

CONVERT(VARCHAR(8), GETDATE(), 5)

29-09-12

DD Mon Y

CONVERT(VARCHAR(9), GETDATE(), 6)

29 Sep 12

Mon DD, Y

CONVERT(VARCHAR(10), GETDATE(), 7)

Sep 29, 12

MM-DD-YY

CONVERT(VARCHAR(8), GETDATE(), 10)

09-29-12

YY/MM/DD

CONVERT(VARCHAR(8), GETDATE(), 11)

12/09/29

YYMMDD

CONVERT(VARCHAR(6), GETDATE(), 12)

120929

Mon DD YYY

CONVERT(VARCHAR(20), GETDATE(), 100)

Sep 29 2012 9:51AM

MM/DD/YYYY

CONVERT(VARCHAR(10), GETDATE(), 101)

09/29/2012

YYYY.MM.DD

CONVERT(VARCHAR(10), GETDATE(), 102)

2012.09.29

DD/MM/YYYY

CONVERT(VARCHAR(10), GETDATE(), 103)

29/09/2012

DD.MM.YYYY

CONVERT(VARCHAR(10), GETDATE(), 104)

29.09.2012

DD-MM-YYYY

CONVERT(VARCHAR(10), GETDATE(), 105)

29-09-2012

DD Mon YYY

CONVERT(VARCHAR(11), GETDATE(), 106)

29 Sep 2012

Mon DD, YYYY

CONVERT(VARCHAR(12), GETDATE(), 107)

Sep 29, 2012

HH:MM:SS

CONVERT(VARCHAR(8), GETDATE(), 108)

09:51:05

Mon DD YYYY HH:MI:SS:MMMAM (or PM)

CONVERT(VARCHAR(26), GETDATE(), 109)

Sep 29 2012 9:51:05:910AM

MM-DD-YYYY

CONVERT(VARCHAR(10), GETDATE(), 110)

09-29-2012

YYYY/MM/DD

CONVERT(VARCHAR(10), GETDATE(), 111)

2012/09/29

YYYYMMDD

CONVERT(VARCHAR(8), GETDATE(), 112)

20120929

DD Mon YYYY HH: MM:SS:MMM(24h)

CONVERT(VARCHAR(24), GETDATE(), 113)

29 Sep 2012 09:51:05:910

HH:MI:SS:MMM(24H)

CONVERT(VARCHAR(12), GETDATE(), 114)

09:51:05:910

YYYY-MM-DD HH:MI:SS(24h)

CONVERT(VARCHAR(19), GETDATE(), 120)

2012-09-29 09:51:05

YYYY-MM-DD HH:MI:SS.MMM(24h)

CONVERT(VARCHAR(23), GETDATE(), 121)

2012-09-29 09:51:05.910

YYYY-MM-DDTHH:MM:SS:MMM

CONVERT(VARCHAR(23), GETDATE(), 126)

2012-09-29T09:51:05.910

DD/MM/YYYY HH:MI:SS:MMMAM

CONVERT(VARCHAR(25), GETDATE(), 131)

14/11/1433 9:51:05:910AM

Here are few more conversion functions for your reference.

Function Name

Description

Syntax

DATEFROMPARTS

Returns a DATE value for the specified year, month and day.

DATEFROMPARTS( <year>, <month>, <day> )

DATETIME2FROMPARTS

Returns a DATETIME2 value for the specified date and time and precision.

DATETIME2FROMPARTS( <year>, <month>, <day>, <hour>, <minute>, <seconds>, <fractions>, <precision> )

DATETIMEFROMPARTS

Returns a DATETIME value for the date and time.

DATETIMEFROMPARTS( <year>, <month>, <day>, <hour>, <minute>, <seconds>, <milliseconds> )

DATETIMEOFFSETFROMPARTS

Returns a DATETIMEOFFSET value for the date and time and with the offsets and precision.

DATETIMEOFFSETFROMPARTS( <year>, <month>, <day>, <hour>, <minute>, <seconds>, <fractions>, <hour_offset>, <minute_offset>, <precision> )

SMALLDATETIMEFROMPARTS

Returns a SMALLDATETIME value for the date and time.

SMALLDATETIMEFROMPARTS( <year>, <month>, <day>, <hour>, <minute> )

TIMEFROMPARTS

Returns a TIME value for the time and with the specified precision.

TIMEFROMPARTS( <hour>, <minute>, <seconds>, <fractions>, <precision> )

EOMONTH

Returns last day of the month for the date.

EOMONTH( <start_date> [, <month_to_add>] )

  1. <year> – Integer specifying a year.
  2. <month> – Integer specifying a month.
  3. <day> – Integer specifying a day.
  4. <hour> – Integer specifying hours.
  5. <minute> – Integer specifying minutes.
  6. <seconds> – Integer specifying seconds.
  7. <milliseconds> – Integer specifying milliseconds.
  8. <fractions> – Integer specifying fractions. This parameter depends on the <precision> parameter.
  9. <hour_offset> – Integer specifying the hour portion of the time zone offset.
  10. <minute_offset> – Integer specifying the minute portion of the time zone offset.
  11. <precision> – Integer specifying the precision of the DATETIME2 value to be returned. For example, if <precision> is 7, then each fraction represents 100 nanoseconds.
  12. <start_date> – Date for which to return the last day of the month.
  13. <month_to_add> – Integer specifying the number of months to add to <start_date>.

Hope this will be a good start and reference when it comes to using date and time. Is there anything else that you have done more with Date functions? Do let us know.

Continue reading...


 

Quick Comparison on RAID Levels August 21st, 2013

Vinod Kumar

This blog post is inspired based on tons of customers I meet daily as part of my job. Many customers often ask me which RAID levels to use with SQL Server. Well, the basics and best practices vary between types of files and how the access happens using SQL Server. As a quick recap, data files needs random data access while Log files need sequential access. And then we need tempdb on the fastest drive. All these are general rules of thumb and not something written on stone.

Here is the quick recap of what I suggest based on various dimensions for each of the RAID levels.

RAID Levels

RAID-0

RAID-1

RAID-5 or

RAID-6

RAID-10

Reliability

Lowest

No fault tolerance results in data loss

Very good

Even better with duplexing

Good

Can tolerate single machine fault

Excellent

Storage Efficiency

100%

50%

>50% <100%

50%

Random Read

Excellent

Fair

Worst of the RAID Levels

Fair

Very good

Random Write

Excellent

Fair

Very good

Very good

Sequential Read

Excellent

Very Good

Comparable to a single drive

Good

Generally, better with smaller stripe sizes

Good

Sequential Write

Excellent

Very Good

Better than other RAID levels

Fair

Good

Cost

Lowest

Moderate

Relatively high cost due to redundant drives

Moderate

High

These are important considerations before we build our very own RAID levels as an Administrator. Obviously, the choice always is between RAID-5 or RAID-10. Please use the above table as a quick reference and do let me know if you found more dimensions.

Continue reading...