Sunday, April 23, 2017

This is a  collection of software engineering incidents that affected a lot of people. They are presented as different themes.
1) When the tower toppled : The Jenga tower of Javascript was a collection of modules used widely by programmers worldwide with a variety of software applications. When one developer unpublished more than 250 of his modules from a popular package manager, there were hundreds of people unable to build and release their software for use in their operations. The developer was peeved when lawyers representing corporation claimed one of his modules was infringing on a brand with a similar name and contacted the admin manager to take away the package from the developer. The developer retaliated with unpublishing his work which included a library used to pad strings with zeros or spaces on the left and this library was used in the core of popular javascript packages. With the dependency gone, the applications failed worldwide. The package manager took a rare step of "un-un-publishing" the required module so that others can carry on with their work.
2) When a typo took services down. A software engineer had a single typo in issuing a command to a take a bunch of servers offline and ended up taking down a lot more including some critical ones in a popular cloud service for storage. Those same critical servers were storing information about other storage objects used by millions of people. Since these servers had never been taken offline, rebuilding them was not even exercised with a disaster management plan and the company had to go on a war footing to make amends.
3) Left the door open – Although software services allow artifacts from users to be available anywhere anytime through online document sharing schemes, they generally exercise little control over what users may upload or inadvertently share with others. Personal medical information are also often stored in spreadsheets and files and these are put up in document sharing portals. A file indexing system then picks the documents up to read its contents and index it to make it easier to find by search when users enter just a few words in a search bar to lookup documents. It turns out that these same medical information was now just a few clicks away for everyone to see.
4) Wake it up- When systems malfunction and the administrators find that there is little information by way of documentation, they bank their hopes on return to normalcy by shutting the system down and waking it up. Generally all systems perform checks and initializations called bootstrap before resuming normal mode of operations.  It turned out that with a glitch in this bootstrap, administrators could take a system down but not could bring it back up as it went into an endless cycle of reboots until finally someone found a way to trick it back to resuming fully.
5) Jump the clock. Software products often work with dates. It is easy to check for events based on time because time is always progressive. However when the time is based on calendar, subtle repetitions may escape attention. This was exactly the case when the leap year extra day was ignored by a popular database server that affected installs worldwide. It was only mitigated by tricking the database server to think it was working a day before the extra day and jumping the clock to the day after.
#codingexercise
Yesterday we were discussing ways to find if there are subsequences of distinct digits that have a sum divisible by m. If we were to enumerate these, it would be as follows:
Void  Combine(List<int> digits, int m, ref List<int> b, int start, int level,  ref List<List<int>> combinations)  
{  
for (int I =start; I < digits.length; I++)  
{   
  if (b.contains(digits[i])== false){  
    b[level] = digits[i];  

    combinations.Add(b);
    if (I < digits.length)  
        Combine(ref digits, ref b, m, i+1, level+1, ref combinations);  
    b[level] = 0;  
}
}

void PrintSubsequencesWithSumDivisibleByM(List<int>digits, int m)
{
var b = new List<int>();
digts.ForEach(X => b.Add(0));
int start = 0;
int level = 0;
var combinations = new List<List<int>>();
Combine(digits, m, ref b, start, level, ref combinations);
Combinations.forEach(x => {
         if (x.Sum() %m == 0){
                x.ForEach(t=> Console.Write("{0},", t));
               Console.WriteLine();
 });
}














No comments:

Post a Comment