Tuesday, 13 September 2016

Performance Issue in Slowly changing dimensions of SSIS

We had 200's of packages in our project and I came across a package which was taking enormously long time. I debugged the package checked the log. My doubt was that it was indexes due to which the package is running very slow and was taking around 2-3 hours usually.

To know about indexes kindly read my article:

I tried everything.  Removed indexes, kept indexes added NOLOCK but still it was taking the same or sometimes more time than that. From the log it was very much clear that the culprit is SCD.

I found one thing in the SCD and experimented with it and luckily the performance was increased and to what extent. It was now able to complete in 1 minute, I was amazed and my lead was very happy with my findings.

The root cause of the slowness was because of Business key which was not contained in any of the indexes and due to which when the Updates Output component was called it was taking huge time to locate the row from the table.

Now once I added the Non Clustered Index on this Business Key field it was running very efficiently. It was now 120 time faster.


doing investing with intelligent approach

Hi all, I hope you had liked my previous blog about discussing stock market investment with father:

So let us move further in the world of investing, so once you start investing we thinks very positively that the stocks that we have chosen will give us very great returns. Also to find good stocks we do lot of research and our most of the time goes into this. It takes a lot of time due to which many people not able to concentrate on their jobs as well.

If you have a portfolio and keep a track of stocks you will find that out of 10 stocks you are able to generate 30-50 % returns from 2 or 3 stocks but other 7 are either generating negative returns or an average returns.

So out of lots of discussions with my friends I found a way through which we can invest for long term and gets a good return:
1. In the stock market only bet on the Large Cap stocks which you know and only when they are near their 52wk low
2. Invest in small cap/mid cap stocks through 5 star mutual funds with SIP option. Also invest in lump sum when the market is very much down.


Tuesday, 6 September 2016

Indexing in SQL Server


Hi all today we are going to discuss about Indexing.

What is indexing? Have you thought what would happen if it was not there?

Basically indexing is a SQL concept that is used to retrieve the data from the database in fast and efficient way. If it was not existed then fetching data from Databases would have taken hours/days/Months and we would be standing hungry in queues of the food chains of McDonald'/KFC for long hours.

Let's see how it works:

Have you imagined how you can search chapters if you don't have the index in your book?

Book is the perfect example of indexes, suppose if any of your teacher asked you to show any random chapter content. How will you show her/him?

You will navigate to index page of your book and will find out the page number. In this way you would be able to track the chapter in a quickest way. On the other side if you were not having the index page in your book, you will have to jump from one page to another till you would have found it.

As you can see indexes in the book helped us reduce the time significantly, in the similar fashion indexes helps tables/views to find the data quickly.


Monday, 15 August 2016

Stock Market Investing discussions with Fathers

                                                   Stock Market Investing discussions with Fathers


In the most of the families, when the child starts earning. He starts feeling very good when the first salary gets credited into the bank account.

Slowly he gets used to the salary and then after some months this salary looks little tiny. Then from somewhere he comes to know about Share Market. He then search about this and find many peoples who are earning a lot by doing investing/trading.

But when he chat about the same with his father then he receives one guidance never play with Stock market(paise doob jayenge). He will remind you about gupta/trivedi uncle who had lost a lot money in the Stock market. He will not listen to you in-respect to Stock Market.

Here is the time most of the people lost the interest about stock market and then never comes into investing. But if you come back into investing there you understand the power of investing. The people with whom you will hangout/live your thinking would be the average of those peoples so start exploring the different ideas.


Sunday, 15 December 2013

Getting started with Console Application


In order to getting started with the console application first start the Visual Studio 2010.

Then click on New Project…  as shown below:


Select the Console Application and write the name of the Console Application as you want and then click on OK.

Now by using this following code we can write our first program to print the “Hello World”.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Hello_World
{
    class Program
    {
        static void Main(string[] args)
        {

            Console.WriteLine("Hello World");
            Console.ReadLine();
        }
    }
}


Output:


C# program to check the character is vowel or not



