Blog Archives

Benefits of Moving More Services Online

Moving More Services Online

Many companies are looking to regenerate positive momentum. The business conditions we face are clearly not for the faint of heart. The times are daunting, volatile, and uncertain. Uncertainty makes planning harder to do, but more important.

For the last 20 years, planning was relatively easy. Economic trends were positive, steady, and predictable. It was a time of optimism in the technology and equity markets. The Internet frenzy was in full swing, and many believed that the tech sector was immune to downturn. Traditional assets were viewed as a liability. Virtual companies flourished, unencumbered by the economic rules other businesses had to live by. The promise appeared unlimited.

Reality, however, intervened with the economic and market downturn in 2001. Many business leaders paused, reflected, and decided to trek back to solid ground. Perspective on the Internet, too, clearly changed. But just as the most vocal advocates of the Internet were guilty of overstatement back then, so too are today’s doomsayers. The Internet has made a lasting impression on our personal and our business lives.

Today’s winners will have the greatest flexibility in their technology, infrastructure, and business model. They don’t just respond to change, they embrace change and become better and stronger.

Tagged
Posted in Business and Strategy Software and Programming

Be More Proactive by Systems Thinking

Be More Proactive by Systems Thinking

How often do you find yourself “putting out fires?” Do you want to position yourself for more proactive and effective thinking?

Systems thinking allows you to look at organizational dynamics. Instead of getting caught up in the details of a situation, you engage in systems thinking to shift your thinking from details to dynamics. You see the interrelationships in any situation, allowing you to think cross-functionally.

Three steps are involved:

  • Step 1: Observing patterns. Ask, “How many times have I seen this kind of behavior?” Is there a pattern emerging?
  • Step 2: Uncovering underlying structure. What is causing this behavior? The structure of the system influences the behavior of its members. Consider, for example, a compensation system that rewards individual behavior even though one of your goals is team-based work.
  • Step 3: Increasing your leverage in the system. Once you begin to see the patterns and underlying structures, you can then resolve your challenges for the long term by looking for the highest leverage in any situation. This leverage helps you to think strategically and solve problems for the long term because you are focused on fundamental causes-and implement solutions that benefit the whole organization rather than just individual departments due to the systems perspective of interconnectedness.

Systems thinking helps you to anticipate rather than react to events. The more you can anticipate what is going on, the more power you will have in dealing with an emerging challenge.

Tagged
Posted in Management and Leadership Mental Models and Psychology Software and Programming

How Larry Page, Sergey Brin, and Marissa Mayer Process Emails

How Marissa Mayer Handled Email while at Google

How Marissa Mayer Handled Email while at Google In an interview with tech journalist David Kirkpatrick for Fortune Magazine’s “Secrets of greatness: How I work” series, Marissa Mayer revealed how she processes emails. Marissa was then the Vice President of Search Products and User Experience, and is presently the CEO of Yahoo!

I don’t feel overwhelmed with information. I really like it. I use Gmail for my personal e-mail—15 to 20 e-mails a day—but on my work e-mail I get as many as 700 to 800 a day, so I need something really fast.

I use an e-mail application called Pine, a Linux-based utility I started using in college. It’s a very simple text-based mailer in a crunchy little terminal window with Courier fonts. I do marathon e-mail catch-up sessions, sometimes on a Saturday or Sunday. I’ll just sit down and do e-mail for ten to 14 hours straight. I almost always have the radio or my TV on. I guess I’m a typical 25- to 35-year-old who’s now really embracing the two-screen experience.

How Larry Page / Sergey Brin Handle Email at Google

Ever wonder how CEOs of large companies manage and process the hundreds or thousands of emails they receive daily?

Larry Page and Sergey Brin, co-founders of Google In a thread on managing loads of email, Quora user David Shin, who previously worked at Google, remembers Page and Brin being asked this question during a Q&A session at Google. When someone asked how they manage their email, one of them (he can’t remember which) responded like this:

When I open up my email, I start at the top and work my way down, and go as far as I feel like. Anything I don’t get to will never be read. Some people end up amazed that they get an email response from a founder of Google in just 5 minutes. Others simply get what they expected (no reply).

Tagged
Posted in Software and Programming

C/C++ Implementation for Longest Common Substring Algorithm

C++ The longest common substring problem is to find the longest string that is a substring of two or more given strings.

You can build a generalized suffix tree for a set of strings with multiple strings using this implementation. A suffix tree contains all the suffixes of the given text as their keys and positions in the text as their values.

