Sometimes you find a string will contain non-printable characters. This line of code has helped me to remove those invisible characters that can mess things up a bit.

$cmd =~ s/([\x00-\x1f])//ge;

So I took the plunge, and designed a chatbot from the ground up using mySQL and Perl.  The basic framework looks good so far, but the knowledge base has a lot more work ahead of it.

I started my first bot.  She is still very dumb, so please don't complain or insult the poor bot for her lack of intelligence.  The idea is to get the bot out there, to start talking to the world, so that I can start getting feedback on what is being said, and start the data mining part of the project to improve the knowledge, one piece at a time.

Please note that everything you say to the bot is recorded, and will be reviewed, so please do not post any personal information (or do so at your own risk).

There are two ways to interact with Cylina.  You can use IRC (#ChatbotsRus on Freenode) or the web.  (Note the IRC version will only work if the PC at home has a connection to the net).

So go for it!  Don't tell me what you think, tell the bot!

As for the code, I have not decided yet when I will make it public.  For now I'll keep it proprietary.  If you are interested in helping out, or would like to run your own bot, get in touch with me and let's see what we can do.  For now I want to focus on the bot itself, and develop the code as the needs develop.

My holidays were great, and part of my time was spent researching AIML (Artificial Intelligence Markup Language).  For those unfamiliar with AIML, it is an XML based language used to build chat bots.  The most famous one on AIML is known as ALICE. Continue reading

This morning I took the iPhone, with it's locked screen, and activated Siri.  Siri jumped on attention, and I said "Call Marnelle", and Siri did it (let me remind you, the phone was locked).

Sending a message, the same thing.  Everything was pretty much accessible through Siri.  This was a bit of a worry.   I found that this is not something new.  Many people have written about the topic.  The fix is really easy.

If you're an iPhone user with Siri, follow these easy steps to secure your phone.

  1. Tap "Settings"
  2. Tap "General"
  3. Tap "Passcode lock"
  4. Enter your passcode (if you don't have a passcode, you don't need to worry about this procedure)
  5. Slide the "Siri" switch under "Allow Access When Locked" to the Off position.

siri_security

I could have used Text::CSV or a multitude of other ways.  The code is slow, but it does the job.

To call it, simply pass the line to the &csvsplit function, and it will return an array of a properly split line. It will honour the " as a text starter, and the , as the seperator.

There are ways of doing this through a regular expression, but the example I tried didn't work. The code will be updated as newer and better versions come around.

sub csvsplit
{
        my $line = $_[0];
 
        my @new;
        my $field;
        my $q = 0;
        for(my $k=0;$k<length($line);$k++)
        {
                my $ch = substr($line,$k,1);
                if($ch eq "\"")
                {
                        if($q == 0)
                        {
                                $q = 1;
                        }
                        else
                        {
                                $q = 0;
                        }
                }
                else
                {
                        if($ch eq "," && $q == 0 || $k == length($line)-1)
                        {
                                push(@new,$field);
                                $field = "";
                        }
                        else
                        {
                                $field .= $ch;
                        }
                }
        }
        return @new;
}

I did find this page that also worked well.

So it's December 21st, 2012 here in Australia.  The end of the world, according to the Mayan calendar (or so they say).  While I'm staring death in the face (with it already being the 21st here in Australia), waiting for earthquakes, asteroids, my internet going down, I thought I would share some essential survival tips with you.

  • Find a nice spot.  Some choose to book expensive hotels, and await their demise in style.  Don't worry about the bill.  Even the hotel staff can't escape!
  • Spend all your life savings.  Go buy that fancy new car, just to feel what it feels like. You won't need it afterwards.
  • Tell your boss what you really think of him!  It's good to get things of your chest, and this is the perfect opportunity!  You won't need a job after December 22nd anyway.
  • Don't worry about the consequences of immoral actions.  It's the end of the world, so ladies, you can't get pregnant!

So while I write my last blog post forever, that will hopefully be found by aliens may thousands of years from now, I wish you all good luck.

This entry is sponsored by Matthew 24:36

Yesterday I had the privilege of seeing my daugter perform at a local school play.  I whipped out my shiny new iPhone 5, hit the video record, and 10 minutes later, the file the phone recorded was a whopping 2GB.

I have a Linux machine, loaded with mencoder and ffmpeg, but my first attempt at reencoding the iPhone video into xvid resulted in a file over 500MB, still too much to email to family overseas.  500MB for a 10 minute video is a bit insane. Continue reading

I upgraded two phones on my Optus account to iPhone 5 late November 2012.  I received by bill this morning, and noticed a couple of international SMSs that we did not make.  I'm trying to determine conclusively what caused these SMSs, and why I'm being billed for them. Continue reading

my $file = substr($d,rindex($d,"/")+1);

# find the largest file
find . -xdev | xargs ls -ld | sort -nrk5 | pg

# find the largest directory
find . -xdev -type d | xargs du -sk | sort -nr |pg