Explaining a simple argument

Author: Administrator  //  Category: Linux

I had a conversation today, where the other party disagreed with me about the following text which I saw in Madden 09:

“The Bengals have played the Steelers more than any other team in the NFL”.

My assertion was that the statement was ambiguous and did not make sense as you could not figure out which team played the other team the most in their own history.

My interpretation of the statement was:

  • The Bengals could have played the Steelers more than any other team in Bengals history
  • The Steelers could have played the Bengals more than any other team in Steelers history

Also Wikipedia appeared to have the correct statement: “the Bengals have met the Steelers more than anyone else in their own history”, which was not ambiguous to me.

Please comment on this as they are having a hard time believing my argument, and if I am wrong I would love to know.

Related posts:

  1. 5 Things I Have Learned About Corporations When I was younger I would email successful people and…
  2. Fedora 11 vs. Ubuntu 9.04 Put Fedora 11 on my laptop just out of boredom,…

Looking for someone to give me a hand

Author: Administrator  //  Category: Linux

Hoping to reach someone intelligent / talented through this. Basically, I need someone for 2 weeks starting 3/8. It will just be a temporary position, with opportunities to work for us later as needed.

Position involves Linux development, and you should know php / perl. The project will involve modems and java also, and the ability to document everything would be great.

Good news about the position is I am leading the project, so anything you can’t figure out, I will. Pay will be somewhere in the $100/hr range, and we need you to be in Cincinnati for the two weeks (3/8 – 3/19), 40 hours per week.

Send me an email (you can find my info in launchpad) or post a comment here if you think you fit the bill. Anyone who has any Ubuntu development experience or contributions to visible projects will definitely take priority. Remember, you need to have the ability to be in Cincinnati, as travel is not covered.

Related posts:

  1. NCPFS NCPFS each release generally is sent out completely not working…

Pygoocanvas, pygtk etc

Author: Administrator  //  Category: Linux

I was reading a post about PyGoocanvas, and decided to take a look at some code and see what fun could be had. I haven’t done much yet, but this screenshot of it is pretty entertaining in it’s own right:

No related posts.

A thousand passwords

Author: Administrator  //  Category: Linux

In this day and age of the internet, we have more content and interaction than ever before. This access generally comes with a price: everything requires a username and password. How does a mere mortal remember their credentials to login to thousands of websites? More importantly, I am not always on the same computer, how do I access my passwords from all of them?

The long term solution would be to see 100% adoption of OpenID. Inevitably many sites will always be behind the curve, so until that day comes, I recommend Revelation.

Revelation is an easy to use, secure and lightweight password manager for Linux. It is written in GTK so those running the GNOME desktop (the default for Ubuntu) will be right at home. You can have several different folders to help organize your passwords, and define actions based on the type of password being stored.

A picture is worth a thousand words, so here is a screenshot of Revelation in action:
revelation

What makes this great is that all of your passwords are stored encrypted. This means if someone takes your computer, without your master password your passwords would be useless. This also means we can store our password using Ubuntu One or Dropbox.

If you are curious about Dropbox I wrote a post with screenshots showing exactly how it works. Simply save your Revelation password file there, and all of your systems that have Dropbox will now have access to those passwords (once you unlock it for that session of course).

Under the preferences window in Revelation you can also adjust your default password size (when you use Revelation you simply randomly generate a new password for each website) for as long as you need, with the longer the better.

If you are running Ubuntu, you can install Revelation by clicking Applications -> Ubuntu Software Center and searching for Revelation. If you would prefer the command line version:

# sudo apt-get install revelation

There are many alternatives out there, but if you are running Linux and just need a simple, no-hassle password manager Revelation is worth five minutes to try it out.

Related posts:

  1. Fedora 11 vs. Ubuntu 9.04 Put Fedora 11 on my laptop just out of boredom,…
  2. Connecting to Ubuntu from Windows Recently I needed to connect to a Ubuntu box from…

Python and real time graphical analysis

Author: Administrator  //  Category: Linux

I have a camera which has a motor attached which I can rotate using a serial cable. I figured it would be fun to have this camera analyze the webcam shots and turn in any direction there was motion. I pulled out python and pygame, and created a prototype. Unfortunately, I can’t make python go very fast. I made two test cases, 1 in C and 1 in python, to figure out if it would be worthwhile to rewrite it:

array-speed-test.c

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>

void compare_arrays(int **screen1, int **screen2)
{
    int x;
    int y;
    int diff;
    int mult;

    for(x = 0; x < 1920; x++) {
        for(y = 0; y < 1080; y++)
        {
            mult = screen1[x][y] * screen2[x][y];
            diff = abs(screen1[x][y] - screen2[x][y]);
        }
    }
}

int main(int argc, char **argv)
{
    srand(time(NULL));
    printf("Generating arrays...\n");
    int **screen1;
    int **screen2;
    int i = 0;
    int j = 0;
    struct timeval now;
    struct timeval end;
    int usecs_passed;

    screen1 = malloc(1920 * sizeof(int *));
    screen2 = malloc(1920 * sizeof(int *));
    for(i = 0; i < 1920; i++)
    {
        screen1[i] = malloc(1080 * sizeof(int));
        screen2[i] = malloc(1080 * sizeof(int));
    }

    for(i = 0; i < 1920; i++)
    {
        for(j = 0; j < 1080; j++)
        {
            screen1[i][j] = rand() % 255;
            screen2[i][j] = rand() % 255;
        }
    }

    printf("Comparing arrays...\n");

    gettimeofday(&now, NULL);
    compare_arrays(screen1, screen2);
    gettimeofday(&end, NULL);

    usecs_passed = end.tv_usec - now.tv_usec;

    printf("Time passed: %dms\n", (usecs_passed / 1000));
    for(i = 0; i < 1920; i++)
    {
        free(screen1[i]);
        free(screen2[i]);
    }

    return 0;
}

And my python code:

array-speed-test.py

#!/usr/bin/python
import random
import time
from math import fabs

def generateArray():
    array_to_gen = [None] * 1920
    for i in range(0, 1920):
        array_to_gen[i] = [None] * 1080

    for x in range(0,1920):
        for y in range(0, 1080):
            array_to_gen[x][y] = random.randrange(0,255)

    return array_to_gen

def compareArrays(screen1, screen2):
    for x in range(0, 1920):
        for y in range(0, 1080):
            diff = fabs(screen1[x][y] - screen2[x][y])
            combo = screen1[x][y] * screen2[x][y]

if __name__ == "__main__":
    print "Generating arrays..."
    screen1 = generateArray()
    screen2 = generateArray()

    print "Created two screens.  Comparing..."
    startTime = time.time()
    compareArrays(screen1, screen2)
    print "Time taken: " + str((time.time() - startTime) * 1000) + "ms"

So far, the C program runs in 25ms, while the python program consistently takes 1100ms. Might have to ditch python for real time analysis, unless someone wants to point out how I am doing this completely wrong (I am assuming the comments will be use Numpy?)