26 Sep 2015 Value-Driven Project Plan

After very stressful three weeks of current work in preparing project plans and design proof of concepts (to validate estimations :-) ), I looked at my personal calendar for PMP PDUs, I realized that I was behind the schedule in gaining 3 PDUs and started looking for interesting webinars and articles.

I looked at the following articles

  • What’s Wrong with the Plan? : With different perception of building capacity and value driven execution and instead of plan-driven execution
  • Prepare to Pitch : an advice to senior project managers to Keep your eyes and ears open, find new opportunities, pitch, execute, repeat. That’s the formula for long-term viability in today’s project management profession.
  • Alignment Map : Mapping from business Cases to project initiates, execution and IT Support

After reading these articles, it enforces further that the project plans should be aligned with business cases and value driven execution

Another interesting article http://larsbarkman.com/2015/08/26/alignmentmaps-with-graphviz/ using graphviz to build a graph. I will try this tool for next assignment :-)

You can check it out another interesting Book www.agileorgdesign.com/p/table-of-contents-preface.html by Sriram Narayan to look different perception of agile in business,team and delivery contexts.


13 Apr 2015 Organize Files

Last year, I dumped my photos and videos from digital camera and few SD Cards in my linux box as backup. Now,I want to organize those files based on the year and the month without loosing files with less effort.I am not remembered whether the files are duplicated.

To my meet goal, I created Python script as ~/organize.py

import os,sys,os.path, time
file=sys.argv[1]
targetBase=sys.argv[2]
if(not file or not os.path.exists(file)):
    print file+" is not exits"
    exit(-1)
if(not targetBase):
    print "no target specified"
    exit(-2)
location=time.strftime("%Y/%m",time.localtime(os.path.getctime(file)))
location=location.replace("/",os.path.sep)
target=targetBase+os.path.sep+location
if not os.path.exists(target):
    os.makedirs(target)
target = target+os.path.sep+os.path.basename(file)
if not os.path.exists(target):
    os.rename(file,target)
    print file +" -> "+ target
else:
    print target + " is already exists"

Execute The following scripts to move files based on created date of file

cd ~/archive/oldphotos
find . -type f -exec python ~/organize.py {} ~/archive/photos
find . -empty -type d -delete # Remove Empty Folders

Now ~/archive/photos are organized like

+ photos
  + 2015
     + 01
        - photo1.jpg
  + 2013
     + 07
        - photo9.jpg

This script can with different combintation with find

find . -name '*.jpg' -type f -exec python ~/organize.py {} ~/archive/photos

If files are duplicated and conflicting with name then those files will be stayed in old folder for manual verification.


04 Apr 2015 My favorite source code editor

What is your favorite source code editor? Is it VIM or Sublime, Brackets or....?

When I started using sublime. I thrilled with its speed and expandability and number of plug-ins.

During my talk on ES6 Preparation, I want to experiment brackets to prepare code snippets and run jasmine test suite. I can able to find similar plugins in brackets. I started use to brackets and best fit for my web projects with autocompletion, lint and code beautify tools.

When I started to work with brackets for multiple projects at the same time and it was challenging with brackets due to single bracket instance and project state was not maintained correctly.

I started to look alternative editor and I wanted to experiment Atom it contains all needed plugins for my development and support multiple atom instances to work complex project structures.

Here are the installed packages for code-beautify, lint my source code that related to golang,python,css and react.

  • atom-beautify
  • atom-jsfmt
  • autocomplete-html
  • autocomplete-plus
  • autoprefixer
  • color-picker
  • csslint
  • emmet
  • fixmyjs
  • fold-functions
  • go-plus
  • go-rename
  • gocode
  • godef
  • jshint
  • language-jsx
  • linter
  • linter-golint
  • merge-conflicts
  • minimap
  • project-manager
  • quotes
  • react
  • refactor
  • tabs-to-spaces
  • terminal-status
  • toggle-quotes
  • toggle-slash

During 3 months usage, I happy with Atom for my current project needs.

Technically, Atom and Brackets are using Webkit as runtime environment and best suitable for small and moderate web projects. sublime developed in C++ and supporting plugin in python and suitable for all project structures. I experienced that find and replace features are time-consuming operations in Atomor Brackets then sublime if the project has more files due to the technical limitation.

vi is favorite editor when I am working in server environment and limited memory constraints. notepad is rescue tool in fresh windows system.

Development community gifted us various editors, I will prefer to install all these editors in my system and love to use when I want to open :-)


30 Jan 2015 can sprint plan/review meeting reschedule frequently?

"Sprint Review Meeting postponed for 2 hours."

"Sprint Planning Meeting rescheduled to tomorrow because ..."

Do you see these messages frequently while working with various sprints?

Generally, Coming late for any meeting or reschedule meetings frequently (mainly India) are taking lightly for different reasons.

Sometimes, When was I coming late to home at 10 PM then My Wife referred that it was big mistake because her next scheduled plan disrupted and it leaded to missing school bus for my children in next day because they are delayed to reach the bus stop. It has an impact on taking food.

In Software Development, Do you see any impact on coming late for Sprint Review Meeting or frequently reschedule meetings ?

