Monday, March 28, 2011

Ideas

How often do you have "big ideas"? It frustrates me as I have so many ideas so frequently, and I don't have enough time to implement them all. Once school is out, I'll have some more freetime and will finally be able to hit on all the projects I've got queued right now.

Stay tuned, when May hits, there will be a lot, I might even start making more videos about the projects and build process.

Thursday, March 24, 2011

Google Market vs. Amazon Appstore

The Amazon App store looks good, and yes I do like the recommendations and whatnot just like regular old Amazon. My question for the big G is this, we had to check "unknown sources" just to get the appstore on our phones and download apps through them.

Recently there were some issues with some apps found in the Android App Market and this prompted google to remove apps from their store, as well as remove them from infected phones. Will they continue to do this with Amazon Store apps, or will it be a "too bad" because it's not something we're controlling, and you took the risk.

Will this fall on Amazon's shoulders?

Here are the emails I've sent to Amazon when I get word from them I'll update:

Since we are installing apps from the Amazon App Store, what will the process be if/when an app that has been downloaded has been found to contain a virus?

Tuesday, March 22, 2011

Batch Renaming

I have a bunch of MTS files that I get from my camcorder, and frankly I don't have any interest in sitting down and renaming each file by hand, in perl this is a pretty simple case, I decided I wanted to name them based on their creation date, then number of file in that creation date. I still would say read over this script and make sure you understand what it is doing and then go ahead and use it.

This can easily be modified to work with any kind of file, but I was only concerned about my video camera files. if you want change the <*.MTS *.m4v> to whatever file types you want!


Here is the code:
#!/usr/bin/perl
# Written by Tyson Bailey
# with date/string creation from: http://www.seto.org/mt- diary/archives/2005/11/using_perl_to_d.html
use File::stat;
use Time::localtime;
@files = <*.MTS *m4v>;
$extension = "";
foreach $file (@files)
{
    # get date/time
    $date_string = ctime(stat($file)->mtime);
    # break it up into an array.
    @date = split('\s+',$date_string);
    $i = 0;
    # figure out file extension
    if ($file =~ m/.m4v$/)
    {
        $extension = "m4v";
    }
    else
    {
        $extension = "MTS";
    }
    # Filename format MAR_05_2011_x.extension
    while (-e "@date[1]_@date[2]_@date[4]_$i.$extension")
    {
        $i++;
    }
    # just to be safe
    $base_name = quotemeta("@date[1]_@date[2]_@date[4]_");
    chomp($file);
    # if our filename already exists we really don't want to try renaming it.
    if ($file !~ m/$base_name/i)
    {
        print "Didn't Matched: $base_name\n";
        print "Renaming: " . $file . "\n";
        print "To: @date[1]_@date[2]_@date[4]_$i.$extension\n";
        rename("$file", "@date[1]_@date[2]_@date[4]_$i.$extension");
    }
    else
    {
        print "Not Renaming: $file\n";
    }
}

Big thanks to:
http://formatmysourcecode.blogspot.com/
for formatting my source code!

Wednesday, March 2, 2011