Linux.com

Community Blogs



Deferred--fat-fingers strike again..

fat finger

 

Recently at work I have noticed an abundance of customers leaving comments with mistyped--"fat-fingered"--email addresses. We have all seen it "yahooo.com", "alo.com","gmale.com". The problem with these lost souls, beside suffering from fat-fingeritis, is the are paying customers and deseve to be heard; "Forgive them for they know not what they do".   The web interface is not maintained by me and asking "those people" to add more logic to the front-end would take an act of congress. I do have control over the email gateways that send these ill fated emails out. After the magick of Google, I stumbled upon the Levenshtein distance theory.  According to wikipedia, "The Levenshtein distance between two strings is given by the minimum number of operations needed to transform one string into the other, where an operation is an insertion, deletion, or substitution of a single character". ;this might work.  I proceeded to look for some code examples and put this together.(I pieced together a couple of examples to suit my needs)

 <code>

#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include <stdio.h>
int levenshtein_distance(char *s,char*t);
int minimum(int a,int b,int c);


int levenshtein_distance(char *s,char*t)

{
  //Step 1
  int k,i,j,n,m,cost,*d,distance;
  n=strlen(s);
  m=strlen(t);
  if(n!=0&&m!=0)
  {
    d=malloc((sizeof(int))*(m+1)*(n+1));
    m++;
    n++;
    //Step 2    
    for(k=0;k<n;k++)
    d[k]=k;
    for(k=0;k<m;k++)
      d[k*n]=k;
    //Step 3 and 4    
    for(i=1;i<n;i++)
      for(j=1;j<m;j++)
    {
        //Step 5
        if(s[i-1]==t[j-1])
          cost=0;
        else
          cost=1;
        //Step 6            
        d[j*n+i]=minimum(d[(j-1)*n+i]+1,d[j*n+i-1]+1,d[(j-1)*n+i-1]+cost);
      }
    distance=d[n*m-1];
    free(d);
    return distance;
  }
  else
    return -1; //a negative return value means that one or both strings are empty.
}

int minimum(int a,int b,int c)
/*Gets the minimum of three values*/
{
  int min=a;
  if(b<min)
    min=b;
  if(c<min)
    min=c;
  return min;
}
int main (int argc, char *argv[]) {
    int result;

   //used just three top domains for testing
    char *domains[3] = {"aol.com", "gmail.com", "comcast.net"};
    int SIZE = 3;
    int x;
    if(argc != 2) {
      printf("Usage: [email address]\n");
    }
    char *first, *second;
    second = argv[1];
    //add loop to go through array
    for(x=0; x < SIZE; x++) {
        result = levenshtein_distance(domains[x], second);
     //if the required steps to match is less than two--I feel confident we have it correct       if (result < 2 ) {
          printf("did you mean %s\n", domains[x]);
        } else {
          printf("could not find a match\n");
        }
    }
    return 0;
}

</code>

Obviously this is not a finished concept, but one can see how this would  be useful. One could use this  to give a list of "possibly-correctable" email addresses in a database table. Anyway found this interesting and wanted to share.

Take care.

 

antiX M8.2 Test 1 now available and looking GREAT!

Here with antiX M8.2 Test 1, running live. Let me tell you why I like antiX so much as a Live CD.

1. Loads, even to RAM, in under two minutes, faster than that to run straight from CD.

2. Recognizes, even on CD, just about any wireless network card you can throw at it.