Agile Practices are more focus on Individuals and interactions over processes and tools. Scrum Masters, Product Owners are the role models for Scrum Team; Team will get influenced or tuned by Product Owner's behaviour.

As product owner, If he/she is coming late to the meeting and not presenting focused backlog items then it signals to team that Product Owner was not focused or this project is less priority for the product owner; Team may take this signal and delivery very poor quality and finding excuses like insufficient time,scope or it is big work for sprint. Follow up meeting like retrospective meeting will be delayed or skipped.

Agile Practices are stressful and highly disciplined practices. I see coming late and delay in sprint plan and review meetings are some of anti-patterns that it may leads to sprints and project poor deliveries.



21 Jan 2015 Javascript Block Level Scope Management

We will have a look at new feature related to scope management in ES6 (Harmony)

What will be the output for this script? Will it run with out errors?

function example(){
"use strict"
console.log(msg);
var msg="hello world";
}
example();

Yes it will compile but it shows message as undefined.

Generally we expects compile or warning. Why?? But one of drawback of Hoisting which is JavaScript's default behavior of moving declarations to the top.

What will be the output for this script? Will it run with out errors?

function example2() {
    "use strict"
    for (var i = 1; i < 5; i++) {
        setTimeout(function () {
            console.log("Iteration"+i);
        }, 10)
    }
    console.log("Last"+i);
}
example2();

Output is

Last5
Iteration5
Iteration5
Iteration5
Iteration5

Why? 5 it is out of my data range of for loop. This behaviour due to Closure access sample reference of variable i and Hoisting

Can I improve this code as

function example2_1() {
    "use strict"
    for (var i = 1; i < 5; i++) {
        var temp = i;
        setTimeout(
            function () {
                (function (j) {
                    console.log(j);
                })(temp);
            }, 10)
    }
}
example2_1();

Now Output as

Last5
Iteration4
Iteration4
Iteration4
Iteration4

It is completely different output and it shows last value because variable was set with last value while execution of function.

We improve this code with immediately invoked function expression(IIFE) as

function example2_1() {
    "use strict"
    for (var i = 1; i < 5; i++) {
        var tempfn = (function(j){
            return function(){
            console.log("Iteration"+j);
            }
        })(i);
        setTimeout(tempfn, 10)
    }
    console.log("Last"+i);
}
example2_1();

Here IIFE tempfn is new function that new scope with j

There are known scope limitation of javascript ES5.It addressed through new concept of let in ES6

Rewrite both examples replace let instead of var

function example() {
    "use strict"
    try{
    console.log(msg);
    let msg = "hello world";
    }catch(e){
    console.log(e);
    }
}
example();

function example2() {
    "use strict"
    for (let i = 1; i < 5; i++) {
        setTimeout(function () {
            console.log(i);
        }, 10)
    }
}
example2();

Output:

[ReferenceError: msg is not defined]
[ReferenceError: i is not defined]
Iteration1
Iteration2
Iteration3
Iteration4

It gives expected result because the scope of variables maintainanced with the block

Update on 23.01.2015: IIFE section was introduced to solve scope issue with previous ES6 version


12 Oct 2014 Are Agile Practices worth?

Scrum and XP Practices are designed for incremental software deliverables when

  • scope is not clear or very frequently changes in requirements
  • difficult to identify activities to perform
  • technical or project risks are high
  • visualize an idea

Traditional Project Management Practices will work very well when

  • scope of work seems to be clear :-) and ability to identify activities and their order of execution
  • less technical or project risks

Both approaches are great based on the context and nature of work.

But I experienced something different during recent assignments.

For one of the recent assignments in product development, I strongly believe Scrum and XP Practices will fit it correctly due to building the concept and understand the technical constraints

we proposed software development practices based on XP and Scrum and build Continous Integration system and shared with the team

we executed four sprints, but it ended up with

  • Sprint items are not ready and too many bugs
  • Basic integration of components is not made.
  • Process owners are team are not happy the process of work.

I think that this situation occurred due to

  • Process owners, Scrum Master are unable to influence the team about agile practices though organization is ready to adapt Agile Practices. Here are a couple of observations
    • delay or overtime for planned meetings like standup,planned and review meetings
    • insufficient information in sprint items with acceptable user stories
    • fail to arrange retrospective meetings
    • lack of mentoring teams and unable to handle anti-patterns development practices
  • Team is unable to accept or adapt practices due to team internal interaction. Here are a couple of observations
    • coming late for the meetings
    • passive in planning and review meetings
    • ineffective standup meetings
    • no interaction with scrum master or process owners to bring sprint results
  • Team members are not ready for the challenge themselves for delivery best from them.Here are a couple of observations
    • consistently missing their sprint items and sharing silly reasons in review meeting
    • ineffective planning their planned works
    • ignore their mistakes that learned from previous sprints
  • Skilled Team Members are not identified for the project(may be)
  • Team size(~12) make slow in decision making

Now, Process Owners don't see other options to meet project schedule back to traditional project management like assign tasks to members and follow up the work with mixing of some agile practices

