Sunday, April 30, 2017

We continue with the list of important software incidents in recent history as described here
30) mistaken blame - Sometimes incidents are attributed to software bugs when in fact they occur due to manual error.Notably, a self-driven car covered 2994 miles coast to coast with three passengers in about 57 hours. While it did this successfully there were a few moments when the car was negotiating turns at high speed and instead of following the apex, it was trying to follow the lanes. The car could have careened off but it was held stable by hands on the wheels This is not a software bug but the system was being made to operate outside the zone of recommended speed. The accomplishments far outweigh the blame.  There are in fact far fewer if any accidents involving normal use of self-driven cars.  That said several accidents are avoided due to the practice of disengagement where a human safety driver takes control of the wheels. Every maker of self-driven car has to report the number of disengagements to give an indication of the overall safety. Google for instance reported 341 disengagements in 424000 autonomous miles over a period of fourteen months in 49 self driving cars.
31) trust the trusted - Some instruments are used for the comfort of knowing they represent security. Private keys are used as such for purposes of encrypting data either at rest or in transit. These keys are cut with random numbers but in some cases the random numbers could be predictable throwing open the possibility of keys being compromised.  This was the case with Valgrind which is a maintainer of Debian. In a software patch of the OpenSSL, the random number generator was broken. The patch was uploaded in late 2006 and made its way into the official release and only reported in early 2008. Keys that were cut with the patch were all compromised in that sense and so was anything that they protected. Still keys continue to be used for encryption.
32) Tunnels - Most people are familiar with the use of https and vpn as securing point to point traffic while absence allows traffic to be visible and even routed in the open. They assume an encrypted channel to be one continuous tunnel for the application. But a proxy can exist breaking the tunnel into two and pretending to be the receiver for the sender and the sender for the receiver at the same time.  
#codingexercise
find the count of appearances of a given digit k insequential numbers upto n
int GetCount(int n,  int k)
{
int count = 0;
for (int i = 0; i <=n; i++)
{
var digits = i.ToDigits();
count += digits.Count(t => t == k);
}
return count;
}
Each digit may appear in combinations of lengths 1 to len(ToDigits(n)) and this can be counted in the form of binomial coefficients. Moreover the digit can occur in repetitions for the same length it can only be repeated for the length of the combination again countable by the binomial coefficients. Each repetition can also have permutations This can help avoiding sequential check for the numbers upto a watermark smaller than the number.

No comments:

Post a Comment