string longestCommonSubstring(const string& str1, const string& str2)
{
  if(str1.empty() || str2.empty())
  {
    return 0;
  }
  int *curr = new int [str2.size()];
  int *prev = new int [str2.size()];
  int *swap = NULL;
  int maxSubstr = 0;
   string longest;
  for(unsigned int i = 0; i < str1.size(); ++i)
  {
    for(unsigned int j = 0; j < str2.size(); ++j)
    {
      if(str1[i] != str2[j])
      {
        curr[j] = 0;
      }
      else
      {
        if(i == 0 || j == 0)
        {
          curr[j] = 1;
        }
        else
        {
          curr[j] = 1 + prev[j-1];
        }
          if(maxSubstr < curr[j])
        {
          maxSubstr = curr[j];
             longest.clear();
        }
          if (maxSubstr == curr[j])
          {
            longest += str1.substr(i - maxSubstr + 1, i + 1);
          }
      }
    }
    swap=curr;
    curr=prev;
    prev=swap;
  }
  delete [] curr;
  delete [] prev;
  return longest.substr(0, maxSubstr);
}
Tagged
Posted in Software and Programming

C/C++ Implementation of Levenshtein Distance Algorithm for Approximate String Matching

C++ The Levenshtein is a measure of how costly it is to adapt a string into another one. If you assign a cost to adding a single character, switching one character for another, and removing a character then you can compute the cost between any two given strings.

Changing a character can be seen as removing a char and adding another one so when adding has cost 1 and removing has cost of one a modification has cost of 2.

The difference between two strings can also be measured in terms of the Levenshtein distance: the distance measure if you think the cost as the “distance” between two strings.

Text comparison is becoming an ever more relevant matter for many fast growing areas such as information retrieval, computational biology, online searching. Levenshtein distance can be used mostly to edit distance, explaining the problem and its relevance.

int levDistance(const std::string source, const std::string target)
{
  // Step 1
  const int n = source.length();
  const int m = target.length();
  if (n == 0) {
    return m;
  }
  if (m == 0) {
    return n;
  }
  // Good form to declare a TYPEDEF
  typedef std::vector< std::vector > Tmatrix;
  Tmatrix matrix(n+1);
  // Size the vectors in the 2.nd dimension. Unfortunately C++ doesn't
  // allow for allocation on declaration of 2.nd dimension of vec of vec
  for (int i = 0; i <= n; i++) {
    matrix[i].resize(m+1);
  }
  // Step 2
  for (int i = 0; i <= n; i++) {
    matrix[i][0]=i;
  }
  for (int j = 0; j <= m; j++) {
    matrix[0][j]=j;
  }
  // Step 3
  for (int i = 1; i <= n; i++) {
    const char s_i = source[i-1];
    // Step 4
    for (int j = 1; j <= m; j++) {
      const char t_j = target[j-1];
      // Step 5
      int cost;
      if (s_i == t_j) {
        cost = 0;
      }
      else {
        cost = 1;
      }
      // Step 6
      const int above = matrix[i-1][j];
      const int left = matrix[i][j-1];
      const int diag = matrix[i-1][j-1];
      int cell = min( above + 1, min(left + 1, diag + cost));
      // Step 6A: Cover transposition, in addition to deletion,
      // insertion and substitution. This step is taken from:
      // Berghel, Hal ; Roach, David : "An Extension of Ukkonen's
      // Enhanced Dynamic Programming ASM Algorithm"
      // (http://www.acm.org/~hlb/publications/asm/asm.html)
      if (i>2 && j>2) {
        int trans=matrix[i-2][j-2]+1;
        if (source[i-2]!=t_j) trans++;
        if (s_i!=target[j-2]) trans++;
        if (cell>trans) cell=trans;
      }
      matrix[i][j]=cell;
    }
  }
  // Step 7
  return matrix[n][m];
}
Tagged
Posted in Software and Programming

C/C++ Functions to Convert to UPPER CASE and lower case

C++ C and C++ implementations that follow the standard library provide two functions in the header ctype.h to convert to upper and lower cases.

char upperA = toupper('x');
char lowerA = tolower('X');

But if you want to write your own function to convert cases, here are two functions that use the string.h header.

C and C++ Functions to Convert to lower case

string lowercase(string s)
{
        for (unsigned int i = 0; i < s.size(); i++)
                if (s[i] >= 0x41 && s[i] <= 0x5A)
                        s[i] = s[i] + 0x20;
        return s;
}

C and C++ Functions to Convert to UPPER CASE

string uppercase(string s)
{
        for (unsigned int i = 0; i < s.size(); i++)
                if (s[i] >= 0x61 && s[i] <= 0x7A)
                        s[i] = s[i] - 0x20;
        return s;
}
Tagged
Posted in Software and Programming

