As it happens from time to time, you may need to look up some data from within an Excel file.  In this case, I have a 2 dimensional data set, and I need to pick a value from it.  In this example, I’m interested in the value of 22 for Women in Asia.

excel1

 

Now you can be clever and say : Oh, that’s easy!  Just enter =Sheet1!C3 and you’re all set.  Great… I got 22, but if I decide to add another column, or add a few rows, that falls down.

To overcome this I’ve developed this simple little formula.

=INDIRECT(ADDRESS(MATCH(“Women“,Sheet1!A:A,0),MATCH(“Asia“,Sheet1!1:1,0),1,1,”Sheet1“))

You can work through the statement, and it’s really simple and elegant in it’s use.

  • The first MATCH command looks for the location of the word Women in column A from the sheet Sheet1.
  • The second MATCH command looks for the location of the word Asia in row 1 from the sheet Sheet1.
  • The ADDRESS command then builds the reference to the cell for Sheet1.
  • The INDIRECT command then retrieves the result from that address.

When copying this in your own spreadsheet, you will need to :-

  1. Adjust the word “Sheet1″ to the sheet name where your data is stored.
  2. Adjust A:A to the column where the left hand titles are stored.
  3. Adjust 1:1 to the row where the top titles are stored.
  4. Adjust the words Asia & Women to the terms you’re referencing in either cell.

Since Linux made it’s appearance on the IT scene many years ago, the battle has been raging between the Windows and the Linux fanboys.  And I will admit that I am a Linux fanboy (sorry Ray!!)

I like Linux, I really do.  As a development platform (yeah, I’m the geek that codes in vi) doing development in Perl for web-based application with mySQL, Linux is great.  I love the power you get from the command-line where you can pipe anything to anything.  It is simply a level of computing freedom that you can not explain to a Windows user.

But now something has happened..  There are some applications that just do not work on Linux.  OpenOffice is goodish, but it is no Microsoft Office.  I use Excel everyday at work, and I love it, but sadly calc just does not have the same grunt.  The ribbon menu from Office also does not transfer to OpenOffice, so transferring between Microsoft Office and OpenOffice is painful.

I think my next big gripe is mounting disks.  When you use Ubuntu Desktop, a lot of the stuff just kind-of works.  Cool, but Ubuntu Desktop is bloated.  Canonical loaded every piece of software imaginable onto that one little CD, making it slow and clunky.  I don’t want all that junk, I load what I need, so I install Ubuntu Server (bare bones), and install icewm on top for some of my gui apps, like Google Chrome, vlc and so on.  But when I want to mount a drive letter to a server, I need to enter the password again.  So I do miss some basic kerberos authentication from the Linux command line back to my Windows boxes.  (Maybe there’s a fancy way to setup the /etc/fstab file with a samba file credentials file, but that defeats the point!  It should use my current login !)

And then there’s bitlocker… A great encryption mechanism for Windows, but sadly, not so portable to Linux.  Yes I know there are fuse drivers, but lets face it — it doesn’t work.  I can read bitlocker file systems, but I can’t write to them.

So sadly I find my self putting my Windows drive into my laptop more often than my Linux drive, and it is only a matter of days before I won’t be putting the Linux disk back in anymore.  I will still use Linux for my hosting platform, but as a personal desktop operating system, maybe not so much.

I wanted an easy way to get my chatbot to interact with the world through text-to-speech.  There are a number of built-in TTS options on many operating systems.  I searched around, and I mashed some code together and created a speech JavaScript library that can be called easily within any web application.

See the library in action here.

I was quite interested by the recent cloud photo leakage scandal.  What was not so unsurprising was the total lack of understanding in what really happened.  In various outlets, many are asking why someone would take private photos of themselves.  Others are saying you shouldn’t trust the cloud.  While I do empathise with Miss Lawrence and the others who had their privacy invaded, I do believe there is a general misunderstanding of what really went wrong. Continue reading

#!/usr/bin/perl
 
use strict;
use WWW::Mechanize;
use HTTP::Cookies;
use JSON;
 
my $URL = "http://localhost/chatbot/rivescript.pl";		# == the URL of the RiveScript chat bot
my $MSG = $ARGV[0];						# == the message to pass to the bot
 
# == setup the json interface
my $json = JSON->new->utf8->pretty;
 
# == setup the web interface, with a permanent cookie jar
my $mech = WWW::Mechanize->new( 
     cookie_jar => HTTP::Cookies->new( file => "cookies.txt" , autosave => 1) 
     );
 
# == post a message to the bot
$mech->post($URL,{ message => $MSG });
 
# == decode the json output
my $vars = $json->decode($mech->content);
 
# == display the reply
print $vars->{reply} . "\n";

Within chatbots I believe there should be a core set of knowledge files, call it an operating system, for lack of a better term.  I call it BotOS, which essentially is common knowledge a bot needs to survive.  What I mean by that, is that some things a bot should just know, regardless of it’s personality or purpose.