In this article we will discuss with you the program for checking whether character is vowel or not using console application in c#.net using for loop:
Step1: Take a new console application using c# as a language in the Visual studio.
Step2: Declare a variable “str_Name” and take the input of the character which you want to test.
Step3: Now check if it is anything from the A,E,I,O,U then it is a vowel otherwise it’s not vowel.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace vowel
{
    class Program
    {
        static void Main(string[] args)
        {
            string str_Name;

            Console.WriteLine("Please enter The charcater to check whether it is vowel or not");
            str_Name = Console.ReadLine();


            if ((str_Name == "A") || (str_Name == "E") || (str_Name == "I") || (str_Name == "O") || (str_Name == "U")
                || (str_Name == "a") || (str_Name == "e") || (str_Name == "i") || (str_Name == "o") || (str_Name == "u"))
            {
                Console.WriteLine("The charcater is vowel");
            }
            else
            {
                Console.WriteLine("The charcater is not vowel");
            }

            Console.ReadLine();
        }
    }
}
Output:-


C# program to check whether the number is Armstrong no or not



In this article check whether the input number is Armstrong no or not by using console application in c#.net using while loop:
Step1: Take a new console application using c# as a language in the Visual studio.
Step2: Declare the variables int_Number, int_Temp, int_Remainder, int_Sum and initialize the “int_sum” value to 0.
Step3: Read an input from the User in this Variable “int_Number” for storing that number which you want to test for Armstrong number, now assign that value to “int_Temp”.
Step4: now run the while loop till the value of “int_Temp” doesn’t become 0 and then digit by digit take the values and multiply that digit value three times and then add it to the “int_sum” variable and in the next step  divide the “int_Temp” variable by 10. In the end check if the “int_sum” value is equal to the “int_Number” then it means that it is Armstrong number.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Armstrong_Number
{
    class Program
    {
        static void Main(string[] args)
        {

            int int_Number, int_Temp, int_Remainder, int_Sum;
            int_Sum = 0;
            Console.WriteLine("please the numbers to be tested for Armstrong number");
            int_Number = int.Parse(Console.ReadLine());

            int_Temp = int_Number;


            while (int_Temp != 0)
            {
                int_Remainder = int_Temp % 10;
                int_Sum = int_Sum + int_Remainder * int_Remainder * int_Remainder;
                int_Temp = int_Temp / 10;
            }

            if (int_Number == int_Sum)
            {
                Console.WriteLine("Entered number is an armstrong number. ");
            }
            else
            {
                Console.WriteLine("Entered number is not an armstrong number. ");
            }
            Console.ReadLine();

        }
    }
}

Output:


C# program to check whether given no. is prime or not



In this article we will discuss with you the program for checking whether given no. is prime or not using console application in c#.net:
Step1: Take a new console application using c# as a language in the Visual studio.
Step2: Read an input from the User in this Variable “int_Number” for storing that number which you want to test for prime number.
Step3: Now if that input number is 1 or 2 then it will be a prime number otherwise we have to loop from 2 till that number and Start dividing that input number from 2 till that number, If it’s divisible by any of the number before the “input number-1” then it means that it’s not a prime number otherwise it is a prime number.

using System;             
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PrimeNo
{
    class Program
    {

        static void Main()
        {
           
            int int_Number;
            int i;
            Console.WriteLine("Enter a number to check whether it is prime or not?");

            int_Number = int.Parse(Console.ReadLine());

            if ((int_Number == 2) || (int_Number == 1))
            {
                Console.WriteLine("The Given number is prime number");
                Console.ReadLine();
            }
            else
            {
                for (i = 2; i < int_Number; i++)
                {
                    if (int_Number % i == 0)
                    {
                        Console.WriteLine("The Given number is not prime number");
                        Console.ReadLine();
                        break;
                    }
                }

                if (int_Number == i)
                {
                    Console.WriteLine("The Given number is prime number");
                    Console.ReadLine();
                }
            }
       }
    }

}

Output:-


C# program to test if string is Palindrome or not