In summary, People and time are one of the critical factors to choose and adapt right development practice.

Are you facing similar situations then refer of excellent book Succeeding with Agile: Software Development Using Scrum which covers transition and challenges in agile adaptation


18 Jul 2013 Code Refactoring Django Projects

When I started worked with one django project and I encountered the following issues

  • limited knowledge on package dependencies (i.e python modules)
  • Taking so much time to setup development environment and no test cases
  • Code is less organized and coding standards PEP08 are not met.

It leads to much cost of development for upcoming sprints. So I decided that I will put extra effort to refactor existing code to make changes quickly and test the functionality.

I think we need to do iterative approach of * Prepare critical test scenarios * Prepare test data * Refactor source code * Execute test cases

use pip to do package management

Prepare Setup

This approach will be iterative so we need setup.py to install test environment quickly.I developed setup.py through setuptools

import os
from setuptools import setup
from setuptools import find_packages

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

def strip_comments(l):
    return l.split('#', 1)[0].strip()

def reqs(path):
    return list(filter(None, [strip_comments(l) for l in
                open(path).readlines()]))

setup(  # url = "http://packages.python.org/ha",
    name='PACKAGE NAME',
    version='0.0.X',
    author='AUTHOR',
    author_email='AUTHOR@SITE',
    description='PACKAGE DESCRIPTION',
    license='MIT',
    keywords='',
    packages=reqs('./install/app-list.txt'),
    include_package_data=True,
    zip_safe=False,
    long_description=read('README.md'),
    classifiers=['Development Status :: 0 - Beta', 'License :: MIT'],
    scripts=reqs('./install/scripts.txt'),
    install_requires=reqs('./install/requirements.txt'),
    )

Through above script we can easily maintain all required packages in install/requirements.txt

I can use pip to install requirement packages in developer system

pip install -r requirements.txt

Prepare Test Cases

I think py.test provide quick way to write test cases with prefix of 'test_' to method instead of alternative test suites like py unittest

Refactoring Source Code

  • Tidy Source Code
  • Refactoring Source Code

Using pytidy.py to clean existing code

pytidy tool will work on single python file. So the following script will help to apply for all files

echo '#!/bin/bash
file=$1
cp $file $file.bk
mv $file $file.src
python pytidy.py $file.src $file
#rm $file.src' > test.sh
chmod +x pytidy.sh
find . -name '*.py' -exec ./pytidy.sh {}\;

Refactoring Source Code

Python is dynamic language, sometimes it is very difficult to identify issues due to refactoring. So I would like to recommended

  • Identify external facing components like WEB API,REST and ensure that those components are not effected or corrective decisions are made
  • Django Models fields may effected and try to avoid model changes. If you decided to change model field names then ensure database changes are consistent
  • Changes in url.py considered and it may effect URL Routing(if you decided that url pattern may change then 404 handler has to consider old routing)

Database Refactoring

Generally it is not recommended to database refactoring when there is very limited test cases to valid the functionality.

I see following options database refactoring

  • Use South to Track the database changes and apply those changes in stage or production environments
  • Re-Create Database with the following approach
python manage.py dumpdata|python -m json.tool >data.json
#Make Necessary changes in data.json
# Create new database with new database settings in settings.py
python manage.py syncdb
python manage.py migrate
python manage.py loaddata data.json
  • Refer Book for advanced concepts on database refactoring

What's next ?

After various sprints,we have good number of test cases and source organized with less technical debut and ready for next sprint requirements. Now, we need to start * thinking about in-line documentation wih examples and expose API Documentation through sphinx * continue to use pylint


17 Jun 2013 Analysis AWS Usage

Sometimes, we need to analyze AWS Resources in very detailed to get insights like * Predicted pattern/trend analysis * Fund allocation on cloud * Optimize solution for cost reduction

AWS provides option to collect AWS Resource usage like EC2 Computation time,S3,Cloudfront bandwidth on monthly exported csv,pdf.

refer

Programming Billing access provide details from service activation day onwards. It will not provide direct option to grab informaton of previous months.

Here is short script with mix of javascript and shell script to grab information after login aws admin console

Now we have consolidate file 'summary.txt' then your powerfull tools Excel or google sheets to analyze it.

Alternative approaches:


07 Apr 2013 How to handle error while loading shared libraries

Today, I installed adobe Reader in ubuntu 12.04 x64. While launch adobe reader 'acroread' and i got the following error

"error while loading shared libraries: libgdk_pixbuf_xlib-2.0.so.0: cannot open shared object file: No such file or directory

After googling in web,I used the following approach to address this problem

Run the following command

strace -e open acroread  # Trace system signals

It gives error at unable to load /usr/lib/libgdk_pixbuf_xlib-2.0.so.0

I understand that acroread is x86 version and it is looking for x86 version of libgdk_pixbuf_xlib and it is not installed.

So I install libgtk version with

sudo apt-get install --install libgtk2.0-0:i386

Here is common approach to handle error while loading shared libraries

  • Trace Errors through strace command
  • Use apt-file to findout source of lib of package or similar package manager
  • Install package
  • Enjoy..