"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

April 13, 2014

Free Tool - Managing System, Environment Variables using Rapid Environment Editor

While managing servers / different environments we keep upgrading environmental variables, custom paths. Rapid Environment Editor tool is very useful for managing this job. It highlights invalid paths to quickly fix them.

While setting up eclipse, this environment issues pop up, this editor was useful to fix issues.

Happy Learning!!!

April 10, 2014

Interview Question - Maximum Palindrome Substring in given String

Some candidates write logic, working code, impressive ideas. This question 'Maximum Palindrome Substring in given String' I got a good answer during one of interview discussions.

I tried the same in codepad link. This is C++ code. The solution code is

int main()
{
    char inputname[50] = "aaabbaa";
    char match[50];
    char temp[50];
    char revtemp[50];
    int length = 0;
    int currentpalindromelength = 0;
    int maxpalindromelength = 0;
    int palstart=0, palend=0;
    int i,j;
    for(i = 0;inputname[i] !='\0'; i++)
    {
        length++;
    }
    printf("length is %d\n", length);
    for(int ipos = 0; ipos  < length; ipos++)
    {
        for(j = ipos+1; j < length; j++)
        {
            int startpos=0;
            for(int k = ipos; k < j; k++)
            {
                temp[startpos++] = inputname[k];
            }
            temp[startpos] = '\0';
            printf("string to compare %s \n", temp);
            startpos=0;
            for(int z = j-1; z >=0; z--)
            {
                revtemp[startpos++] = inputname[z];
            }
            revtemp[startpos] = '\0';
            printf("reverse string to compare %s\n", revtemp);
            int result = strcmp(temp, revtemp);
            if (result == 0)
            {
                    printf("Both strings are equal \n");
                    currentpalindromelength = 0;
                    for(int iCur = 0;temp[iCur] !='\0'; iCur++)
                    {
                        currentpalindromelength ++;
                    }
                    if(currentpalindromelength > maxpalindromelength)
                    {
                        maxpalindromelength = currentpalindromelength;
                        palstart = ipos;
                        palend =j;
                    }
            }
            else
            {
                  printf("\nBoth strings are not equal \n");
           }
        }
    }
    printf("max palindrome length is %d",maxpalindromelength);
    printf("start pos is %d\n",palstart);
    printf("end pos is %d\n",palend);
    for(int k = palstart; k < palend; k++)
    {
         printf("%c",inputname[k]);
    }
    printf("\n");
    return 0;
}


This worked for multiple cases. codepad is very good!.

Happy Coding!!!

April 08, 2014

Frequently Used Scripts & Notes


TSQL Reusable scripts - bookmarking the same

Tip #1. What is the command to truncate a SQL Server log file?

Tip #2. Settings to Capture Deadlock Trace in SQL Server Logs
DBCC TRACEON (1204, -1)
DBCC TRACEON (1222, -1)

Tip #3. Checking SQL Server Version

select SERVERPROPERTY('productversion'),SERVERPROPERTY('productlevel'),SERVERPROPERTY('edition')

Tip #4. Creating a custom firefox template

Step 1. Windows -> Run specify below command
firefox.exe -ProfileManager -no-remote

Step 2. Create custom profile

Step 3. Command to run selenium using template
Example:  java -jar selenium-server.jar -firefoxProfileTemplate “<Selenium Profile Directory>”

Usage:  java -jar selenium-server.jar -firefoxProfileTemplate C:\Users\Administrator\AppData\Roaming\Mozilla\Firefox\Profiles\sd88nd1n.FRProfile

Step 4. With Logs captured below is modified steps

Usage: java -jar C:\\SeleniumServer\\selenium-server-standalone-2.25.0.jar -port 5555 > C:\\ReportLogs\\\SeleniumServerStatus.txt 2>&1 -firefoxProfileTemplate "C:\\Users\\Administrator\\AppData\Roaming\\Mozilla\\Firefox\\Profiles\\ku6gbc8j.FRProfile"

References Link1


Happy Learning!!!

February 17, 2014

mTail - Windows Real time Log Monitoring Tool, Log Searching - Free Tools

