Funzy Tech Musings on technology

21Jan/100

Percentage Comparison of 2 Strings

A recent project had me trying to determine a way to compare two strings and calculate their percentage difference. I was using Java and honestly figured there would be a built in function that would do just that. Unfortunately that was not the case.

After doing a good deal of research I discovered the Levenshtein Distance. Using the psuedocode on Wikipedia (and bits of code elsewhere) I was able to create a function that returns the percentage difference between the strings. I cannot take 100% credit for the script, but feel free to use it in any way you see fit.

public static int getLevenshteinDistance (String s, String t) {
if (s == null || t == null) {
throw new IllegalArgumentException("Strings must not be null");
}

int n = s.length();
int m = t.length();

if (n == 0) {
return m;
}

else if (m == 0) {
return n;
}

int p[] = new int[n+1];
int d[] = new int[n+1];
int _d[];
int i;
int j;

char t_j;

int cost;

for (i = 0; i<=n; i++) {
p[i] = i;
}

for (j = 1; j<=m; j++) {
t_j = t.charAt(j-1);
d[0] = j;

for (i=1; i<=n; i++) {
cost = s.charAt(i-1)==t_j ? 0 : 1;

d[i] = Math.min(Math.min(d[i-1]+1, p[i]+1),  p[i-1]+cost);
}
_d = p;
p = d;
d = _d;
}

//Determine percentage difference
double levNum = (double)p[n];
double percent = (levNum/Math.max(s.length(),t.length()))*100;
int percentDiff = (int)percent;

return percentDiff;
}

5Jan/101

Guake for Windows

If you ask me, Guake is the next best thing since sliced bread for GUI-based Linux users. It allows you to open a persistent, transparent terminal window by pressing F12 while in Gnome. Did I mention it's toggle-activated. Meaning when you don't need it in front of you, you press F12 again and it slips into your top bar. The transparency is great for when you are reading an article and want to see the commands you need to run through the terminal window.

So on to my dilemma. My work machines are all Windows-based and I found myself doing more and more remote Linux management using them. Now if only I could find a Guake alternative for Windows... I spent the good part of a weekend trying to do just that. I finally stumbled upon a few great articles that helped me piece it all together...

Combine PuttyTray, Launchy, and putty-launchy-plugin and you've got yourself a darn close match to Guake.

I've used Launchy before, so I had that installed. PuttyTray was new to me, but came up when searching for transparent putty. After installing and launching PuttyTray, click the Window option on the left.

You'll notice the Window transparency option at the bottom. I find setting it between 175 and 185 works best for me, but try it out on your own setup to fine tune.

If you're also looking to have the putty terminal be a certain size or fill up the entire screen, you can adjust this by playing with the Columns & Rows settings within PuttyTray.

The last piece is the putty-launchy-plugin. Install it, and open the Launchy options (Alt+Space and press the little gear in the top right). Click Plugins and you'll notice a new plugin called Putty. Specify the path to your PuttyTray executable and adjust the remaining settings as needed.

Now, to launch a persistent, transparent terminal window, simply press Alt+Space and type in "ssh". If you get further into it you'll notice that your saved sessions can be executed from Launchy as well. Enjoy!

7Sep/095

Tracking your sales leads, for free

While working at a local Rochester firm, sales tracking consisted of a precariously rigged Excel sheet that only one person could edit at a time, was consistently out-dated, and just all around horrible to use. Not to mention you couldn't access it outside the network without VPN access.

After asking around, this was a pretty typical setup. And the response from business owners when asked about sales tracking tools consisted of, "sales tracking is for the big guys" or "small to medium businesses can't afford full time sales professionals, let alone a system to track their leads."

In comes SugarCRM... It's open source, runs on a LAMP (Linux, Apache, Mysql, PHP) server, and takes less than 30 minutes to set up. It sounds too good to be true, I felt the same way trying it out.

SugarCRM

After the initial setup I copied what I could from the existing spreadsheet into SugarCRM, showed it to my boss, and had her test it out for a few days. The result, she was amazed! It was immediately implemented to everyone within the company (every employee is a salesperson within a small business).

One of the best features is the ability to add cloud connectors (LinkedIn, Jigsaw, homebrew) to your leads. Once you're logged in you can hover over a LinkedIn icon and see if you have any connections within the organization, or if you've even spelled the company's name correctly.

I'd have to say the second best feature is the charts/reports. A picture truly is worth a thousand words. The below image makes it even easier to see that  a large amount of potential money is stuck in the First Discussion phase and gives staff an opportunity to put emphasis on opportunities within that bucket.

funnelChart

If you're already using SugarCRM you may notice that the above funnel chart doesn't come built in. I have a secret for enabling it, leave a comment and I'll send you the details.

Oh and don't forget the ever popular plugin capability! Anyone with a will and a way has been at work creating features and functions to make the tool fit your needs.

I'm writing this about a month after roll-out and things are going strong. Sales leads generation is up, sales are up, and we've developed a nurture program for companies who have expressed interest but may not be ready to purchase.

Without further sounding like a complete commercial, go have a look. Get rid of the idea that sales tracking is costly and time consuming. Find the nearest open source guru, an afternoon and be amazed at how cheap and simple lead tracking can be.

   
Get Adobe Flash playerPlugin by wpburn.com wordpress themes