Tag Archives: C#

Its My Birthday… Again

In just a few hours its my birthday, I’m assured its time I lied about my age. I’m going with that I’m 3869 years old, and changing my name to Methstevelah, Methuselah’s cooler brother.

Spirytus 96% Polish Vodka

Spirytus 96% Polish Vodka

Last year I bought my self a new Synology NAS Unit, this year I bought myself an Amazon Echo which I mentioned wanting to learn to code in C#. I have found Javascript maybe a better option rather than C#, but I’m still exploring.

I have worked on many JavaScript applications, so I have a basic understanding, as for Node.JS I have no idea, so maybe order a book or two for my birthday. 

I have wrote my first Skill and won a Echo Dot, and working on my second skill which is domainer related and once its more complete I’ll post more about it.

My sister got me the bottle of Polish Rectified Spirytus at 96% Alcohol by Volume, which is my 4th Strongest Alcohol in my bar. 

1, Denatured Alcohol at 100%
2, Spirytus 96%
3, Knockeen Hills Poteen at 90%.
4, Hapsburg Premium Absinthe 89.9%.
5, Balkan Vodka at 88%.

The denatured alcohol was acquired for a science project, such a hassle, its not really drinking, but given its pure alcohol I listed it.

Diet Death

Amazon Echo

Amazon Echo

I have just ruined my work out today by polishing off a pack of Sainsburys sugar ring doughnuts, but as my friend Saskia says Birthday Cake or Doughnuts in my case have no calories, so my hour on the cross trainer today is still valid 😛

A year on I have actually had the first part of my shoulder surgery, the left shoulder is done and and I’m well into rehab. I’m just starting to warm up my shoulder in the gym with some light machine work. Irony is when I say I’m doing light work, everyone is like should you be lifting that much ? My light seems to be most peoples heavy.

New Skillset

Sadly my new skillset isn’t going off this year as the training courses in both near by colleges who offer the course are full. Upside I’m £6,000 a year better off, which is what the course would cost, plus books and whatever else I would need.

College is bloody expensive.

Coding Amazon Echo Skills for Alexa with C#

Amazon Echo

Amazon Echo

I was reading this months CODE Magazine and there is an article about coding new Skills for Amazon Echo and Echo Dot to extend Alexa’s functionality. When you think about how you could extend Alexa to fit into your life, it could be well worth adding C# into your life. Amazon Echo is currently on offer for Mothers Day, with a £15 discount, maybe the time to get one. 

Lets say you want to check if a domain is registered, you could say “Alexa ask NominetTool if steven.uk is registered ?” or Alexa ask NominetTool who steven.uk is Registered to ?”. I guess depending on how accurate Alexa turns out to be, you could even try “Alexa ask NominetTool to Register steven.co.uk”.

I don’t have an Echo or Echo Dot, nor do I code in C# but this article does make it seem like a fun reason to learn. Its been maybe 10 yrs or more since I last opened VC++, and probably longer than that since I last wrote any reasonable amount of code. Looking at C# it doesn’t look that difficult once the new syntax makes sense. If I can pick up a cheap Echo or Echo Dot, I may just delve in to this. 

Looking at the code sample they provided…

HowTo.prototype.intentHandlers = {
   "RecipeIntent": function (intent, session, response) {
      var itemSlot = intent.slots.Item, itemName;
      
      if (itemSlot && itemSlot.value) {
         itemName = itemSlot.value.toLowerCase();
      }
      
      var cardTitle = "Recipe for " + itemName,
         recipe = recipes[itemName],
         speechOutput,
         repromptOutput;
      
      if (recipe) {
         speechOutput = {
            speech: recipe,
            type: AlexaSkill.speechOutputType.PLAIN_TEXT
         };
      
         response.tellWithCard(speechOutput, cardTitle, recipe);
      } else {
         var speech;
      
         if (itemName) {
            speech = "I'm sorry, I currently do not know the
                       recipe for " + itemName + ". What else can I help
                       with?";
         } else {
            speech = "I'm sorry, I currently do not know that
                       recipe. What else can I help with?";
         }
      
         speechOutput = {
            speech: speech,
            type: AlexaSkill.speechOutputType.PLAIN_TEXT
         };
      
         repromptOutput = {
            speech: "What else can I help with?",
            type: AlexaSkill.speechOutputType.PLAIN_TEXT
         };
      
         response.ask(speechOutput, repromptOutput);
      }
   },
      
   "AMAZON.StopIntent": function (intent, session, response) {
      var speechOutput = "Goodbye";
      response.tell(speechOutput);
   },
      
   "AMAZON.CancelIntent": function (intent, session, response) {
      var speechOutput = "Goodbye";
      response.tell(speechOutput);
   },
      
   "AMAZON.HelpIntent": function (intent, session, response) {
      var speechText = "You can ask questions such as, what's the
                 recipe, or, you can say exit... Now, what can I help you
                 with?";
      
      var repromptText = "You can say things like, what's the
                 recipe, or you can say exit... Now, what can I help you
                 with?";
      
      var speechOutput = {
         speech: speechText,
         type: AlexaSkill.speechOutputType.PLAIN_TEXT
      };
      
      var repromptOutput = {
         speech: repromptText,
         type: AlexaSkill.speechOutputType.PLAIN_TEXT
      };
      
      response.ask(speechOutput, repromptOutput);
   }
};

It looks quite simple to program, I guess you would use a PHP or C# web interface to execute the Recipes section, or in the example I gave to handle the domain name queries. Port the Whois Family Parser over to C# and you would be able to ask questions about whois result. 

Exciting times ahead.