This post is for mTail - Log monitoring tool on windows. I have used it it is very good. The benefits are
  • Monitor multiple Servers with multiple instances of this tool concurrently
  • Simple and easy to use
  • Start / Stop option to stop in case you have viewed error
Free tools for File Search / Exception Checking in logs

Happy Learning!!

February 09, 2014

Interesting Bug

Sharing one Unique Interesting bug identified during testing

Case #1 - Property_Id values mismatch was the primary issue. Two tables were defined in two databases. The scenario is Property_Id on Database A is based on master tables defined , example Master A. Issue was## mapping of MasterA was used in DatabaseB instead of MasterB. It was difficult to identify as Property_Id values were always overlapping for a smaller set of input data

Database A
MasterA
Property_Id Value
1    A
2    B
3    C
.......
10    D

TableA
Property_Id  Local_Id (Identity Column) Value
1 1
2 2
3 3
1 4
2 5
2 6


Database B
MasterB
Property_Id Value
10    A
20    B
30    C

TableB (Expected)
Property_Id          Local_Id (Identity Column) Value
10 1
20 2
30 3
10 4
20 5
20 6

TableB (Actual)
Property_Id           Local_Id (Identity Column) Value
1 1
2 2
3 3
10 4
2 5
2 6

The bug was not easily identified as Property values in MasterA and MasterB overlapped.  The values were matching in most cases for a smaller dataset.


Happy Learning!!!

January 05, 2014

Weekend Learning - Good Session - Taming Big Data with Berkeley Data Analytics Stack

Good Session - Taming Big Data with Berkeley Data Analytics Stack 



Notes captured from the session

Big Data Use Cases (Making personalized decisions for each customer, Analyse data trends)

Data Processing Goals
  • Earlier Trend - Analyse historical data
  • Current Trend - Real time data processing
  • Goal - Sophisticated data processing (Trend analysis, Anomaly detection)
Open Analytics Stack
  • Apps - Data Analysis, Mining, Decision Driven Apps
  • Data Processing - HBase, Hive, Hadoop
  • Storage - HDFS
  • Infrastructure - Cluster
Goals of Open Analytics Stack
  • Support batch, interactive and stream processing
Implementation Notes
  • Store data in memory (SSD's, 512GB of RAM)
  • FB / Yahoo / Bing - Some very large jobs but vast majority are pretty small
  • Aggregating inputs for other jobs fit in memory of cluster
  • Parallelism of jobs, Failure Recovery, Job Scheduling handled
  • Trade-off between accuracy and response time
  • Single execution framework for batch, streaming and interactive computations
New layers added are mentioned in ()
  • Application
  • Data Processing (In Memory Processing)
  • Storage (Data Management Layer), (Resource Management)
  • Infrastructure
  • One cluster for both MPI and Hadoop
  • Spark (Batch & Interactive Apps Support)
  • Spark and Shark are available in Amazon Elastic Map Reduce
  • Tachyon - Storage abstraction
Architecture and Component - Screenshots






Download the components from link
AMP Lab Blog link

Good Session, Happy Learning!!!

December 15, 2013

Weekend Reading Notes

Note #1 - SQL Server Database Engine Performance Tuning Basics - Must read for every TSQL Developer
Key Learning's
  • Perf counter values analysis
  • Temp Db configuration
  • Enable Lock pages in memory
  • Interpreting Avg. Disk Sec/Read values

Key Query  - SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

Note #3 - One more NOSQL DB that supports ACID transactions - FoundationDB

Key Learning's
  • Memory optimized Tables(MOT) reside in memory not in disks
  • Steps to estimate memory for MOT
  • Garbage collection of older version of records (similar to snapshot / read committed isolation levels)

Happy Learning!!!

December 12, 2013

DataScience Basics - Part I

Welcome to series of posts to learn Data Science basics. This video is a good starting material to get started



Link

Key Learnings
  • Data Science term defined by Peter Naur
  • How Role of Statistician differs from Data Scientist
  • BI Tools vs Data Science perspectives
More Reads
Happy Reading!!!