Türkçe   |   English
Calendar
Categories
Archive
Links
Blogroll
Files

05.08.2008
Most Valuable Practices On The Way To Solution

This title is the translation to English of a book that Turkish MVPs wrote in Turkish. The main subject of the book is sharing the knowledge and experience that MVPs have had during business life. The book has a different style and contains very valuable information that is worth reading. I wrote three chapters named Customer In Software Projects, Tips For Software Project Management and High Performance and Code Optimization. If you live in Turkey you can get the book from all bookstores. If you are outside of Turkey, I am planning to publish the sections I wrote in English at my blog, but it may take some time. You can contact me for any opinion or suggestion about the book.

Clues,News
Comments(0)

10.05.2008
T.C. Identity Number correctness validation

There is a hash algorithm which makes us able to validate T.C. Identity Number that we take as an input in our projects. You can find the method that checks this hash below.

        private bool ValidateNumber(string parNumber)

        {

            for (int i = 0; i < parNumber.Length; i++)

            {

                if (!(char.IsNumber(parNumber[i]))) return false;

            }

 

            return true;

        }

        public void ValidateTCIdentityNumber(string TCIdentityNumber)

        {

            if (ValidateNumber(TCIdentityNumber.Trim()))

            {

                if (TCIdentityNumber.Trim().Length < 11)

                {

                    throw new Exception("T.C. Kimlik Numarası 11 karakterden az olamaz. Lütfen kontrol ediniz.");

                }

                else

                {

                    decimal identityNumberDecimal = Convert.ToDecimal(TCIdentityNumber.Trim());

                    decimal temp = Math.Floor(identityNumberDecimal / 100);

                    decimal temp1 = Math.Floor(identityNumberDecimal / 100);

                    int[] D = new int[10];

                    for (int n = 9; n >= 1; n--)

                    {

                        D[n] = (int)temp1 % 10;

                        temp1 = Math.Floor(temp1 / 10);

                    }

                    int oddSum = D[9] + D[7] + D[5] + D[3] + D[1];

                    int evenSum = D[8] + D[6] + D[4] + D[2];

                    int total = oddSum * 3 + evenSum;

                    int ChkDigit1 = (10 - (total % 10)) % 10;

                    oddSum = ChkDigit1 + D[8] + D[6] + D[4] + D[2];

                    evenSum = D[9] + D[7] + D[5] + D[3] + D[1];

 

                    total = oddSum * 3 + evenSum;

                    int ChkDigit2 = (10 - (total % 10)) % 10;

                    temp = (temp * 100) + (ChkDigit1 * 10) + ChkDigit2;

                    if (temp != identityNumberDecimal)

                    {

                        throw new Exception("T.C. Kimlik Numaranızı kontrol ediniz.");

                    }

                }

            }

            else

            {

                throw new Exception("T.C. Kimlik Numarası yalnızca rakamlardan oluşmalıdır. Lütfen kontrol ediniz.");

            }

        }

 

Clues,Codes
Comments(4)

03.03.2008
.Net Programmer vs SQL Programmer

We work as software developers in software development industry. However are we actually a .Net Programmer or a SQL Programmer?
You can easily decide what kind of a programmer you are after considering the differences between these two concepts.

*While .Net Programmer uses the objects and methods of .Net Framework to achive the functionality requirement of application, SQL Programmer uses the methods of Sql Server.
*While .Net Programmer manages the business rules by the decision mechanisms and loops in .Net Framework, SQL programmer prefers to use decision mechanisms and loops in SQL server such as cursors.
*While .Net Programmer manages the transactions in business layer, SQL Programmer manages transactions in Sql Server.
*While .Net programmer designs the application compatible and can be easily integrated to any database system, SQL Programmer uses commands and functions which are specific to SQL Server.
*While .Net Programmer uses stored procedures or queries which are short, easy to read and written for a specific purpose, SQL programmer uses complex queries, stored procedures or triggers.

Clues,News
Comments(0)

15.01.2008
Passing Objects Between Pages
In order to pass objects within pages we commonly add objects to session at first page, and we remove objects from session just after reading values at redirected page. It is more manageable to use Context.Item for this purpose since it relases objects automaticly. In order to make this technique redirection should be made by Server.Transfer method.
Clues,Codes
Comments(0)

12.01.2008
location.replace
We commonly set the new page address to window.location.href property to redirect a page at client side via javascript. window.location.replace is a function that provides same functionality however it also loads the new url over current history entry. Redirection with this function does not allow users navigate to the previous URL by using browser's Back button. And finally window.location.relpace('newPage.html') is the syntax of this function.
Clues,Codes
Comments(0)