In this article we will discuss with you the program for testing a string whether it’s palindrome or not using console application in c#.net:
Palindrome: - Palindrome is nothing but the string that remains the same when its reversed.
Step1: Take a new console application using c# as a language in the Visual studio.
Step2: Declare 2 variable “str_Orginal_String” and “str_Reverse_String” for storing the original   and reverse string and initialize the reverse variable “str_Reverse_String” with blank.
Step3: Read an input from the User in this Variable “str_Orginal_String” for storing that string which you want to test for palindrome.
Step4: now loop through the last position to the first position of that Original string and store each character value in “str_Reverse_String” to get the final Reverse string.

Step5: Now compare the original string with the reverse string if that is same then it would be palindrome string otherwise it will be not palindrome string.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Palindrome
{
    class Program
    {

        static void Main()
        {
           
            string str_Orginal_String, str_Reverse_String;
            str_Reverse_String = "";
            Console.WriteLine ("Please enter the string to test for palindrome string ?");

            str_Orginal_String = Console.ReadLine ();

            for (int i = str_Orginal_String.Length - 1; i >= 0; i--)
            {
                str_Reverse_String = str_Reverse_String + str_Orginal_String[i];
            }

            if (str_Orginal_String == str_Reverse_String)
            {
                Console.WriteLine ("The string " + str_Orginal_String + " is palindrome");
            }
            else
            {
                Console.WriteLine ("The string " +str_Orginal_String + " is not                   palindrome");
            }
            Console.ReadLine ();
       }
    }



}

Output:-


C# program to find the Fibonacci Series



In this article we will show you how to write code for Fibonacci series using console application in c#.net using for loop:

Step1: Take a new console application using c# as a language in the Visual studio.
Step2: Declare a variable “int_No_of_term” for getting the Number of Term in the Fibonacci series.
Step3: Read an input from the User in this Variable.
Step4: Make an array for name “int_fibbo” of the size “int_No_of_term” for storing the fibonacci series values.
Step5: Assign the first and second value of the Fibonacci series in the array position 0 and 1 respectively. Print the first 2 number of the Fibonacci series.
Step6: now loop through till the last no in the series to calculate the next Fibonacci numbers using the logic nth series value= (n-1)th series value+ (n-2)th series value.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Fibonaci
{
    class Program
    {

        static void Main()
        {
           
            int int_No_of_term;
            Console.WriteLine("Enter the number of terms for the fibonacci series you    
                           want to print?");
      
            int_No_of_term = int.Parse(Console.ReadLine());

            int[] int_fibbo = new int[int_No_of_term];

            int_fibbo[0] = 0;
            int_fibbo[1] = 1;


            //for printing the first value of the fibonacci series
            Console.WriteLine(int_fibbo[0]);
            //for printing the second value of the fibonacci series
            Console.WriteLine(int_fibbo[1]);

            for (int i = 2; i < int_No_of_term; i++)
            {
                int_fibbo[i] = int_fibbo[i - 1] + int_fibbo[i - 2];
                //for print the fibonacci series from 3rd position till nth position
                Console.WriteLine(int_fibbo[i]);
            }
            Console.ReadLine();
       }
    }



}

Output:-




C# program to find the factorial of a number



In this article we will discuss with you the program for calculating the factorial of a number using console application in c#.net:
Step1: Take a new console application using c# as a language in the Visual studio.
Step2: Read an input from the User in this Variable “int_Number” for storing that number whose factorial you want to find out.
Step3: Now if that input number is 1 or 0 then its factorial will be 1 otherwise we have to loop from the input number till 1 and multiply the input no with its immediate lower number till 1.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PrimeNo
{
    class Program
    {

        static void Main()
        {
           
            int int_number;
            long ln_num;
            ln_num = 1;


            Console.WriteLine("please enter the number whose factorial you want to find");
            int_number = int.Parse(Console.ReadLine());

            if ((int_number == 1) || (int_number == 0))
            {
                Console.WriteLine("factorial of the number "+int_number+ " is 1.");
            }
            else
            {
                for (int i = int_number; i >= 1; i--)
                {
                    ln_num = ln_num * i;
                }
                Console.WriteLine("factorial of the number " + int_number + " is " +ln_num );
            }

            Console.ReadLine();
       }
    }

}

Output:-