These are (but not limited to) :

  • A list of substitutions (if I say “what’s”, you know I meant “what is”)
  • A list of person substitutions (if I say “I am” you say “you are”)
  • A list of common spelling mistakes (If I say “becuas”, you know I meant “because”)
  • A list of common redirections (if I say “Where is your house”, you know I meant “Where do you live”)
  • A list of arrays (grouping pork, beef and lamb as meat)

To promote cross collaboration, I’ve decided to host the data file on Google Docs.  Every night, a dump is taken from the file, and converted into an equivalent A.I. text file.  Currently only RiveScript is fully supported, and partial support for AIML.

Update – The Google Docs idea is not working.  I’ll work on something like a Wiki interface.  For now, I’ll maintain the data files.

The resulting files could (in theory) be placed into the same directory as your bot, and start to enhance it’s understanding with the built-in redirection, and also help with the common spelling issues.  However as we’re just starting out, there’s still some work to be done for the BotOS to become a real game changer.

If you would like to contribute, email me with the data you’d like to add in, and I’ll be more than happy to paste it in.  If you’d like to be an active participant, I’ll be more than happy to share the document with you, provided you’ll abide by playing nice, and work towards the spirit of collaborating and improving chatbots overall.

And of course, if you have your own bot language that I have not covered yet, or you find a mistake in some of the code, let me know.  I’d be more than happy to adjust the code to cater for that requirement.

Data files

These files are updated from time to time.  All (except personality.rs) can be dropped in place of your existing bot, and it should enhance the bot’s ability to respond.

  • Substituions, spelling, array and reductions – begin.rs
  • A core set of chatbot rules – core.rs
  • A personality variable file to support the core rules – personality.rs
  • Some factual knowledge (still early days) – knowledge.rs

Some legal stuff

By contributing your content, you are allowing others to benefit from your work.  BotOS may be used in any bot application, be it a hobby or commercial, free or paid.  It doesn’t matter.  You just can not sell a clone of BotOS as your own.
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

#!/usr/bin/perl
use strict;
use Win32::OLE;
 
my $v = Win32::OLE->new('SAPI.SpVoice');
$v->Speak('Hello world');
$v->Waituntildone(-1);

If you have a bank card, chances are that you have the Paypass feature.  Paypass basically lets you pay for goods and services with your credit card by simply “waving” it at the terminal.  On top of that, there is no need to enter a pin for some transactions up to $100.

Now if that doesn’t scare you, it should.

The only reason they are using Paypass is to get customers quicker through the checkouts at the busy shopping centers.  That means more business, and more money for the big companies.  I’m sorry, I insist on using the chip every time.

Risk 1 – someone can scan your card without you knowing

Yes, this can happen.  Since it is a proximity card, there is a risk that someone can stand next to you, and activate the card without you knowing.

Risk 2 – paying the wrong amount

If the merchant enters the wrong amount, chances are you’ll just “scan & go”, not realizing that they’ve overcharged you.  This is thanks to the pinless transaction.

I complained to my bank about it, and they were hiding behind the fact that it’s actually Mastercard who controls it.  They have “no influence over it”.  I asked if I can get PayPass disabled, and they said no.  The only thing they could do is issue me a debit only card, but then I won’t be able to purchase online, or use my card overseas.  Bummer..  They are forcing me to use this insecure technology.

What does Mastercard have to say about it?  Numerous people (including myself) have commented to Mastercard on their Facebook page, and the standard boiler-plate response from them as as follow :-

We understand that you have some concerns relating to PayPass functionality. The inclusion of the PayPass functionality on MasterCard cards is part of an industry wide upgrade with all MasterCard cards in Australia to feature the contactless payment technology within a couple of years. Rest assured even with the PayPass functionality enabled, MasterCard customers are still protected by the Zero Liability Policy: http://www.mastercard.com.au/zero-liability.html for any unauthorised transactions. Additionally, the banks use sophisticated fraud detection software that can identify unusual purchasing behaviours and patterns and can block the card. In the unfortunate situation where cards are lost or stolen irrespective if an unauthorised transaction occurs via PayPass or by the traditional dip and swipe manner, customers are protected.

We hope this answers your queries.

Thanks,
MasterCard Australia

Seriously Mastercard ??

The fact that the entire industry is upgrading it does not make it safe or secure.  When you take away my power to choose when my card can be charged, it is not secure anymore.  Policies like “Zero Liability” is a joke, because as soon as a bogus transaction is noticed, it might be too late, and my kids will go hungry because all my money will be gone.  I am sure they will require me to go to the bank, fill in numerous forms, and prove to them why I should get my money back.  They are not going to make it easy.  And for the fraud protection?  Come on… I know business intelligence solutions have come a long way, but we’re talking about millions of transactions a day, and correlating all that information is no easy task.

There is a way to disable Paypass, although the banks may not recommend it (and it may actually break the card), but if you’re concerned about the security of Paypass, maybe this is worth looking into.

I am very happy with my SSL certificate installation!

That’s right… All of massyn.net is now running as an encrypted site.  I just managed to finish up the last bit of config on my .htaccess file, and WordPress is also very happy with running on SSL.

I’m really glad I switched to my own virtual machine..  This is very cool.