3. Has a good selection of software, and given that you can run it live, from USB, or install it to disk from the CD, it is easy to install or just use as is (as I am doing right now.

4. It's fast, and I think it is a blend of being easy enough, yet fast enough. You can get smaller Live CDs, but they take more tinkering and they don't have as many good apps. You can get larger live CDs, but they don't boot or run as fast as antiX.

I consider this the #1 top Live CD overall and one of the best systems around. You can run it either as a stable system or you can also customize and build your own system from it. What other system can do all of these things well? Some can do certain tasks better, perhaps, but on the balance this is the best live CD you can get!

The appearance of this version is better than ever - the nicest boot splash screen I've seen yet, thanks to the great artists in the antiX community!

 

Spanish airline uses GNOME

So recently ive been jet setting around the world and have been lucky enough to sample various airline lounges. Airline lounges are the way to go people, there is nothing like free beer before teleporting yourself at 10,000m and 900 km/h+ to the other side of the world. My blissful amusement soared when I discovered while at Barcelona airport that the Spanair lounge had internet internals running some version of the GNOME desktop. Since this encounter ive also discovered that Spanair are using Red Hat Enterprise Linux for various operations optimization applications.

http://www.businesswire.com/portal/site/google/index.jsp?ndmViewId=news_view&newsId=20070910005053&newsLang=en

This makes total sense for an organisation that's operating in a market with such tight margins. Spanair IT, well done.

 

What you gonna do...?

What you gonna do...?

What you gonna do if when trying to ssh to machineB you were accidentally type no to the host key ? 

Dont panic. 

Do this:

vi ~/.ssh/known_hosts

remove the faulty line
you can even remove the whole file

the known_hosts file is on the server *from* which you try to ssh 

Then try to ssh machineB again. And don’t forget to click yes :P

 

Frame buffer ATI RC410, Radeon Xpress 200M

1280x800でフレームバッファ表示
video=radeonfb:1280x800-32@60

起動スプラッシュ
splash=silent,fadein,theme:default console=tty1 quiet

 /boot/grub/menu.lst

title Gentoo Linux 2.6.29-gentoo-r4-Build2
root (hd0,4)
kernel /boot/kernel-genkernel-x86-2.6.29-gentoo-r4-Build2 root=/dev/ram0 real_root=/dev/sda5 video=radeonfb:1280x800-32@60 acpi=force key_timeout=10 splash=silent,fadein,theme:default console=tty1 quiet
initrd /boot/initramfs-genkernel-x86-2.6.29-gentoo-r4-Build2

 

Graphical Python Programming part 2: Write Your Own Screensaver

In part 1 In part I, you learned how to use Python and PyGTK to bring up a window and draw lines and circles. Let's take that example and extend it to draw some pretty graphics.

You've already seen that you can draw a line in your PyGTK app like this:

 

widget.window.draw_line(xgc, x1, y1, x2, y2)

The color, line thickness and line style will all be taken from whatever you've set in xgc, your graphics context.

You can use that to make some whizzy color-changing graphics -- lines constantly redrawing in different positions and colors. You could make a screensaver! See the rest of this excellent howto by ace coder Akkana Peck at LinuxPlanet.

 

Preparing our mind for a Free Software Cloud World

I was reading in some many spanish blogs, my native language, about the the potential risk of move open source and all kind of software to the "cloud computing", because we will not have control of the software running our personal data. Cloud computing exits from the Webmail birth times, but all the major activity with a computer are going to that. What i tell it's obvious, but not at all.

Ubuntu One, from my point of view is an interesting way to the cloud computing in our free world. Not because of the easy way that UO offer the resources, because of, this kind of paradigm shift that the service provide. But "cloud computing collective thoughts" in our community are reflecting another serious tips to analyze. For some projects are critical to keep alive the open source software stack, and for others are just a "responsability and commitement reduction", convenient way to avoid innovation. 

As Fedora Ambassador in the past, i have a beautiful experience around the community specially in Latinamerica, my birthland. But with the new Red Hat President, talking last weeks ago about the "non interest of Red Hat Inc. for a Fedora Desktop as a goal, because of the future of the Linux Desktop in Cloud Computing", makes me think, that this is a wrong vision around the need to get a "perfect desktop". 

 If it is the case, in the Red Hat point of view, theres no need to improve anything, in exception, that makes u earn money. This is not the spirit of Open Source commitement. Take Fedora just as a "test bank", giving away the need to improve the desktop, despiting the potential leadership that Red Hat community had in the past, its a pity so far. But what is the connection of "Cloud Computing" with the "Perfect Desktop"?, Red Hat must "recycle" their Desktop view, and become more responsible with their community, helping improve the desktop, more than compile the last GNOME and KDE version. 

The backbone

Even thought the desktop as we know today, dissapears and becomes a "frame buffer on line",what kind of Cloud Desktop we will use?. If we dont work all together to improve desktop experience, Privative Desktop will rule the future of clod computing and control or freedom will happen on desktop. 

Will be enough time to start a "Free Clound Computing Software Movement", but in this case, the copyfight will be mixed with Personal Data Storage Rights, but this is a track out of scope today. 

Let's help to Linux platform community to improve the desktop experience, cause, i supposa that all of us want a floss cloud desktop standard in the future. 

 

 

Cloudera Announces the Industry's First Certification Program for Hadoop/MapReduce

 

BURLINGAME, Calif., - May 28, 2009 - Cloudera, the commercial HadoopTM company, today announced the Cloudera Certified Hadoop Professional (CCHP) credential - the industry's first certification program for Hadoop and MapReduce. The certification program documents and tests the recipients understanding of big data analysis and how to manage big data using the Hadoop platform.

 

The CCHP credential requires successful completion of a test administered by Cloudera - after which the passing participant's test date is registered and available for third party CCHP certification. The first CCHP test is scheduled for June 23rd, 2009 in Washington DC and costs $499 to register.

 

"For those working with Hadoop and MapReduce, a CCHP certification serves to establish them as a trusted and valuable resource," said Christophe Bisciglia, Founder at Cloudera. "Developers, technical leaders, and data management specialists can use a CCHP credential to demonstrate their experience with Hadoop and MapReduce while customers can reduce risk by relying on contractors and suppliers who retain current Cloudera Certification for their personnel."

This CCHP test focuses on the basic principles of large-scale data processing with Hadoop and MapReduce. Specifically, it will cover:

* Hadoop Basics

* Data Import / Export

* MapReduce Algorithms and Applications

* Hive and Pig Basics

* Understanding when to use MapReduce, Hive and/or Pig

 

In preparation, Cloudera offers a comprehensive array of training sessions, exercises and tutorials designed to provide a deep comprehension around working with Hadoop and MapReduce, as well as related business intelligence platforms such as Hive. For more information about the Cloudera Certified Hadoop Professional credential, visit http://www.cloudera.com/hadoop-training-certification.

 

About Cloudera

Cloudera (www.cloudera.com), the commercial Hadoop company, develops and sells Hadoop, the open source software that powers the data processing engines of the world's largest and most popular web sites. Founded by leading experts on big data from Facebook, Google, Oracle and Yahoo, Cloudera's mission is to bring the power of Hadoop, MapReduce, and distributed storage to companies of all sizes in the enterprise, Internet and government sectors. Headquartered in Silicon Valley, Cloudera has financial backing from Accel Partners and angel investors who include Diane Greene (former CEO of VMware), Marten Mickos (former CEO of MySQL), and Gideon Yu (CFO of Facebook). Cloudera's advisors include the founders of the Hadoop project, Doug Cutting and Mike Cafarella.

 

Blubness, the most powerful force in the universe?

Blubness or the blub paradox is a concept used to explain a phenomenon that occurs when a programmer becomes so cognitively locked into thinking in the programming language they predominately use that they begin to lose their ability (if they ever had it) to recognize the superior power of other languages and instead just view these languages as "weird" because they display different characteristics to their language of choice, blub.

The idea of blub (the average programming language) was first introduced by Paul Graham in his essay "Beating the Averages".

Blubness is a powerful force because it is deeply linked to the human tendency to seek comfort in the familiar and to resist change. It spans all IQ's and levels of programming ability and interestingly seems to very strongly effect those who have excelled in their specific areas of programming expertise.

Here is Paul Graham's "Beating the Averages" essay http://www.paulgraham.com/avg.html

To learn more about the blub paradox join the Anti-blubness group at linux.com http://www.linux.com/community/groups/viewgroup/911-Antiblubness

 

The Lean green eco-friendly Linux machine

Green IT is one of the hottest of today's technology trends, and the GNU/Linux community has risen to the challenge. Along with several corporate partners, the GNU/Linux operating system provides solutions for dealing with power consumption, carbon emissions, and e-waste. See the eco-friendly advances of the GNU/Linux and FLOSS communities with green computing practices and how you can help the cause.
 

OpenSUSE Weekly News #74 WIP

Hello Friends,

ATM i'm workin' on the OpenSUSE Weekly News Issue 74. If you have anything (Posts, Blogs or other), you can send this to: This e-mail address is being protected from spambots. You need JavaScript enabled to view it . So i can add this to the next Issue...

 
Page 114 of 145

Upcoming Linux Foundation Courses

  1. LFS201 Essentials of System Administration
    12 Jan » 30 Mar - Online Self-Paced
    Details
  2. LFD331 Developing Linux Device Drivers
    01 Jun » 05 Jun - Virtual (GUARANTEED TO RUN)
    Details
  3. LFD320 Linux Kernel Internals and Debugging
    08 Jun » 12 Jun - San Jose - CA + Virtual (GUARANTEED TO RUN)
    Details

View All Upcoming Courses


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board