Definition: Stochastic Processes

Stochastic Processes

A stochastic process is a series of trials the results of which are only probabilistically determined. Examples of stochastic processes include the number of customers in a checkout line, congestion on a highway, and the price of a financial security.

In a stochastic or random process there is some indeterminacy. The term stochastic is usually applied to sequences of trials ordered in time. As an example consider a time-ordered sequence of tosses of a fair die with specified probabilities for any given face coming up in a given toss.

Two fundamentally important kinds of stochastic processes are:

  • Bernoulli Sequences, in which the trials are all probabilistically independent of one another, and Markov processes.
  • Markov Processes, where the probabilities for the outcome of a trial may depend conditionally on the outcome of the previous trial, but they are probabilistically independent of the outcomes of any trials before the one immediately preceding the trial in question.

Recommended Reading

Tagged
Posted in Mental Models and Psychology Software and Programming

Three Ways to Use AutoHotKey to Rock Your Firefox Experience

AutoHotkey Numeric Keypad for Firefox

We are devoted aficionados of AutoHotkey, an open-source scripting language that can be used to religiously automate repetitive tasks on the Microsoft Windows operating system tasks and save time. AutoHotkey primarily works by overriding the default key commands on any software that runs on Windows. The core of AutoHotkey is a custom scripting language that can help define keyboard shortcuts or hotkeys.

If the keyboard on your Windows computer has a numeric keypad, you can use the keys on the numeric keypad to assist you with using the Firefox browser. By installing and running these scripts to scroll and close tabs, you don’t need to move your hands a long way from the mouse. Here are three simple scripts.

Scroll Down a Firefox Page using the ‘Add’ Key on the Numeric Keypad

This simple script substitutes the ‘Page Down’ key with the ‘Add’ key on the numeric keypad, thus helping you scroll down on Firefox pages.

NumpadAdd::
        Send {PgDn}
Return

Scroll Up a Firefox Page using the ‘Subtract’ Key on the Numeric Keypad

This simple script substitutes the ‘Page Up’ key with the ‘Subtract’ key on the numeric keypad, thus helping you scroll up on Firefox pages.

NumpadSub::
        Send {PgUp}
Return

Close a Firefox Tab using the ‘Pause’ Key

This simple script substitutes the ‘Control + F4′ key combination with the ‘Pause’ key on your keypad, thus helping you close the current tab in the Firefox application.

Pause::
        Send ^{F4}
Return

This AutoHotkey Script Needs ‘MozillaWindowClass’

To restrict the customization of these special keys just to the Firefox browser, you will need to an #IfWinActive block with the ahk_class set to MozillaWindowClass. Here is the full script. Actually, MozillaWindowClass refers to any window in any Mozilla application; hence you will notice that these shortcuts work on the Mozilla Thunderbird email application as well.

#IfWinActive ahk_class MozillaWindowClass
        Pause::
                Send ^{F4}
        Return
        NumpadAdd::
                Send {PgDn}
        Return
        NumpadSub::
                Send {PgUp}
        Return
#IfWinActive

For a basic introduction to the utility of AutoHotkey and a tutorial on installing AutoHotkey and compiling AutoHotkey scripts, see this useful YouTube video or this orderly guide from howtogeek.

Tagged
Posted in Software and Programming

ExifTool: Command Line & GUI to Remove EXIF Image Metadata in Photos

ExifTool: Command Line & GUI to Remove EXIF Image Metadata

Nearly all cell phones, digital cameras, and scanners insert metadata in the digital photos they capture. This is done using the Exchangeable image file format (Exif) data structure or standard.

Some devices just embed the make and model of the camera. Other devices insert more extensive data such as camera settings, GPS location data, and other information that might be specific to that camera or cell phone. Many owners of digital cameras and cell phones are oblivious that their photos are tagged with sensitive information.

Since the Exif data contain information about the photo, the Exif data pose privacy and security concerns. When pictures from these devices are posted online, the Exif metadata can be used to sense the time the photo was taken and the location where it was taken, if the camera or cell phone has the GPS location data feature. The distinctive ID number of the camera device can be used to identify the owner of the camera. It is therefore best to remove Exif data before publishing or posting pictures online and avoid privacy and security concerns.

My favorite software to remove Exif data is ExifTool by Phil Harvey. Exiftool is a cross-platform tool that can remove, modify, and add Exif and other metadata in various file formats. The software is intuitive and easy to use. I use the command line to manipulate whole directories of files using a combination of command options and wildcards.

exiftool.exe -all= -overwrite_original *.jpg
Tagged
Posted in Software and Programming