<?xml version="1.0"?>
<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007" xmlns:atom="http://www.w3.org/2005/Atom">
   <channel>
      <title>Blag blogs!</title>
      <description>Pipes Output</description>
      <link>http://pipes.yahoo.com/pipes/pipe.info?_id=b2ff46214b30613bced2561728ed39e9</link>
      <atom:link rel="next" href="http://pipes.yahoo.com/pipes/pipe.run?_id=b2ff46214b30613bced2561728ed39e9&amp;_render=rss&amp;page=2"/>
      <pubDate>Thu, 01 Oct 2015 21:39:37 +0000</pubDate>
      <generator>http://pipes.yahoo.com/pipes/</generator>
      <item>
         <title>My first post on Ada</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/KRAmS18VUx4/my-first-post-on-ada.html</link>
         <description>Well...it might be my fist post on &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.adacore.com/adaanswers/about/ada&quot;&gt;Ada&lt;/a&gt;&amp;nbsp;but it's not my first encounter with Ada -;) I learned it about 10 years ago or more...but until now...I didn't give to much of a use...&lt;br /&gt;&lt;br /&gt;If you're wondering...what's Ada? Well...according to Wikipedia...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Ada is a structured, statically typed, imperative, wide-spectrum, and object-oriented high-level computer programming language, extended from Pascal and other languages.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;So yes...it pretty much looks like Pascal...but way more strict...and complex...&lt;br /&gt;&lt;br /&gt;As usual with my &quot;My first post on...&quot; I build a Fibonacci List generator...something simple to start re-learning the language...so here it goes...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;fibonacci.adb&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;with Ada.Text_IO;&lt;br /&gt;with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;&lt;br /&gt;&lt;br /&gt;procedure Fibonacci is&lt;br /&gt; package IO renames Ada.Text_IO;&lt;br /&gt; package Number_IO is new Ada.Text_IO.Integer_IO (Integer);&lt;br /&gt; num : Integer;&lt;br /&gt; &lt;br /&gt; function Fib(num:Integer;a:Integer;b:Integer) return Unbounded_String is&lt;br /&gt; result : Unbounded_String;&lt;br /&gt; begin&lt;br /&gt;  if a &amp;gt; 0 and num &amp;gt; 1 then&lt;br /&gt;   result := result &amp;amp; Integer'Image(a+b) &amp;amp; &quot; &quot; &amp;amp; Fib(num-1,a+b,a);&lt;br /&gt;  elsif a = 0 then&lt;br /&gt;   result := Integer'Image(a) &amp;amp; &quot; &quot; &amp;amp; Integer'Image(b) &amp;amp; &quot; &quot; &amp;amp; &lt;br /&gt;             Integer'Image(a+b) &amp;amp; &quot; &quot; &amp;amp; Fib(num-1,a+b,b);&lt;br /&gt;  end if;&lt;br /&gt;  return result;&lt;br /&gt; end Fib;&lt;br /&gt; &lt;br /&gt;begin&lt;br /&gt; IO.Put(&quot;Enter a number: &quot;);&lt;br /&gt; Number_IO.Get(num);&lt;br /&gt; IO.Put(To_String(Fib(num,0,1)));&lt;br /&gt;end Fibonacci;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;And here are the screenshots...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-_0lg6OoEXTI/Vg2VF0Zac7I/AAAAAAAAErM/rTgxEWoMvQ0/s1600/Fibonacci_Ada_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;http://3.bp.blogspot.com/-_0lg6OoEXTI/Vg2VF0Zac7I/AAAAAAAAErM/rTgxEWoMvQ0/s400/Fibonacci_Ada_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-QsdbjDjxGcY/Vg2VGIr44aI/AAAAAAAAErQ/qXp4duATKkE/s1600/Fibonacci_Ada_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;107&quot; src=&quot;http://1.bp.blogspot.com/-QsdbjDjxGcY/Vg2VGIr44aI/AAAAAAAAErQ/qXp4duATKkE/s400/Fibonacci_Ada_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Well...that's was fairly easy...but of course I needed to investigate a little bit...so the challenge will be when I start working on my LED Numbers app... -:P&lt;br /&gt;&lt;br /&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-5078847111525353885</guid>
         <pubDate>Thu, 01 Oct 2015 20:27:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://3.bp.blogspot.com/-_0lg6OoEXTI/Vg2VF0Zac7I/AAAAAAAAErM/rTgxEWoMvQ0/s72-c/Fibonacci_Ada_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>SAP HANA on the OCaml hump</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/HKTvwFVMdhM/sap-hana-on-ocaml-hump.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;This post was originally posted on&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/29/sap-hana-on-the-ocaml-hump&quot;&gt;SAP HANA on the OCaml hump&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://ocaml.org/&quot;&gt;OCaml&lt;/a&gt; is an industrial strength programming language supporting functional, imperative and object-oriented styles.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-5HQe3TFkMYo/Vgrki4ZUf8I/AAAAAAAAEqY/cpaxlCaBs4o/s1600/OCaml_Logo.png&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;110&quot; src=&quot;http://1.bp.blogspot.com/-5HQe3TFkMYo/Vgrki4ZUf8I/AAAAAAAAEqY/cpaxlCaBs4o/s400/OCaml_Logo.png&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Sounds nice, right? OCaml is the next step of the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://caml.inria.fr/&quot;&gt;Caml programming language&lt;/a&gt;.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Having learning other functional programming languages like &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.haskell.org/&quot;&gt;Haskell&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.erlang.org/&quot;&gt;Erlang&lt;/a&gt;, OCaml was the next obvious choice for me…so I decided to start learning it…not an easy task for sure…but really fun and enlighten.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;So…no example or demonstration would be complete if we didn’t hook it up with SAP HANA, right? So…let’s go and do it -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;First, we need to create a Calculation View and call it “FLIGHTS_BY_CARRIER”. It will be composed of two tables, SCARR and SFLIGHT.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, we need to create a Join object and link the table by MANDT and CARRID. From here select the following fields as output MANDT, CARRID, CARRNAME, PRICE and CURRENCY.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then create an Aggregation object selecting the fields CARRNAME, PRICE (As Aggregated Column) and CURRENCY. Filter the CURRENCY field by ‘USD’.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then create a Projection object and select only PRICE and CARRNAME.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the Semantics object make sure to select “CROSS CLIENT” as the Default Client.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-xlbfgS9cTtM/VgL5cIKC5SI/AAAAAAAAEpo/Dh2tcn1j-us/s1600/Calculation_View.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://3.bp.blogspot.com/-xlbfgS9cTtM/VgL5cIKC5SI/AAAAAAAAEpo/Dh2tcn1j-us/s400/Calculation_View.jpg&quot; width=&quot;215&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Now, switch to the SAP HANA Development View and create a new repository. Call it “Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create a new “XS Engine” project and call it “Flights” as well. Link it to the “Flights” repository.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create an empty “.xsapp” file.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create a file called “.xsaccess” with the following code.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;.xsaccess&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;          &quot;exposed&quot; : true,&lt;br /&gt;          &quot;authentication&quot; : [ { &quot;method&quot; : &quot;Basic&quot; } ]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Finally create a file called “flights.xsodata” with the following code&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;flights.xodata&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;service {&lt;br /&gt;          &quot;Blag/FLIGHTS_BY_CARRIER.calculationview&quot; as &quot;FLIGHTS&quot; keys &lt;br /&gt;                                                        generate local &quot;Id&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Activate your project and launch it on your browser, you should see something like this…&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-lnx5UicasOE/VgL68YXrClI/AAAAAAAAEp0/NE8FXuS7m4w/s1600/XSProject.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;http://4.bp.blogspot.com/-lnx5UicasOE/VgL68YXrClI/AAAAAAAAEp0/NE8FXuS7m4w/s400/XSProject.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;The SAP HANA part is done…so we can move into the OCaml part…&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For first timers, OPAM (the package manager for OCaml can be tricky and sometimes frustrating), so let’s make your lives easier by following this single easy steps…on a terminal session type this…&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;opam init&lt;/div&gt;&lt;div&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;eval `opam config env`&lt;/div&gt;&lt;div&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;opam switch 4.01.0&lt;/div&gt;&lt;div&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;eval `opam config env`&lt;/div&gt;&lt;div&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;opam install core utop core_extended async uri yojson cohttp lwt ezjsonm&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;It will take a while but by installing all the required packages in a single command, prevents errors from happening.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To code for OCaml I use one of the most awesome editors I have ever found…&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.geany.org/&quot;&gt;Geany&lt;/a&gt;. It comes almost pre-configured to handle a lot of programming languages, but just to make sure, here’s how I configure it to work with OCaml.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, create a file and save it as OCaml_HANA.ml&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then, click on the “Choose more build actions” button&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-2PZ8DtbZ56M/VgroxS-bYsI/AAAAAAAAEqg/uROesXc2GE4/s1600/Options.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;86&quot; src=&quot;http://2.bp.blogspot.com/-2PZ8DtbZ56M/VgroxS-bYsI/AAAAAAAAEqg/uROesXc2GE4/s320/Options.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The little half arrow on the right of the brown brick looking button. This will open the following screen&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-MN7sk_n84AA/Vgro5PyVfsI/AAAAAAAAEqo/6MoT_PFUHBU/s1600/Geany_OCaml.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://1.bp.blogspot.com/-MN7sk_n84AA/Vgro5PyVfsI/AAAAAAAAEqo/6MoT_PFUHBU/s400/Geany_OCaml.jpg&quot; width=&quot;342&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On Compile put the following&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;corebuild -pkg yojson,cohttp.async,cohttp.lwt,lwt,ezjsonm &quot;%e.native&quot;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And on Execute put&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;“./%e.native”&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With that, we should be more than ready to start coding -:) Copy and paste the following code…&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;OCaml_HANA.ml&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;open Core.Std&lt;br /&gt;open Yojson.Basic.Util&lt;br /&gt;open Ezjsonm&lt;br /&gt;&lt;br /&gt;let get_definition_from_json json =&lt;br /&gt; let json = Ezjsonm.from_string(json) in&lt;br /&gt; let json = Ezjsonm.(find json [&quot;d&quot;;&quot;results&quot;]) in&lt;br /&gt; let json = Ezjsonm.to_string(json) in&lt;br /&gt; let json = Yojson.Basic.from_string(json) in&lt;br /&gt; let json = Yojson.Basic.Util.to_list json in&lt;br /&gt; let carrname = Yojson.Basic.Util.filter_member &quot;CARRNAME&quot; json in&lt;br /&gt; let carrname = Yojson.Basic.Util.filter_string carrname in&lt;br /&gt; let price = Yojson.Basic.Util.filter_member &quot;PRICE&quot; json in&lt;br /&gt; let price = Yojson.Basic.Util.filter_string price in&lt;br /&gt; printf &quot;Reading SAP HANA from OCaml&amp;#92;n&amp;#92;n&quot;;&lt;br /&gt; for i = 0 to List.length(carrname) - 1 do&lt;br /&gt;  printf &quot;%s: %s&amp;#92;n&quot; (List.nth_exn carrname i) (List.nth_exn price i)&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;let fetch uri =&lt;br /&gt; let cred = Cohttp.Auth.string_of_credential(`Basic(&quot;SYSTEM&quot;, &quot;YourPassword&quot;)) in&lt;br /&gt; let headers = Cohttp.Header.init() in &lt;br /&gt; let headers = Cohttp.Header.add headers &quot;Authorization&quot; cred in&lt;br /&gt; let open Lwt in&lt;br /&gt; Cohttp_lwt_unix.Client.get ~headers:headers uri &lt;br /&gt; &amp;gt;&amp;gt;= fun (_,body) -&amp;gt;&lt;br /&gt; Cohttp_lwt_body.to_string_list body&lt;br /&gt; &amp;gt;&amp;gt;= fun strings -&amp;gt;&lt;br /&gt; return(get_definition_from_json (String.concat strings))  &lt;br /&gt;&lt;br /&gt;let () =&lt;br /&gt;  let hana_uri = Uri.of_string &quot;http://YourServer:8000/Flights/flights.xsodata&lt;/pre&gt;&lt;pre&gt;                                /FLIGHTS?$format=json&quot;&lt;br /&gt;  in Lwt_main.run (fetch hana_uri)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Save your file, press the “Compile the current file” button. The first on the previous images which shows a triangle with an arrow and a ball (all in nice 3D) and then press the “Run or view the current file” button. Last one on the previous image which shows two engines.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-AmteLMNNGAE/VgrpiwjSVsI/AAAAAAAAEqw/0g2yMcrW6b4/s1600/OCaml_HANA.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;221&quot; src=&quot;http://1.bp.blogspot.com/-AmteLMNNGAE/VgrpiwjSVsI/AAAAAAAAEqw/0g2yMcrW6b4/s400/OCaml_HANA.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;You will notice that it comes pretty fast…&lt;br /&gt;&lt;br /&gt;Now…something funny about my code…and that might be because of two simple reasons…&lt;br /&gt;&lt;br /&gt;•&amp;nbsp;I’m still learning OCaml&lt;br /&gt;•&amp;nbsp;The documentation for external packages is almost non-existent (Actually, I need to browse the GitHub source codes in order to achieve most of the code)&lt;br /&gt;&lt;br /&gt;So…the funny thing is that I’m using two different JSON libraries to actually read the ODATA generated by SAP HANA…by using only one I couldn’t manage to get the information that I needed…so using both and extracting pieces from here and there I actually got what I wanted…not so fun when you are doing it…but in the end there a big reward on finally being able to compile it and get the desired output -;)&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Greetings,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Blag.&lt;/div&gt;&lt;div&gt;Development Culture.&lt;/div&gt;</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-4742950160478657356</guid>
         <pubDate>Tue, 29 Sep 2015 20:03:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-5HQe3TFkMYo/Vgrki4ZUf8I/AAAAAAAAEqY/cpaxlCaBs4o/s72-c/OCaml_Logo.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Amazon Alexa and Philips Hue</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/sTlEOReu-D0/amazon-alexa-and-philips-hue.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;This post was originally posted on&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/28/amazon-alexa-and-philips-hue&quot;&gt;Amazon Alexa and Philips Hue&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s1600/d_shop_blog_logo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s400/d_shop_blog_logo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;b&gt;If you are an SAP Employee, please follow us on&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/about_page/sh2Kp26QQkHwkMPFAEqAD9&quot;&gt;Jam&lt;/a&gt;.&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Since we got the Amazon Alexa on the d-shop here at SAP Labs Silicon Valley...I have been looking for new ways to make it interact with many things...so a couple of days my good friend and colleague &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/people/aaronwilliams&quot;&gt;Aaron Williams&lt;/a&gt; asked me about the Philips Hue...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;At first...I wasn't sure it was going to work, because as everybody knows...the Hue needs to be on the same network to be able to work...and Amazon Lambda is sitting on a server who knows where...so I start looking into it...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;When using the Amazon Alexa app we can hook up the Hue to allow Alexa to turn on and off the light...but nothing more...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;You need to go to Settings --&amp;gt; Connected Home -&amp;gt; Discover Devices (It will ask you to push the button on the Hue Bridge).&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;For sure...this wasn't enough for me...so I kept thinking about it and realized that &quot;Hey!...the Philips Hue works when you want to change the lights...and it does it remotely...so there must be a way to do it&quot;...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Gladly...I found this blog...&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blog.paulshi.me/technical/2013/11/27/Philips-Hue-Remote-API-Explained.html&quot;&gt;Philips Hue Remote API Explained&lt;/a&gt;...where the author basically explains how you can &quot;trick&quot; Hue into thinking that you are connecting from your IPhone...hence...you're doing a remote connection...genius if you ask me -;)&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;For this to work you need to create a meethue account...just singing using your Google account didn't worked for me...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li style=&quot;text-align:justify;&quot;&gt;Basically, you need to first find your &lt;b&gt;BridgeId&lt;/b&gt; by going here &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.meethue.com/api/nupn&quot;&gt;https://www.meethue.com/api/nupn&lt;/a&gt;&lt;/li&gt;&lt;li style=&quot;text-align:justify;&quot;&gt;Get your &lt;b&gt;access token&lt;/b&gt; by going here &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.meethue.com/en-US/api/gettoken?devicename=iPhone+5&amp;amp;appid=hueapp&amp;amp;deviceid=**BRIDGEID**&quot;&gt;www.meethue.com/en-US/api/gettoken?devicename=iPhone+5&amp;amp;appid=hueapp&amp;amp;deviceid=**BRIDGEID**&lt;/a&gt;&lt;/li&gt;&lt;li style=&quot;text-align:justify;&quot;&gt;On the &quot;Back to the App&quot; button, copy the link for the AccessToken that will look like this &lt;a rel=&quot;nofollow&quot;&gt;phhueapp://sdk/login/**ACCESSTOKEN**&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;By the way...if you find something like this at the end &quot;%3D&quot; simply change it for an &quot;=&quot;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Having both the &lt;b&gt;BridgeId &lt;/b&gt;and &lt;b&gt;AccessToken &lt;/b&gt;we should be ready to go &amp;nbsp;-;)&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;We need to create both a Function and a Skill...please refer to this blog &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blagrants.blogspot.com/2015/09/amazon-alexa-and-sap-hana.html&quot;&gt;Amazon Alexa and SAP HANA&lt;/a&gt; to create them...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;The function will be called &lt;b&gt;getLights &lt;/b&gt;and the skill &lt;b&gt;Lights&lt;/b&gt;. The Invocation Name will be &quot;&lt;b&gt;lights&lt;/b&gt;&quot;.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Here's the Interaction Model that we're going to use...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Intent Schema&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;  &quot;intents&quot;: [&lt;br /&gt;    {&lt;br /&gt;      &quot;intent&quot;: &quot;GetLightsIntent&quot;,&lt;br /&gt;      &quot;slots&quot;: [&lt;br /&gt;        {&lt;br /&gt;          &quot;name&quot;: &quot;color&quot;,&lt;br /&gt;          &quot;type&quot;: &quot;LITERAL&quot;&lt;br /&gt;        }&lt;br /&gt;      ]&lt;br /&gt;    },&lt;br /&gt;    {&lt;br /&gt;      &quot;intent&quot;: &quot;HelpIntent&quot;,&lt;br /&gt;      &quot;slots&quot;: []&lt;br /&gt;    }&lt;br /&gt;  ]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Sample Utterances&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;GetLightsIntent color {red|color}&lt;br /&gt;GetLightsIntent color {blue|color}&lt;br /&gt;GetLightsIntent color {green|color}&lt;br /&gt;GetLightsIntent color {pink|color}&lt;br /&gt;GetLightsIntent color {purple|color}&lt;br /&gt;GetLightsIntent color {aqua|color}&lt;br /&gt;GetLightsIntent color {white|color}&lt;br /&gt;GetLightsIntent color {yellow|color}&lt;br /&gt;GetLightsIntent color {black|color}&lt;br /&gt;&lt;br /&gt;HelpIntent help&lt;br /&gt;HelpIntent help me&lt;br /&gt;HelpIntent what can I ask you&lt;br /&gt;HelpIntent get help&lt;br /&gt;HelpIntent to help&lt;br /&gt;HelpIntent to help me&lt;br /&gt;HelpIntent what commands can I ask&lt;br /&gt;HelpIntent what commands can I say&lt;br /&gt;HelpIntent what can I do&lt;br /&gt;HelpIntent what can I use this for&lt;br /&gt;HelpIntent what questions can I ask&lt;br /&gt;HelpIntent what can you do&lt;br /&gt;HelpIntent what do you do&lt;br /&gt;HelpIntent how do I use you&lt;br /&gt;HelpIntent how can I use you&lt;br /&gt;HelpIntent what can you tell me&lt;br /&gt;HelpIntent how do i change colors&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Now...the most important thing is the code -:P&lt;br /&gt;&lt;br /&gt;Let’s create a folder and call it “Lights” or something nice like that…then create a folder called “src”. Copy the code from &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://github.com/dustincoates/alexa-bus-schedule/blob/master/src/index.js&quot;&gt;here&lt;/a&gt;...and create a file called “AlexaSkills.js”&lt;br /&gt;&lt;br /&gt;We’re going to need to install the request package on our function, so do the following on a terminal&lt;br /&gt;&lt;br /&gt;&lt;b&gt;sudo npm install --prefix=~/Alexa/Lights/src request&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This will create a folder called “node_modules” with the package in our project folder…then create a file called “index.js” and copy and paste the following code…&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;index.js&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;var request = require(&quot;request&quot;)&lt;br /&gt;  , AlexaSkill = require('./AlexaSkill')&lt;br /&gt;  , APP_ID     = 'YourAPPId'&lt;br /&gt;  , TOKEN = 'YourAccessToken';&lt;br /&gt;&lt;br /&gt;var error = function (err, response, body) {&lt;br /&gt;    console.log('ERROR [%s]', err);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;var getJsonFromLights = function(color,callback){&lt;br /&gt;switch(color){&lt;br /&gt; case 'red':&lt;br /&gt;  x = 0.674; y = 0.322; break;&lt;br /&gt; case 'green':&lt;br /&gt;  x = 0.408; y = 0.517; break;&lt;br /&gt; case 'blue':&lt;br /&gt;  x = 0.168; y = 0.041; break;&lt;br /&gt; case 'white':&lt;br /&gt;  x = 0.3227; y = 0.329; break;&lt;br /&gt; case 'yellow':&lt;br /&gt;  x = 0.4317; y = 0.4996; break;&lt;br /&gt; case 'purple':&lt;br /&gt;  x = 0.2725; y = 0.1096; break;&lt;br /&gt; case 'orange':&lt;br /&gt;  x = 0.5562; y = 0.4084; break;&lt;br /&gt; case 'pink':&lt;br /&gt;  x = 0.3944; y = 0.3093; break;&lt;br /&gt; case 'black':&lt;br /&gt;  x = 0.168; y = 0.041; break;    &lt;br /&gt; case 'aqua':&lt;br /&gt;  x = 0.2858; y = 0.2747; break;&lt;br /&gt; default:&lt;br /&gt;  x = 0.3227; y = 0.329; break;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var options = { method: 'POST',&lt;br /&gt;                url: 'https://www.meethue.com/api/sendmessage',&lt;br /&gt;                qs: { token: TOKEN},&lt;br /&gt;                headers: { 'content-type': 'application/x-www-form-urlencoded' },&lt;br /&gt;                body: 'clipmessage={ bridgeId: &quot;YourBridgeId&quot;,&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;                                     clipCommand:  {url:&quot;/api/0/lights/1/state&quot;,&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;                                     method: &quot;PUT&quot;, body: {xy:[' + x + ',' + y + ']}}}' };&lt;br /&gt;&lt;br /&gt;var error_log = &quot;&quot;;&lt;br /&gt;&lt;br /&gt;request(options, function (error, response, body) {&lt;br /&gt; if (!error) {&lt;br /&gt;  error_log = color;&lt;br /&gt; }else{&lt;br /&gt;  error_log = &quot;There was a mistake&quot;;&lt;br /&gt; }&lt;br /&gt; callback(error_log);&lt;br /&gt;    });&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var handleLightsRequest = function(intent, session, response){&lt;br /&gt;  getJsonFromLights(intent.slots.color.value, function(data){&lt;br /&gt; var text = 'The color has been changed to ' + data;&lt;br /&gt;    var cardText = 'The color has been changed to ' + intent.slots.color.value;&lt;br /&gt;&lt;br /&gt;    var heading = 'The color has been changed to ' + intent.slots.color.value;&lt;br /&gt;    response.tellWithCard(text, heading, cardText);&lt;br /&gt;  });&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;var Lights = function(){&lt;br /&gt;  AlexaSkill.call(this, APP_ID);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Lights.prototype = Object.create(AlexaSkill.prototype);&lt;br /&gt;Lights.prototype.constructor = Lights;&lt;br /&gt;&lt;br /&gt;Lights.prototype.eventHandlers.onSessionStarted = function(sessionStartedRequest, session){&lt;br /&gt;  console.log(&quot;onSessionStarted requestId: &quot; + sessionStartedRequest.requestId&lt;br /&gt;      + &quot;, sessionId: &quot; + session.sessionId);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Lights.prototype.eventHandlers.onLaunch = function(launchRequest, session, response){&lt;br /&gt;  // This is when they launch the skill but don't specify what they want.&lt;br /&gt;&lt;br /&gt;  var output = 'Welcome to Hue Lights. Please say a color';&lt;br /&gt;&lt;br /&gt;  var reprompt = 'Which color would you like?';&lt;br /&gt;&lt;br /&gt;  response.ask(output, reprompt);&lt;br /&gt;&lt;br /&gt;  console.log(&quot;onLaunch requestId: &quot; + launchRequest.requestId&lt;br /&gt;      + &quot;, sessionId: &quot; + session.sessionId);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Lights.prototype.intentHandlers = {&lt;br /&gt;  GetLightsIntent: function(intent, session, response){&lt;br /&gt;    handleLightsRequest(intent, session, response);&lt;br /&gt;  },&lt;br /&gt;&lt;br /&gt;  HelpIntent: function(intent, session, response){&lt;br /&gt;    var speechOutput = 'Change your Hue Light to any color. Which color would you like?';&lt;br /&gt;    response.ask(speechOutput);&lt;br /&gt;  }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;exports.handler = function(event, context) {&lt;br /&gt;    var skill = new Lights();&lt;br /&gt;    skill.execute(event, context);&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;When it's done...simply compress the node_module folder, AlexaSkills.js and index.js files into a .zip file called &lt;b&gt;Lights.zip&lt;/b&gt; and upload it to your Amazon Lambda...&lt;br /&gt;&lt;br /&gt;To call this skill on Alexa...you can do the following...&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Alexa, turn on lamp 1 (Taking into account that your light my be called different)&lt;/li&gt;&lt;li&gt;Alexa, ask lights for color blue&lt;/li&gt;&lt;li&gt;Alexa, turn off lamp 1&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;You can see the available colors in the code...but just in case they should be...&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Red&lt;/li&gt;&lt;li&gt;Green&lt;/li&gt;&lt;li&gt;Blue&lt;/li&gt;&lt;li&gt;Aqua&lt;/li&gt;&lt;li&gt;Pink&lt;/li&gt;&lt;li&gt;White&lt;/li&gt;&lt;li&gt;Black&lt;/li&gt;&lt;li&gt;Yellow&lt;/li&gt;&lt;li&gt;Purple&lt;/li&gt;&lt;li&gt;Orange&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&amp;nbsp;And of course...here's the video &amp;nbsp;-:D&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.&lt;br /&gt;&lt;br /&gt;</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-7900411755525673891</guid>
         <pubDate>Mon, 28 Sep 2015 20:34:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s72-c/d_shop_blog_logo.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>R - My journey so far</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/Fc1LT2YTTrM/r-my-journey-so-far.html</link>
         <description>The first time I heard about &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://cran.r-project.org/&quot;&gt;R&lt;/a&gt;, was about 4 years ago...a couple of week after I joined &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.sap.com/&quot;&gt;SAP&lt;/a&gt;. At that time I read in one of our internal documents that &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://hana.sap.com/abouthana.html&quot;&gt;SAP HANA&lt;/a&gt; was going to be able to interact with the R programming Language.&lt;br /&gt;&lt;br /&gt;At first, I was totally clueless about R...I had never heard from it before...so I of course start looking for some more information, download R and RStudio and start learning how to use it...&lt;br /&gt;&lt;br /&gt;After some time...I posted my first blog talking about R...that was on November 28, 2011...the blog was &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blagrants.blogspot.com/2011/11/dealing-with-r-and-hana.html&quot;&gt;Dealing with R and HANA&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;After that I kept learning and using it whenever it was suitable...and I end up writing my most successful blog on the SAP Community Network...that was on May 21, 2012.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/developer-center/hana/blog/2012/05/21/when-sap-hana-met-r--first-kiss&quot;&gt;When SAP HANA met R - First kiss&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;That up to now, has 21,879 views and 62 comments, 16 likes and 32 bookmarks.&lt;br /&gt;&lt;br /&gt;R is huge...it really is...there's thousands of packages that solve thousands of issues...so that's when I start reading R related books from my good friends at &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.packtpub.com/&quot;&gt;&lt;b&gt;Packt Publishing&lt;/b&gt;&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1VaEkAa&quot;&gt;Web Application Development with R using Shiny&lt;/a&gt; (See my review &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blagrants.blogspot.com/2013/11/web-application-development-with-r.html&quot;&gt;here&lt;/a&gt;).&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-KA9w3AwPTRU/UpZC-OqVBiI/AAAAAAAADRs/jwTOxtK_yYg/s400/Shiny_Packt.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://2.bp.blogspot.com/-KA9w3AwPTRU/UpZC-OqVBiI/AAAAAAAADRs/jwTOxtK_yYg/s400/Shiny_Packt.jpg&quot; width=&quot;257&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;As I was improving my R skills...I knew that something was missing...I really didn't knew much about Statistics and my Machine Learning skills were pretty dull as well...that's when I read another awesome book...and I think my favorite book on R so far...&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1gQvDs4&quot;&gt;Machine Learning with R&lt;/a&gt; (See my review &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blagrants.blogspot.com/2014/01/machine-learning-with-r-book-review.html&quot;&gt;here&lt;/a&gt;).&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-QS-nGu6H2i8/UsrVr_ucmaI/AAAAAAAADYw/gJfpVXhMj3g/s1600/Machine_Learning_R.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://1.bp.blogspot.com/-QS-nGu6H2i8/UsrVr_ucmaI/AAAAAAAADYw/gJfpVXhMj3g/s1600/Machine_Learning_R.jpg&quot; width=&quot;255&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Another topic that it's interesting is Social Media...and how to get value out of it...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1Jrl1Xt&quot;&gt;Social Media Mining with R&lt;/a&gt; (See my review &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blagrants.blogspot.com/2014/05/social-media-mining-with-r-book-review.html&quot;&gt;here&lt;/a&gt;).&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-NNr0y1_d0UM/U3UVJbA2lCI/AAAAAAAADhg/mkIwmeDZpU8/s1600/SocialMedia_R.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://4.bp.blogspot.com/-NNr0y1_d0UM/U3UVJbA2lCI/AAAAAAAADhg/mkIwmeDZpU8/s1600/SocialMedia_R.jpg&quot; width=&quot;258&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;If you're wondering how Social Media can be used with R, then please take a look at my blog &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/developer-center/hana/blog/2013/03/10/getting-flexible-with-sap-hana&quot;&gt;Getting Flexible with SAP HANA&lt;/a&gt; where I use SAP HANA, R, Twitter and Schema Flexibility to analyze hashtags that can be further explored using for example &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://go.sap.com/product/analytics/lumira.html&quot;&gt;SAP Lumira&lt;/a&gt;.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;If you are into the Bioinformatics world...which I'm not -:( You should appreciate this book...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1QA56LR&quot;&gt;Bioinformatics with R Cookbook&lt;/a&gt; (See my review &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blagrants.blogspot.com/2014/08/bioinformatics-with-r-cookbook-book.html&quot;&gt;here&lt;/a&gt;).&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-mbFEuqnecps/U-U-JMrMuzI/AAAAAAAADoE/hrY-HLd7EkU/s1600/Bio_R.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://2.bp.blogspot.com/-mbFEuqnecps/U-U-JMrMuzI/AAAAAAAADoE/hrY-HLd7EkU/s1600/Bio_R.jpg&quot; width=&quot;259&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;And there are some more books that I haven't read yet, but might help you to get started into the R world like...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1OUjb8q&quot;&gt;Data Manipulation with R&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1gQxi0z&quot;&gt;R Data Visualization Cookbook&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1OUjMHo&quot;&gt;Instant R Starter&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;So...why are all this books important? Well...obviously, they are all about R and R is amazing and becoming more important each and every day...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Look at this video to realize why Data Science is a hot topic to learn...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Or you just can download it as a nice PDF for offline reading&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1MryNha&quot; style=&quot;font-family:'Times New Roman', serif;font-size:12pt;&quot;&gt;http://bit.ly/1MryNha&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Also...by just reading this blog post...you have the opportunity to buy any of these books with a 50% discount by using this code at checkout time...&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align:center;&quot;&gt;&lt;span style=&quot;font-family:'Times New Roman', serif;font-size:12pt;&quot;&gt;&lt;b&gt;SIXRB50&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;A big opportunity NOT to be missed out...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;span style=&quot;font-family:Arial, sans-serif;font-size:12pt;&quot;&gt;&lt;b&gt;The validity of codes till 31st October. Limited copies are available.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;Greetings,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;Blag.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;Development Culture.&lt;/span&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-4212259650727784582</guid>
         <pubDate>Thu, 24 Sep 2015 22:13:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://2.bp.blogspot.com/-KA9w3AwPTRU/UpZC-OqVBiI/AAAAAAAADRs/jwTOxtK_yYg/s72-c/Shiny_Packt.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Join us for Geeky Thursday on October</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/VAP9KGqkE6M/join-us-for-geeky-thursday-on-october.html</link>
         <description>&lt;h2&gt;&lt;b&gt;What's Geeky Thursday?&lt;/b&gt;&lt;/h2&gt;It's an event that happens every Thursday per week. An hour and little bit more of &quot;hands-on&quot; session where not so common programming languages (ex: Lua, Julia, R, Haskell) and Programming Paradimgs (Functional, Stack Based, Logical, Object-Oriented) are being presented.&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Why Geeky Thursday?&lt;/b&gt;&lt;/h2&gt;Because Developers...because knowing just a couple of programming languages is not enough...because learning another paradigm can expand your horizons and make a better developer.&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Geeky Thursday is hands-on...do I need my laptop?&lt;/b&gt;&lt;/h2&gt;Well...it really depends on you...the source code is going to be available...it's going to be explained and run on-site...there's not going to be live typing...but it's always better if you can compile and run the examples yourself...&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Is Geeky Thursday only about Programming?&lt;/b&gt;&lt;/h2&gt;No...without any aims to become a &quot;Brown Bag Session&quot;...Geeky Thursday looks forward to become a &quot;Mini Meetup&quot; space...where cool things can be explored.&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Is Geeky Thursday held only on Silicon Valley?&lt;/b&gt;&lt;/h2&gt;For now...it is...but...if you manage or you are in touch with a d-shop manager, ask him/her to get in touch with me (a.tejada.galindo@sap.com)...I would be more than happy to share my slides and anything needed to expand Geeky Thursday to other locations.&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Is any space limitation?&lt;/b&gt;&lt;/h2&gt;Yes, we can invite 10 people from SAP and we have space for 5 people that external to SAP. Depending on the attendance level we might increase this values.&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Can I host a Geeky Thursday event?&lt;/b&gt;&lt;/h2&gt;Of course! You're more than welcome! Just get in touch with me and will be setup an slot for you!&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Scheduled Geeky Thursdays&lt;/b&gt;&lt;/h2&gt;&lt;b&gt;R Programming Language --&amp;gt; October 8 from 1:00 to 2:00pm (d-shop on Building 9 at SAP Labs Silicon Valley)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;For SAP Employees&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/sh2Kp26QQkHwkMPFAEqAD9/events/K7BJsIiucH7XjLszzcO0Eh&quot;&gt;https://jam4.sapjam.com/groups/sh2Kp26QQkHwkMPFAEqAD9/events/K7BJsIiucH7XjLszzcO0Eh&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;For Externals&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.eventbrite.com/myevent?eid=18783268261&quot;&gt;https://www.eventbrite.com/myevent?eid=18783268261&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;R is a programming language and software environment for statistical computing and graphics. Please join us to learn the basics of R.&lt;br /&gt;&lt;br /&gt;You can download R from here &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://cran.r-project.org/&quot;&gt;https://cran.r-project.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can download RStudio from here &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.rstudio.com/&quot;&gt;https://www.rstudio.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Julia Programming Language --&amp;gt; October 15 from 1:00 to 2:00pm (d-shop on Building 9 at SAP Labs Silicon Valley)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;For SAP Employees&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/sh2Kp26QQkHwkMPFAEqAD9/events/5FieiznXF6EgaGfg34qKdd&quot;&gt;https://jam4.sapjam.com/groups/sh2Kp26QQkHwkMPFAEqAD9/events/5FieiznXF6EgaGfg34qKdd&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;For Externals&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.eventbrite.com/myevent?eid=18783317408&quot;&gt;https://www.eventbrite.com/myevent?eid=18783317408&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Julia is a high-level dynamic programming language designed to address the requirements of high-performance numerical and scientific computing while also being effective for general-purpose programming, even web use or as a specification language.&lt;br /&gt;&lt;br /&gt;You can download Julia from here &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://julialang.org/&quot;&gt;http://julialang.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Clojure Programming Language --&amp;gt; October 29 from 1:00 to 2:00pm (d-shop on Building 9 at SAP Labs Silicon Valley)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;For SAP Employees&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/sh2Kp26QQkHwkMPFAEqAD9/events/RoZ8dId4NGqxzWCys2hMN4&quot;&gt;https://jam4.sapjam.com/groups/sh2Kp26QQkHwkMPFAEqAD9/events/RoZ8dId4NGqxzWCys2hMN4&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;For Externals&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.eventbrite.com/myevent?eid=18783402663&quot;&gt;https://www.eventbrite.com/myevent?eid=18783402663&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Clojure is a dynamic programming language that targets the Java Virtual Machine (and the CLR, and JavaScript). It is designed to be a general-purpose language, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded programming. Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system.&lt;br /&gt;&lt;br /&gt;You can download Clojure from here &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://clojure.org/&quot;&gt;http://clojure.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-7906681564032174912</guid>
         <pubDate>Thu, 24 Sep 2015 19:56:00 +0000</pubDate>
      </item>
      <item>
         <title>(Defining SAP HANA (OData) with Racket)</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/eQwu7jikKs8/defining-sap-hana-odata-with-racket.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;This post was originally posted on&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/23/defining-sap-hana-odata-with-racket&quot;&gt;(Defining SAP HANA (OData) with Racket)&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://racket-lang.org/&quot;&gt;Racket&lt;/a&gt; is a full spectrum programming language that goes beyond Lisp and Scheme with dialects that support objects, types, laziness and more. And that more means Functional, Procedural, Object Oriented, Logic, Reflective and Meta.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-u7Bmoa-KSS4/VgL4Doa8x0I/AAAAAAAAEpU/Owb-i6_cLCg/s1600/Racket_Logo.png&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/-u7Bmoa-KSS4/VgL4Doa8x0I/AAAAAAAAEpU/Owb-i6_cLCg/s1600/Racket_Logo.png&quot;/&gt;&lt;/a&gt;&lt;/div&gt;Basically…Racket is the new name of PLT Scheme. And PLT Scheme comes from the Lisp family.&lt;br /&gt;&lt;br /&gt;So, before we move on…I want to share an XKCD comic that brings some light about Lisp -:)&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-yNay-IeWuOI/VgL4NBUMLeI/AAAAAAAAEpc/7tzYDnqxXMs/s1600/XKCD_lisp_Comic.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;118&quot; src=&quot;http://2.bp.blogspot.com/-yNay-IeWuOI/VgL4NBUMLeI/AAAAAAAAEpc/7tzYDnqxXMs/s400/XKCD_lisp_Comic.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;First, we need to create a Calculation View and call it “FLIGHTS_BY_CARRIER”. It will be composed of two tables, SCARR and SFLIGHT.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, we need to create a Join object and link the table by MANDT and CARRID. From here select the following fields as output MANDT, CARRID, CARRNAME, PRICE and CURRENCY.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then create an Aggregation object selecting the fields CARRNAME, PRICE (As Aggregated Column) and CURRENCY. Filter the CURRENCY field by ‘USD’.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then create a Projection object and select only PRICE and CARRNAME.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the Semantics object make sure to select “CROSS CLIENT” as the Default Client.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-xlbfgS9cTtM/VgL5cIKC5SI/AAAAAAAAEpo/Dh2tcn1j-us/s1600/Calculation_View.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://3.bp.blogspot.com/-xlbfgS9cTtM/VgL5cIKC5SI/AAAAAAAAEpo/Dh2tcn1j-us/s400/Calculation_View.jpg&quot; width=&quot;215&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Now, switch to the SAP HANA Development View and create a new repository. Call it “Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create a new “XS Engine” project and call it “Flights” as well. Link it to the “Flights” repository.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create an empty “.xsapp” file.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create a file called “.xsaccess” with the following code.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;.xsaccess&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;          &quot;exposed&quot; : true,&lt;br /&gt;          &quot;authentication&quot; : [ { &quot;method&quot; : &quot;Basic&quot; } ]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Finally create a file called “flights.xsodata” with the following code&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;flights.xodata&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;service {&lt;br /&gt;          &quot;Blag/FLIGHTS_BY_CARRIER.calculationview&quot; as &quot;FLIGHTS&quot; keys &lt;br /&gt;                                                        generate local &quot;Id&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Activate your project and launch it on your browser, you should see something like this…&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-lnx5UicasOE/VgL68YXrClI/AAAAAAAAEp0/NE8FXuS7m4w/s1600/XSProject.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;http://4.bp.blogspot.com/-lnx5UicasOE/VgL68YXrClI/AAAAAAAAEp0/NE8FXuS7m4w/s400/XSProject.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;The SAP HANA part is done…so we can move into the Racket part…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Racket is a very complete programming language…so no external packages are needed…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;To code for Racket I use the best Racket editor “Dr. Racket” that is actually embedded in the Racket installer…so again…no need to worry -:)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Copy and paste the following code…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Racket_HANA.rkt&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;#lang racket&lt;br /&gt;(require json)&lt;br /&gt;(require net/base64)&lt;br /&gt;(require net/url)&lt;br /&gt;&lt;br /&gt;(define make-auth-header&lt;br /&gt;     (list (string-append&lt;br /&gt;       &quot;Authorization: Basic &quot;&lt;br /&gt;       (bytes-&amp;gt;string/utf-8&lt;br /&gt;        (base64-encode&lt;br /&gt;         (string-&amp;gt;bytes/utf-8&lt;br /&gt;          (string-append &quot;SYSTEM&quot; &quot;:&quot; &quot;YourPassword&quot;)))))))&lt;br /&gt;&lt;br /&gt;(define (get_path path params)&lt;br /&gt;  (port-&amp;gt;string(get-pure-port path params)))&lt;br /&gt;&lt;br /&gt;(define json (string-&amp;gt;jsexpr (get_path (string-&amp;gt;url &quot;YouServer:8000/Flights/flights.xsodata/FLIGHTS?$format=json&quot;) &lt;br /&gt;                              make-auth-header)))&lt;br /&gt;(define results (hash-ref (hash-ref json 'd) 'results))&lt;br /&gt;&lt;br /&gt;(define (show_info results len ctr)&lt;br /&gt;  (cond [(or (= ctr len) (&amp;lt; ctr len))&lt;br /&gt;         (string-append (hash-ref (list-ref results ctr) 'CARRNAME) &quot;: &quot;&lt;br /&gt;                        (hash-ref (list-ref results 0) 'PRICE) &quot;&amp;#92;n&quot;&lt;br /&gt;                        (show_info results len (add1 ctr)))]&lt;br /&gt;        [(&amp;gt; ctr len)&lt;br /&gt;         (string-append &quot;&quot; &quot;&amp;#92;n&quot;)]))&lt;br /&gt;&lt;br /&gt;(display (show_info results (sub1 (length results)) 0))&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Now you see it…Racket is all about parenthesis -:) Anyway…press the run button and you will have this…&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-W6CL_C35OpQ/VgL8ZFnxmAI/AAAAAAAAEqA/QxyJJLQyvIc/s1600/Racket_HANA.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;http://1.bp.blogspot.com/-W6CL_C35OpQ/VgL8ZFnxmAI/AAAAAAAAEqA/QxyJJLQyvIc/s400/Racket_HANA.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;I have been interfacing SAP HANA OData with a lot of languages…and so far…Racket has been one of my fastest implementations…while it’s hard to get used to all these weird parenthesis…it’s a very nice and powerful language…and thing get done faster that one could imagine…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Greetings,&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Development Culture.&lt;/div&gt;&lt;br /&gt;</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-1486094166261034899</guid>
         <pubDate>Wed, 23 Sep 2015 19:42:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-u7Bmoa-KSS4/VgL4Doa8x0I/AAAAAAAAEpU/Owb-i6_cLCg/s72-c/Racket_Logo.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED is my new Hello World - Falcon Time</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/D6G735bKK1w/led-is-my-new-hello-world-falcon-time.html</link>
         <description>Following my tradition...here's my LED Numbers app using Falcon...I used my Julia code as a base start...and I gotta say...the code is pretty much the same...which is nice for now...but I hope to find some hidden and weird features as I learn more about Falcon -;)&lt;br /&gt;&lt;br /&gt;Here's the source code...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;LED_Numbers.fal&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;leds =  [&quot;0&quot; =&amp;gt; [&quot; _  &quot;,&quot;| | &quot;,&quot;|_| &quot;],&lt;br /&gt;         &quot;1&quot; =&amp;gt; [&quot;  &quot;,&quot;| &quot;,&quot;| &quot;],&lt;br /&gt;         &quot;2&quot; =&amp;gt; [&quot; _  &quot;,&quot; _| &quot;,&quot;|_  &quot;],&lt;br /&gt;         &quot;3&quot; =&amp;gt; [&quot;_  &quot;,&quot;_| &quot;,&quot;_| &quot;],&lt;br /&gt;         &quot;4&quot; =&amp;gt; [&quot;    &quot;,&quot;|_| &quot;,&quot;  | &quot;],&lt;br /&gt;         &quot;5&quot; =&amp;gt; [&quot; _  &quot;,&quot;|_  &quot;,&quot; _| &quot;],&lt;br /&gt;         &quot;6&quot; =&amp;gt; [&quot; _  &quot;,&quot;|_  &quot;,&quot;|_| &quot;],&lt;br /&gt;         &quot;7&quot; =&amp;gt; [&quot;_   &quot;,&quot; |  &quot;,&quot; |  &quot;],&lt;br /&gt;         &quot;8&quot; =&amp;gt; [&quot; _  &quot;,&quot;|_| &quot;,&quot;|_| &quot;],&lt;br /&gt;         &quot;9&quot; =&amp;gt; [&quot; _  &quot;,&quot;|_| &quot;,&quot; _| &quot;]]&lt;br /&gt;   &lt;br /&gt;print(&quot;Enter a number: &quot;)&lt;br /&gt;number = input()&lt;br /&gt;len = number.len()&lt;br /&gt;for i in [0:3]&lt;br /&gt; for j in [0:len]&lt;br /&gt;  print(leds[number[j]][i])&lt;br /&gt; end&lt;br /&gt; printl(&quot;&quot;)&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;And of course...here are the pictures...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-qdldUDAbBAQ/VfxXvb2odBI/AAAAAAAAEoo/bcSHcsgh-HE/s1600/LEDNumbers_Falcon_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;121&quot; src=&quot;http://1.bp.blogspot.com/-qdldUDAbBAQ/VfxXvb2odBI/AAAAAAAAEoo/bcSHcsgh-HE/s400/LEDNumbers_Falcon_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/--JyqrwBK8WI/VfxXvvGBVdI/AAAAAAAAEos/0P46CFZLS7k/s1600/LEDNumbers_Falcon_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;121&quot; src=&quot;http://3.bp.blogspot.com/--JyqrwBK8WI/VfxXvvGBVdI/AAAAAAAAEos/0P46CFZLS7k/s400/LEDNumbers_Falcon_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-4443265426851969373</guid>
         <pubDate>Fri, 18 Sep 2015 18:35:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-qdldUDAbBAQ/VfxXvb2odBI/AAAAAAAAEoo/bcSHcsgh-HE/s72-c/LEDNumbers_Falcon_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>My first post on Falcon</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/76UaiHGS9qI/my-first-post-on-falcon.html</link>
         <description>I discovered &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://falconpl.org/index.ftd?page_id=Home&quot;&gt;Falcon&lt;/a&gt; a couple of months ago...but didn't have the time to start playing with it...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-IgdGDIrvXFs/VfxLvnkPCzI/AAAAAAAAEoE/GGUFMZ7fKZg/s1600/FalconLogo.png&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-IgdGDIrvXFs/VfxLvnkPCzI/AAAAAAAAEoE/GGUFMZ7fKZg/s1600/FalconLogo.png&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Falcon is an open source, multi-paradigm programming language. While it looks like a new programming language, it's actually kind of old having it's first appearance on 2003...&lt;br /&gt;&lt;br /&gt;Syntactically, it's pretty similar to &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://lua.org/&quot;&gt;Lua&lt;/a&gt;...which means is kind of similar to &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://golang.org/&quot;&gt;Go&lt;/a&gt; or &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://en.wikipedia.org/wiki/C%2B%2B&quot;&gt;C++&lt;/a&gt;...but of course it has some pretty and unique cool features -;)&lt;br /&gt;&lt;br /&gt;For now...I just ported my Lua version of the Fibonacci Numbers...and beside the fact that Falcon doesn't use &quot;then&quot; and the fact that Falcon can't concatenate numbers with string (but can concatenate string with numbers)...the code is pretty much the same...&lt;br /&gt;&lt;br /&gt;Let's see how it goes when I code my LED Numbers app -;)&lt;br /&gt;&lt;br /&gt;Here's the code...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;fibonacci.fal&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;function fib(num,a,b)&lt;br /&gt; result = &quot;&quot;&lt;br /&gt; if a &amp;gt; 0 and num &amp;gt; 1&lt;br /&gt;  result = result + (a+b) + &quot; &quot; + fib(num-1,a+b,a)&lt;br /&gt; elif a == 0&lt;br /&gt;  result = &quot;&quot; + a + &quot; &quot; + b + &quot; &quot; + (a+b) + &quot; &quot; + fib(num-1,a+b,b)&lt;br /&gt; end&lt;br /&gt; return result &lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;print(&quot;Enter a number: &quot;)&lt;br /&gt;num = int( input() )&lt;br /&gt;print(fib(num,0,1))&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Here's the result...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-MIXNQgtadcw/VfxNmFrlYfI/AAAAAAAAEoU/2Gwb0aWGtb4/s1600/Fibonacci_Falcon_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;111&quot; src=&quot;http://1.bp.blogspot.com/-MIXNQgtadcw/VfxNmFrlYfI/AAAAAAAAEoU/2Gwb0aWGtb4/s400/Fibonacci_Falcon_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-eWDWES-1pzg/VfxNmGPZtAI/AAAAAAAAEoQ/yKR3PCYP22w/s1600/Fibonacci_Falcon_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;96&quot; src=&quot;http://1.bp.blogspot.com/-eWDWES-1pzg/VfxNmGPZtAI/AAAAAAAAEoQ/yKR3PCYP22w/s400/Fibonacci_Falcon_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-5717893539791520375</guid>
         <pubDate>Fri, 18 Sep 2015 17:55:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-IgdGDIrvXFs/VfxLvnkPCzI/AAAAAAAAEoE/GGUFMZ7fKZg/s72-c/FalconLogo.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Purely SAP HANA with Haskell</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/4InxLsL_OaA/purely-sap-hana-with-haskell.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;This post was originally posted on&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/17/purely-sap-hana-with-haskell&quot;&gt;Purely SAP HANA with Haskell&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.haskell.org/&quot;&gt;Haskell&lt;/a&gt; is a general-purpose purely functional programming language with non-strict semantics and strong static typing.&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-u9TivOF3Sk4/VfsHlXA8EjI/AAAAAAAAEnM/Ta8w_qEVtjE/s1600/Haskell_Logo.png&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/-u9TivOF3Sk4/VfsHlXA8EjI/AAAAAAAAEnM/Ta8w_qEVtjE/s1600/Haskell_Logo.png&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What does that means? Nothing…just that Haskell is the most pure programming language around…which means that there are not and cannot be side effects…like Haskellers like to say…”If it compiles…it will always work”…&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There’s an XKCD cartoon that nicely resumes what Haskell is about -;)&lt;/div&gt;&lt;div style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-iABpG1yuVJE/VfsHvLL2kDI/AAAAAAAAEnU/jl4voo5kkQ8/s1600/XKCD_Haskell.png&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://4.bp.blogspot.com/-iABpG1yuVJE/VfsHvLL2kDI/AAAAAAAAEnU/jl4voo5kkQ8/s320/XKCD_Haskell.png&quot; width=&quot;224&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Well…I will run it -:P What I love about Haskell is that it really makes you forget everything you learned before…once assigned, a variable can’t never change its value…recursion is a must…printing on the terminal is considered impure, but there’s of course a work around it…everything is a function…forget about Classes and Objects…pattern matching is your best friend…and so many more cool things -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;So…no example or demonstration would be complete if we didn’t hook it up with SAP HANA, right? So…let’s go and do it -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;First, we need to create a Calculation View and call it “FLIGHTS_BY_CARRIER”. It will be composed of two tables, SCARR and SFLIGHT.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;First, we need to create a Join object and link the table by MANDT and CARRID. From here select the following fields as output MANDT, CARRID, CARRNAME, PRICE and CURRENCY.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Then create an Aggregation object selecting the fields CARRNAME, PRICE (As Aggregated Column) and CURRENCY. Filter the CURRENCY field by ‘USD’.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Then create a Projection object and select only PRICE and CARRNAME.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;On the Semantics object make sure to select “CROSS CLIENT” as the Default Client.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-RadWDRVzXJM/VfsH9v38WWI/AAAAAAAAEnc/_0pdHy9cOtA/s1600/Calculation_View.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://3.bp.blogspot.com/-RadWDRVzXJM/VfsH9v38WWI/AAAAAAAAEnc/_0pdHy9cOtA/s320/Calculation_View.jpg&quot; width=&quot;172&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Now, switch to the SAP HANA Development View and create a new repository. Call it “Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create a new “XS Engine” project and call it “Flights” as well. Link it to the “Flights” repository.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create an empty “.xsapp” file.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create a file called “.xsaccess” with the following code.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;.xsaccess&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;          &quot;exposed&quot; : true,&lt;br /&gt;          &quot;authentication&quot; : [ { &quot;method&quot; : &quot;Basic&quot; } ]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Finally create a file called “flights.xsodata” with the following code&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;flights.xsodata&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;service {&lt;br /&gt;          &quot;Blag/FLIGHTS_BY_CARRIER.calculationview&quot; as &quot;FLIGHTS&quot; keys &lt;br /&gt;                                                        generate local &quot;Id&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Activate your project and launch it on your browser, you should see something like this…&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-hgyYGKg3vjs/VfsJHWVPulI/AAAAAAAAEnk/91PjeWsjUIA/s1600/XSProject.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;http://1.bp.blogspot.com/-hgyYGKg3vjs/VfsJHWVPulI/AAAAAAAAEnk/91PjeWsjUIA/s400/XSProject.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;The SAP HANA part is done…so we can move into the Haskell part…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;On a terminal session type this…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;cabal update&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;cabal install --j --disable-tests wreq&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;&lt;b&gt;In later versions of wreq, lens and aeson are already included…but just in case…&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;cabal install lens&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;cabal install aeson&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;To code for Haskell I use one of the most awesome editors I have ever found…&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.geany.org/&quot;&gt;Geany&lt;/a&gt;. It comes almost pre-configured to handle a lot of programming languages, so you will be ready to code for Haskell.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Basically you only need to press the “Run or view the current file”, last image that shows some engines…which basically will bring up GHCi which is the Glasgow Haskell Compiler Interactive.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-kexmNshkd-Q/VfsJcIpn9JI/AAAAAAAAEns/aqXHaqTvL-A/s1600/Options.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;53&quot; src=&quot;http://1.bp.blogspot.com/-kexmNshkd-Q/VfsJcIpn9JI/AAAAAAAAEns/aqXHaqTvL-A/s200/Options.jpg&quot; width=&quot;200&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;With that, we should be more than ready to start coding -:) Copy and paste the following code…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Haskell_HANA.hs&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{-# LANGUAGE OverloadedStrings #-}&lt;br /&gt;import Network.Wreq&lt;br /&gt;import Control.Lens&lt;br /&gt;import Data.Aeson&lt;br /&gt;import Data.Aeson.Lens&lt;br /&gt;import Data.Aeson.Types&lt;br /&gt;import Data.Text&lt;br /&gt;import Data.Vector&lt;br /&gt;import Prelude as P&lt;br /&gt;import qualified Data.ByteString.Lazy as B&lt;br /&gt;&lt;br /&gt;get_info :: B.ByteString -&amp;gt; Text -&amp;gt; Text -&amp;gt; Text -&amp;gt; Text -&amp;gt; Int -&amp;gt; Int -&amp;gt; String&lt;br /&gt;get_info json d results carrname price len ctr&lt;br /&gt; | ctr &amp;lt; len = unpack(json ^. key d . key results . nth ctr . key carrname . _String) P.++ &lt;br /&gt;               &quot;: &quot; P.++ unpack(json ^. key d . key results . nth ctr . key price . _String) P.++ &quot;&amp;#92;n&quot; &lt;br /&gt;               P.++ get_info json d results carrname price len (ctr+1)&lt;br /&gt; | ctr &amp;gt;= len = []&lt;br /&gt;&lt;br /&gt;main :: IO ()&lt;br /&gt;main = do&lt;br /&gt; let d = pack &quot;d&quot;&lt;br /&gt; let results = pack &quot;results&quot;&lt;br /&gt; let carrname = pack &quot;CARRNAME&quot;&lt;br /&gt; let price = pack &quot;PRICE&quot;&lt;br /&gt; let opts = defaults &amp;amp; auth ?~ basicAuth &quot;SYSTEM&quot; &quot;YourPassword&quot;&lt;br /&gt; r &amp;lt;- getWith opts &quot;http://YourHANAServer:8000/Flights/flights.xsodata/FLIGHTS?$format=json&quot;&lt;br /&gt; let json = r ^. responseBody&lt;br /&gt; let results_array = json ^. key d . key results . _Array&lt;br /&gt; let len = Data.Vector.length results_array&lt;br /&gt; putStr $ get_info json d results carrname price len 0&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Save your file and press the “Run or view the current file” button.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-nKguD7MNbmo/VfsKE1hURFI/AAAAAAAAEn0/FOnoBKZdSEM/s1600/Haskell_HANA.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;http://4.bp.blogspot.com/-nKguD7MNbmo/VfsKE1hURFI/AAAAAAAAEn0/FOnoBKZdSEM/s400/Haskell_HANA.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;You will need to use the format “:l name_of_your_file” to load it into memory and then you can just call the main function to execute it -;)&lt;br /&gt;&lt;br /&gt;I have to say…Haskell is not an easy language…and pulling out this blog wasn’t an easy task either…I need to do a lot of research…but gladly the Wreq and Aeson packages are simply awesome!&lt;br /&gt;&lt;br /&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Expert.</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-7571679847823743868</guid>
         <pubDate>Thu, 17 Sep 2015 19:22:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-u9TivOF3Sk4/VfsHlXA8EjI/AAAAAAAAEnM/Ta8w_qEVtjE/s72-c/Haskell_Logo.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>SAP HANA through the looking Glass</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/Xf0V8bmNtVA/sap-hana-through-looking-glass.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;This post was originally posted on&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/12/sap-hana-through-the-looking-glass&quot;&gt;SAP HANA through the looking Glass&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s1600/d_shop_blog_logo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s400/d_shop_blog_logo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;b&gt;If you are an SAP Employee, please follow us on&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/about_page/sh2Kp26QQkHwkMPFAEqAD9&quot;&gt;Jam&lt;/a&gt;.&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Even when &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.google.com/glass/start/&quot;&gt;Google Glass&lt;/a&gt; is no more...at least not for individuals…I thought that connecting it to SAP HANA would make for a nice blog...because after all we have one at the d-shop…so here we go -;)&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-L5We74_AWQU/VfODBPhu8JI/AAAAAAAAEk4/TOCjcb0uXUg/s1600/Glass_Logo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;http://3.bp.blogspot.com/-L5We74_AWQU/VfODBPhu8JI/AAAAAAAAEk4/TOCjcb0uXUg/s400/Glass_Logo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;First, we need to create a Calculation View and call it “FLIGHTS_BY_CARRIER”. It will be composed of two tables, SCARR and SFLIGHT.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;First, we need to create a Join object and link the table by MANDT and CARRID. From here select the following fields as output MANDT, CARRID, CARRNAME, PRICE and CURRENCY.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Then create an Aggregation object selecting the fields CARRNAME, PRICE (As Aggregated Column) and CURRENCY. Filter the CURRENCY field by ‘USD’.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Then create a Projection object and select only PRICE and CARRNAME.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;On the Semantics object make sure to select “CROSS CLIENT” as the Default Client.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-YyaI9OOCdTw/VfDxMTlBIvI/AAAAAAAAEi4/oyZoAaeoigQ/s1600/Calculation_View.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://4.bp.blogspot.com/-YyaI9OOCdTw/VfDxMTlBIvI/AAAAAAAAEi4/oyZoAaeoigQ/s400/Calculation_View.jpg&quot; width=&quot;215&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Now, switch to the SAP HANA Development View and create a new repository. Call it “Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create a new “XS Engine” project and call it “Flights” as well. Link it to the “Flights” repository.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create an empty “.xsapp” file.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create a file called “.xsaccess” with the following code.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;.xsaccess&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;          &quot;exposed&quot; : true,&lt;br /&gt;          &quot;authentication&quot; : [ { &quot;method&quot; : &quot;Basic&quot; } ]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;font-size:11pt;line-height:16.8667px;&quot;&gt;Finally create a file called “flights.xsodata” with the following code&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Flights.xodata&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;service {&lt;br /&gt;          &quot;Blag/FLIGHTS_BY_CARRIER.calculationview&quot; as &quot;FLIGHTS&quot; keys &lt;br /&gt;                                                        generate local &quot;Id&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;&quot;&gt;&lt;br /&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Activate your project and launch it on your browser, you should see something like this…&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-h0MZOwZaIog/VfDyh1sNjbI/AAAAAAAAEjI/J2vg4BOBjd4/s1600/XSProject.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;http://4.bp.blogspot.com/-h0MZOwZaIog/VfDyh1sNjbI/AAAAAAAAEjI/J2vg4BOBjd4/s400/XSProject.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;The SAP HANA part is done…so we can move into the Google Glass part…&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;First, download &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://developer.android.com/sdk/index.html&quot;&gt;Android Studio&lt;/a&gt; and update your SDK Manager to include the following…API 19 including Google Glass Kit Preview.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-A2E4VpLn0l4/VfOEIX9yjgI/AAAAAAAAElE/fU3jZO_y4hg/s1600/SDK_Manager.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; src=&quot;http://4.bp.blogspot.com/-A2E4VpLn0l4/VfOEIX9yjgI/AAAAAAAAElE/fU3jZO_y4hg/s400/SDK_Manager.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create a new project and call it “GLASS_HANA” or whatever you fancy…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-Gk9qsDB9NsI/VfOES5Syg2I/AAAAAAAAElM/1z45iHqpw14/s1600/Create_Project.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;331&quot; src=&quot;http://1.bp.blogspot.com/-Gk9qsDB9NsI/VfOES5Syg2I/AAAAAAAAElM/1z45iHqpw14/s400/Create_Project.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;On the next screen, uncheck “Phone and Tablet” and check “Glass”. Make sure that “Glass Development Kit Preview (API 19) is selected.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-CAp08dvl3Ew/VfOEbsE7DiI/AAAAAAAAElU/dwfX3kHQWag/s1600/Glass_Development.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;238&quot; src=&quot;http://2.bp.blogspot.com/-CAp08dvl3Ew/VfOEbsE7DiI/AAAAAAAAElU/dwfX3kHQWag/s400/Glass_Development.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Choose “Immersion Activity”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-_Fpbp-0cXQ8/VfOEiQRSOzI/AAAAAAAAElc/uaHG4PeXZ3k/s1600/Activity.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;147&quot; src=&quot;http://1.bp.blogspot.com/-_Fpbp-0cXQ8/VfOEiQRSOzI/AAAAAAAAElc/uaHG4PeXZ3k/s400/Activity.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Leave the “MainActiviy” name and change the Activity Title if you want.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-N8VO2yYyJNo/VfOEsfqGq1I/AAAAAAAAElk/6XeT5lPtaEY/s1600/MainActivity.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;213&quot; src=&quot;http://3.bp.blogspot.com/-N8VO2yYyJNo/VfOEsfqGq1I/AAAAAAAAElk/6XeT5lPtaEY/s400/MainActivity.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;On the “MainActivity” file copy the following code&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;MainActivity.java&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;package glass.app.com.flightsreport;&lt;br /&gt;&lt;br /&gt;import com.google.android.glass.media.Sounds;&lt;br /&gt;import com.google.android.glass.widget.CardBuilder;&lt;br /&gt;import com.google.android.glass.widget.CardScrollAdapter;&lt;br /&gt;import com.google.android.glass.widget.CardScrollView;&lt;br /&gt;&lt;br /&gt;import android.app.Activity;&lt;br /&gt;import android.content.Context;&lt;br /&gt;import android.media.AudioManager;&lt;br /&gt;import android.os.Bundle;&lt;br /&gt;import android.view.View;&lt;br /&gt;import android.view.ViewGroup;&lt;br /&gt;import android.widget.AdapterView;&lt;br /&gt;import com.android.volley.RequestQueue;&lt;br /&gt;import com.android.volley.toolbox.Volley;&lt;br /&gt;import android.speech.RecognizerIntent;&lt;br /&gt;import android.speech.tts.TextToSpeech;&lt;br /&gt;&lt;br /&gt;public class MainActivity extends Activity {&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * {@link CardScrollView} to use as the main content view.&lt;br /&gt;     */&lt;br /&gt;    private CardScrollView mCardScroller;&lt;br /&gt;    private TextToSpeech mTTS;&lt;br /&gt;    private RequestQueue mQueue;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * &quot;Hello World!&quot; {@link View} generated by {@link #buildView()}.&lt;br /&gt;     */&lt;br /&gt;    private View mView;&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    protected void onCreate(Bundle bundle) {&lt;br /&gt;        super.onCreate(bundle);&lt;br /&gt;&lt;br /&gt;        mView = buildView();&lt;br /&gt;&lt;br /&gt;        mCardScroller = new CardScrollView(this);&lt;br /&gt;        mCardScroller.setAdapter(new CardScrollAdapter() {&lt;br /&gt;            @Override&lt;br /&gt;            public int getCount() {&lt;br /&gt;                return 1;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            @Override&lt;br /&gt;            public Object getItem(int position) {&lt;br /&gt;                return mView;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            @Override&lt;br /&gt;            public View getView(int position, View convertView, ViewGroup parent) {&lt;br /&gt;                return mView;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            @Override&lt;br /&gt;            public int getPosition(Object item) {&lt;br /&gt;                if (mView.equals(item)) {&lt;br /&gt;                    return 0;&lt;br /&gt;                }&lt;br /&gt;                return AdapterView.INVALID_POSITION;&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;        // Handle the TAP event.&lt;br /&gt;        mCardScroller.setOnItemClickListener(new AdapterView.OnItemClickListener() {&lt;br /&gt;            @Override&lt;br /&gt;            public void onItemClick(AdapterView parent, View view, int position, long id) {&lt;br /&gt;                // Plays disallowed sound to indicate that TAP actions are not supported.&lt;br /&gt;                AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);&lt;br /&gt;                am.playSoundEffect(Sounds.DISALLOWED);&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;        setContentView(mCardScroller);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    protected void onResume() {&lt;br /&gt;        super.onResume();&lt;br /&gt;        mCardScroller.activate();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    protected void onPause() {&lt;br /&gt;        mCardScroller.deactivate();&lt;br /&gt;        mTTS.shutdown();&lt;br /&gt;        super.onPause();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Builds a Glass styled &quot;Hello World!&quot; view using the {@link CardBuilder} class.&lt;br /&gt;     */&lt;br /&gt;    private View buildView() {&lt;br /&gt;        mTTS = new TextToSpeech(this, new TextToSpeech.OnInitListener() {&lt;br /&gt;            @Override&lt;br /&gt;            public void onInit(int status) {&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;        final CardBuilder card = new CardBuilder(this, CardBuilder.Layout.TEXT);&lt;br /&gt;        mQueue = Volley.newRequestQueue(this);&lt;br /&gt;        final String carrName = getIntent().getExtras().getStringArrayList(RecognizerIntent.EXTRA_RESULTS).get(0);&lt;br /&gt;        HANAFlightsAPI.getFlightsData(carrName, mQueue, new HANAFlightsAPI.Callback() {&lt;br /&gt;            @Override&lt;br /&gt;            public void onFlightsData(HANAFlightsAPI.FlightsData flightsData) {&lt;br /&gt;                card.setText(flightsData.price);&lt;br /&gt;                card.setFootnote(flightsData.carrierName);&lt;br /&gt;                setContentView(card.getView());&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;&lt;br /&gt;        return card.getView();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Create a new file and call it “HANAFlightsAPI” and copy the following code&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;HANAFlightsAPI.java&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;package glass.app.com.flightsreport;&lt;br /&gt;&lt;br /&gt;import android.util.Log;&lt;br /&gt;import com.android.volley.RequestQueue;&lt;br /&gt;import com.android.volley.Response;&lt;br /&gt;import com.android.volley.VolleyError;&lt;br /&gt;import com.android.volley.toolbox.JsonObjectRequest;&lt;br /&gt;import org.json.JSONException;&lt;br /&gt;import org.json.JSONObject;&lt;br /&gt;import android.util.Base64;&lt;br /&gt;import java.util.HashMap;&lt;br /&gt;import java.util.Map;&lt;br /&gt;import com.android.volley.AuthFailureError;&lt;br /&gt;import java.net.URI;&lt;br /&gt;import java.net.URISyntaxException;&lt;br /&gt;&lt;br /&gt;public class HANAFlightsAPI {&lt;br /&gt;    /**&lt;br /&gt;     * Open Weather Map API Endpoint&lt;br /&gt;     */&lt;br /&gt;    public static final String URL = &quot;http://YourServer:8000/Flights/flights.xsodata/FLIGHTS?$format=json&amp;amp;&lt;br /&gt;                                      $filter=CARRNAME%20eq%20&quot;;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Object containing qualitative description of weather as well as temperature in Fahrenheit.&lt;br /&gt;     */&lt;br /&gt;    public static class FlightsData {&lt;br /&gt;&lt;br /&gt;        public final String carrierName;&lt;br /&gt;        public final String price;&lt;br /&gt;&lt;br /&gt;        public FlightsData(String carrierName, String price) {&lt;br /&gt;            this.carrierName = carrierName;&lt;br /&gt;            this.price = price;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public interface Callback {&lt;br /&gt;        void onFlightsData(FlightsData flightsData);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;      public static void getFlightsData(String carrierName, RequestQueue queue, final Callback callback) {&lt;br /&gt;        URI uri = null;&lt;br /&gt;        try {&lt;br /&gt;            uri = new URI(carrierName.replaceAll(&quot; &quot;, &quot;%20&quot;));&lt;br /&gt;        } catch (URISyntaxException e) {&lt;br /&gt;            // TODO Auto-generated catch block&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;        queue.add(new JsonObjectRequest(URL + &quot;%27&quot; + uri + &quot;%27&quot;, null,&lt;br /&gt;                new Response.Listener&amp;lt;JSONObject&amp;gt;() {&lt;br /&gt;                    @Override&lt;br /&gt;                    public void onResponse(JSONObject response) {&lt;br /&gt;                        String carrier = &quot;&quot;;&lt;br /&gt;                        String price = &quot;&quot;;&lt;br /&gt;                        try {&lt;br /&gt;                            JSONObject results = (JSONObject) response.getJSONObject(&quot;d&quot;).getJSONArray(&quot;results&quot;).get(0);&lt;br /&gt;                            carrier = results.getString(&quot;CARRNAME&quot;);&lt;br /&gt;                            price = results.getString(&quot;PRICE&quot;);&lt;br /&gt;                        } catch (JSONException e) {&lt;br /&gt;                            e.printStackTrace();&lt;br /&gt;                        }&lt;br /&gt;                        callback.onFlightsData(new FlightsData(carrier, price));&lt;br /&gt;                    }&lt;br /&gt;                }, new Response.ErrorListener() {&lt;br /&gt;            @Override&lt;br /&gt;            public void onErrorResponse(VolleyError error) {&lt;br /&gt;                Log.e(&quot;onErrorResponse&quot;, error.getMessage());&lt;br /&gt;            }&lt;br /&gt;        }) {&lt;br /&gt;&lt;br /&gt;            @Override&lt;br /&gt;            public Map&amp;lt;String, String&amp;gt; getHeaders() throws AuthFailureError {&lt;br /&gt;                HashMap&amp;lt;String, String&amp;gt; headers = new HashMap&amp;lt;String, String&amp;gt;();&lt;br /&gt;                String creds = String.format(&quot;%s:%s&quot;, &quot;SYSTEM&quot;, &quot;YourPassword&quot;);&lt;br /&gt;                String auth = &quot;Basic &quot; + Base64.encodeToString(creds.getBytes(), Base64.DEFAULT);&lt;br /&gt;                headers.put(&quot;Authorization&quot;, auth);&lt;br /&gt;                return headers;&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Go the second build.gradle file (the one that says “Module.app”) and add this...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Module.app&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;dependencies {&lt;br /&gt;    compile fileTree(dir: 'libs', include: ['*.jar'])&lt;br /&gt;    compile 'com.mcxiaoke.volley:library:1.0.+'&lt;br /&gt;    androidTestCompile 'org.hamcrest:hamcrest-all:1.3'&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;This will add the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://developer.android.com/training/volley/index.html&quot;&gt;Volley library&lt;/a&gt; which is an HTTP library designed to make Android apps networking easier and faster.&lt;br /&gt;&lt;br /&gt;Open the file “voice_trigger.xml” and copy the following code&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;voice_trigger.xml&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;trigger keyword=&quot;Flight Report&quot;&amp;gt;&lt;br /&gt;    &amp;lt;input prompt=&quot;Which Carrier?&quot;/&amp;gt;&lt;br /&gt;&amp;lt;/trigger&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Open the file “strings.xml” and copy the following code&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;strings.xml&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;resources&amp;gt;&lt;br /&gt;    &amp;lt;string name=&quot;app_name&quot;&amp;gt;Flights Report&amp;lt;/string&amp;gt;&lt;br /&gt;    &amp;lt;string name=&quot;glass_voice_trigger&quot;&amp;gt;flights report&amp;lt;/string&amp;gt;&lt;br /&gt;    &amp;lt;string name=&quot;glass_voice_prompt&quot;&amp;gt;which carrier?&amp;lt;/string&amp;gt;&lt;br /&gt;&amp;lt;/resources&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Open the file “AndroidManifest.xml” and copy the following code&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;AndroidManifest.xml&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;    package=&quot;glass.app.com.flightsreport&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;uses-permission android:name=&quot;com.google.android.glass.permission.DEVELOPMENT&quot;/&amp;gt;&lt;br /&gt;    &amp;lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;application&lt;br /&gt;        android:allowBackup=&quot;true&quot;&lt;br /&gt;        android:icon=&quot;@drawable/ic_launcher&quot;&lt;br /&gt;        android:label=&quot;Flights Report&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;activity android:name=&quot;.MainActivity&quot;&amp;gt;&lt;br /&gt;            &amp;lt;intent-filter&amp;gt;&lt;br /&gt;                &amp;lt;action android:name=&quot;com.google.android.glass.action.VOICE_TRIGGER&quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/intent-filter&amp;gt;&lt;br /&gt;            &amp;lt;meta-data&lt;br /&gt;                android:name=&quot;com.google.android.glass.VoiceTrigger&quot;&lt;br /&gt;                android:resource=&quot;@xml/voice_trigger&quot;/&amp;gt;&lt;br /&gt;        &amp;lt;/activity&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;/application&amp;gt;&lt;br /&gt;&amp;lt;/manifest&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;We’re almost ready…we need to connect our Google Glass and make sure it’s on Debug On.&lt;br /&gt;&lt;br /&gt;Navigate to “Settings” and enter it.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-4jmOFKO7H4Q/VfOLNsiAkYI/AAAAAAAAEl0/ywu8ksp4QK8/s1600/Glass_Settings.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;223&quot; src=&quot;http://2.bp.blogspot.com/-4jmOFKO7H4Q/VfOLNsiAkYI/AAAAAAAAEl0/ywu8ksp4QK8/s400/Glass_Settings.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Navigate to “Device info” and click it&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-lV5ym9SF3Jg/VfOLVta2VUI/AAAAAAAAEl8/FvFho6lzbIE/s1600/Glass_DeviceInfo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;221&quot; src=&quot;http://1.bp.blogspot.com/-lV5ym9SF3Jg/VfOLVta2VUI/AAAAAAAAEl8/FvFho6lzbIE/s400/Glass_DeviceInfo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Navigate to “Turn on debug” and click it. It should become “Turn off debug”&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-KGmqhP63FTI/VfOLb18miSI/AAAAAAAAEmE/ccg3zmnsC-4/s1600/Glass_Debug.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;http://4.bp.blogspot.com/-KGmqhP63FTI/VfOLb18miSI/AAAAAAAAEmE/ccg3zmnsC-4/s400/Glass_Debug.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;With that we will be able to link our Google Glass to our Android Studio project. Simply run it and you will see this on the Glass.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;background-color:white;color:#333333;font-family:Calibri, sans-serif;font-size:14.6667px;line-height:22px;text-align:left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-rulahZYfuGM/VfOLilTy2yI/AAAAAAAAEmM/ZTwxE3zOzpk/s1600/Flight_Report.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;http://1.bp.blogspot.com/-rulahZYfuGM/VfOLilTy2yI/AAAAAAAAEmM/ZTwxE3zOzpk/s400/Flight_Report.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Click to enter it and you will see the main screen&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-M9DSdO0ppak/VfOLqj84jPI/AAAAAAAAEmU/vNY40e1Kay8/s1600/Flight_Report_Carrier.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;http://1.bp.blogspot.com/-M9DSdO0ppak/VfOLqj84jPI/AAAAAAAAEmU/vNY40e1Kay8/s400/Flight_Report_Carrier.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Say a carrier name like “American Airlines”&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;background-color:white;color:#333333;font-family:Calibri, sans-serif;font-size:14.6667px;line-height:22px;text-align:left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-Bw80auemu6E/VfOLzVypPLI/AAAAAAAAEmc/q-JY0TiJyvo/s1600/Flight_Report_AA.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;http://2.bp.blogspot.com/-Bw80auemu6E/VfOLzVypPLI/AAAAAAAAEmc/q-JY0TiJyvo/s400/Flight_Report_AA.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Wait and the application will connect to our SAP HANA OData and display the result&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-drnwXBR2Tc8/VfOL8mt8fiI/AAAAAAAAEmk/1vd4HAwcs0M/s1600/Flight_Report_AA_Result.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;222&quot; src=&quot;http://2.bp.blogspot.com/-drnwXBR2Tc8/VfOL8mt8fiI/AAAAAAAAEmk/1vd4HAwcs0M/s400/Flight_Report_AA_Result.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Now, to not make you believe that I’m just making this up…try another one…like “Lufthansa”&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-XF9B0XxFsYE/VfOMFwEaRTI/AAAAAAAAEms/x84UQ53c_q8/s1600/Flight_Report_Lufthansa.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;221&quot; src=&quot;http://3.bp.blogspot.com/-XF9B0XxFsYE/VfOMFwEaRTI/AAAAAAAAEms/x84UQ53c_q8/s400/Flight_Report_Lufthansa.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Wait to see the result…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-3aC71Evt3_I/VfOMPHQ0_LI/AAAAAAAAEm0/Y3750TpLum4/s1600/Flight_Report_Lufthansa_Result.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;http://3.bp.blogspot.com/-3aC71Evt3_I/VfOMPHQ0_LI/AAAAAAAAEm0/Y3750TpLum4/s400/Flight_Report_Lufthansa_Result.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Cool, huh? You could also ask for “Delta Airlines” or “United Airlines”…if you ask for something else, it might give you back the result for the most approximate name or just the default one.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;I’m happy enough with this little project -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Greetings,&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Development Culture.&lt;/div&gt;</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-1822936328717306796</guid>
         <pubDate>Sat, 12 Sep 2015 03:29:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s72-c/d_shop_blog_logo.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Amazon Alexa and SAP HANA</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/4YlQVlKFejk/amazon-alexa-and-sap-hana.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;This post was originally posted on&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/10/amazon-alexa-and-sap-hana&quot;&gt;Amazon Alexa and SAP HANA&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s1600/d_shop_blog_logo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s400/d_shop_blog_logo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;b&gt;If you are an SAP Employee, please follow us on&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/about_page/sh2Kp26QQkHwkMPFAEqAD9&quot;&gt;Jam&lt;/a&gt;.&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://en.wikipedia.org/wiki/Amazon_Echo&quot;&gt;Amazon Alexa&lt;/a&gt; (Formerly Amazon Echo) is an awesome technology that allows you to give voice commands and get cool answers. Yes…it’s like Siri but from Amazon. Also, it doesn’t live on your cellphone, as Alexa is black cylinder packed up with seven microphones and very loud speakers.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-HERh3THnUoQ/VfDw_QeNQBI/AAAAAAAAEio/KWaY-7kPWMY/s1600/Alexa.jpeg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-HERh3THnUoQ/VfDw_QeNQBI/AAAAAAAAEio/KWaY-7kPWMY/s1600/Alexa.jpeg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-9-KldUa5isU/VfDw_r2uTLI/AAAAAAAAEis/iDS3idXoZ9Y/s1600/Alexa_Herself.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;210&quot; src=&quot;http://3.bp.blogspot.com/-9-KldUa5isU/VfDw_r2uTLI/AAAAAAAAEis/iDS3idXoZ9Y/s400/Alexa_Herself.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;We just get one for the d-shop almost a week ago…so of course…I needed to hack it and make it work with SAP HANA -;)&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;First, we need to create a Calculation View and call it “FLIGHTS_BY_CARRIER”. It will be composed of two tables, SCARR and SFLIGHT.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;First, we need to create a Join object and link the table by MANDT and CARRID. From here select the following fields as output MANDT, CARRID, CARRNAME, PRICE and CURRENCY.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Then create an Aggregation object selecting the fields CARRNAME, PRICE (As Aggregated Column) and CURRENCY. Filter the CURRENCY field by ‘USD’.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Then create a Projection object and select only PRICE and CARRNAME.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;On the Semantics object make sure to select “CROSS CLIENT” as the Default Client.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-YyaI9OOCdTw/VfDxMTlBIvI/AAAAAAAAEi4/oyZoAaeoigQ/s1600/Calculation_View.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://4.bp.blogspot.com/-YyaI9OOCdTw/VfDxMTlBIvI/AAAAAAAAEi4/oyZoAaeoigQ/s400/Calculation_View.jpg&quot; width=&quot;215&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Now, switch to the SAP HANA Development View and create a new repository. Call it “Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create a new “XS Engine” project and call it “Flights” as well. Link it to the “Flights” repository.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create an empty “.xsapp” file.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Create a file called “.xsaccess” with the following code.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;.xsaccess&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;          &quot;exposed&quot; : true,&lt;br /&gt;          &quot;authentication&quot; : [ { &quot;method&quot; : &quot;Basic&quot; } ]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;font-size:11pt;line-height:115%;&quot;&gt;Finally create a file called “flights.xsodata” with the following code&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Flights.xodata&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;service {&lt;br /&gt;          &quot;Blag/FLIGHTS_BY_CARRIER.calculationview&quot; as &quot;FLIGHTS&quot; keys &lt;br /&gt;                                                        generate local &quot;Id&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Activate your project and launch it on your browser, you should see something like this…&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-h0MZOwZaIog/VfDyh1sNjbI/AAAAAAAAEjI/J2vg4BOBjd4/s1600/XSProject.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;http://4.bp.blogspot.com/-h0MZOwZaIog/VfDyh1sNjbI/AAAAAAAAEjI/J2vg4BOBjd4/s400/XSProject.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The SAP HANA part is done…so we can move into the Amazon Alexa part…&lt;br /&gt;&lt;br /&gt;I need to thank this blog post &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://tobuildsomething.com/2015/08/14/Amazon-Echo-Alexa-Tutorial-The-Definitive-Guide-to-Coding-an-Alexa-Skill/&quot;&gt;Alexa Skills Tutorial: The Definitive Guide to Coding for the Amazon Echo&lt;/a&gt; as it really helped me to write my own blog post -;)&lt;br /&gt;&lt;br /&gt;In order to code for Amazon Alexa, we can use a new and awesome service from Amazon called Amazon Lambda…which basically allows you to define a NodeJS service that will run only when you need it to run…and also allows you to use the first million requests per month for free…&lt;br /&gt;&lt;br /&gt;First…log into your Amazon Web Services Account and get into Amazon Lambda. Make sure you are on the North Virginia region…otherwise this will not work…&lt;br /&gt;&lt;br /&gt;Once in there…create a new lambda function and select alexa-skills-kit-color-expert&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-zaYNG2QeXco/VfDzCZtjAKI/AAAAAAAAEjM/MPPKC_iIMdk/s1600/Lambda_Function.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;226&quot; src=&quot;http://4.bp.blogspot.com/-zaYNG2QeXco/VfDzCZtjAKI/AAAAAAAAEjM/MPPKC_iIMdk/s400/Lambda_Function.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Then, select the “Alexa Skills Kit” Event Source Type…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-vxP9H-twdjk/VfDzUSxJx-I/AAAAAAAAEjU/5XBBIs8zj68/s1600/Event_Sources.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;96&quot; src=&quot;http://1.bp.blogspot.com/-vxP9H-twdjk/VfDzUSxJx-I/AAAAAAAAEjU/5XBBIs8zj68/s400/Event_Sources.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Then, we need to configure our function…meaning, we need to name it…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-ivEbPQuxPpI/VfD0fMr9RYI/AAAAAAAAEjg/VSioW3sM0e0/s1600/Configure_Function_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;102&quot; src=&quot;http://3.bp.blogspot.com/-ivEbPQuxPpI/VfD0fMr9RYI/AAAAAAAAEjg/VSioW3sM0e0/s400/Configure_Function_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Leave the code entry type for later and choose a role…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-pLQywCxUf60/VfD0p4f4deI/AAAAAAAAEjo/kcKSmDbvdYE/s1600/Configure_Function_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;151&quot; src=&quot;http://1.bp.blogspot.com/-pLQywCxUf60/VfD0p4f4deI/AAAAAAAAEjo/kcKSmDbvdYE/s400/Configure_Function_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Choose Basic execution role and a pop up will be shown…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-1Rk-wfax_lk/VfD024r7_GI/AAAAAAAAEjw/_l-OK80sHTA/s1600/Configure_Function_03.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;173&quot; src=&quot;http://1.bp.blogspot.com/-1Rk-wfax_lk/VfD024r7_GI/AAAAAAAAEjw/_l-OK80sHTA/s400/Configure_Function_03.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Press the “Allow it” button at the bottom. Continue and finally press the “Create Function” button. A ARN number will be generated for your function, take note of it as we will need it on the next step.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Now, we need to go to &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://developer.amazon.com/&quot;&gt;http://developer.amazon.com&lt;/a&gt; and log in.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Choose Apps &amp;amp; Services --&amp;gt; Alexa --&amp;gt; Alexa Skills Set.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-z0OseJmop-s/VfD1D_rUE_I/AAAAAAAAEj4/ylaYTdcNr48/s1600/Alexa_Dashboard.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;http://1.bp.blogspot.com/-z0OseJmop-s/VfD1D_rUE_I/AAAAAAAAEj4/ylaYTdcNr48/s400/Alexa_Dashboard.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;Press the “Add New Skill” button and enter the Name, Invocation Name (How are we going to call it from Alexa), version and the Endpoint (In this case, the ARN number from our Lambda Function)…&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-0kLzf6wshmk/VfD1P8D_XaI/AAAAAAAAEkA/GFJSMO5ZEVo/s1600/Create_New_Skill.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;193&quot; src=&quot;http://3.bp.blogspot.com/-0kLzf6wshmk/VfD1P8D_XaI/AAAAAAAAEkA/GFJSMO5ZEVo/s400/Create_New_Skill.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;When we click on next, an Application Id number will be generated. Take note of it as we will need it on the coding part…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;The Interaction Model section is very important as here we’re going to define the “Intent Schema” and “Sample Utterances”…the first will define the parameters that we’re going to send to Alexa and the second is how we are going to call our application.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Intent Schema&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;  &quot;intents&quot;: [&lt;br /&gt;    {&lt;br /&gt;      &quot;intent&quot;: &quot;GetSAPHANAIntent&quot;,&lt;br /&gt;      &quot;slots&quot;: [&lt;br /&gt;        {&lt;br /&gt;          &quot;name&quot;: &quot;airline&quot;,&lt;br /&gt;          &quot;type&quot;: &quot;LITERAL&quot;&lt;br /&gt;        }&lt;br /&gt;      ]&lt;br /&gt;    },&lt;br /&gt;    {&lt;br /&gt;      &quot;intent&quot;: &quot;HelpIntent&quot;,&lt;br /&gt;      &quot;slots&quot;: []&lt;br /&gt;    }&lt;br /&gt;  ]&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;Our variable is going to be called “airline” and it’s going to be a LITERAL…other types are NUMBER, DATE, TIME and DURATION. The intent is the method that we’re going to call in our code…&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Sample Utterances&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;GetSAPHANAIntent get total amount for airline {American Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get total amount for airline {United Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get total amount for airline {Delta Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get total amount for airline {Lufthansa Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get amount for {Delta Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get amount for {Lufthansa|airline}&lt;br /&gt;GetSAPHANAIntent get amount for {United Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get amount for {American Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get {United Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get {Lufthansa|airline}&lt;br /&gt;GetSAPHANAIntent get {Delta Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get {American Airlines|airline}&lt;br /&gt;&lt;br /&gt;HelpIntent help&lt;br /&gt;HelpIntent help me&lt;br /&gt;HelpIntent what can I ask you&lt;br /&gt;HelpIntent get help&lt;br /&gt;HelpIntent to help&lt;br /&gt;HelpIntent to help me&lt;br /&gt;HelpIntent what commands can I ask&lt;br /&gt;HelpIntent what commands can I say&lt;br /&gt;HelpIntent what can I do&lt;br /&gt;HelpIntent what can I use this for&lt;br /&gt;HelpIntent what questions can I ask&lt;br /&gt;HelpIntent what can you do&lt;br /&gt;HelpIntent what do you do&lt;br /&gt;HelpIntent how do I use you&lt;br /&gt;HelpIntent how can I use you&lt;br /&gt;HelpIntent what can you tell me&lt;br /&gt;HelpIntent how do i get an amount&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;font-size:11pt;line-height:115%;&quot;&gt;The Test section is where we can test our application by sending a utterance like “get American Airlines”…we need to create our function code before we can test it…so don’t worry about this for now…&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-tkDsP7kzqXY/VfD70SW2d2I/AAAAAAAAEkQ/y22h4W54Zsg/s1600/Test_Section.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;392&quot; src=&quot;http://3.bp.blogspot.com/-tkDsP7kzqXY/VfD70SW2d2I/AAAAAAAAEkQ/y22h4W54Zsg/s400/Test_Section.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Forget about the Publishing Information section unless you really want to publish your application…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Let’s create a folder and call it “Alexa_HANA” or something nice like that…then create a folder called “src”. Copy the code from &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://github.com/dustincoates/alexa-bus-schedule/blob/master/src/index.js&quot;&gt;here&lt;/a&gt;&amp;nbsp;and create a file called “AlexaSkills.js”&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;We’re going to need to install the node-rest-client package on our function, so do the following on a terminal&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;b&gt;sudo npm install --prefix=~/Alexa_HANA/src node-rest-client&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;This will create a folder called “node_modules” with the package in our project folder…then create a file called “index.js” and copy and paste the following code…&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;index.js&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;var Client = require('node-rest-client').Client&lt;br /&gt;  , AlexaSkill = require('./AlexaSkill')&lt;br /&gt;  , APP_ID     = 'amzn1.echo-sdk-ams.app.XXX';&lt;br /&gt;&lt;br /&gt;var error = function (err, response, body) {&lt;br /&gt;    console.log('ERROR [%s]', err);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;function toTitleCase(str)&lt;br /&gt;{&lt;br /&gt;    return str.replace(/&amp;#92;w&amp;#92;S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var getJsonFromHANA = function(airline, callback){&lt;br /&gt; var sAirline = toTitleCase(airline);&lt;br /&gt; var options_auth={user:&quot;SYSTEM&quot;,password:&quot;YourPassword&quot;};&lt;br /&gt; client = new Client(options_auth);&lt;br /&gt; client.get(&quot;http://YourServer:8000/Flights/flights.xsodata/FLIGHTS?$format=json&amp;amp;$filter=CARRNAME eq &amp;#92;'&quot; +&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;                    sAirline + &quot;&amp;#92;'&quot;, function(data, response){&lt;/pre&gt;&lt;pre&gt;  if (data.d.results[0] != undefined){&lt;br /&gt;   var Amount = data.d.results[0].PRICE; &lt;br /&gt;  }else{&lt;br /&gt;   var Amount = &quot;Sorry I coudln't find that airline&quot;; &lt;br /&gt;  }&lt;br /&gt;  callback(Amount);&lt;br /&gt; }).on('error',function(err){&lt;br /&gt;            callback(&quot;Sorry there was a connection error&quot;);&lt;br /&gt;       });&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var handleHANARequest = function(intent, session, response){&lt;br /&gt;  getJsonFromHANA(intent.slots.airline.value, function(data){&lt;br /&gt; var text = data;&lt;br /&gt;    var cardText = 'Total sales are: ' + text;&lt;br /&gt;&lt;br /&gt;    var heading = 'Total sales for: ' + intent.slots.airline.value;&lt;br /&gt;    response.tellWithCard(text, heading, cardText);&lt;br /&gt;  });&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;var HANA = function(){&lt;br /&gt;  AlexaSkill.call(this, APP_ID);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;HANA.prototype = Object.create(AlexaSkill.prototype);&lt;br /&gt;HANA.prototype.constructor = HANA;&lt;br /&gt;&lt;br /&gt;HANA.prototype.eventHandlers.onSessionStarted = function(sessionStartedRequest, session){&lt;br /&gt;  console.log(&quot;onSessionStarted requestId: &quot; + sessionStartedRequest.requestId&lt;br /&gt;      + &quot;, sessionId: &quot; + session.sessionId);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;HANA.prototype.eventHandlers.onLaunch = function(launchRequest, session, response){&lt;br /&gt;  // This is when they launch the skill but don't specify what they want.&lt;br /&gt;  var output = 'Welcome to S A P HANA. ' +&lt;br /&gt;    'Say an Airline Name.';&lt;br /&gt;&lt;br /&gt;  var reprompt = 'Which Airline would you like?';&lt;br /&gt;&lt;br /&gt;  response.ask(output, reprompt);&lt;br /&gt;&lt;br /&gt;  console.log(&quot;onLaunch requestId: &quot; + launchRequest.requestId&lt;br /&gt;      + &quot;, sessionId: &quot; + session.sessionId);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;HANA.prototype.intentHandlers = {&lt;br /&gt;  GetSAPHANAIntent: function(intent, session, response){&lt;br /&gt;    handleHANARequest(intent, session, response);&lt;br /&gt;  },&lt;br /&gt;&lt;br /&gt;  HelpIntent: function(intent, session, response){&lt;br /&gt;    var speechOutput = 'Get the total amount for any airline. ' +&lt;br /&gt;      'Which Airline would you like?';&lt;br /&gt;    response.ask(speechOutput);&lt;br /&gt;  }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;exports.handler = function(event, context) {&lt;br /&gt;    var skill = new HANA();&lt;br /&gt;    skill.execute(event, context);&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Once is done, we will need to .zip the files…so go into your “src” folder and create a .zip file that include the “node_modules” folder, the AlexaSkills.js file and the index.js file…you can call the .zip file “SAPHANA.zip”.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;Now, go back to your Amazon Lambda function and choose the Code tab. Then choose “Upload a .ZIP file” and press Upload. Choose your SAPHANA.zip file and then press the “Save” button.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-xLQUypWzJKE/VfD9b9VIxCI/AAAAAAAAEkc/a-Ed8twikOo/s1600/Upload_Code.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;236&quot; src=&quot;http://4.bp.blogspot.com/-xLQUypWzJKE/VfD9b9VIxCI/AAAAAAAAEkc/a-Ed8twikOo/s400/Upload_Code.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;With that…we should be ready to keep going -;)&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;We can now use the Test section of our Alexa Skill…&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-jM0UnXO4CMc/VfD9jvRjH2I/AAAAAAAAEkk/UJFqxrd7_uI/s1600/Test_Done.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;366&quot; src=&quot;http://3.bp.blogspot.com/-jM0UnXO4CMc/VfD9jvRjH2I/AAAAAAAAEkk/UJFqxrd7_uI/s400/Test_Done.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Once you know it’s working…you can test your function in your Amazon Alexa by saying…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;b&gt;“Alexa ask get hana”&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;And then “get American Airlines” or “get total amount for Delta Airlines”&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Here’s a video to show you how it works -:)&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;span style=&quot;font-family:Wingdings;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;As you can see…it’s actually pretty easy but there’s something you need to keep in mind…Alexa will not be able to recognize everything you say…so you need to be careful with your utterances…also…in SAP HANA we have “American Airlines” but Alexa will understand “american airlines”…that’s why I needed to capitalize the first letter as otherwise, both are different airline names -;)&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Greetings,&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Development Culture.&lt;/div&gt;</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-7212272216560441056</guid>
         <pubDate>Thu, 10 Sep 2015 04:35:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s72-c/d_shop_blog_logo.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Firing Up (BeagleBone Black, WebCam, Missile Launcher and OpenCV)</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/LtauAdH8hCk/firing-up-beaglebone-black-webcam.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;This post was originally posted on&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/09/firing-up-beaglebone-black-webcam-missile-launcher-and-opencv&quot;&gt;Firing Up (BeagleBone Black, WebCam, Missile Launcher and OpenCV)&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s1600/d_shop_blog_logo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s400/d_shop_blog_logo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;b&gt;If you are an SAP Employee, please follow us on&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/about_page/sh2Kp26QQkHwkMPFAEqAD9&quot;&gt;Jam&lt;/a&gt;.&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;My good friend John Astill came to visit us at d-shop some time ago…and he saw the Thunder Missile Launcher that I bought as a Christmas present for my team dinner. He told me…”Blag…you should build that app that fires up missiles when you put a color or object in front of the camera”…that got me thinking of course -;)&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-oJIKVCfAl00/VfB-jp6BmqI/AAAAAAAAEgU/l_i3jQAIGa8/s1600/DreamCheeky.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://3.bp.blogspot.com/-oJIKVCfAl00/VfB-jp6BmqI/AAAAAAAAEgU/l_i3jQAIGa8/s320/DreamCheeky.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;So John…this blog is for you&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;So, let’s start…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;You will need OpenCV installed…so the regular way should work…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;b&gt;sudo apt-get install opencv&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;And OpenCV should be installed and ready to use now…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Next…I needed to hack the Missile Launcher in order to be able to make it fire…so this is where the fun begins…I hooked the Missile Launcher to my Linux box on VMWare and made a &lt;b&gt;lsusb -vv &lt;/b&gt;command to get the information about the USB device…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-fDT3p5TgE9M/VfB-wPqglKI/AAAAAAAAEgc/8ppKuraoLSI/s1600/lsusb.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;266&quot; src=&quot;http://3.bp.blogspot.com/-fDT3p5TgE9M/VfB-wPqglKI/AAAAAAAAEgc/8ppKuraoLSI/s400/lsusb.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Here we can see that the IdVendor is 0x2123 and the idProduct is 0x1010. This doesn’t really give us anything as we don’t know to pass the information we need in order to make it work…so next step was to sniff the device in order to get the USB commands…I did this using &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://sourceforge.net/projects/usbsnoop/&quot;&gt;SnoopyPro&lt;/a&gt; a USB Sniffer Tools for Windows…and just notice that I couldn’t make it work properly on Windows 7, so I need to use my old and nice Windows XP VMWare Image…and install the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://dreamcheeky.com/download-support&quot;&gt;Dream Cheeky software&lt;/a&gt;...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-NbLiPoidglw/VfCBXkchMWI/AAAAAAAAEgo/jjPJKWg-bMo/s1600/Thunder.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://1.bp.blogspot.com/-NbLiPoidglw/VfCBXkchMWI/AAAAAAAAEgo/jjPJKWg-bMo/s320/Thunder.jpg&quot; width=&quot;255&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Once we have SnoopyPro running, need to connect the Missile Launcher and click on File --&amp;gt; Unpack Drivers…&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-KMjRv5LEh9M/VfCBfUNd4wI/AAAAAAAAEgw/PokVNWhhVrI/s1600/USB_Devices_Menu.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/-KMjRv5LEh9M/VfCBfUNd4wI/AAAAAAAAEgw/PokVNWhhVrI/s1600/USB_Devices_Menu.jpg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Next, we need to look for the correct IdVendor and IdProduct and right-click to select Install and Restart.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-la78zIeVgNQ/VfCBsR6CcxI/AAAAAAAAEg4/lAv0OTRkJHA/s1600/USB_Devices.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;271&quot; src=&quot;http://4.bp.blogspot.com/-la78zIeVgNQ/VfCBsR6CcxI/AAAAAAAAEg4/lAv0OTRkJHA/s400/USB_Devices.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;This will allow us to log everything that happens while using the device. By default, at least for the Missile Launcher…it will log 14 lines that don’t matter much to us…but when we hit for example the Up button…then we get more interesting info…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-hfe6RR9r-Do/VfCB2FOfkiI/AAAAAAAAEhA/FP7ee6I2U4Q/s1600/UpButton.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;183&quot; src=&quot;http://1.bp.blogspot.com/-hfe6RR9r-Do/VfCB2FOfkiI/AAAAAAAAEhA/FP7ee6I2U4Q/s400/UpButton.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;This is basically saying that to make the launcher move up, we need to pass the following…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;b&gt;0x02 0x02 0x00 0x00 0x00 0x00 0x00 0x00&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Now…the part that interests us is the Fire action…so let’s explore it…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-e0-IxPtakEg/VfCCAbaVgeI/AAAAAAAAEhI/77c48vutXhs/s1600/FireButton.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; src=&quot;http://2.bp.blogspot.com/-e0-IxPtakEg/VfCCAbaVgeI/AAAAAAAAEhI/77c48vutXhs/s400/FireButton.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;This one is&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;b&gt;0x02 0x10 0x00 0x00 0x00 0x00 0x00 0x00&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Cool…now we’re getting closer…but…there’s a piece that it’s missing…how do we send this command? Easy…just take a look at the Transfer command…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-bgvq5vXR0W4/VfCCJP9k5RI/AAAAAAAAEhQ/Acst0Np7rMw/s1600/Transfer_Command.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;http://2.bp.blogspot.com/-bgvq5vXR0W4/VfCCJP9k5RI/AAAAAAAAEhQ/Acst0Np7rMw/s400/Transfer_Command.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;This command tells us that we need to pass the information like this…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;b&gt;0x21 0x09 0 0&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Followed by the action we want to perform…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;In order to use the device on our BeagleBone…we need to install something first…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;b&gt;pip install pysub&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;This library will allow us to connect and more important, send commands to our device.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;As we’re going to use a Camera and the Missile Launcher both at the same time…we need a USB Hub that it’s powered…otherwise, it will never work…I got this one from &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.amazon.com/gp/product/B00DQFGH80/ref=oh_aui_detailpage_o01_s00?ie=UTF8&amp;amp;psc=1&quot;&gt;Amazon&lt;/a&gt;.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;So…power up the USB Hub and connect both WebCam and Missile Launcher, connect the Hub to your BeagleBone Black and then connect the BeagleBone to your laptop…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Use Nano or any other editor of your choice and create a file called Thunder.py&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Thunder.py&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;import cv2&lt;br /&gt;import numpy as np&lt;br /&gt;import usb.core&lt;br /&gt;&lt;br /&gt;cam = cv2.VideoCapture(-1)&lt;br /&gt;cam.set(3, 960)&lt;br /&gt;cam.set(4,720)&lt;br /&gt;s, img = cam.read()&lt;br /&gt;&lt;br /&gt;dev = usb.core.find(idVendor=0x2123,idProduct=0x1010)&lt;br /&gt;try:&lt;br /&gt;            dev.detach_kernel_driver(0)&lt;br /&gt;except Exception, e:&lt;br /&gt;            pass&lt;br /&gt;&lt;br /&gt;winName = &quot;Thunder&quot;&lt;br /&gt;cv2.namedWindow(winName, cv2.CV_WINDOW_AUTOSIZE)&lt;br /&gt;while s:&lt;br /&gt;        s, img = cam.read()&lt;br /&gt;        key = cv2.waitKey(10)&lt;br /&gt;        if key == 27:&lt;br /&gt;                cv.destroyWindow(winName)&lt;br /&gt;                break&lt;br /&gt;        hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)&lt;br /&gt;              lower_green = np.array([38, 100, 50])&lt;br /&gt;              upper_green = np.array([75, 255, 255])&lt;br /&gt;&lt;br /&gt;        mask = cv2.inRange(hsv, lower_green, upper_green)&lt;br /&gt;        res = cv2.bitwise_and(img,img, mask=mask)&lt;br /&gt;        cv2.imshow(winName, res)&lt;br /&gt;&lt;br /&gt;        if cv2.countNonZero(mask) &amp;gt; 61000:&lt;br /&gt;                dev.ctrl_transfer(0x21, 0x09, 0, 0,&lt;br /&gt;                                  [0x02, 0x010, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;This code will basically open up the camera connection, and turn the display black so only the color that we want to track is shown. In this case, we want to fire up the missile launcher only when we see something “green”. As you can see we’re passing the transfer command as single parameters but the fire command as an array.&lt;br /&gt;&lt;br /&gt;Now…the BeagleBone doesn’t have a display…so you could attach a monitor and a keyboard or you could do something more interesting and smart…&lt;br /&gt;&lt;br /&gt;We’re going to install Tight VNC Server&lt;br /&gt;&lt;br /&gt;&lt;b&gt;sudo apt-get install tightvncserver&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The first time you run it, it will ask you for a password for the current user, so go ahead and provide one…&lt;br /&gt;&lt;br /&gt;And it will start running…so you will be able to open a Remote Desktop connection to your BeagleBone…now you only need a client to connect to it...&lt;br /&gt;&lt;br /&gt;If you’re using Windows you can download the TightVNC Client from here…&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.tightvnc.com/download/2.7.10/tightvnc-2.7.10-setup-64bit.msi&quot;&gt;http://www.tightvnc.com/download/2.7.10/tightvnc-2.7.10-setup-64bit.msi&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.tightvnc.com/download/2.7.10/tightvnc-2.7.10-setup-32bit.msi&quot;&gt;http://www.tightvnc.com/download/2.7.10/tightvnc-2.7.10-setup-32bit.msi&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you’re using Linux you can simply download it using apt-get install like this…&lt;br /&gt;&lt;br /&gt;&lt;b&gt;sudo apt-get install xtightvncviewer&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Run it on the terminal&lt;br /&gt;&lt;br /&gt;Just provide the IP for your BeagleBone which should be 192.168.7.2:1 on the small box that will appear, provide the password that you setup for the VNCServer on the next screen and you’re all set…&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-M01-Ek5ephU/VfCC1E_PTEI/AAAAAAAAEhY/luI711_xl68/s1600/VNC_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-M01-Ek5ephU/VfCC1E_PTEI/AAAAAAAAEhY/luI711_xl68/s1600/VNC_01.jpg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-2BI2E0_HlNY/VfCC1N4ht5I/AAAAAAAAEhg/zlPeDS7PrVI/s1600/VNC_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://2.bp.blogspot.com/-2BI2E0_HlNY/VfCC1N4ht5I/AAAAAAAAEhg/zlPeDS7PrVI/s1600/VNC_02.jpg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-uKEeANjT7rw/VfCC1FP6NCI/AAAAAAAAEhc/ovHZssbu9Ok/s1600/VNC_03.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;248&quot; src=&quot;http://1.bp.blogspot.com/-uKEeANjT7rw/VfCC1FP6NCI/AAAAAAAAEhc/ovHZssbu9Ok/s320/VNC_03.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;If you’re using Windows…simply double click the tightvnc-jviewer.jar file and enter the following information…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-kLajuYLFwPo/VfCC_qWDwiI/AAAAAAAAEhw/dK3pyn5EI5Q/s1600/VNC_Win_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;187&quot; src=&quot;http://1.bp.blogspot.com/-kLajuYLFwPo/VfCC_qWDwiI/AAAAAAAAEhw/dK3pyn5EI5Q/s320/VNC_Win_01.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-5c5WQH_B1gU/VfCC_tYmz2I/AAAAAAAAEh0/coB0zjx90DY/s1600/VNC_Win_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;188&quot; src=&quot;http://4.bp.blogspot.com/-5c5WQH_B1gU/VfCC_tYmz2I/AAAAAAAAEh0/coB0zjx90DY/s320/VNC_Win_02.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-RFRUeoI2Btg/VfCC_hUwdEI/AAAAAAAAEh8/WyLTDyt5y8E/s1600/VNC_Win_03.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;257&quot; src=&quot;http://2.bp.blogspot.com/-RFRUeoI2Btg/VfCC_hUwdEI/AAAAAAAAEh8/WyLTDyt5y8E/s320/VNC_Win_03.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;In order to test this, we need to simply print a nice green box…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-1IolFmUtoEY/VfCDL3uVQgI/AAAAAAAAEiI/NXaGyA4cJGw/s1600/Green_Box.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://2.bp.blogspot.com/-1IolFmUtoEY/VfCDL3uVQgI/AAAAAAAAEiI/NXaGyA4cJGw/s400/Green_Box.jpg&quot; width=&quot;300&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Then we can run the app…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-4kuPLsDZ9wM/VfCDTt5KAgI/AAAAAAAAEiQ/YEp-ED_Kq5c/s1600/Running_App.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://2.bp.blogspot.com/-4kuPLsDZ9wM/VfCDTt5KAgI/AAAAAAAAEiQ/YEp-ED_Kq5c/s400/Running_App.jpg&quot; width=&quot;300&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;And put the green box in front of the camera -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;background-color:white;color:#333333;font-family:Arial, Helvetica, clean, sans-serif;font-size:14px;line-height:21px;text-align:left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-dIlB61P_mVg/VfCDadFqfxI/AAAAAAAAEiY/AqcKQoiU9v0/s1600/Firing_Up.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://3.bp.blogspot.com/-dIlB61P_mVg/VfCDadFqfxI/AAAAAAAAEiY/AqcKQoiU9v0/s400/Firing_Up.jpg&quot; width=&quot;300&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;Sorry for the flaky picture…but the Missile Launcher was firing off and I had my phone on one hand and the green box paper in the other one -;) &lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;Greetings,&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;Development Culture.&lt;/div&gt;</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-3948046014555599112</guid>
         <pubDate>Wed, 09 Sep 2015 19:42:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s72-c/d_shop_blog_logo.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Nest Thermostat and R - Creating a Shiny dashboard</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/qHnLWXLlr6I/nest-thermostat-and-r-creating-shiny.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;This post was originally posted on &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/09/nest-thermostat-and-r--creating-a-shiny-dashboard&quot;&gt;Nest Thermostat and R - Creating a Shiny dashboard&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s1600/d_shop_blog_logo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s400/d_shop_blog_logo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;b&gt;If you are an SAP Employee, please follow us on &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/about_page/sh2Kp26QQkHwkMPFAEqAD9&quot;&gt;Jam&lt;/a&gt;.&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;div&gt;At the d-shop we're always looking forward to play with the latest technologies...a while the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://nest.com/thermostat/meet-nest-thermostat/&quot;&gt;Nest Thermostat&lt;/a&gt; is not really &quot;new&quot;, we're in the process of getting one.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For now, we are happy to be able to play a little bit with &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://developer.nest.com/documentation/cloud/home-simulator/&quot;&gt;Nest Home Simulator&lt;/a&gt; available on the Google Chrome Store.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this blog, we're going to use the Nest Home Simulator, the Statistics Programming Language &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.r-project.org/&quot;&gt;R&lt;/a&gt; and the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://shiny.rstudio.com/&quot;&gt;Shiny package&lt;/a&gt;, which allows us to create awesome web interfaces to manage data. Also, we're going to need the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://cran.r-project.org/web/packages/rjson/index.html&quot;&gt;RJson package&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First step will be to create an account on the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://developer.nest.com/&quot;&gt;Nest Developer Program&lt;/a&gt; and the install the Nest Home Simulator.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-QktSfZ3bB5A/VfByhEUUI8I/AAAAAAAAEfY/x9vjePi-v6U/s1600/Nest_Simulator.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;176&quot; src=&quot;http://3.bp.blogspot.com/-QktSfZ3bB5A/VfByhEUUI8I/AAAAAAAAEfY/x9vjePi-v6U/s400/Nest_Simulator.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Wen we log into the Simulator, we are going to be able to create a Thermostat to start playing around with the current and target temperatures...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-GbglmE1LJBM/VfByqrzgwfI/AAAAAAAAEfg/Vm0DZJVX4wM/s1600/Nest_Simulator_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;287&quot; src=&quot;http://2.bp.blogspot.com/-GbglmE1LJBM/VfByqrzgwfI/AAAAAAAAEfg/Vm0DZJVX4wM/s400/Nest_Simulator_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;The second important thing, is that when we are log into the Nest Developer Program we're going to be able to create a client which will access our thermostat and also, we will going to able to generate a unique number to communicate with it.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-IGkcRf_e2Y0/VfByz7RI2DI/AAAAAAAAEfo/qoV_sHnLzjQ/s1600/Nest_Developers.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;236&quot; src=&quot;http://3.bp.blogspot.com/-IGkcRf_e2Y0/VfByz7RI2DI/AAAAAAAAEfo/qoV_sHnLzjQ/s400/Nest_Developers.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;We need to just copy and paste the URL from the Authorization URL and after accepting the conditions a number will be presented...we need this number for our R code...but keep in mind that once the connection is closed, we will need to generate a new number...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/--96GZNoT2xY/VfBy-46kkWI/AAAAAAAAEfw/38pfCh-G9dU/s1600/Works_with_Nest.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://2.bp.blogspot.com/--96GZNoT2xY/VfBy-46kkWI/AAAAAAAAEfw/38pfCh-G9dU/s400/Works_with_Nest.jpg&quot; width=&quot;322&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Now, we're ready to add some code to the mix...when working with R, is always better to use &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.rstudio.com/&quot;&gt;RStudio&lt;/a&gt;...so copy and paste this code...and remember to replace the code variable with your own number...also you will need to replace the Client ID and Client Secret with the information from your Nest Developer Program Client code...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Nest_Dashboard.R&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;library(&quot;shiny&quot;)&lt;br /&gt;library(&quot;rjson&quot;)&lt;br /&gt;&lt;br /&gt;if(!exists(&quot;access_code&quot;)){&lt;br /&gt;  code&amp;lt;-&quot;XXX&quot;&lt;br /&gt;  info_data&amp;lt;-data.frame(Humidity=integer(),&lt;/pre&gt;&lt;pre&gt;  Current_Temperature=integer(),Target_Temperature=integer(),Times=character())&lt;br /&gt;  access_code&amp;lt;-system(sprintf('curl -X POST&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;  &quot;https://api.home.nest.com/oauth2/access_token?client_id=XXX&amp;amp;code=%s&amp;amp;&lt;/pre&gt;&lt;pre&gt;  client_secret=XXX&amp;amp;grant_type=authorization_code&quot;',code),intern=T)&lt;br /&gt;  document&amp;lt;-fromJSON(access_code)&lt;br /&gt;  access&amp;lt;-document$access_token&lt;br /&gt;  devices&amp;lt;-paste(&quot;https://developer-api.nest.com/devices?auth=&quot;,access,sep=&quot;&quot;)&lt;br /&gt;  all_devices&amp;lt;-system(sprintf('curl -L -X GET -H &quot;Accept: application/json&quot; &quot;%s&quot;',devices),intern=T)&lt;br /&gt;  device&amp;lt;-gsub(&quot;thermostats|:|{|&amp;#92;&quot;|humidity.*&quot;,&quot;&quot;,all_devices,perl=T)&lt;br /&gt;  themostat_code&amp;lt;-paste(&quot;https://developer-api.nest.com/devices/thermostats/&quot;,device,&quot;?auth=&quot;,access,sep=&quot;&quot;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;get_nest_info = function(info_data){&lt;br /&gt;    thermostat&amp;lt;-system(sprintf('curl -L -X GET -H &quot;Accept: application/json&quot; &quot;%s&quot;',themostat_code),intern=T)&lt;br /&gt;    info&amp;lt;-fromJSON(thermostat)&lt;br /&gt;    timeframe&amp;lt;-Sys.time()&lt;br /&gt;    timeframe&amp;lt;-gsub(&quot;&amp;#92;&amp;#92;d+-&amp;#92;&amp;#92;d+-&amp;#92;&amp;#92;d+&amp;#92;&amp;#92;s&quot;,&quot;&quot;,timeframe)&lt;br /&gt;    new_data&amp;lt;-data.frame(Humidity=info$humidity,Current_Temperature=info$ambient_temperature_f,&lt;/pre&gt;&lt;pre&gt;    Target_Temperature=info$target_temperature_f,Times=timeframe,stringsAsFactors = F)&lt;br /&gt;    if(nrow(info_data)==10){&lt;br /&gt;      info_data&amp;lt;-info_data[-1,]&lt;br /&gt;    }&lt;br /&gt;    info_data&amp;lt;-rbind(info_data,new_data)&lt;br /&gt;  return(info_data)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;runApp(list(&lt;br /&gt;  ui = pageWithSidebar(    &lt;br /&gt;    &lt;br /&gt;    headerPanel(&quot;Nest Dashboard&quot;),&lt;br /&gt;    &lt;br /&gt;    sidebarPanel(&lt;br /&gt;    ),&lt;br /&gt;    &lt;br /&gt;    mainPanel(&lt;br /&gt;      plotOutput(&quot;nestPlot&quot;)&lt;br /&gt;    )&lt;br /&gt;  ),&lt;br /&gt;  server =function(input, output, session) {&lt;br /&gt;    autoInvalidate &amp;lt;- reactiveTimer(10000, session)&lt;br /&gt;      output$nestPlot &amp;lt;- renderPlot({&lt;br /&gt;        autoInvalidate()&lt;br /&gt;        info_data&amp;lt;&amp;lt;-get_nest_info(info_data) &lt;br /&gt;        plot(info_data$Current_Temperature,type=&quot;n&quot;,axes=F,ann=F)&lt;br /&gt;        lines(info_data$Current_Temperature,col=&quot;blue&quot;)&lt;br /&gt;        lines(info_data$Target_Temperature,col=&quot;red&quot;)&lt;br /&gt;        points(info_data$Current_Temperature, pch=21, bg=&quot;lightcyan&quot;, cex=1.25)&lt;br /&gt;        points(info_data$Target_Temperature, pch=21, bg=&quot;lightcyan&quot;, cex=1.25)&lt;br /&gt;        box()&lt;br /&gt;        xy&amp;lt;-length(info_data$Times)&lt;br /&gt;        axis(2, col.axis=&quot;blue&quot;, las=1)&lt;br /&gt;        axis(1, at=1:xy, lab=info_data$Times, col.axis=&quot;purple&quot;)&lt;br /&gt;        legend(&quot;topright&quot;,c(&quot;Current Temp&quot;,&quot;Target Temp&quot;),lty=c(1,1),col=c(&quot;blue&quot;,&quot;red&quot;),bty=&quot;n&quot;)&lt;br /&gt;    })&lt;br /&gt;  }&lt;br /&gt;))&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;This code will get 10 readings until it refreshes itself to get 10 new ones. So we can update the Current and Target Temperature values in order to see the Dashboard changing...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-zQhCtp8d6rw/VfB0Xfc5_AI/AAAAAAAAEf8/-JZ70hsVUsg/s1600/Nest_Dashboard_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;324&quot; src=&quot;http://1.bp.blogspot.com/-zQhCtp8d6rw/VfB0Xfc5_AI/AAAAAAAAEf8/-JZ70hsVUsg/s640/Nest_Dashboard_01.jpg&quot; width=&quot;640&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-2QIvhjhUFZ8/VfB0XBZIsAI/AAAAAAAAEgA/conE1er5OC4/s1600/Nest_Dashboard_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;324&quot; src=&quot;http://3.bp.blogspot.com/-2QIvhjhUFZ8/VfB0XBZIsAI/AAAAAAAAEgA/conE1er5OC4/s640/Nest_Dashboard_02.jpg&quot; width=&quot;640&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.&lt;/div&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-39499896371250985</guid>
         <pubDate>Wed, 09 Sep 2015 18:18:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s72-c/d_shop_blog_logo.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED is my new Hello World - Mercury Time</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/61Lz9y2yxws/led-is-my-new-hello-world-mercury-time.html</link>
         <description>This one was a little bit tricky and longer than I expected...it also...forced me to spend a lot of time reading the documentation as there aren't many tutorials or books about Mercury...&lt;br /&gt;&lt;br /&gt;Anyway...in the end it's working fine, so I'm quite happy -:)&lt;br /&gt;&lt;br /&gt;Mercury has a lot of pretty convenient functions...you just need to find them out -;)&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;led_numbers.m&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;:- module led_numbers.&lt;br /&gt;:- interface.&lt;br /&gt;:- import_module io.&lt;br /&gt;&lt;br /&gt;:- pred main(io::di, io::uo) is det.&lt;br /&gt;&lt;br /&gt;:- implementation.&lt;br /&gt;:- import_module list, string, int, array, char.&lt;br /&gt;&lt;br /&gt;:- pred get_leds(list.list(character)::in, list.list(character)::in, &lt;br /&gt;                 int::in, list.list(string)::out ) is det.&lt;br /&gt; &lt;br /&gt;get_leds(LDIGITS, LDIGITS_AUX, N, RESPONSE) :-&lt;br /&gt; (&lt;br /&gt;  LEDS = array([array([&quot; _  &quot;,&quot;| | &quot;,&quot;|_| &quot;]),&lt;br /&gt;                array([&quot;  &quot;,&quot;| &quot;,&quot;| &quot;]),&lt;br /&gt;                array([&quot; _  &quot;,&quot; _| &quot;,&quot;|_  &quot;]),&lt;br /&gt;                array([&quot;_  &quot;,&quot;_| &quot;,&quot;_| &quot;]),&lt;br /&gt;                array([&quot;    &quot;,&quot;|_| &quot;,&quot;  | &quot;]),&lt;br /&gt;                array([&quot; _  &quot;,&quot;|_  &quot;,&quot; _| &quot;]),&lt;br /&gt;                array([&quot; _  &quot;,&quot;|_  &quot;,&quot;|_| &quot;]),&lt;br /&gt;                array([&quot;_   &quot;,&quot; |  &quot;,&quot; |  &quot;]),&lt;br /&gt;                array([&quot; _  &quot;,&quot;|_| &quot;,&quot;|_| &quot;]),&lt;br /&gt;                array([&quot; _  &quot;,&quot;|_| &quot;,&quot; _| &quot;])&lt;br /&gt;               ]),&lt;br /&gt;  list.length(LDIGITS,LEN),&lt;br /&gt;  ( if LEN &amp;gt; 0 then&lt;br /&gt;   HEAD = det_head(LDIGITS),&lt;br /&gt;   TAIL = det_tail(LDIGITS),&lt;br /&gt;   char.to_int(HEAD, HEAD_I:int),&lt;br /&gt;   HEAD_N:int = HEAD_I - 48,&lt;br /&gt;   LINE = elem(HEAD_N, LEDS),&lt;br /&gt;   SUB_LINE = elem(N, LINE),&lt;br /&gt;   get_leds(TAIL, LDIGITS_AUX, N, RESULT),&lt;br /&gt;   RESPONSE = [SUB_LINE] ++ RESULT&lt;br /&gt;    else if N &amp;lt; 2 then&lt;br /&gt;   get_leds(LDIGITS_AUX, LDIGITS_AUX, N+1, RESULT),&lt;br /&gt;   RESPONSE = [&quot;&amp;#92;n&quot;]  ++ RESULT&lt;br /&gt;    else if N = 2 then&lt;br /&gt;   RESPONSE = [&quot;&amp;#92;n&quot;]&lt;br /&gt;    else&lt;br /&gt;   RESPONSE = [] )&lt;br /&gt; ). &lt;br /&gt; &lt;br /&gt;main(!IO) :-&lt;br /&gt; io.write_string(&quot;Enter a number: &quot;,!IO),&lt;br /&gt; io.read_line_as_string(Result, !IO),&lt;br /&gt; ( if&lt;br /&gt;   Result = ok(String),&lt;br /&gt;   NUM = string.strip(String),&lt;br /&gt;   to_char_list(NUM,LDIGITS),&lt;br /&gt;   get_leds(LDIGITS, LDIGITS, 0, RESPONSE)&lt;br /&gt;  then&lt;br /&gt;   io.write_string(string.join_list(&quot;&quot;, RESPONSE), !IO)&lt;br /&gt;  else&lt;br /&gt;   io.write_string(&quot;Not a number...&quot;,!IO)&lt;br /&gt; ).&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Anyway...here are the screens -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-YMD8zf9pVqs/VciweojZ6OI/AAAAAAAAEeo/TJ9M45ig1Uw/s1600/LED_Mercury_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;242&quot; src=&quot;http://3.bp.blogspot.com/-YMD8zf9pVqs/VciweojZ6OI/AAAAAAAAEeo/TJ9M45ig1Uw/s400/LED_Mercury_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-d5hbBFSnNUk/VciwiXhUegI/AAAAAAAAEe0/Y9SyEoYsL4I/s1600/LED_Mercury_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;227&quot; src=&quot;http://4.bp.blogspot.com/-d5hbBFSnNUk/VciwiXhUegI/AAAAAAAAEe0/Y9SyEoYsL4I/s400/LED_Mercury_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Hope you like it -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Greetings,&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Development Culture.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-6388339654149454920</guid>
         <pubDate>Mon, 10 Aug 2015 14:15:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://3.bp.blogspot.com/-YMD8zf9pVqs/VciweojZ6OI/AAAAAAAAEeo/TJ9M45ig1Uw/s72-c/LED_Mercury_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>My first post on Mercury</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/2I4rYLhD6u0/my-first-post-on-mercury.html</link>
         <description>So...my new language for a couple of weeks...is &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.mercurylang.org/index.html&quot;&gt;Mercury&lt;/a&gt; -:)&lt;br /&gt;&lt;br /&gt;You may ask...what is Mercury?&lt;br /&gt;&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;b&gt;Mercury looks like Prolog, but feels like strict Haskell or pure OCaml.&lt;/b&gt;&lt;/blockquote&gt;&amp;nbsp;In other words is a logical, functional and object-oriented programming language...&lt;br /&gt;&lt;br /&gt;As always...I needed to develop an app to learn how to use it...and while it gave me more than one headache...here it is -;)&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;fibo.m&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;:- module fibo.&lt;br /&gt;:- interface.&lt;br /&gt;:- import_module io.&lt;br /&gt;&lt;br /&gt;:- pred main(io::di, io::uo) is det.&lt;br /&gt;&lt;br /&gt;:- implementation.&lt;br /&gt;:- import_module string, int.&lt;br /&gt;&lt;br /&gt;:- pred fibo(int::in, int::in, int::in, string::out) is det.&lt;br /&gt;&lt;br /&gt;fibo(NUM, A, B, FIBS) :-&lt;br /&gt; ( &lt;br /&gt;  if A = 0 &lt;br /&gt;  then fibo(NUM-1,A+B,B,FIB), FIBS = int_to_string(A) ++ &quot; &quot; ++ int_to_string(B) ++ &lt;br /&gt;                                     &quot; &quot; ++ int_to_string(A+B) ++ &quot; &quot; ++ FIB&lt;br /&gt;  else if A &amp;gt; 0, NUM &amp;gt; 1&lt;br /&gt;  then fibo(NUM-1,A+B,A,FIB), FIBS = int_to_string(A+B) ++ &quot; &quot; ++ FIB&lt;br /&gt;  else FIBS = &quot;&quot;&lt;br /&gt; ).&lt;br /&gt; &lt;br /&gt;main(!IO) :-&lt;br /&gt; io.write_string(&quot;Enter a number: &quot;,!IO),&lt;br /&gt; io.read_line_as_string(Result, !IO),&lt;br /&gt; ( if&lt;br /&gt;   Result = ok(String),&lt;br /&gt;   string.to_int(string.strip(String), N)&lt;br /&gt;  then&lt;br /&gt;   fibo(N,0,1,FIBS),&lt;br /&gt;   io.write_string(FIBS,!IO)&lt;br /&gt;  else&lt;br /&gt;   io.write_string(&quot;Not a number...&quot;,!IO)&lt;br /&gt; ).&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;The cool thing about Mercury is that it forces you to not allow your app to fail...as the &quot;else&quot; is mandatory...if you enter a number then it's fine...but if you enter a letter, you are forced to do something...&lt;br /&gt;&lt;br /&gt;Here are the pics...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-QRWCfoJIdck/VcJVZnvbKvI/AAAAAAAAEeI/8pJpiA89gtg/s1600/Mercury_Fibo_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;206&quot; src=&quot;http://1.bp.blogspot.com/-QRWCfoJIdck/VcJVZnvbKvI/AAAAAAAAEeI/8pJpiA89gtg/s400/Mercury_Fibo_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-CfOh1EmIpWM/VcJVdno_sZI/AAAAAAAAEeQ/w72Dk0M4M3w/s1600/Mercury_Fibo_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;208&quot; src=&quot;http://3.bp.blogspot.com/-CfOh1EmIpWM/VcJVdno_sZI/AAAAAAAAEeQ/w72Dk0M4M3w/s400/Mercury_Fibo_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&amp;nbsp;Now...I just need to break my head a little bit more trying to make my LED_Numbers app -:D&lt;br /&gt;&lt;br /&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-3787201851475893838</guid>
         <pubDate>Wed, 05 Aug 2015 18:35:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-QRWCfoJIdck/VcJVZnvbKvI/AAAAAAAAEeI/8pJpiA89gtg/s72-c/Mercury_Fibo_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED is my new Hello World - Zonnon Time</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/rO_8-HgE4wQ/led-is-my-new-hello-world-zonnon-time.html</link>
         <description>You knew this was coming...don't you? -;)&lt;br /&gt;&lt;br /&gt;So here...I took another approach because Zonnon doesn't have a built-in split command...and also because I'm not sure how to create an array of arrays and because I couldn't make my procedure return an array and then assign it to another array -:(&lt;br /&gt;&lt;br /&gt;Still...I'm quite happy with the result -:D&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;LED_Numbers.znn&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;module LED_Numbers;&lt;br /&gt;&lt;br /&gt;var num, text, concat:string;&lt;br /&gt;var leds:array 10 of string;&lt;br /&gt;var led:array 3 of string;&lt;br /&gt;var i, j, z, len, lenled:integer; &lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt; leds[0]:=&quot; _  ,| | ,|_| ,&quot;;&lt;br /&gt; leds[1]:=&quot;  ,| ,| ,&quot;;&lt;br /&gt; leds[2]:=&quot; _  , _| ,|_  ,&quot;;&lt;br /&gt; leds[3]:=&quot;_  ,_| ,_| ,&quot;;&lt;br /&gt; leds[4]:=&quot;    ,|_| ,  | ,&quot;;&lt;br /&gt; leds[5]:=&quot; _  ,|_  , _| ,&quot;;&lt;br /&gt; leds[6]:=&quot; _  ,|_  ,|_| ,&quot;;&lt;br /&gt; leds[7]:=&quot;_   , |  , |  ,&quot;;&lt;br /&gt; leds[8]:=&quot; _  ,|_| ,|_| ,&quot;;&lt;br /&gt; leds[9]:=&quot; _  ,|_| , _| ,&quot;;&lt;br /&gt; write(&quot;Enter a number: &quot;);readln(num);&lt;br /&gt; len:=num.Length;&lt;br /&gt; for j:=0 to len - 1 do&lt;br /&gt;  i:=0;&lt;br /&gt;  text:=leds[integer(num[j])-48];&lt;br /&gt;  lenled:=text.Length;&lt;br /&gt;  for z:= 0 to lenled - 1 do&lt;br /&gt;   if text[z] # &quot;,&quot; then&lt;br /&gt;    concat:= concat + string(text[z]);&lt;br /&gt;   else&lt;br /&gt;    led[i]:=led[i] + concat;&lt;br /&gt;    concat:=&quot;&quot;;&lt;br /&gt;    i:= i + 1;&lt;br /&gt;   end;&lt;br /&gt;  end;&lt;br /&gt; end; &lt;br /&gt; writeln(led[0]);&lt;br /&gt; writeln(led[1]);&lt;br /&gt; writeln(led[2]);&lt;br /&gt;end LED_Numbers.&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Anyway...here are the pictures -;)&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-va6bZjHYUlE/Vbvr8B4U-nI/AAAAAAAAEdk/vM_bnk175-4/s1600/Zonnon_LED_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;266&quot; src=&quot;http://3.bp.blogspot.com/-va6bZjHYUlE/Vbvr8B4U-nI/AAAAAAAAEdk/vM_bnk175-4/s400/Zonnon_LED_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-ipL7FfovJIg/Vbvr_3T7BNI/AAAAAAAAEds/GrOa6VkHCrk/s1600/Zonnon_LED_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;268&quot; src=&quot;http://1.bp.blogspot.com/-ipL7FfovJIg/Vbvr_3T7BNI/AAAAAAAAEds/GrOa6VkHCrk/s400/Zonnon_LED_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-7055963321714933562</guid>
         <pubDate>Fri, 31 Jul 2015 21:47:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://3.bp.blogspot.com/-va6bZjHYUlE/Vbvr8B4U-nI/AAAAAAAAEdk/vM_bnk175-4/s72-c/Zonnon_LED_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>My first post on Zonnon</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/XFHZ0BFPUzk/my-first-post-on-zonnon.html</link>
         <description>As always...I was looking for new and cool programming languages to learn...and then &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://twitter.com/thulium3&quot;&gt;Mark Teichmann&lt;/a&gt; came up with something really nice -;) The &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.zonnon.ethz.ch/&quot;&gt;Zonnon&lt;/a&gt; programming language...&lt;br /&gt;&lt;br /&gt;So...what's Zonnon?&amp;nbsp;Zonnon is a general-purpose programming language in the Pascal, Modula-2 and Oberon family...and it's run on .NET/Mono...&lt;br /&gt;&lt;span style=&quot;background-color:white;font-family:arial, helvetica, geneva;font-size:13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:arial, helvetica, geneva;&quot;&gt;&lt;span style=&quot;font-size:13.3333px;&quot;&gt;It's been a really long time since I used &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://en.wikipedia.org/wiki/Pascal_(programming_language)&quot;&gt;Pascal&lt;/a&gt; or &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://en.wikipedia.org/wiki/Delphi_(programming_language)&quot;&gt;Delphi&lt;/a&gt;...but...just like riding a bicycle...the knowledge came back as soon I started writing some code -;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial, helvetica, geneva;&quot;&gt;&lt;span style=&quot;font-size:13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family:arial, helvetica, geneva;&quot;&gt;&lt;span style=&quot;font-size:13.3333px;&quot;&gt;Now...the only problem I have with Zonnon...is that's there's almost no documentation...and what's available is in Russian...so...a lot Google helped me up...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial, helvetica, geneva;&quot;&gt;&lt;span style=&quot;font-size:13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:13.3333px;&quot;&gt;&lt;span style=&quot;background-color:white;font-family:arial, helvetica, geneva;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial, helvetica, geneva;&quot;&gt;&lt;span style=&quot;font-size:13.3333px;&quot;&gt;Here's the Fibonacci Numbers app...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color:white;font-family:arial, helvetica, geneva;font-size:13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Fibo.znn&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;module Fibo;&lt;br /&gt;var num: integer;&lt;br /&gt;var a, b: integer;&lt;br /&gt;&lt;br /&gt;procedure fib (var num, a, b : integer): string;&lt;br /&gt;var result: string;&lt;br /&gt;var ab: integer;&lt;br /&gt;begin&lt;br /&gt; result := &quot;&quot;;&lt;br /&gt; if (a &amp;gt; 0) &amp;amp; (num &amp;gt; 1) then&lt;br /&gt;  num := num - 1;&lt;br /&gt;  ab := a + b;&lt;br /&gt;  result := result + string(ab) + &quot; &quot; + fib(num, ab, a);&lt;br /&gt; elsif a == 0 then&lt;br /&gt;  num := num - 1;&lt;br /&gt;  ab := a + b;&lt;br /&gt;  result := string(a) + &quot; &quot; + string(b) + &quot; &quot; + string(ab) + &quot; &quot; + fib(num, ab, b);&lt;br /&gt; end;&lt;br /&gt; return result;&lt;br /&gt;end fib;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt; a := 0;&lt;br /&gt; b := 1;&lt;br /&gt; write(&quot;Enter a number: &quot;);readln(num);&lt;br /&gt; writeln(fib(num,a,b));&lt;br /&gt; writeln(&quot;&quot;);&lt;br /&gt;end Fibo.&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;And a couple of pictures...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-u2c0Ms3wFSk/VbvgA1izGII/AAAAAAAAEdM/Gz_fw74WCLQ/s1600/Zonnon_Fibo_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;238&quot; src=&quot;http://4.bp.blogspot.com/-u2c0Ms3wFSk/VbvgA1izGII/AAAAAAAAEdM/Gz_fw74WCLQ/s400/Zonnon_Fibo_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/--lugSd_vnLg/VbvgHMVPFpI/AAAAAAAAEdU/mBQBSb0UlYI/s1600/Zonnon_Fibo_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;235&quot; src=&quot;http://2.bp.blogspot.com/--lugSd_vnLg/VbvgHMVPFpI/AAAAAAAAEdU/mBQBSb0UlYI/s400/Zonnon_Fibo_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;I need to keep playing and exploring Zonnon...there's a lot of cool things still hiding from me -;)&lt;br /&gt;&lt;br /&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-7107972391789746158</guid>
         <pubDate>Fri, 31 Jul 2015 21:10:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-u2c0Ms3wFSk/VbvgA1izGII/AAAAAAAAEdM/Gz_fw74WCLQ/s72-c/Zonnon_Fibo_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED is my new Hello World - Forth Time</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/VEWjhvJG0Tc/led-is-my-new-hello-world-forth-time.html</link>
         <description>Just as you expected...it's time again for my LED Numbers application...this time...using Forth -:)&lt;br /&gt;&lt;br /&gt;The code is a little bit longer that I would have expected...but I guess it's either because I'm still a Forth newbie...or because Forth being a stack based programming language has it's own way of dealing with this kind of application...&lt;br /&gt;&lt;br /&gt;Here's the source code...enjoy! -;)&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;LED_Numbers.fth&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;VARIABLE picky&lt;br /&gt;&lt;br /&gt;: COLLECT_PICKY DUP 1- picky ! ;&lt;br /&gt;&lt;br /&gt;: NPICK COLLECT_PICKY 2 * 0 ?DO picky @ PICK LOOP ;&lt;br /&gt;&lt;br /&gt;: SPLIT BEGIN DUP WHILE 10 /MOD REPEAT DROP DEPTH ;&lt;br /&gt;&lt;br /&gt;: First_Line&lt;br /&gt;  CASE&lt;br /&gt;  0 OF SPACE .&quot; _  &quot; ENDOF 1 OF SPACE SPACE ENDOF&lt;br /&gt;  2 OF SPACE .&quot; _  &quot; ENDOF 3 OF .&quot; _  &quot; ENDOF&lt;br /&gt;  4 OF SPACE SPACE SPACE SPACE ENDOF 5 OF SPACE .&quot; _  &quot; ENDOF&lt;br /&gt;  6 OF SPACE .&quot; _  &quot;ENDOF 7 OF .&quot; _   &quot;  ENDOF &lt;br /&gt;  8 OF SPACE .&quot; _  &quot; ENDOF 9 OF SPACE .&quot; _  &quot; ENDOF&lt;br /&gt;  ENDCASE ;&lt;br /&gt;  &lt;br /&gt;: Second_Line&lt;br /&gt;  CASE&lt;br /&gt;  0 OF .&quot; | | &quot; ENDOF 1 OF .&quot; | &quot; ENDOF&lt;br /&gt;  2 OF SPACE .&quot; _| &quot; ENDOF 3 OF .&quot; _| &quot; ENDOF&lt;br /&gt;  4 OF .&quot; |_| &quot; ENDOF 5 OF .&quot; |_  &quot; ENDOF&lt;br /&gt;  6 OF .&quot; |_  &quot;ENDOF 7 OF SPACE .&quot; |  &quot;  ENDOF &lt;br /&gt;  8 OF .&quot; |_| &quot; ENDOF 9 OF .&quot; |_| &quot; ENDOF&lt;br /&gt;  ENDCASE ;&lt;br /&gt;  &lt;br /&gt;: Third_Line&lt;br /&gt;  CASE&lt;br /&gt;  0 OF .&quot; |_| &quot; ENDOF 1 OF .&quot; | &quot; ENDOF&lt;br /&gt;  2 OF .&quot; |_  &quot; ENDOF 3 OF .&quot; _| &quot; ENDOF&lt;br /&gt;  4 OF SPACE SPACE .&quot; | &quot; ENDOF 5 OF SPACE .&quot; _| &quot; ENDOF&lt;br /&gt;  6 OF .&quot; |_| &quot;ENDOF 7 OF SPACE .&quot; |  &quot;  ENDOF &lt;br /&gt;  8 OF .&quot; |_| &quot; ENDOF 9 OF SPACE .&quot; _| &quot; ENDOF&lt;br /&gt;  ENDCASE ;&lt;br /&gt;&lt;br /&gt;: LED &lt;br /&gt;  SPLIT&lt;br /&gt;  NPICK&lt;br /&gt;  DEPTH 3 / 0 ?DO First_Line LOOP CR&lt;br /&gt;  DEPTH 2 / 0 ?DO Second_Line LOOP CR&lt;br /&gt;  DEPTH 0 ?DO Third_Line LOOP ;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;And of course...you want to see an image...so here it goes -;)&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-N1IezKYXBwc/VbEnTFP9WpI/AAAAAAAAEco/miO-F0fONIo/s1600/LED_Numbers_Forth.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;313&quot; src=&quot;http://4.bp.blogspot.com/-N1IezKYXBwc/VbEnTFP9WpI/AAAAAAAAEco/miO-F0fONIo/s400/LED_Numbers_Forth.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Hope you like it... -:D&lt;br /&gt;&lt;br /&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-4815541648202806149</guid>
         <pubDate>Thu, 23 Jul 2015 17:46:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-N1IezKYXBwc/VbEnTFP9WpI/AAAAAAAAEco/miO-F0fONIo/s72-c/LED_Numbers_Forth.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>My first post on Forth</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/nWNDSWCvW7A/my-first-post-on-forth.html</link>
         <description>So...after a very long time...I finally decided to learn &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.forth.com/&quot;&gt;Forth&lt;/a&gt;...and if I thought I have dealt with difficult programming languages before...I was like Jon Snow...I knew nothing -:(&lt;br /&gt;&lt;br /&gt;Forth is a stack based programming language...meaning that you program using a stack with the LIFO functionality...Last In - First Out...&lt;br /&gt;&lt;br /&gt;Something like this...you enter 1 2 3 and Forth will output it as 3 2 1...weird, huh?&lt;br /&gt;&lt;br /&gt;Of course...I started to read a book...and unlike most other times...I have finish it a long time ago...but with Forth...one book is not just enough...I have been reading and coding like crazy...&lt;br /&gt;&lt;br /&gt;The book is &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.forth.com/starting-forth/&quot;&gt;Starting Forth&lt;/a&gt; by Leo Brodie...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.forth.com/starting-forth/&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://2.bp.blogspot.com/-Fgu6Qdt3COs/Va7ZKqI_1II/AAAAAAAAEcE/tmNntp9ykOs/s400/Starting_Forth.jpg&quot; width=&quot;300&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The book itself is really good...it's 166 pages so it's not very long and gives you a nice introduction to the world of Forth...of course...as I said...one book is not enough...and even when this book is really good and highly recommended...Forth is very difficult to grasp but learning it is just amazing -:)&lt;br /&gt;&lt;br /&gt;It took me a very long time but finally I was able to come with an example of my already &quot;famous&quot; Fibonacci Numbers...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Fibo.fth&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;: FIBO &lt;br /&gt;   1 SWAP &lt;br /&gt;   0 DUP . &lt;br /&gt;   ?DO &lt;br /&gt;      DUP . OVER OVER + ROT DROP &lt;br /&gt;   LOOP &lt;br /&gt;   DROP DEPTH &lt;br /&gt;   DEPTH 2 = IF 2DROP 0 THEN &lt;br /&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;I told you...Forth is not by any chance and easy language...and actually I wrote the code in just one line...but put it here in different lines to make more clear...&lt;br /&gt;&lt;br /&gt;Let's see an image...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-hXpVYCIMdt4/Va7b4htOkFI/AAAAAAAAEcQ/s1tPaFE48wg/s1600/Forth_Fibo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;262&quot; src=&quot;http://3.bp.blogspot.com/-hXpVYCIMdt4/Va7b4htOkFI/AAAAAAAAEcQ/s1tPaFE48wg/s400/Forth_Fibo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I'm sure I going to spend quite more time with Forth...as I feel that's there so much to learn...if you like what you see...learn it too -;) Otherwise...look for something less weird -:)&lt;br /&gt;&lt;br /&gt;BTW...I'm using pForth...I used gForth when I first started but I think pForth is more Forth complaint...&lt;br /&gt;&lt;br /&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-2193911477700017345</guid>
         <pubDate>Wed, 22 Jul 2015 00:14:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://2.bp.blogspot.com/-Fgu6Qdt3COs/Va7ZKqI_1II/AAAAAAAAEcE/tmNntp9ykOs/s72-c/Starting_Forth.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Exploring SparkR</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/ecVaBy0dvtc/exploring-sparkr.html</link>
         <description>A colleague from work, asked me to investigate about &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://spark.apache.org/&quot;&gt;Spark&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.r-project.org/&quot;&gt;R&lt;/a&gt;. So the most obvious thing to was to investigate about &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://amplab-extras.github.io/SparkR-pkg/&quot;&gt;SparkR&lt;/a&gt; -;)&lt;br /&gt;&lt;br /&gt;I installed Scala, Hadoop, Spark and SparkR...not sure Hadoop is needed for this...but I wanted to have the full picture -:)&lt;br /&gt;&lt;br /&gt;Anyway...I came across a piece of code that reads lines from a file and count how many lines have a &quot;a&quot; and how many lines have a &quot;b&quot;...&lt;br /&gt;&lt;br /&gt;For this code I used the lyrics of &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.azlyrics.com/lyrics/afi/girlsnotgrey.html&quot;&gt;Girls Not Grey&lt;/a&gt; by &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://afireinside.net/&quot;&gt;AFI&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;SparkR.R&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;library(SparkR)&lt;br /&gt;&lt;br /&gt;start.time &amp;lt;- Sys.time()&lt;br /&gt;sc &amp;lt;- sparkR.init(master=&quot;local&quot;)&lt;br /&gt;logFile &amp;lt;- &quot;/home/blag/R_Codes/Girls_Not_Grey&quot;&lt;br /&gt;logData &amp;lt;- SparkR:::textFile(sc, logFile)&lt;br /&gt;numAs &amp;lt;- count(SparkR:::filterRDD(logData, function(s) { grepl(&quot;a&quot;, s) }))&lt;br /&gt;numBs &amp;lt;- count(SparkR:::filterRDD(logData, function(s) { grepl(&quot;b&quot;, s) }))&lt;br /&gt;paste(&quot;Lines with a: &quot;, numAs, &quot;, Lines with b: &quot;, numBs, sep=&quot;&quot;)&lt;br /&gt;end.time &amp;lt;- Sys.time()&lt;br /&gt;time.taken &amp;lt;- end.time - start.time&lt;br /&gt;time.taken&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-4sG8CwMAOqQ/VZIjoP1SVpI/AAAAAAAAEao/gzx04LKEwXw/s1600/SparkR_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;221&quot; src=&quot;http://2.bp.blogspot.com/-4sG8CwMAOqQ/VZIjoP1SVpI/AAAAAAAAEao/gzx04LKEwXw/s400/SparkR_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;0.3167355 seconds...pretty fast...I wonder how regular R will behave?&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;PlainR.R&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;library(&quot;stringr&quot;)&lt;br /&gt;&lt;br /&gt;start.time &amp;lt;- Sys.time()&lt;br /&gt;logFile &amp;lt;- &quot;/home/blag/R_Codes/Girls_Not_Grey&quot;&lt;br /&gt;logfile&amp;lt;-read.table(logFile,header = F, fill = T)&lt;br /&gt;logfile&amp;lt;-apply(logfile[,], 1, function(x) paste(x, collapse=&quot; &quot;))&lt;br /&gt;df&amp;lt;-data.frame(lines=logfile)&lt;br /&gt;a&amp;lt;-sum(apply(df,1,function(x) grepl(&quot;a&quot;,x)))&lt;br /&gt;b&amp;lt;-sum(apply(df,1,function(x) grepl(&quot;b&quot;,x)))&lt;br /&gt;paste(&quot;Lines with a: &quot;, a, &quot;, Lines with b: &quot;, b, sep=&quot;&quot;)&lt;br /&gt;end.time &amp;lt;- Sys.time()&lt;br /&gt;time.taken &amp;lt;- end.time - start.time&lt;br /&gt;time.taken&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-SQk2tpVAWwg/VZIf5kV92UI/AAAAAAAAEaE/jFOfoVONips/s1600/PlainR_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;http://4.bp.blogspot.com/-SQk2tpVAWwg/VZIf5kV92UI/AAAAAAAAEaE/jFOfoVONips/s400/PlainR_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Nice...0.01522398 seconds...wait...what? Isn't Spark supposed to be pretty fast? Well...I remembered that I read somewhere that Spark shines with big files...&lt;br /&gt;&lt;br /&gt;Well...I prepared a file with 5 columns and 1 million records...let's see how that goes...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;SparkR.R&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;library(SparkR)&lt;br /&gt;&lt;br /&gt;start.time &amp;lt;- Sys.time()&lt;br /&gt;sc &amp;lt;- sparkR.init(master=&quot;local&quot;)&lt;br /&gt;logFile &amp;lt;- &quot;/home/blag/R_Codes/Doc_Header.csv&quot;&lt;br /&gt;logData &amp;lt;- SparkR:::textFile(sc, logFile)&lt;br /&gt;numAs &amp;lt;- count(SparkR:::filterRDD(logData, function(s) { grepl(&quot;a&quot;, s) }))&lt;br /&gt;numBs &amp;lt;- count(SparkR:::filterRDD(logData, function(s) { grepl(&quot;b&quot;, s) }))&lt;br /&gt;paste(&quot;Lines with a: &quot;, numAs, &quot;, Lines with b: &quot;, numBs, sep=&quot;&quot;)&lt;br /&gt;end.time &amp;lt;- Sys.time()&lt;br /&gt;time.taken &amp;lt;- end.time - start.time&lt;br /&gt;time.taken&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-5ERthZK7nXM/VZIhI0yq4JI/AAAAAAAAEaQ/9fZtimjAC0s/s1600/SparkR_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;http://2.bp.blogspot.com/-5ERthZK7nXM/VZIhI0yq4JI/AAAAAAAAEaQ/9fZtimjAC0s/s400/SparkR_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;26.45734 seconds for a million records? Nice job -:) Let's see if plain R wins again...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;PlainR.R&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;library(&quot;stringr&quot;)&lt;br /&gt;&lt;br /&gt;start.time &amp;lt;- Sys.time()&lt;br /&gt;logFile &amp;lt;- &quot;/home/blag/R_Codes/Doc_Header.csv&quot;&lt;br /&gt;logfile&amp;lt;-read.csv(logFile,header = F)&lt;br /&gt;logfile&amp;lt;-apply(logfile[,], 1, function(x) paste(x, collapse=&quot; &quot;))&lt;br /&gt;df&amp;lt;-data.frame(lines=logfile)&lt;br /&gt;a&amp;lt;-sum(apply(df,1,function(x) grepl(&quot;a&quot;,x)))&lt;br /&gt;b&amp;lt;-sum(apply(df,1,function(x) grepl(&quot;b&quot;,x)))&lt;br /&gt;paste(&quot;Lines with a: &quot;, a, &quot;, Lines with b: &quot;, b, sep=&quot;&quot;)&lt;br /&gt;end.time &amp;lt;- Sys.time()&lt;br /&gt;time.taken &amp;lt;- end.time - start.time&lt;br /&gt;time.taken&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-d4z0V2tHHtQ/VZIiKJYhRnI/AAAAAAAAEac/U_BBoXJ7n5c/s1600/PlainR_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;http://3.bp.blogspot.com/-d4z0V2tHHtQ/VZIiKJYhRnI/AAAAAAAAEac/U_BBoXJ7n5c/s400/PlainR_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;48.31641 seconds? Look like Spark was almost twice as fast this time...and this is a pretty simple example...I'm sure that when complexity arises...the gap is even bigger...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And sure...I know that a lot of people can take my plain R code and make it even faster than Spark...but...this is my blog...not theirs -;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I will come back as soon as I learn more about SparkR -:D&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;UPDATE&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;So...I got a couple of comments claiming that read.csv() is too slow...and I should measuring the process not the loading of an csv file...while I don't agree...because everything is included in the process...I did something as simple as moving the start.time after the csv file is done...let's see how much of a change this brings...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-8Rl9ifPEEqI/VZU8FI-6E_I/AAAAAAAAEbA/eyDF4ZrrmxM/s1600/SparkR_03.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;160&quot; src=&quot;http://4.bp.blogspot.com/-8Rl9ifPEEqI/VZU8FI-6E_I/AAAAAAAAEbA/eyDF4ZrrmxM/s400/SparkR_03.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;b&gt;SparkR&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Around 1 second faster...which means that reading the csv was really efficient...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-U6q-guFuHPg/VZU8YPAIddI/AAAAAAAAEbI/L3PXasZTwzo/s1600/PlainR_03.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;155&quot; src=&quot;http://4.bp.blogspot.com/-U6q-guFuHPg/VZU8YPAIddI/AAAAAAAAEbI/L3PXasZTwzo/s400/PlainR_03.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;b&gt;Plain R&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;Around 6 seconds faster...read.csv is not that good...but...SparkR is almost 50% faster...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;HOLLY CRAP UPDATE!&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;span style=&quot;background-color:white;color:#222222;font-family:arial, sans-serif;font-size:12.8px;&quot;&gt;&amp;nbsp;Markus from Spain gave me this code on the comments...I just added a couple of things to make complaint...but...damn...I wish I could code like that in R! -:D Thanks Markus!!!&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color:white;color:#222222;font-family:arial, sans-serif;font-size:12.8px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Markus's code&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;logFile &amp;lt;- &quot;/home/blag/R_Codes/Doc_Header.csv&quot;&lt;br /&gt;lines &amp;lt;- readLines(logFile)&lt;br /&gt;start.time &amp;lt;- Sys.time()&lt;br /&gt;a&amp;lt;-sum(grepl(&quot;a&quot;, lines, fixed=TRUE))&lt;br /&gt;b&amp;lt;-sum(grepl(&quot;b&quot;, lines, fixed=TRUE))&lt;br /&gt;paste(&quot;Lines with a: &quot;, a, &quot;, Lines with b: &quot;, b, sep=&quot;&quot;)&lt;br /&gt;end.time &amp;lt;- Sys.time()&lt;br /&gt;time.taken &amp;lt;- end.time - start.time&lt;br /&gt;time.taken&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-R1J6Bw8VSgQ/VZYc0XiO8dI/AAAAAAAAEbc/T8wcDx4wcBI/s1600/PlainR_04.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;151&quot; src=&quot;http://1.bp.blogspot.com/-R1J6Bw8VSgQ/VZYc0XiO8dI/AAAAAAAAEbc/T8wcDx4wcBI/s400/PlainR_04.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Simply...superb! -:)&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Greetings,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Blag.&lt;/div&gt;&lt;div&gt;Development Culture.&lt;/div&gt;</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-7983886616038777899</guid>
         <pubDate>Tue, 30 Jun 2015 05:20:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://2.bp.blogspot.com/-4sG8CwMAOqQ/VZIjoP1SVpI/AAAAAAAAEao/gzx04LKEwXw/s72-c/SparkR_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED is my new Hello World - Lua Time</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/YgPJ7uISUio/led-is-my-new-hello-world-lua-time.html</link>
         <description>Getting on with my tradition of building an LED application for each and every new programming language that I learn...it's time for Lua -;)&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;LedNumbers.lua&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;local function split(s,delim)&lt;br /&gt; local result = {}&lt;br /&gt; for match in (s..delim):gmatch(&quot;(.-)&quot;..delim) do&lt;br /&gt;  table.insert(result,match)&lt;br /&gt; end&lt;br /&gt; return result&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;leds = {[0] = &quot; _  ,| | ,|_| &quot;,&lt;br /&gt;        [1] = &quot;  ,| ,| &quot;,&lt;br /&gt;        [2] = &quot; _  , _| ,|_  &quot;,&lt;br /&gt;        [3] = &quot;_  ,_| ,_| &quot;,&lt;br /&gt;        [4] = &quot;    ,|_| ,  | &quot;,&lt;br /&gt;        [5] = &quot; _  ,|_  , _| &quot;,&lt;br /&gt;        [6] = &quot; _  ,|_  ,|_| &quot;,&lt;br /&gt;        [7] = &quot;_   , |  , |  &quot;,&lt;br /&gt;        [8] = &quot; _  ,|_| ,|_| &quot;,&lt;br /&gt;        [9] = &quot; _  ,|_| , _| &quot;}&lt;br /&gt;&lt;br /&gt;io.write(&quot;Enter a number: &quot;)&lt;br /&gt;num = io.read()&lt;br /&gt;for i = 1,3 do&lt;br /&gt; for j = 1, #num do&lt;br /&gt;  line=split(leds[tonumber(string.sub(num,j,j))],&quot;,&quot;)&lt;br /&gt;  io.write(line[i])&lt;br /&gt; end&lt;br /&gt; print(&quot;&quot;)&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;What you can see right away...and that's something that really surprised me...is that Lua doesn't provide a &quot;split&quot; or &quot;explode&quot; command out of the box, so you need to make it yourself...actually...the same holds true for Haskell...but for me...functional languages are on another league...and anyway...Haskell's implementation of the split function is way shorter...&lt;br /&gt;&lt;br /&gt;Here's the result...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-eT8qYGsvMzU/VYMHAPbtzpI/AAAAAAAAEZk/m0RveeZdoZM/s1600/LedNumbers_Lua.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;246&quot; src=&quot;http://1.bp.blogspot.com/-eT8qYGsvMzU/VYMHAPbtzpI/AAAAAAAAEZk/m0RveeZdoZM/s400/LedNumbers_Lua.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-1822100103772273753</guid>
         <pubDate>Thu, 18 Jun 2015 18:06:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-eT8qYGsvMzU/VYMHAPbtzpI/AAAAAAAAEZk/m0RveeZdoZM/s72-c/LedNumbers_Lua.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>My first post on Lua</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/tlnNCYlwy-U/my-first-post-on-lua.html</link>
         <description>&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.lua.org/&quot;&gt;Lua&lt;/a&gt; is a programming language that always intrigued me but that I never spend time on trying to learn...&lt;br /&gt;&lt;br /&gt;This has changed of course -;) As I have start reading &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.amazon.com/dp/0470069171/?tag=googhydr-20&amp;amp;hvadid=51346705265&amp;amp;hvpos=1t1&amp;amp;hvexid=&amp;amp;hvnetw=g&amp;amp;hvrand=15084709288727832319&amp;amp;hvpone=29.93&amp;amp;hvptwo=&amp;amp;hvqmt=b&amp;amp;hvdev=c&amp;amp;ref=pd_sl_1xdmgf8e7v_b&quot;&gt;Beginning Lua Programming&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.amazon.com/dp/0470069171/?tag=googhydr-20&amp;amp;hvadid=51346705265&amp;amp;hvpos=1t1&amp;amp;hvexid=&amp;amp;hvnetw=g&amp;amp;hvrand=15084709288727832319&amp;amp;hvpone=29.93&amp;amp;hvptwo=&amp;amp;hvqmt=b&amp;amp;hvdev=c&amp;amp;ref=pd_sl_1xdmgf8e7v_b&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://4.bp.blogspot.com/-bKBEsqeLvp8/VXtlO8ouA-I/AAAAAAAAEY4/jbeprKyXEvU/s400/BeginningLua.jpg&quot; width=&quot;316&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So...what is Lua exactly? Well...it's&amp;nbsp;is a powerful, fast, lightweight, embeddable scripting language.&lt;br /&gt;&lt;br /&gt;A simple description for a simple language...and nope...I'm not implying simple as &quot;useless&quot; but rather as simple on its learning curve and its design...Lua is indeed pretty powerful and you will be more than surprised if you know where its being used...just search and get amazed -;)&lt;br /&gt;&lt;br /&gt;The syntax pretty much reminds me of Python or Julia...so it's fairly easy to get used to it...&lt;br /&gt;&lt;br /&gt;As an example...here is my Fibonacci numbers example...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Fibonacci.lua&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;function fib(num,a,b)&lt;br /&gt; local result = &quot;&quot;&lt;br /&gt; if a &amp;gt; 0 and num &amp;gt; 1 then&lt;br /&gt;  result = result .. (a+b) .. &quot; &quot; .. fib(num-1,a+b,a)&lt;br /&gt; elseif a == 0 then&lt;br /&gt;  result = a .. &quot; &quot; .. b .. &quot; &quot; .. (a+b) .. &quot; &quot; .. fib(num-1,a+b,b)&lt;br /&gt; end&lt;br /&gt; return result&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;io.write(&quot;Enter a number: &quot;)&lt;br /&gt;num = tonumber(io.read())&lt;br /&gt;print(fib(num,0,1))&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Here's a couple of tests -:)&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-AYksnhJMKO4/VXtoE-FQGXI/AAAAAAAAEZE/PqB0vWHV0oM/s1600/LuaFib_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-AYksnhJMKO4/VXtoE-FQGXI/AAAAAAAAEZE/PqB0vWHV0oM/s1600/LuaFib_01.jpg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-ZPwUYv0YR7s/VXtoI84P05I/AAAAAAAAEZM/4vP7A_Tt79Q/s1600/LuaFib_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;187&quot; src=&quot;http://3.bp.blogspot.com/-ZPwUYv0YR7s/VXtoI84P05I/AAAAAAAAEZM/4vP7A_Tt79Q/s320/LuaFib_02.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-3588075798134878748</guid>
         <pubDate>Fri, 12 Jun 2015 23:27:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-bKBEsqeLvp8/VXtlO8ouA-I/AAAAAAAAEY4/jbeprKyXEvU/s72-c/BeginningLua.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED is my new Hello World - OpenEuphoria Time</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/69H2NVfiCVA/led-is-my-new-hello-world-openephoria.html</link>
         <description>I started using &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://openeuphoria.org/&quot;&gt;OpenEuphoria&lt;/a&gt; a long time ago...when it was called &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.rapideuphoria.com/&quot;&gt;RapidEuphoria&lt;/a&gt;...but...I stopped using as I started learning other languages...&lt;br /&gt;&lt;br /&gt;Yesterday...all of a sudden...I realized that it is indeed a really cool language, so I wanted to refresh myself and what better than building my LED example one more time -;)&lt;br /&gt;&lt;br /&gt;So...here it is -:)&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;LedNumbers.ex&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;include get.e&lt;br /&gt;include std/map.e&lt;br /&gt;include std/convert.e&lt;br /&gt;include std/sequence.e&lt;br /&gt;&lt;br /&gt;sequence num&lt;br /&gt;sequence snum&lt;br /&gt;object onum&lt;br /&gt;atom anum&lt;br /&gt;map leds = new()&lt;br /&gt;   put(leds, 0, {&quot; _  &quot;,&quot;| | &quot;,&quot;|_| &quot;})&lt;br /&gt;   put(leds, 1, {&quot;  &quot;,&quot;| &quot;,&quot;| &quot;})&lt;br /&gt;   put(leds, 2, {&quot; _  &quot;,&quot; _| &quot;,&quot;|_  &quot;})&lt;br /&gt;   put(leds, 3, {&quot;_  &quot;,&quot;_| &quot;,&quot;_| &quot;})&lt;br /&gt;   put(leds, 4, {&quot;    &quot;,&quot;|_| &quot;,&quot;  | &quot;})&lt;br /&gt;   put(leds, 5, {&quot; _  &quot;,&quot;|_  &quot;,&quot; _| &quot;})&lt;br /&gt;   put(leds, 6, {&quot; _  &quot;,&quot;|_  &quot;,&quot;|_| &quot;})&lt;br /&gt;   put(leds, 7, {&quot;_   &quot;,&quot; |  &quot;,&quot; |  &quot;})&lt;br /&gt;   put(leds, 8, {&quot; _  &quot;,&quot;|_| &quot;,&quot;|_| &quot;})&lt;br /&gt;   put(leds, 9, {&quot; _  &quot;,&quot;|_| &quot;,&quot; _| &quot;})&lt;br /&gt;   &lt;br /&gt;num = prompt_string(&quot;Enter a number: &quot;)&lt;br /&gt;snum = breakup(num,1)&lt;br /&gt;for i = 1 to 3 do&lt;br /&gt;        for j = 1 to length(num) do&lt;br /&gt;            anum = to_number(snum[j])&lt;br /&gt;            onum = map:get(leds,anum)&lt;br /&gt;            puts(1,onum[i])&lt;br /&gt;        end for&lt;br /&gt;        puts(1,&quot;&amp;#92;n&quot;)&lt;br /&gt;end for&lt;br /&gt;puts(1,&quot;&amp;#92;n&quot;)&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Of course...you want to see it in action -:D&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-3_mDvTlK9oU/VXsWc1LoHCI/AAAAAAAAEYk/NR5USpnT9nY/s1600/Euphoria_LED.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;278&quot; src=&quot;http://4.bp.blogspot.com/-3_mDvTlK9oU/VXsWc1LoHCI/AAAAAAAAEYk/NR5USpnT9nY/s400/Euphoria_LED.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;If you haven't already...give OpenEuphoria a try...it's really fun -;)&lt;br /&gt;&lt;br /&gt;Greetings,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-5531491330747191063</guid>
         <pubDate>Fri, 12 Jun 2015 17:34:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-3_mDvTlK9oU/VXsWc1LoHCI/AAAAAAAAEYk/NR5USpnT9nY/s72-c/Euphoria_LED.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED is my new Hello World - Pony Time</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/9go3SmASVlA/led-is-my-new-hello-world-pony-time.html</link>
         <description>As you know...I'm always in a constant search for new, weird and cool programming languages...well...this time...the language came to me -;)&lt;br /&gt;&lt;br /&gt;I was contacted by &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.twitter.com/scblessing&quot;&gt;@scblessing&lt;/a&gt; letting me know about a programming language his company is working on...&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.ponylang.org/&quot;&gt;Pony&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So...what's exactly is Pony?&amp;nbsp;&lt;b&gt;Pony is an object-oriented, actor-model, capabilities-secure, high performance programming language.&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;Think about it as a nice mix of C++ and Erlang -;)&lt;br /&gt;&lt;br /&gt;The &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://tutorial.ponylang.org/&quot;&gt;documentation&lt;/a&gt; is not yet complete...but it's a good starting point...and also...it provides a &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://sandbox.ponylang.org/&quot;&gt;Sandbox&lt;/a&gt; where you can read the source of Pony libraries and execute some fine examples...&lt;br /&gt;&lt;br /&gt;So of course...I couldn't be happy with reading and playing around with it...I needed to code my LED as I do with all other programming languages...so here it is -;)&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;main.pony&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;actor Main&lt;br /&gt; var _env: Env&lt;br /&gt; &lt;br /&gt; new create(env: Env) =&amp;gt;&lt;br /&gt;  _env = env&lt;br /&gt;  let leds: Array[Array[String]] = [[&quot; _  &quot;,&quot;| | &quot;,&quot;|_| &quot;],&lt;br /&gt;                                    [&quot;  &quot;,&quot;| &quot;,&quot;| &quot;],&lt;br /&gt;                                    [&quot; _  &quot;,&quot; _| &quot;,&quot;|_  &quot;],&lt;br /&gt;                                    [&quot;_  &quot;,&quot;_| &quot;,&quot;_| &quot;],&lt;br /&gt;                                    [&quot;    &quot;,&quot;|_| &quot;,&quot;  | &quot;],&lt;br /&gt;                                    [&quot; _  &quot;,&quot;|_  &quot;,&quot; _| &quot;],&lt;br /&gt;                                    [&quot; _  &quot;,&quot;|_  &quot;,&quot;|_| &quot;],&lt;br /&gt;                                    [&quot;_   &quot;,&quot; |  &quot;,&quot; |  &quot;],&lt;br /&gt;                                    [&quot; _  &quot;,&quot;|_| &quot;,&quot;|_| &quot;],&lt;br /&gt;                                    [&quot; _  &quot;,&quot;|_| &quot;,&quot; _| &quot;]]&lt;br /&gt;&lt;br /&gt;  var num: String = try env.args(1) else &quot;&quot; end&lt;br /&gt;  var i: I64 = 0&lt;br /&gt;  var j: I64 = 0&lt;br /&gt;  var line: String = &quot;&quot;&lt;br /&gt;  while i &amp;lt; 3 do&lt;br /&gt;   while j &amp;lt; num.size().string().i64() do&lt;br /&gt;    try line = line.insert(line.size().string().i64(),&lt;br /&gt;             leds(num.substring(j,j).u64())(i.string().u64())) else &quot;&quot; end&lt;br /&gt;    j = j + 1&lt;br /&gt;   end&lt;br /&gt;   i = i + 1&lt;br /&gt;   j = 0&lt;br /&gt;   _env.out.print(line)&lt;br /&gt;   line = &quot;&quot;&lt;br /&gt;  end&lt;br /&gt;  _env.out.print(&quot;&quot;)&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;And here...you can see it in action -:D&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-_jlbZ5lFVxE/VXnIxAmys4I/AAAAAAAAEYQ/OeQqIcVlEXI/s1600/Pony_LED.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;333&quot; src=&quot;http://1.bp.blogspot.com/-_jlbZ5lFVxE/VXnIxAmys4I/AAAAAAAAEYQ/OeQqIcVlEXI/s400/Pony_LED.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;My thoughts are that Pony while still a young language, has a lot of potential and my quick experience with it was nothing but fun and exciting...I will keep a close look at it -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Greetings,&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Development Culture.&lt;/div&gt;</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-2676898771986097681</guid>
         <pubDate>Thu, 11 Jun 2015 18:15:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-_jlbZ5lFVxE/VXnIxAmys4I/AAAAAAAAEYQ/OeQqIcVlEXI/s72-c/Pony_LED.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Clojure in Action - Book Review</title>
         <link>http://feedproxy.google.com/~r/BlagsBagOfRants/~3/TDxHrIcYm30/clojure-in-action-book-review.html</link>
         <description>I just finished reading this book a couple of minutes ago...so here's my small review...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.manning.com/rathore/&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://1.bp.blogspot.com/-HSxHxAppiO4/VV_Z5EEpkwI/AAAAAAAAEW8/VpGgU_A8vMw/s320/Clojure.jpg&quot; width=&quot;256&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;The book is kinda big...with 434 pages...and it's the first book and my first approach to &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://clojure.org/&quot;&gt;Clojure&lt;/a&gt;.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;I have to say...I'm not a big fan of Java...I don't even actually like it...but Clojure...it's something else -:) With its Lisp like syntax and it's functional orientation...it's a delightful programming language...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;The book itself it's a great introduction to have us ready for something else...but...as Clojure is still a young language...some of the examples don't work mainly because some keywords or libraries had become obsolete...gladly most of the examples work just out of the box...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;There are also many examples that help to fully understand what Clojure is all about...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-LhevBh08JM0/VV_cuXPEEJI/AAAAAAAAEXQ/bB0BQsEylAQ/s1600/Clojure_001.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;115&quot; src=&quot;http://3.bp.blogspot.com/-LhevBh08JM0/VV_cuXPEEJI/AAAAAAAAEXQ/bB0BQsEylAQ/s400/Clojure_001.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-WXKfi-87bgg/VV_cuV4ssJI/AAAAAAAAEXI/V3ev3Q5voLA/s1600/Clojure_002.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;143&quot; src=&quot;http://2.bp.blogspot.com/-WXKfi-87bgg/VV_cuV4ssJI/AAAAAAAAEXI/V3ev3Q5voLA/s400/Clojure_002.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-m7rLZnfBOlM/VV_cudztGXI/AAAAAAAAEXM/qP65Oo15JB0/s1600/Clojure_003.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;165&quot; src=&quot;http://4.bp.blogspot.com/-m7rLZnfBOlM/VV_cudztGXI/AAAAAAAAEXM/qP65Oo15JB0/s400/Clojure_003.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;If you haven't heard about closures, recursion, higher-order functions or currying...the this book is for you...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;While I'm planning to read more Clojure books, I can say that this book is the perfect way to get started...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Greetings,&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Development Culture.&lt;/div&gt;&lt;br /&gt;</description>
         <author>noreply@blogger.com (Alvaro &quot;Blag&quot; Tejada Galindo)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-4144704359177008692.post-3840074669071424148</guid>
         <pubDate>Sat, 23 May 2015 02:00:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-HSxHxAppiO4/VV_Z5EEpkwI/AAAAAAAAEW8/VpGgU_A8vMw/s72-c/Clojure.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Mi primer post en Ada</title>
         <link>http://atejada.blogspot.com/2015/10/mi-primer-post-en-ada.html</link>
         <description>Bueno...este puede ser mi primer post en &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.adacore.com/adaanswers/about/ada&quot;&gt;Ada&lt;/a&gt;&amp;nbsp;pero no es mi primer encuentro con Ada -;) Lo aprendí más o menos hace 10 años...pero hasta ahora...no le había dado mucho uso...&lt;br /&gt;&lt;br /&gt;Si se están preguntándo...qué es Ada? Bueno...según Wikipedia...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Ada es un lenguaje de programación de alto nivel, estructurado, de tipeo estático, imperativo, de amplio espectro y orientado a objetos, extendido de Pascal y otros lenguajes.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Así que...sí...se ve bastante parecido a Pascal...pero mucho más estricto...y complejo...&lt;br /&gt;&lt;br /&gt;Como siempre con mi &quot;Mi primer post en...&quot; construí un generador de lista Fibonacci...algo simple para comenzar a re-aprender el lenguaje...así que ahí les va...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;fibonacci.adb&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;with Ada.Text_IO;&lt;br /&gt;with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;&lt;br /&gt;&lt;br /&gt;procedure Fibonacci is&lt;br /&gt; package IO renames Ada.Text_IO;&lt;br /&gt; package Number_IO is new Ada.Text_IO.Integer_IO (Integer);&lt;br /&gt; num : Integer;&lt;br /&gt; &lt;br /&gt; function Fib(num:Integer;a:Integer;b:Integer) return Unbounded_String is&lt;br /&gt; result : Unbounded_String;&lt;br /&gt; begin&lt;br /&gt;  if a &amp;gt; 0 and num &amp;gt; 1 then&lt;br /&gt;   result := result &amp;amp; Integer'Image(a+b) &amp;amp; &quot; &quot; &amp;amp; Fib(num-1,a+b,a);&lt;br /&gt;  elsif a = 0 then&lt;br /&gt;   result := Integer'Image(a) &amp;amp; &quot; &quot; &amp;amp; Integer'Image(b) &amp;amp; &quot; &quot; &amp;amp; &lt;br /&gt;             Integer'Image(a+b) &amp;amp; &quot; &quot; &amp;amp; Fib(num-1,a+b,b);&lt;br /&gt;  end if;&lt;br /&gt;  return result;&lt;br /&gt; end Fib;&lt;br /&gt; &lt;br /&gt;begin&lt;br /&gt; IO.Put(&quot;Enter a number: &quot;);&lt;br /&gt; Number_IO.Get(num);&lt;br /&gt; IO.Put(To_String(Fib(num,0,1)));&lt;br /&gt;end Fibonacci;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Y aquí están las imágenes...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-_0lg6OoEXTI/Vg2VF0Zac7I/AAAAAAAAErM/rTgxEWoMvQ0/s1600/Fibonacci_Ada_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;http://3.bp.blogspot.com/-_0lg6OoEXTI/Vg2VF0Zac7I/AAAAAAAAErM/rTgxEWoMvQ0/s400/Fibonacci_Ada_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-QsdbjDjxGcY/Vg2VGIr44aI/AAAAAAAAErQ/qXp4duATKkE/s1600/Fibonacci_Ada_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;107&quot; src=&quot;http://1.bp.blogspot.com/-QsdbjDjxGcY/Vg2VGIr44aI/AAAAAAAAErQ/qXp4duATKkE/s400/Fibonacci_Ada_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Bueno...eso fué relativamente sencillo...pero por supuesto, tuve que investigar un poco...así que el verdadero reto va a llegar cuando tenga que hacer mi aplicación de Números LED... -:P&lt;br /&gt;&lt;br /&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-2511283292928843667</guid>
         <pubDate>Thu, 01 Oct 2015 13:27:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://3.bp.blogspot.com/-_0lg6OoEXTI/Vg2VF0Zac7I/AAAAAAAAErM/rTgxEWoMvQ0/s72-c/Fibonacci_Ada_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>SAP HANA en la joraba de OCaml</title>
         <link>http://atejada.blogspot.com/2015/09/sap-hana-en-la-joraba-de-ocaml.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;Este post fué posteado originalmente en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/29/sap-hana-on-the-ocaml-hump&quot;&gt;SAP HANA on the OCaml hump&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://ocaml.org/&quot;&gt;OCaml&lt;/a&gt; es un lenguaje de programación de fuerza industrial que soporta estilos funcional, imperativo y orientado a objetos.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-5HQe3TFkMYo/Vgrki4ZUf8I/AAAAAAAAEqY/cpaxlCaBs4o/s1600/OCaml_Logo.png&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;110&quot; src=&quot;http://1.bp.blogspot.com/-5HQe3TFkMYo/Vgrki4ZUf8I/AAAAAAAAEqY/cpaxlCaBs4o/s400/OCaml_Logo.png&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Suena bonito, no? OCaml es el siguiente paso del&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://caml.inria.fr/&quot;&gt;Lenguaje de programación Caml&lt;/a&gt;.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Habiendo aprendido otros lenguajes de programación funcional como&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.haskell.org/&quot;&gt;Haskell&lt;/a&gt; y &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.erlang.org/&quot;&gt;Erlang&lt;/a&gt;, OCaml fué para mi la próxima opción obvia…así que decidí comenzar a aprenderlo…no fué una tarea fácil debo decirlo…pero realmente divertida y iluminadora.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Así que…ninguna demostración estaría completa si la enlazaramos con SAP HANA, so? Así que…vamos a hacerlo -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Primero, debemos crear un objeto Join y asociar la tabla por MANDT y CARRID. De ahí, seleccionar los siguientes campos como output MANDT, CARRID, CARRNAME, PRICE y CURRENCY.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Luego crear un objeto Aggregation seleccionándo los campos CARRNAME, PRICE (Como columnas agregadas) y CURRENCY. Debemos filtrar el campo CURRENCY por ‘USD’.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Luego, debemos crear un objeto Projection y seleccionar solo PRICE y CARRNAME.&lt;br /&gt;&lt;br /&gt;En el objeto Semantics asegúrense de marcar &amp;nbsp;“CROSS CLIENT” como cliente por defecto.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-RadWDRVzXJM/VfsH9v38WWI/AAAAAAAAEnc/_0pdHy9cOtA/s1600/Calculation_View.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://3.bp.blogspot.com/-RadWDRVzXJM/VfsH9v38WWI/AAAAAAAAEnc/_0pdHy9cOtA/s320/Calculation_View.jpg&quot; width=&quot;172&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Ahora, cambiemos a la vista SAP HANA Development y creemos un nuevo repositorio. Lo llamaremos“Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un proyecto “XS Engine” y también lo llamamos “Flights”. Lo enlazamos con el repositorio “Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un archivo vacio llamado “.xsapp”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un archivo llamado “.xsaccess” con el siguente código.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;.xsaccess&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;          &quot;exposed&quot; : true,&lt;br /&gt;          &quot;authentication&quot; : [ { &quot;method&quot; : &quot;Basic&quot; } ]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style=&quot;text-align:justify;&quot;&gt;Finalmente creamos un archivo llamado “flights.xsodata” con el siguiente código&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;flights.xsodata&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;service {&lt;br /&gt;          &quot;Blag/FLIGHTS_BY_CARRIER.calculationview&quot; as &quot;FLIGHTS&quot; keys &lt;br /&gt;                                                        generate local &quot;Id&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style=&quot;text-align:justify;&quot;&gt;Activamos el proyecto y lanzamos nuestro browser...deberíamos ver algo como esto…&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-hgyYGKg3vjs/VfsJHWVPulI/AAAAAAAAEnk/91PjeWsjUIA/s1600/XSProject.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;http://1.bp.blogspot.com/-hgyYGKg3vjs/VfsJHWVPulI/AAAAAAAAEnk/91PjeWsjUIA/s400/XSProject.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;La parte de SAP HANA está lista…así que podemos pasar a la parte de OCaml…&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Para los principiantes, OPAM (El manejador de paquetes de OCaml puede ser complicado y a veces frustrante), así que vamos a hacerles la vida más sencilla siguiendo estos simples pasos…en el terminal escriban esto…&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;opam init&lt;/div&gt;&lt;div&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;eval `opam config env`&lt;/div&gt;&lt;div&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;opam switch 4.01.0&lt;/div&gt;&lt;div&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;eval `opam config env`&lt;/div&gt;&lt;div&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;opam install core utop core_extended async uri yojson cohttp lwt ezjsonm&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Se va a demorar un poco, pero instalándo todos los paquetes requeridos en un solo comando previene que los errores ocurran.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Para programar en OCaml utilizo unos de los editores más asombrosos que he encontrado…&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.geany.org/&quot;&gt;Geany&lt;/a&gt;. viene pre-configurado para manejar una gran cantidad de lenguajes de programación, pero solo para estar seguros, aquí está como lo configuré para trabajar con OCaml.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Primero, creamos un archivo y lo grabamos como OCaml_HANA.ml&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Luego, hacemos click en el botón “Choose more build actions”&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-2PZ8DtbZ56M/VgroxS-bYsI/AAAAAAAAEqg/uROesXc2GE4/s1600/Options.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;86&quot; src=&quot;http://2.bp.blogspot.com/-2PZ8DtbZ56M/VgroxS-bYsI/AAAAAAAAEqg/uROesXc2GE4/s320/Options.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;La pequeña media flecha que está al lado del botón que parece un ladrillo marrón. Esto abrirá la siguiente pantalla&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-MN7sk_n84AA/Vgro5PyVfsI/AAAAAAAAEqo/6MoT_PFUHBU/s1600/Geany_OCaml.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://1.bp.blogspot.com/-MN7sk_n84AA/Vgro5PyVfsI/AAAAAAAAEqo/6MoT_PFUHBU/s400/Geany_OCaml.jpg&quot; width=&quot;342&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;En &quot;Compile&quot; escriban lo siguiente&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;corebuild -pkg yojson,cohttp.async,cohttp.lwt,lwt,ezjsonm &quot;%e.native&quot;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Y en &quot;Execute&quot; pongan&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;“./%e.native”&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Con esto, estaremos más que listos para comenzar a programar -:) Copien y peguen el siguiente código…&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;OCaml_HANA.ml&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;open Core.Std&lt;br /&gt;open Yojson.Basic.Util&lt;br /&gt;open Ezjsonm&lt;br /&gt;&lt;br /&gt;let get_definition_from_json json =&lt;br /&gt; let json = Ezjsonm.from_string(json) in&lt;br /&gt; let json = Ezjsonm.(find json [&quot;d&quot;;&quot;results&quot;]) in&lt;br /&gt; let json = Ezjsonm.to_string(json) in&lt;br /&gt; let json = Yojson.Basic.from_string(json) in&lt;br /&gt; let json = Yojson.Basic.Util.to_list json in&lt;br /&gt; let carrname = Yojson.Basic.Util.filter_member &quot;CARRNAME&quot; json in&lt;br /&gt; let carrname = Yojson.Basic.Util.filter_string carrname in&lt;br /&gt; let price = Yojson.Basic.Util.filter_member &quot;PRICE&quot; json in&lt;br /&gt; let price = Yojson.Basic.Util.filter_string price in&lt;br /&gt; printf &quot;Reading SAP HANA from OCaml&amp;#92;n&amp;#92;n&quot;;&lt;br /&gt; for i = 0 to List.length(carrname) - 1 do&lt;br /&gt;  printf &quot;%s: %s&amp;#92;n&quot; (List.nth_exn carrname i) (List.nth_exn price i)&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;let fetch uri =&lt;br /&gt; let cred = Cohttp.Auth.string_of_credential(`Basic(&quot;SYSTEM&quot;, &quot;YourPassword&quot;)) in&lt;br /&gt; let headers = Cohttp.Header.init() in &lt;br /&gt; let headers = Cohttp.Header.add headers &quot;Authorization&quot; cred in&lt;br /&gt; let open Lwt in&lt;br /&gt; Cohttp_lwt_unix.Client.get ~headers:headers uri &lt;br /&gt; &amp;gt;&amp;gt;= fun (_,body) -&amp;gt;&lt;br /&gt; Cohttp_lwt_body.to_string_list body&lt;br /&gt; &amp;gt;&amp;gt;= fun strings -&amp;gt;&lt;br /&gt; return(get_definition_from_json (String.concat strings))  &lt;br /&gt;&lt;br /&gt;let () =&lt;br /&gt;  let hana_uri = Uri.of_string &quot;http://YourServer:8000/Flights/flights.xsodata&lt;/pre&gt;&lt;pre&gt;                                /FLIGHTS?$format=json&quot;&lt;br /&gt;  in Lwt_main.run (fetch hana_uri)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Guarden su archivo, presionen el botón “Compile the current file”. El primer botón de la imagen anterior que muestra un triángulo con una flecha y una esfera (todo en un bonito 3D) y luego presionen el botón “Run or view the current file&quot;. El último botón de la imagen que muestra dos engranajes.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-AmteLMNNGAE/VgrpiwjSVsI/AAAAAAAAEqw/0g2yMcrW6b4/s1600/OCaml_HANA.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;221&quot; src=&quot;http://1.bp.blogspot.com/-AmteLMNNGAE/VgrpiwjSVsI/AAAAAAAAEqw/0g2yMcrW6b4/s400/OCaml_HANA.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Notarán que se ejecuta bastante rápidamente…&lt;br /&gt;&lt;br /&gt;Ahora…algo gracioso acerca de mi código…y debe ser por alguna de estas dos simples razones…&lt;br /&gt;&lt;br /&gt;•&amp;nbsp;Aún estoy aprendiendo OCaml&lt;br /&gt;•&amp;nbsp;La documentación para paquetes externos no es un muy extensa o simplemente no existe (En realidad, tuve que navegar por el código fuente en GitHub para poder realizar la mayoría del código)&lt;br /&gt;&lt;br /&gt;Así que…la cosa graciosa es que estoy utilizándo dos librerías JSON diferentes para poder leer la información ODATA generada por SAP HANA…utilizándo solamente uno no podría manejar la información que necesitaba…así que utilizándo los dos y extrayendo las piezas de aquí y allá finalmente obtuve lo que quería…no es muy divertido cuando lo estás haciendo por primera vez…pero al final hay una gran recompenza cuando finalmente puedes compilar y obtener el outpur que quieres -;)&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Saludos,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Blag.&lt;/div&gt;&lt;div&gt;Development Culture.&lt;/div&gt;</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-4272889598723549598</guid>
         <pubDate>Tue, 29 Sep 2015 13:03:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-5HQe3TFkMYo/Vgrki4ZUf8I/AAAAAAAAEqY/cpaxlCaBs4o/s72-c/OCaml_Logo.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Amazon Alexa y Philips Hue</title>
         <link>http://atejada.blogspot.com/2015/09/amazon-alexa-y-philips-hue.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;Este post fué posteado originalmente en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/28/amazon-alexa-and-philips-hue&quot;&gt;Amazon Alexa and Philips Hue&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s1600/d_shop_blog_logo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s400/d_shop_blog_logo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;b&gt;Si eres un empleado de SAP, por favor siguenos en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/about_page/sh2Kp26QQkHwkMPFAEqAD9&quot;&gt;Jam&lt;/a&gt;.&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Desde que llegó el Amazon Alexa al d-shop aquí en SAP Labs Silicon Valley...estaba buscándo la forma de hacerla interactuar con diferentes cosas...así que hace un par de días mi buen amigo y colega&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/people/aaronwilliams&quot;&gt;Aaron Williams&lt;/a&gt; me preguntó sobre el Philips Hue...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Al inicio...no estaba seguro de que fuera a funcionar, porque como todo el mundo sabe...el Hue necesita estar en la misma red para poder trabajar...y Amazon Lambda está en un servidor quien sabe donde...así que comenzé a investigar...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Cuando utilizamos el app de Amazon Alexa podemos enlazar el Hue para permitirle a Alexa prender o apagar las luces...pero nada más...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Debemos ir a Settings --&amp;gt; Connected Home --&amp;gt; Discover Devices (Te va a pedir que presiones el botón en el Hue Bridge).&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Por supuesto...esto no era suficiente para mi...así que seguí pensándo en esto y me di cuenta de que &quot;Hey!...el app de Philips Hue funciona cuando quieres cambiar el color de las luces...y lo hace de forma remota...así que debe de haber una manera de hacerlo&quot;...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Afortunadamente...encontré este blog...&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blog.paulshi.me/technical/2013/11/27/Philips-Hue-Remote-API-Explained.html&quot;&gt;Philips Hue Remote API Explained&lt;/a&gt;...donde el autor basicamente explica como puedes &quot;engañar&quot; al Hue para hacerle pensar que te estás conectándo desde tu IPhone...entonces...estás haciendo una conexión remota...un genio si me lo preguntan -;)&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Para que esto funciones debemos crear una cuenta en meethue...si solo nos logeamos con nuestra cuenta de Google no va a funcionar...por lo menos no me funcionó a mí...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li style=&quot;text-align:justify;&quot;&gt;Basicamente, tienes que encontrar primero el&amp;nbsp;&lt;b&gt;BridgeId&lt;/b&gt; hacinedo click en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.meethue.com/api/nupn&quot;&gt;https://www.meethue.com/api/nupn&lt;/a&gt;&lt;/li&gt;&lt;li style=&quot;text-align:justify;&quot;&gt;Obtener tu&amp;nbsp;&lt;b&gt;access token&lt;/b&gt; haciendo click en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.meethue.com/en-US/api/gettoken?devicename=iPhone+5&amp;amp;appid=hueapp&amp;amp;deviceid=**BRIDGEID**&quot;&gt;www.meethue.com/en-US/api/gettoken?devicename=iPhone+5&amp;amp;appid=hueapp&amp;amp;deviceid=**BRIDGEID**&lt;/a&gt;&lt;/li&gt;&lt;li style=&quot;text-align:justify;&quot;&gt;En el &amp;nbsp;botón &quot;Back to the App&quot;, copia el enlaza de AccessToken que se verá como este&amp;nbsp;&lt;a rel=&quot;nofollow&quot;&gt;phhueapp://sdk/login/**ACCESSTOKEN**&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Por cierto...si encuentras algo como esto a final &quot;%3D&quot; simplemente cambialo por &quot;=&quot;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Teniendo ambos el&amp;nbsp;&lt;b&gt;BridgeId &lt;/b&gt;y el&amp;nbsp;&lt;b&gt;AccessToken &lt;/b&gt;deberíamos estar listos para continuar -;)&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Debemos crear una Función y un Skill...por favor vean este blog &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://atejada.blogspot.com/2015/09/amazon-alexa-y-sap-hana.html&quot;&gt;Amazon Alexa y SAP HANA&lt;/a&gt; para poder crearlas...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;La función se va a llamar&amp;nbsp;&lt;b&gt;getLights &lt;/b&gt;y el skill &lt;b&gt;Lights&lt;/b&gt;. El nombre de invocación será &quot;&lt;b&gt;lights&lt;/b&gt;&quot;.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Aquí esta el Interaction Model que vamos a utilizar...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Intent Schema&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;  &quot;intents&quot;: [&lt;br /&gt;    {&lt;br /&gt;      &quot;intent&quot;: &quot;GetLightsIntent&quot;,&lt;br /&gt;      &quot;slots&quot;: [&lt;br /&gt;        {&lt;br /&gt;          &quot;name&quot;: &quot;color&quot;,&lt;br /&gt;          &quot;type&quot;: &quot;LITERAL&quot;&lt;br /&gt;        }&lt;br /&gt;      ]&lt;br /&gt;    },&lt;br /&gt;    {&lt;br /&gt;      &quot;intent&quot;: &quot;HelpIntent&quot;,&lt;br /&gt;      &quot;slots&quot;: []&lt;br /&gt;    }&lt;br /&gt;  ]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Sample Utterances&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;GetLightsIntent color {red|color}&lt;br /&gt;GetLightsIntent color {blue|color}&lt;br /&gt;GetLightsIntent color {green|color}&lt;br /&gt;GetLightsIntent color {pink|color}&lt;br /&gt;GetLightsIntent color {purple|color}&lt;br /&gt;GetLightsIntent color {aqua|color}&lt;br /&gt;GetLightsIntent color {white|color}&lt;br /&gt;GetLightsIntent color {yellow|color}&lt;br /&gt;GetLightsIntent color {black|color}&lt;br /&gt;&lt;br /&gt;HelpIntent help&lt;br /&gt;HelpIntent help me&lt;br /&gt;HelpIntent what can I ask you&lt;br /&gt;HelpIntent get help&lt;br /&gt;HelpIntent to help&lt;br /&gt;HelpIntent to help me&lt;br /&gt;HelpIntent what commands can I ask&lt;br /&gt;HelpIntent what commands can I say&lt;br /&gt;HelpIntent what can I do&lt;br /&gt;HelpIntent what can I use this for&lt;br /&gt;HelpIntent what questions can I ask&lt;br /&gt;HelpIntent what can you do&lt;br /&gt;HelpIntent what do you do&lt;br /&gt;HelpIntent how do I use you&lt;br /&gt;HelpIntent how can I use you&lt;br /&gt;HelpIntent what can you tell me&lt;br /&gt;HelpIntent how do i change colors&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Ahora...lo más importante es el código -:P&lt;br /&gt;&lt;br /&gt;Vamos a crear una carpeta y la llamaremos “Lights” o algo así…luego creamos una carpeta llamada “src”. Copiamos el código que esta&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://github.com/dustincoates/alexa-bus-schedule/blob/master/src/index.js&quot;&gt;aquí&lt;/a&gt;...y creamos un archivo llamado “AlexaSkills.js”&lt;br /&gt;&lt;br /&gt;Vamos a necesitar instalar el paquete request para nuestra función, así que hagamos esto en el terminal&lt;br /&gt;&lt;br /&gt;&lt;b&gt;sudo npm install --prefix=~/Alexa/Lights/src request&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Esto va a crear una carpeta llamada “node_modules” con el paquete es nuestra carpeta del proyecto…luego creamos un archivo llamado “index.js” y copiamos y pegamos el siguiente código…&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;index.js&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;var request = require(&quot;request&quot;)&lt;br /&gt;  , AlexaSkill = require('./AlexaSkill')&lt;br /&gt;  , APP_ID     = 'YourAPPId'&lt;br /&gt;  , TOKEN = 'YourAccessToken';&lt;br /&gt;&lt;br /&gt;var error = function (err, response, body) {&lt;br /&gt;    console.log('ERROR [%s]', err);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;var getJsonFromLights = function(color,callback){&lt;br /&gt;switch(color){&lt;br /&gt; case 'red':&lt;br /&gt;  x = 0.674; y = 0.322; break;&lt;br /&gt; case 'green':&lt;br /&gt;  x = 0.408; y = 0.517; break;&lt;br /&gt; case 'blue':&lt;br /&gt;  x = 0.168; y = 0.041; break;&lt;br /&gt; case 'white':&lt;br /&gt;  x = 0.3227; y = 0.329; break;&lt;br /&gt; case 'yellow':&lt;br /&gt;  x = 0.4317; y = 0.4996; break;&lt;br /&gt; case 'purple':&lt;br /&gt;  x = 0.2725; y = 0.1096; break;&lt;br /&gt; case 'orange':&lt;br /&gt;  x = 0.5562; y = 0.4084; break;&lt;br /&gt; case 'pink':&lt;br /&gt;  x = 0.3944; y = 0.3093; break;&lt;br /&gt; case 'black':&lt;br /&gt;  x = 0.168; y = 0.041; break;    &lt;br /&gt; case 'aqua':&lt;br /&gt;  x = 0.2858; y = 0.2747; break;&lt;br /&gt; default:&lt;br /&gt;  x = 0.3227; y = 0.329; break;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var options = { method: 'POST',&lt;br /&gt;                url: 'https://www.meethue.com/api/sendmessage',&lt;br /&gt;                qs: { token: TOKEN},&lt;br /&gt;                headers: { 'content-type': 'application/x-www-form-urlencoded' },&lt;br /&gt;                body: 'clipmessage={ bridgeId: &quot;YourBridgeId&quot;,&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;                                     clipCommand:  {url:&quot;/api/0/lights/1/state&quot;,&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;                                     method: &quot;PUT&quot;, body: {xy:[' + x + ',' + y + ']}}}' };&lt;br /&gt;&lt;br /&gt;var error_log = &quot;&quot;;&lt;br /&gt;&lt;br /&gt;request(options, function (error, response, body) {&lt;br /&gt; if (!error) {&lt;br /&gt;  error_log = color;&lt;br /&gt; }else{&lt;br /&gt;  error_log = &quot;There was a mistake&quot;;&lt;br /&gt; }&lt;br /&gt; callback(error_log);&lt;br /&gt;    });&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var handleLightsRequest = function(intent, session, response){&lt;br /&gt;  getJsonFromLights(intent.slots.color.value, function(data){&lt;br /&gt; var text = 'The color has been changed to ' + data;&lt;br /&gt;    var cardText = 'The color has been changed to ' + intent.slots.color.value;&lt;br /&gt;&lt;br /&gt;    var heading = 'The color has been changed to ' + intent.slots.color.value;&lt;br /&gt;    response.tellWithCard(text, heading, cardText);&lt;br /&gt;  });&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;var Lights = function(){&lt;br /&gt;  AlexaSkill.call(this, APP_ID);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Lights.prototype = Object.create(AlexaSkill.prototype);&lt;br /&gt;Lights.prototype.constructor = Lights;&lt;br /&gt;&lt;br /&gt;Lights.prototype.eventHandlers.onSessionStarted = function(sessionStartedRequest, session){&lt;br /&gt;  console.log(&quot;onSessionStarted requestId: &quot; + sessionStartedRequest.requestId&lt;br /&gt;      + &quot;, sessionId: &quot; + session.sessionId);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Lights.prototype.eventHandlers.onLaunch = function(launchRequest, session, response){&lt;br /&gt;  // This is when they launch the skill but don't specify what they want.&lt;br /&gt;&lt;br /&gt;  var output = 'Welcome to Hue Lights. Please say a color';&lt;br /&gt;&lt;br /&gt;  var reprompt = 'Which color would you like?';&lt;br /&gt;&lt;br /&gt;  response.ask(output, reprompt);&lt;br /&gt;&lt;br /&gt;  console.log(&quot;onLaunch requestId: &quot; + launchRequest.requestId&lt;br /&gt;      + &quot;, sessionId: &quot; + session.sessionId);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Lights.prototype.intentHandlers = {&lt;br /&gt;  GetLightsIntent: function(intent, session, response){&lt;br /&gt;    handleLightsRequest(intent, session, response);&lt;br /&gt;  },&lt;br /&gt;&lt;br /&gt;  HelpIntent: function(intent, session, response){&lt;br /&gt;    var speechOutput = 'Change your Hue Light to any color. Which color would you like?';&lt;br /&gt;    response.ask(speechOutput);&lt;br /&gt;  }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;exports.handler = function(event, context) {&lt;br /&gt;    var skill = new Lights();&lt;br /&gt;    skill.execute(event, context);&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Cuando está listo...simplemente comprimimos la carpeta node_module, &amp;nbsp;y los archivos AlexaSkills.js y index.js en un archivo .zip llamado &lt;b&gt;Lights.zip&lt;/b&gt; y lo subimos a Amazon Lambda...&lt;br /&gt;&lt;br /&gt;Para llamar a este skill en Alexa...podemos hacer lo siguiente...&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Alexa, turn on lamp 1 (Tomándo en cuenta que la luz se puede llamar de otra manera)&lt;/li&gt;&lt;li&gt;Alexa, ask lights for color blue&lt;/li&gt;&lt;li&gt;Alexa, turn off lamp 1&lt;/li&gt;&lt;/ul&gt;Pueden ver los colores disponibles en el código...pero por siacaso deberían ser...&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Red&lt;/li&gt;&lt;li&gt;Green&lt;/li&gt;&lt;li&gt;Blue&lt;/li&gt;&lt;li&gt;Aqua&lt;/li&gt;&lt;li&gt;Pink&lt;/li&gt;&lt;li&gt;White&lt;/li&gt;&lt;li&gt;Black&lt;/li&gt;&lt;li&gt;Yellow&lt;/li&gt;&lt;li&gt;Purple&lt;/li&gt;&lt;li&gt;Orange&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Y por supuesto...aquí está el video &amp;nbsp;-:D&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.&lt;br /&gt;&lt;br /&gt;</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-3423923669380062107</guid>
         <pubDate>Mon, 28 Sep 2015 13:34:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s72-c/d_shop_blog_logo.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>R - Mi largo viaje</title>
         <link>http://atejada.blogspot.com/2015/09/r-mi-largo-viaje.html</link>
         <description>La primera vez que escuché algo sobre &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://cran.r-project.org/&quot;&gt;R&lt;/a&gt;, fué hace más o menos 4 años atrás...un par de semanas luego de unirme a &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.sap.com/&quot;&gt;SAP&lt;/a&gt;. En ese momento leí en uno de nuestros documentos internos que&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://hana.sap.com/abouthana.html&quot;&gt;SAP HANA&lt;/a&gt; iba a poder integrarse con el lenguaje de programacíón R.&lt;br /&gt;&lt;br /&gt;Al inicio, estaba totalmente ignoránte acerca de R...nunca antes lo había escuchado...así que por supuesto comenzé a buscar más información, descargué R y RStudio y empecé a aprender como utilizarlo...&lt;br /&gt;&lt;br /&gt;Luego de un tiempo...publiqué mi primer blog hablándo sobre R...esto fué el 28 de Noviembre del 2011...el blog fué&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blagrants.blogspot.com/2011/11/dealing-with-r-and-hana.html&quot;&gt;Dealing with R and HANA&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;Luego de eso, seguí aprendiendo y utilizándolo cada vez que podía...y terminé escribiéndo mi más exitoso blog en el SAP Community Network...esto fué el 21 de Mayo del 2012.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/developer-center/hana/blog/2012/05/21/when-sap-hana-met-r--first-kiss&quot;&gt;When SAP HANA met R - First kiss&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Que a la fecha tiene 21,879 vistas y 62 comentarios, 16 likes y 32 bookmarks.&lt;br /&gt;&lt;br /&gt;R es inmenso...realmente lo es...existen cientos de paquetes que resuelven cientos de problemas...así es que comencé a leet libros relacionados con R de mis buenos amigos de&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.packtpub.com/&quot;&gt;&lt;b&gt;Packt Publishing&lt;/b&gt;&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1VaEkAa&quot;&gt;Web Application Development with R using Shiny&lt;/a&gt; (Pueden leer mi review&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blagrants.blogspot.com/2013/11/web-application-development-with-r.html&quot;&gt;aquí&lt;/a&gt;).&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-KA9w3AwPTRU/UpZC-OqVBiI/AAAAAAAADRs/jwTOxtK_yYg/s400/Shiny_Packt.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://2.bp.blogspot.com/-KA9w3AwPTRU/UpZC-OqVBiI/AAAAAAAADRs/jwTOxtK_yYg/s400/Shiny_Packt.jpg&quot; width=&quot;257&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;A medida que mis habilidades en R iban mejorándo...sabía que algo me estaba faltándo...realmente no sabía mucho sobre Estadística y mis habilidades de Machine Learning eran bastante pobres...y ahí es donde leí otro libro asombroso...y creo que hasta ahora es mi libro favorito sobre R&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1gQvDs4&quot;&gt;Machine Learning with R&lt;/a&gt; (Pueden leer mi review&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blagrants.blogspot.com/2014/01/machine-learning-with-r-book-review.html&quot;&gt;aquí&lt;/a&gt;).&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-QS-nGu6H2i8/UsrVr_ucmaI/AAAAAAAADYw/gJfpVXhMj3g/s1600/Machine_Learning_R.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://1.bp.blogspot.com/-QS-nGu6H2i8/UsrVr_ucmaI/AAAAAAAADYw/gJfpVXhMj3g/s1600/Machine_Learning_R.jpg&quot; width=&quot;255&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Otro tópico interesánte es Social Media...y como obtener valor de sus datos...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1Jrl1Xt&quot;&gt;Social Media Mining with R&lt;/a&gt; (Pueden leer mi review&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blagrants.blogspot.com/2014/05/social-media-mining-with-r-book-review.html&quot;&gt;aquí&lt;/a&gt;).&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-NNr0y1_d0UM/U3UVJbA2lCI/AAAAAAAADhg/mkIwmeDZpU8/s1600/SocialMedia_R.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://4.bp.blogspot.com/-NNr0y1_d0UM/U3UVJbA2lCI/AAAAAAAADhg/mkIwmeDZpU8/s1600/SocialMedia_R.jpg&quot; width=&quot;258&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Si se preguntan como el Social Media puede ser utilizado con R, entonces revisen mi blog&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/developer-center/hana/blog/2013/03/10/getting-flexible-with-sap-hana&quot;&gt;Getting Flexible with SAP HANA&lt;/a&gt; donde utilizo SAP HANA, R, Twitter y Schema Flexibility para analizar hashtags que pueden ser explorados a más profundidad utilizándo herramientas como&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://go.sap.com/product/analytics/lumira.html&quot;&gt;SAP Lumira&lt;/a&gt;.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Si estás en el mundo de la Bioinformática...en el cual no estoy yo -:( Podrían apreciar este libro...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1QA56LR&quot;&gt;Bioinformatics with R Cookbook&lt;/a&gt; (Pueden leet mi review&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blagrants.blogspot.com/2014/08/bioinformatics-with-r-cookbook-book.html&quot;&gt;aquí&lt;/a&gt;).&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-mbFEuqnecps/U-U-JMrMuzI/AAAAAAAADoE/hrY-HLd7EkU/s1600/Bio_R.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://2.bp.blogspot.com/-mbFEuqnecps/U-U-JMrMuzI/AAAAAAAADoE/hrY-HLd7EkU/s1600/Bio_R.jpg&quot; width=&quot;259&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Y hay también otros libros que no he podido leer aún, pero que podrían ayudarlos a ingresar al mundo de R...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1OUjb8q&quot;&gt;Data Manipulation with R&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1gQxi0z&quot;&gt;R Data Visualization Cookbook&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1OUjMHo&quot;&gt;Instant R Starter&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Así que...por qué son importante estos libros? Bueno...obviamente, todos son sobre R y R es asombroso y su importancia está subiendo cada día más...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Miren este video para darse cuenta de porque Data Science es un tópico crítico para aprender actualmente...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;O pueden simplemente descargar un bonito PDF para leerlo offline&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://bit.ly/1MryNha&quot; style=&quot;font-family:'Times New Roman', serif;font-size:12pt;&quot;&gt;http://bit.ly/1MryNha&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;También...tan solo con leer este post...tienen la oportunidad de comprar cualquiera de estos libros con un 50% de descuento utilizándo este código al momento del checkout...&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align:center;&quot;&gt;&lt;span style=&quot;font-family:'Times New Roman', serif;font-size:12pt;&quot;&gt;&lt;b&gt;SIXRB50&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;Una gran oportunidad que NO se puede dejar pasar...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;span style=&quot;font-family:Arial, sans-serif;font-size:12pt;&quot;&gt;&lt;b&gt;La validez de este código expira el 31 de Octubre. Copias limitadas.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;Saludos,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;Blag.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family:Times New Roman, serif;&quot;&gt;Development Culture.&lt;/span&gt;&lt;/div&gt;</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-6917575854434913929</guid>
         <pubDate>Thu, 24 Sep 2015 15:13:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://2.bp.blogspot.com/-KA9w3AwPTRU/UpZC-OqVBiI/AAAAAAAADRs/jwTOxtK_yYg/s72-c/Shiny_Packt.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Únete al Geeky Thursday en Octubre</title>
         <link>http://atejada.blogspot.com/2015/09/unete-al-geeky-thursday-en-octubre.html</link>
         <description>&lt;h2&gt;&lt;b&gt;Qué es Geeky Thursday?&lt;/b&gt;&lt;/h2&gt;Es un evento que sucede cada Jueves de la semana. Una hora y un poco más de una sesión &quot;hands-on&quot; donde lenguajes de programación no muy comunes (ej: Lua, Julia, R, Haskell) y Paradígmas de Programación (Funcional, Basado en Stack, Lógico, Orientado a Objetos) son presentados.&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Por qué Geeky Thursday?&lt;/b&gt;&lt;/h2&gt;Porque desarrolladores...porque saber solo unos cuantos lenguajes de programación no es suficiente...porque aprender otro paradígma puede expandir tus horizontes y hacerte un mejor desarrollador.&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Geeky Thursday es hands-on...necesito my laptop?&lt;/b&gt;&lt;/h2&gt;Bueno...en realidad depende de ti...el código fuente va a estar disponible...va a ser explicado y ejecutado en vivo...no va a ver codificación en vivo...pero siempre es mejor si puedes compilar y ejecutar los códigos por ti mismo...&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Geeky Thursday es sólo acerca de Programación?&lt;/b&gt;&lt;/h2&gt;No...sin ánimos de querer crear un &quot;Brown Bag Session&quot;...Geeky Thursday intenta convertirse en un espacio de &quot;Mini Meetup&quot;...donde cosas interesántes y novedosas pueden ser exploradas.&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Es el Geeky Thursday dado sólo en el Silicon Valley?&lt;/b&gt;&lt;/h2&gt;Por ahora...sí lo es...pero...si tu or tu manager están en contacto con un manager del d-shop, pidele que se ponga en contacto conmigo (a.tejada.galindo@sap.com)...estaré más que feliz de compartir mis diapositivas y ayudar a expandir Geeky Thursday en otras locaciones.&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Hay alguna limitación en cuanto a espacio?&lt;/b&gt;&lt;/h2&gt;Sí, podemos invitar hasta 10 personas de SAP y tenemos espacio para 5 personas que sea externas a SAP. Dependiendo del nivel de asistencia podríamos aumentar este límite.&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Puedo yo presentar un Geeky Thursday?&lt;/b&gt;&lt;/h2&gt;Por supuesto! Estás más que invitado! Solo ponte en contacto conmigo y te asignaré una fecha!&lt;br /&gt;&lt;h2&gt;&lt;b&gt;Geeky Thursdays Programados&lt;/b&gt;&lt;/h2&gt;&lt;b&gt;R Programming Language --&amp;gt; Octubre 8 de 1:00 a 2:00pm (d-shop en Edificio 9 en SAP Labs Silicon Valley)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Para Empleados de SAP&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/sh2Kp26QQkHwkMPFAEqAD9/events/K7BJsIiucH7XjLszzcO0Eh&quot;&gt;https://jam4.sapjam.com/groups/sh2Kp26QQkHwkMPFAEqAD9/events/K7BJsIiucH7XjLszzcO0Eh&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Para Externos a SAP&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.eventbrite.com/myevent?eid=18783268261&quot;&gt;https://www.eventbrite.com/myevent?eid=18783268261&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;R es un lenguaje de programación y entorno de software para computación estadística y gráficos.&lt;br /&gt;&lt;br /&gt;Puedes descargar R en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://cran.r-project.org/&quot;&gt;https://cran.r-project.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Puedes descargar RStudio en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.rstudio.com/&quot;&gt;https://www.rstudio.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Julia Programming Language --&amp;gt; Octubre 25 de 1:00 a 2:00pm (d-shop en Edificio 9 en SAP Labs Silicon Valley)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Para Empleados de SAP&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/sh2Kp26QQkHwkMPFAEqAD9/events/5FieiznXF6EgaGfg34qKdd&quot;&gt;https://jam4.sapjam.com/groups/sh2Kp26QQkHwkMPFAEqAD9/events/5FieiznXF6EgaGfg34qKdd&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Para Externos a SAP&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.eventbrite.com/myevent?eid=18783317408&quot;&gt;https://www.eventbrite.com/myevent?eid=18783317408&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Julia es un lenguaje dinámico de alto nivel diseñado para resolver los requerimientos de computaciones científicas y de alto performance numérico siendo al mismo tiempo efectivo para programación de propósito múltiple, tanto como para programación web y lenguaje de especificación.&lt;br /&gt;&lt;br /&gt;Puedes descargar Julia en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://julialang.org/&quot;&gt;http://julialang.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Clojure Programming Language --&amp;gt; Octubre 29&amp;nbsp;&lt;/b&gt;&lt;b&gt;de 1:00 a 2:00pm (d-shop en Edificio 9 en SAP Labs Silicon Valley)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Para Empleados de SAP&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/sh2Kp26QQkHwkMPFAEqAD9/events/RoZ8dId4NGqxzWCys2hMN4&quot;&gt;https://jam4.sapjam.com/groups/sh2Kp26QQkHwkMPFAEqAD9/events/RoZ8dId4NGqxzWCys2hMN4&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Para Externos a SAP&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.eventbrite.com/myevent?eid=18783402663&quot;&gt;https://www.eventbrite.com/myevent?eid=18783402663&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Clojure es un lenguaje de programación dinámico que apunta a la Máquina Virtual de Java (y el CLR, y JavaScript). Está diseñado para ser un lenguaje de propósito multiple, combinándo la interoperabilidad y fléxibilidad de un lenguaje script con la eficiencia y e infraestructura robusta de la programación de hilos múltiples. Clojure es un dialecto de Lisp, y comparte con Lisp la filosofía de &quot;El código es data&quot; y el poderoso systemas de macros.&lt;br /&gt;&lt;br /&gt;Puedes descargar Clojure en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://clojure.org/&quot;&gt;http://clojure.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-3998002431531722018</guid>
         <pubDate>Thu, 24 Sep 2015 12:56:00 +0000</pubDate>
      </item>
      <item>
         <title>(Definiendo SAP HANA (OData) con Racket)</title>
         <link>http://atejada.blogspot.com/2015/09/definiendo-sap-hana-odata-con-racket.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;Este post fué posteado originalmente en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/23/defining-sap-hana-odata-with-racket&quot;&gt;(Defining SAP HANA (OData) with Racket)&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://racket-lang.org/&quot;&gt;Racket&lt;/a&gt; es un lenguaje de largo espectro que va más allá de Lisp y Scheme con dialectos que soportan objectos, types, laziness y más. Y más significa Funcional, Procedural, Orientado a Objetos, Lógico, Reflexivo y Meta.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-u7Bmoa-KSS4/VgL4Doa8x0I/AAAAAAAAEpU/Owb-i6_cLCg/s1600/Racket_Logo.png&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/-u7Bmoa-KSS4/VgL4Doa8x0I/AAAAAAAAEpU/Owb-i6_cLCg/s1600/Racket_Logo.png&quot;/&gt;&lt;/a&gt;&lt;/div&gt;Basicamente…Racket es un nuevo nombre para PLT Scheme. Y PLT Scheme viene de la familia Lisp.&lt;br /&gt;&lt;br /&gt;Así que, antes de seguir adelánte…quiero compartir un cómic de XKCD que trata de iluminarnos sobre lo que es Lisp -:)&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-yNay-IeWuOI/VgL4NBUMLeI/AAAAAAAAEpc/7tzYDnqxXMs/s1600/XKCD_lisp_Comic.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;118&quot; src=&quot;http://2.bp.blogspot.com/-yNay-IeWuOI/VgL4NBUMLeI/AAAAAAAAEpc/7tzYDnqxXMs/s400/XKCD_lisp_Comic.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Primero, debemos crear un objeto Join y asociar la tabla por MANDT y CARRID. De ahí, seleccionar los siguientes campos como output MANDT, CARRID, CARRNAME, PRICE y CURRENCY.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Luego crear un objeto Aggregation seleccionándo los campos CARRNAME, PRICE (Como columnas agregadas) y CURRENCY. Debemos filtrar el campo CURRENCY por ‘USD’.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Luego, debemos crear un objeto Projection y seleccionar solo PRICE y CARRNAME.&lt;br /&gt;&lt;br /&gt;En el objeto Semantics asegúrense de marcar &amp;nbsp;“CROSS CLIENT” como cliente por defecto.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-RadWDRVzXJM/VfsH9v38WWI/AAAAAAAAEnc/_0pdHy9cOtA/s1600/Calculation_View.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://3.bp.blogspot.com/-RadWDRVzXJM/VfsH9v38WWI/AAAAAAAAEnc/_0pdHy9cOtA/s320/Calculation_View.jpg&quot; width=&quot;172&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Ahora, cambiemos a la vista SAP HANA Development y creemos un nuevo repositorio. Lo llamaremos“Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un proyecto “XS Engine” y también lo llamamos “Flights”. Lo enlazamos con el repositorio “Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un archivo vacio llamado “.xsapp”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un archivo llamado “.xsaccess” con el siguente código.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;.xsaccess&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;          &quot;exposed&quot; : true,&lt;br /&gt;          &quot;authentication&quot; : [ { &quot;method&quot; : &quot;Basic&quot; } ]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style=&quot;text-align:justify;&quot;&gt;Finalmente creamos un archivo llamado “flights.xsodata” con el siguiente código&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;flights.xsodata&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;service {&lt;br /&gt;          &quot;Blag/FLIGHTS_BY_CARRIER.calculationview&quot; as &quot;FLIGHTS&quot; keys &lt;br /&gt;                                                        generate local &quot;Id&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style=&quot;text-align:justify;&quot;&gt;Activamos el proyecto y lanzamos nuestro browser...deberíamos ver algo como esto…&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-hgyYGKg3vjs/VfsJHWVPulI/AAAAAAAAEnk/91PjeWsjUIA/s1600/XSProject.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;http://1.bp.blogspot.com/-hgyYGKg3vjs/VfsJHWVPulI/AAAAAAAAEnk/91PjeWsjUIA/s400/XSProject.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;La parte de SAP HANA está lista…así que ahora podemos pasar a la parte de Racket…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Racket es un lenguaje de programación muy completo…así que no necesitamos paquetes externos…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Para programar en Racket utilizo el mejor editor de Racket “Dr. Racket” que viene incluído en la instalación de Racket…así que nuevamente…no hay de que preocuparse -:)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Copien y peguen el siguiente código…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Racket_HANA.rkt&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;#lang racket&lt;br /&gt;(require json)&lt;br /&gt;(require net/base64)&lt;br /&gt;(require net/url)&lt;br /&gt;&lt;br /&gt;(define make-auth-header&lt;br /&gt;     (list (string-append&lt;br /&gt;       &quot;Authorization: Basic &quot;&lt;br /&gt;       (bytes-&amp;gt;string/utf-8&lt;br /&gt;        (base64-encode&lt;br /&gt;         (string-&amp;gt;bytes/utf-8&lt;br /&gt;          (string-append &quot;SYSTEM&quot; &quot;:&quot; &quot;YourPassword&quot;)))))))&lt;br /&gt;&lt;br /&gt;(define (get_path path params)&lt;br /&gt;  (port-&amp;gt;string(get-pure-port path params)))&lt;br /&gt;&lt;br /&gt;(define json (string-&amp;gt;jsexpr (get_path (string-&amp;gt;url &quot;YouServer:8000/Flights/flights.xsodata/FLIGHTS?$format=json&quot;) &lt;br /&gt;                              make-auth-header)))&lt;br /&gt;(define results (hash-ref (hash-ref json 'd) 'results))&lt;br /&gt;&lt;br /&gt;(define (show_info results len ctr)&lt;br /&gt;  (cond [(or (= ctr len) (&amp;lt; ctr len))&lt;br /&gt;         (string-append (hash-ref (list-ref results ctr) 'CARRNAME) &quot;: &quot;&lt;br /&gt;                        (hash-ref (list-ref results 0) 'PRICE) &quot;&amp;#92;n&quot;&lt;br /&gt;                        (show_info results len (add1 ctr)))]&lt;br /&gt;        [(&amp;gt; ctr len)&lt;br /&gt;         (string-append &quot;&quot; &quot;&amp;#92;n&quot;)]))&lt;br /&gt;&lt;br /&gt;(display (show_info results (sub1 (length results)) 0))&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Ahora lo pueden ver…Racket adora los parentesis -:) En fín…presionar el botón &quot;run&quot; y tendrás esto…&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-W6CL_C35OpQ/VgL8ZFnxmAI/AAAAAAAAEqA/QxyJJLQyvIc/s1600/Racket_HANA.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;http://1.bp.blogspot.com/-W6CL_C35OpQ/VgL8ZFnxmAI/AAAAAAAAEqA/QxyJJLQyvIc/s400/Racket_HANA.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;He estado haciendo interfaces de SAP HANA OData con muchos lenguajes…y hasta ahora…Racket ha sido una de mis implementaciones más cortas…aunque es dificil acostumbrarse a tantos parentesis…es un lenguaje muy interesánte y poderoso…y lás cosas salen más pronto de lo que uno podría imaginarse…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Saludos,&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Development Culture.&lt;/div&gt;&lt;br /&gt;</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-4585300721838067073</guid>
         <pubDate>Wed, 23 Sep 2015 12:42:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-u7Bmoa-KSS4/VgL4Doa8x0I/AAAAAAAAEpU/Owb-i6_cLCg/s72-c/Racket_Logo.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED es mi nuevo Hello World - Tiempo de Falcon</title>
         <link>http://atejada.blogspot.com/2015/09/led-es-mi-nuevo-hello-world-tiempo-de.html</link>
         <description>Continuándo con mi tradición...aquí está mi aplicación de Números LED utilizándo Falcon...utilicé mi código en Julia como código base...y debo decirlo...el código es practicamente el mismo...lo cual es bueno por ahora...pero espero poder encontrar algunas gemas ocultas y características extrañas a medida que aprendo más sobre Falcon -;)&lt;br /&gt;&lt;br /&gt;Aquí está el código fuente...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;LED_Numbers.fal&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;leds =  [&quot;0&quot; =&amp;gt; [&quot; _  &quot;,&quot;| | &quot;,&quot;|_| &quot;],&lt;br /&gt;         &quot;1&quot; =&amp;gt; [&quot;  &quot;,&quot;| &quot;,&quot;| &quot;],&lt;br /&gt;         &quot;2&quot; =&amp;gt; [&quot; _  &quot;,&quot; _| &quot;,&quot;|_  &quot;],&lt;br /&gt;         &quot;3&quot; =&amp;gt; [&quot;_  &quot;,&quot;_| &quot;,&quot;_| &quot;],&lt;br /&gt;         &quot;4&quot; =&amp;gt; [&quot;    &quot;,&quot;|_| &quot;,&quot;  | &quot;],&lt;br /&gt;         &quot;5&quot; =&amp;gt; [&quot; _  &quot;,&quot;|_  &quot;,&quot; _| &quot;],&lt;br /&gt;         &quot;6&quot; =&amp;gt; [&quot; _  &quot;,&quot;|_  &quot;,&quot;|_| &quot;],&lt;br /&gt;         &quot;7&quot; =&amp;gt; [&quot;_   &quot;,&quot; |  &quot;,&quot; |  &quot;],&lt;br /&gt;         &quot;8&quot; =&amp;gt; [&quot; _  &quot;,&quot;|_| &quot;,&quot;|_| &quot;],&lt;br /&gt;         &quot;9&quot; =&amp;gt; [&quot; _  &quot;,&quot;|_| &quot;,&quot; _| &quot;]]&lt;br /&gt;   &lt;br /&gt;print(&quot;Enter a number: &quot;)&lt;br /&gt;number = input()&lt;br /&gt;len = number.len()&lt;br /&gt;for i in [0:3]&lt;br /&gt; for j in [0:len]&lt;br /&gt;  print(leds[number[j]][i])&lt;br /&gt; end&lt;br /&gt; printl(&quot;&quot;)&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Y por supuesto...aquí están las imágenes...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-qdldUDAbBAQ/VfxXvb2odBI/AAAAAAAAEoo/bcSHcsgh-HE/s1600/LEDNumbers_Falcon_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;121&quot; src=&quot;http://1.bp.blogspot.com/-qdldUDAbBAQ/VfxXvb2odBI/AAAAAAAAEoo/bcSHcsgh-HE/s400/LEDNumbers_Falcon_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/--JyqrwBK8WI/VfxXvvGBVdI/AAAAAAAAEos/0P46CFZLS7k/s1600/LEDNumbers_Falcon_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;121&quot; src=&quot;http://3.bp.blogspot.com/--JyqrwBK8WI/VfxXvvGBVdI/AAAAAAAAEos/0P46CFZLS7k/s400/LEDNumbers_Falcon_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-6640868562335838520</guid>
         <pubDate>Fri, 18 Sep 2015 11:34:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-qdldUDAbBAQ/VfxXvb2odBI/AAAAAAAAEoo/bcSHcsgh-HE/s72-c/LEDNumbers_Falcon_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Mi primer post en Falcon</title>
         <link>http://atejada.blogspot.com/2015/09/mi-primer-post-en-falcon.html</link>
         <description>Descubrí &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://falconpl.org/index.ftd?page_id=Home&quot;&gt;Falcon&lt;/a&gt; hace algunos meses...pero no tuve el tiempo de empezar a jugar con el...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-IgdGDIrvXFs/VfxLvnkPCzI/AAAAAAAAEoE/GGUFMZ7fKZg/s1600/FalconLogo.png&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-IgdGDIrvXFs/VfxLvnkPCzI/AAAAAAAAEoE/GGUFMZ7fKZg/s1600/FalconLogo.png&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Falcon es un lenguaje de programación multi-paradigma y código abierto. Aunque se ve como un nuevo lenguaje de programación, en realidad es un poco viejo, puesto que su primera aparación fué en el 2003...&lt;br /&gt;&lt;br /&gt;Sintácticamente, es bastante similar a&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://lua.org/&quot;&gt;Lua&lt;/a&gt;...lo cual significa que también se parece a &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://golang.org/&quot;&gt;Go&lt;/a&gt; o&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://en.wikipedia.org/wiki/C%2B%2B&quot;&gt;C++&lt;/a&gt;...pero por supuesto tiene algunas carácterísticas propias y muy interesántes -;)&lt;br /&gt;&lt;br /&gt;Por ahora...solo he portado mi versión de Número Fibonacci en Lua...y fuera del hecho de que Falcon no utiliza &quot;then&quot; y el hecho de que Falcon no puede concatenar números con strings (pero puede concatenar strings con números)...el código es prácticamente el mismo...&lt;br /&gt;&lt;br /&gt;Veamos como nos va cuando haga mi aplicación de Números LED -;)&lt;br /&gt;&lt;br /&gt;Aquí está el código fuente...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;fibonacci.fal&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;function fib(num,a,b)&lt;br /&gt; result = &quot;&quot;&lt;br /&gt; if a &amp;gt; 0 and num &amp;gt; 1&lt;br /&gt;  result = result + (a+b) + &quot; &quot; + fib(num-1,a+b,a)&lt;br /&gt; elif a == 0&lt;br /&gt;  result = &quot;&quot; + a + &quot; &quot; + b + &quot; &quot; + (a+b) + &quot; &quot; + fib(num-1,a+b,b)&lt;br /&gt; end&lt;br /&gt; return result &lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;print(&quot;Enter a number: &quot;)&lt;br /&gt;num = int( input() )&lt;br /&gt;print(fib(num,0,1))&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Aquí está el resultado...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-MIXNQgtadcw/VfxNmFrlYfI/AAAAAAAAEoU/2Gwb0aWGtb4/s1600/Fibonacci_Falcon_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;111&quot; src=&quot;http://1.bp.blogspot.com/-MIXNQgtadcw/VfxNmFrlYfI/AAAAAAAAEoU/2Gwb0aWGtb4/s400/Fibonacci_Falcon_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-eWDWES-1pzg/VfxNmGPZtAI/AAAAAAAAEoQ/yKR3PCYP22w/s1600/Fibonacci_Falcon_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;96&quot; src=&quot;http://1.bp.blogspot.com/-eWDWES-1pzg/VfxNmGPZtAI/AAAAAAAAEoQ/yKR3PCYP22w/s400/Fibonacci_Falcon_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-3449076089410654069</guid>
         <pubDate>Fri, 18 Sep 2015 10:55:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-IgdGDIrvXFs/VfxLvnkPCzI/AAAAAAAAEoE/GGUFMZ7fKZg/s72-c/FalconLogo.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Puramente SAP HANA con Haskell</title>
         <link>http://atejada.blogspot.com/2015/09/puramente-sap-hana-con-haskell.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;Este post fué posteado originalmente en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/17/purely-sap-hana-with-haskell&quot;&gt;Purely SAP HANA with Haskell&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.haskell.org/&quot;&gt;Haskell&lt;/a&gt; es un lengiaje puramente funcional de propósito general con semánticas no estríctas y tipeado estático fuerte.&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-u9TivOF3Sk4/VfsHlXA8EjI/AAAAAAAAEnM/Ta8w_qEVtjE/s1600/Haskell_Logo.png&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/-u9TivOF3Sk4/VfsHlXA8EjI/AAAAAAAAEnM/Ta8w_qEVtjE/s1600/Haskell_Logo.png&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Qué significa esto? Nada…solo que Haskell es el lenguaje más puro que circula por esto lares…lo cual significa que no hay y no pueden haber efectos seccundarios…como los Haskellers suelen decir…”Si compila…siempre va a funcionar”…&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hay una caricatura de XKCD que resume de manera elegante lo que es Haskell -;)&lt;/div&gt;&lt;div style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-iABpG1yuVJE/VfsHvLL2kDI/AAAAAAAAEnU/jl4voo5kkQ8/s1600/XKCD_Haskell.png&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://4.bp.blogspot.com/-iABpG1yuVJE/VfsHvLL2kDI/AAAAAAAAEnU/jl4voo5kkQ8/s320/XKCD_Haskell.png&quot; width=&quot;224&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Bueno…yo lo ejecutaría -:P Lo que me encanta acerca de Haskell es que realmente te hace olvidar todo lo que habías aprendido antes…una vez asignada, una variable no puede cambiar su valor…la recursividad es practicamente obligatoria…escribir en el terminal es considerado algo impuro, pero hay por supuesto una forma de hacerlo…todo es una función…olvidate de las Clases y los Objetos…pattern matching es tu mejor amigo…y muchas otras cosas realmente interesántes -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Así que…ninguna explicación estaría completa si no lo conectara con SAP HANA, no? Así que…vamos a hacerlo -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Primero, debemos crear un objeto Join y asociar la tabla por MANDT y CARRID. De ahí, seleccionar los siguientes campos como output MANDT, CARRID, CARRNAME, PRICE y CURRENCY.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Luego crear un objeto Aggregation seleccionándo los campos CARRNAME, PRICE (Como columnas agregadas) y CURRENCY. Debemos filtrar el campo CURRENCY por ‘USD’.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Luego, debemos crear un objeto Projection y seleccionar solo PRICE y CARRNAME.&lt;br /&gt;&lt;br /&gt;En el objeto Semantics asegúrense de marcar &amp;nbsp;“CROSS CLIENT” como cliente por defecto.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-RadWDRVzXJM/VfsH9v38WWI/AAAAAAAAEnc/_0pdHy9cOtA/s1600/Calculation_View.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://3.bp.blogspot.com/-RadWDRVzXJM/VfsH9v38WWI/AAAAAAAAEnc/_0pdHy9cOtA/s320/Calculation_View.jpg&quot; width=&quot;172&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Ahora, cambiemos a la vista SAP HANA Development y creemos un nuevo repositorio. Lo llamaremos“Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un proyecto “XS Engine” y también lo llamamos “Flights”. Lo enlazamos con el repositorio “Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un archivo vacio llamado “.xsapp”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un archivo llamado “.xsaccess” con el siguente código.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;.xsaccess&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;          &quot;exposed&quot; : true,&lt;br /&gt;          &quot;authentication&quot; : [ { &quot;method&quot; : &quot;Basic&quot; } ]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style=&quot;text-align:justify;&quot;&gt;Finalmente creamos un archivo llamado “flights.xsodata” con el siguiente código&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;flights.xsodata&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;service {&lt;br /&gt;          &quot;Blag/FLIGHTS_BY_CARRIER.calculationview&quot; as &quot;FLIGHTS&quot; keys &lt;br /&gt;                                                        generate local &quot;Id&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style=&quot;text-align:justify;&quot;&gt;Activamos el proyecto y lanzamos nuestro browser...deberíamos ver algo como esto…&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-hgyYGKg3vjs/VfsJHWVPulI/AAAAAAAAEnk/91PjeWsjUIA/s1600/XSProject.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;http://1.bp.blogspot.com/-hgyYGKg3vjs/VfsJHWVPulI/AAAAAAAAEnk/91PjeWsjUIA/s400/XSProject.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;La parte de SAP HANA está lista…así que ahora podemos movernos a la parte de Haskell…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;En el terminal escribe esto…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;cabal update&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;cabal install --j --disable-tests wreq&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;&lt;b&gt;En las nuevas versiones de wreq, lens y aeson ya están incluídos…pero por siacaso…&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;cabal install lens&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;cabal install aeson&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Para programar en Haskell utilizo uno de los editores más asombrosos que he encontrado…&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.geany.org/&quot;&gt;Geany&lt;/a&gt;. Viene casi pre-configurado para manejar muchisimos lenguajes de programación, así que estárán listos para programar en Haskell.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Basicamente solo necesitas presionar el botón “Run or view the current file”, la última imágen muestra unos engranajes…lo cual basicamente va a traer el GHCi que es el Glasgow Haskell Compiler Interactive.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-kexmNshkd-Q/VfsJcIpn9JI/AAAAAAAAEns/aqXHaqTvL-A/s1600/Options.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;53&quot; src=&quot;http://1.bp.blogspot.com/-kexmNshkd-Q/VfsJcIpn9JI/AAAAAAAAEns/aqXHaqTvL-A/s200/Options.jpg&quot; width=&quot;200&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Con eso, estaremos más que preparados para comenzar a programar -:) Copia y pega el siguiente código…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Haskell_HANA.hs&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{-# LANGUAGE OverloadedStrings #-}&lt;br /&gt;import Network.Wreq&lt;br /&gt;import Control.Lens&lt;br /&gt;import Data.Aeson&lt;br /&gt;import Data.Aeson.Lens&lt;br /&gt;import Data.Aeson.Types&lt;br /&gt;import Data.Text&lt;br /&gt;import Data.Vector&lt;br /&gt;import Prelude as P&lt;br /&gt;import qualified Data.ByteString.Lazy as B&lt;br /&gt;&lt;br /&gt;get_info :: B.ByteString -&amp;gt; Text -&amp;gt; Text -&amp;gt; Text -&amp;gt; Text -&amp;gt; Int -&amp;gt; Int -&amp;gt; String&lt;br /&gt;get_info json d results carrname price len ctr&lt;br /&gt; | ctr &amp;lt; len = unpack(json ^. key d . key results . nth ctr . key carrname . _String) P.++ &lt;br /&gt;               &quot;: &quot; P.++ unpack(json ^. key d . key results . nth ctr . key price . _String) P.++ &quot;&amp;#92;n&quot; &lt;br /&gt;               P.++ get_info json d results carrname price len (ctr+1)&lt;br /&gt; | ctr &amp;gt;= len = []&lt;br /&gt;&lt;br /&gt;main :: IO ()&lt;br /&gt;main = do&lt;br /&gt; let d = pack &quot;d&quot;&lt;br /&gt; let results = pack &quot;results&quot;&lt;br /&gt; let carrname = pack &quot;CARRNAME&quot;&lt;br /&gt; let price = pack &quot;PRICE&quot;&lt;br /&gt; let opts = defaults &amp;amp; auth ?~ basicAuth &quot;SYSTEM&quot; &quot;YourPassword&quot;&lt;br /&gt; r &amp;lt;- getWith opts &quot;http://YourHANAServer:8000/Flights/flights.xsodata/FLIGHTS?$format=json&quot;&lt;br /&gt; let json = r ^. responseBody&lt;br /&gt; let results_array = json ^. key d . key results . _Array&lt;br /&gt; let len = Data.Vector.length results_array&lt;br /&gt; putStr $ get_info json d results carrname price len 0&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Guarda tu archivo y presiona el botón “Run or view the current file”.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-nKguD7MNbmo/VfsKE1hURFI/AAAAAAAAEn0/FOnoBKZdSEM/s1600/Haskell_HANA.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;http://4.bp.blogspot.com/-nKguD7MNbmo/VfsKE1hURFI/AAAAAAAAEn0/FOnoBKZdSEM/s400/Haskell_HANA.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Debes utilizar el formato “:l name_of_your_file” para cargar el programa en memoria y luego simplemente puedes llamar a la función principal para poder ejecutarlo -;)&lt;br /&gt;&lt;br /&gt;Debo decirlo…Haskell no es un lenguaje sencillo…y escribir este post no fué tampoco una tarea sencilla…tuve que hacer mucha investigación…pero afortunadamente los paquetes Wreq y Aeson son simplemente asombrosos!&lt;br /&gt;&lt;br /&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Expert.</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-2565884239079683781</guid>
         <pubDate>Thu, 17 Sep 2015 12:22:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-u9TivOF3Sk4/VfsHlXA8EjI/AAAAAAAAEnM/Ta8w_qEVtjE/s72-c/Haskell_Logo.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>SAP HANA a través del Glass con que se mira</title>
         <link>http://atejada.blogspot.com/2015/09/sap-hana-traves-del-glass-con-que-se.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;Este post fué posteado originalmente en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/12/sap-hana-through-the-looking-glass&quot;&gt;SAP HANA through the looking Glass&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s1600/d_shop_blog_logo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s400/d_shop_blog_logo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;b&gt;Si eres un empleado de SAP, por favor siguenos en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/about_page/sh2Kp26QQkHwkMPFAEqAD9&quot;&gt;Jam&lt;/a&gt;.&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Aún cuando&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.google.com/glass/start/&quot;&gt;Google Glass&lt;/a&gt; ya no va más...al menos no para el consumo masivo…Pensé que conectarlo a SAP HANA serviría para poder escribir un buen blog...puesto que después de todo, tenemos uno en el d-shop…así que aquí vamos -;)&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-L5We74_AWQU/VfODBPhu8JI/AAAAAAAAEk4/TOCjcb0uXUg/s1600/Glass_Logo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;http://3.bp.blogspot.com/-L5We74_AWQU/VfODBPhu8JI/AAAAAAAAEk4/TOCjcb0uXUg/s400/Glass_Logo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;div&gt;Primero, debemos crear un objeto Join y asociar la tabla por MANDT y CARRID. De ahí, seleccionar los siguientes campos como output MANDT, CARRID, CARRNAME, PRICE y CURRENCY.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Luego crear un objeto Aggregation seleccionándo los campos CARRNAME, PRICE (Como columnas agregadas) y CURRENCY. Debemos filtrar el campo CURRENCY por ‘USD’.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Luego, debemos crear un objeto Projection y seleccionar solo PRICE y CARRNAME.&lt;br /&gt;&lt;br /&gt;En el objeto Semantics asegúrense de marcar &amp;nbsp;“CROSS CLIENT” como cliente por defecto.&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-YyaI9OOCdTw/VfDxMTlBIvI/AAAAAAAAEi4/oyZoAaeoigQ/s1600/Calculation_View.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://4.bp.blogspot.com/-YyaI9OOCdTw/VfDxMTlBIvI/AAAAAAAAEi4/oyZoAaeoigQ/s400/Calculation_View.jpg&quot; width=&quot;215&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Ahora, cambiemos a la vista SAP HANA Development y creemos un nuevo repositorio. Lo llamaremos“Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un proyecto “XS Engine” y también lo llamamos “Flights”. Lo enlazamos con el repositorio “Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un archivo vacio llamado “.xsapp”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un archivo llamado “.xsaccess” con el siguente código.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;.xsaccess&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;          &quot;exposed&quot; : true,&lt;br /&gt;          &quot;authentication&quot; : [ { &quot;method&quot; : &quot;Basic&quot; } ]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;font-size:14.6667px;line-height:16.8667px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;font-size:14.6667px;line-height:16.8667px;&quot;&gt;Finalmente creamos un archivo llamado “flights.xsodata” con el siguiente código&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Flights.xodata&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;service {&lt;br /&gt;          &quot;Blag/FLIGHTS_BY_CARRIER.calculationview&quot; as &quot;FLIGHTS&quot; keys &lt;br /&gt;                                                        generate local &quot;Id&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;&quot;&gt;&lt;br /&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;span style=&quot;&quot;&gt;Activamos el proyecto y lanzamos nuestro browser...deberíamos ver algo como esto…&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-h0MZOwZaIog/VfDyh1sNjbI/AAAAAAAAEjI/J2vg4BOBjd4/s1600/XSProject.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;http://4.bp.blogspot.com/-h0MZOwZaIog/VfDyh1sNjbI/AAAAAAAAEjI/J2vg4BOBjd4/s400/XSProject.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;span style=&quot;&quot;&gt;La parte de SAP HANA está lista…así que ahora podemos movernos a la parte de Google Glass…&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Primer, debemos descargar&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://developer.android.com/sdk/index.html&quot;&gt;Android Studio&lt;/a&gt; y actualizar el SDK Manager para incluir lo siguiente…API 19 incluyéndo Google Glass Kit Preview.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-A2E4VpLn0l4/VfOEIX9yjgI/AAAAAAAAElE/fU3jZO_y4hg/s1600/SDK_Manager.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; src=&quot;http://4.bp.blogspot.com/-A2E4VpLn0l4/VfOEIX9yjgI/AAAAAAAAElE/fU3jZO_y4hg/s400/SDK_Manager.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un nuevo proyecto y lo llamamo “GLASS_HANA” o cualquier cosa que se les ocurra…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-Gk9qsDB9NsI/VfOES5Syg2I/AAAAAAAAElM/1z45iHqpw14/s1600/Create_Project.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;331&quot; src=&quot;http://1.bp.blogspot.com/-Gk9qsDB9NsI/VfOES5Syg2I/AAAAAAAAElM/1z45iHqpw14/s400/Create_Project.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;En la siguiente pantalla, quiten el check “Phone and Tablet” y marquen “Glass”. Asegurense de que “Glass Development Kit Preview (API 19) está seleccionado.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-CAp08dvl3Ew/VfOEbsE7DiI/AAAAAAAAElU/dwfX3kHQWag/s1600/Glass_Development.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;238&quot; src=&quot;http://2.bp.blogspot.com/-CAp08dvl3Ew/VfOEbsE7DiI/AAAAAAAAElU/dwfX3kHQWag/s400/Glass_Development.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Escogemos “Immersion Activity”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-_Fpbp-0cXQ8/VfOEiQRSOzI/AAAAAAAAElc/uaHG4PeXZ3k/s1600/Activity.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;147&quot; src=&quot;http://1.bp.blogspot.com/-_Fpbp-0cXQ8/VfOEiQRSOzI/AAAAAAAAElc/uaHG4PeXZ3k/s400/Activity.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Dejamos el nombre “MainActiviy” y pueden cambiar el Activity Title is quieren....&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-N8VO2yYyJNo/VfOEsfqGq1I/AAAAAAAAElk/6XeT5lPtaEY/s1600/MainActivity.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;213&quot; src=&quot;http://3.bp.blogspot.com/-N8VO2yYyJNo/VfOEsfqGq1I/AAAAAAAAElk/6XeT5lPtaEY/s400/MainActivity.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;En el archivo “MainActivity” copien el siguiente código...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;MainActivity.java&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;package glass.app.com.flightsreport;&lt;br /&gt;&lt;br /&gt;import com.google.android.glass.media.Sounds;&lt;br /&gt;import com.google.android.glass.widget.CardBuilder;&lt;br /&gt;import com.google.android.glass.widget.CardScrollAdapter;&lt;br /&gt;import com.google.android.glass.widget.CardScrollView;&lt;br /&gt;&lt;br /&gt;import android.app.Activity;&lt;br /&gt;import android.content.Context;&lt;br /&gt;import android.media.AudioManager;&lt;br /&gt;import android.os.Bundle;&lt;br /&gt;import android.view.View;&lt;br /&gt;import android.view.ViewGroup;&lt;br /&gt;import android.widget.AdapterView;&lt;br /&gt;import com.android.volley.RequestQueue;&lt;br /&gt;import com.android.volley.toolbox.Volley;&lt;br /&gt;import android.speech.RecognizerIntent;&lt;br /&gt;import android.speech.tts.TextToSpeech;&lt;br /&gt;&lt;br /&gt;public class MainActivity extends Activity {&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * {@link CardScrollView} to use as the main content view.&lt;br /&gt;     */&lt;br /&gt;    private CardScrollView mCardScroller;&lt;br /&gt;    private TextToSpeech mTTS;&lt;br /&gt;    private RequestQueue mQueue;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * &quot;Hello World!&quot; {@link View} generated by {@link #buildView()}.&lt;br /&gt;     */&lt;br /&gt;    private View mView;&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    protected void onCreate(Bundle bundle) {&lt;br /&gt;        super.onCreate(bundle);&lt;br /&gt;&lt;br /&gt;        mView = buildView();&lt;br /&gt;&lt;br /&gt;        mCardScroller = new CardScrollView(this);&lt;br /&gt;        mCardScroller.setAdapter(new CardScrollAdapter() {&lt;br /&gt;            @Override&lt;br /&gt;            public int getCount() {&lt;br /&gt;                return 1;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            @Override&lt;br /&gt;            public Object getItem(int position) {&lt;br /&gt;                return mView;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            @Override&lt;br /&gt;            public View getView(int position, View convertView, ViewGroup parent) {&lt;br /&gt;                return mView;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            @Override&lt;br /&gt;            public int getPosition(Object item) {&lt;br /&gt;                if (mView.equals(item)) {&lt;br /&gt;                    return 0;&lt;br /&gt;                }&lt;br /&gt;                return AdapterView.INVALID_POSITION;&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;        // Handle the TAP event.&lt;br /&gt;        mCardScroller.setOnItemClickListener(new AdapterView.OnItemClickListener() {&lt;br /&gt;            @Override&lt;br /&gt;            public void onItemClick(AdapterView parent, View view, int position, long id) {&lt;br /&gt;                // Plays disallowed sound to indicate that TAP actions are not supported.&lt;br /&gt;                AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);&lt;br /&gt;                am.playSoundEffect(Sounds.DISALLOWED);&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;        setContentView(mCardScroller);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    protected void onResume() {&lt;br /&gt;        super.onResume();&lt;br /&gt;        mCardScroller.activate();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    protected void onPause() {&lt;br /&gt;        mCardScroller.deactivate();&lt;br /&gt;        mTTS.shutdown();&lt;br /&gt;        super.onPause();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Builds a Glass styled &quot;Hello World!&quot; view using the {@link CardBuilder} class.&lt;br /&gt;     */&lt;br /&gt;    private View buildView() {&lt;br /&gt;        mTTS = new TextToSpeech(this, new TextToSpeech.OnInitListener() {&lt;br /&gt;            @Override&lt;br /&gt;            public void onInit(int status) {&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;        final CardBuilder card = new CardBuilder(this, CardBuilder.Layout.TEXT);&lt;br /&gt;        mQueue = Volley.newRequestQueue(this);&lt;br /&gt;        final String carrName = getIntent().getExtras().getStringArrayList(RecognizerIntent.EXTRA_RESULTS).get(0);&lt;br /&gt;        HANAFlightsAPI.getFlightsData(carrName, mQueue, new HANAFlightsAPI.Callback() {&lt;br /&gt;            @Override&lt;br /&gt;            public void onFlightsData(HANAFlightsAPI.FlightsData flightsData) {&lt;br /&gt;                card.setText(flightsData.price);&lt;br /&gt;                card.setFootnote(flightsData.carrierName);&lt;br /&gt;                setContentView(card.getView());&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;&lt;br /&gt;        return card.getView();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Creamos un nuevo archivo y lo llamamos “HANAFlightsAPI” y copiamos el siguiente código&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;HANAFlightsAPI.java&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;package glass.app.com.flightsreport;&lt;br /&gt;&lt;br /&gt;import android.util.Log;&lt;br /&gt;import com.android.volley.RequestQueue;&lt;br /&gt;import com.android.volley.Response;&lt;br /&gt;import com.android.volley.VolleyError;&lt;br /&gt;import com.android.volley.toolbox.JsonObjectRequest;&lt;br /&gt;import org.json.JSONException;&lt;br /&gt;import org.json.JSONObject;&lt;br /&gt;import android.util.Base64;&lt;br /&gt;import java.util.HashMap;&lt;br /&gt;import java.util.Map;&lt;br /&gt;import com.android.volley.AuthFailureError;&lt;br /&gt;import java.net.URI;&lt;br /&gt;import java.net.URISyntaxException;&lt;br /&gt;&lt;br /&gt;public class HANAFlightsAPI {&lt;br /&gt;    /**&lt;br /&gt;     * Open Weather Map API Endpoint&lt;br /&gt;     */&lt;br /&gt;    public static final String URL = &quot;http://YourServer:8000/Flights/flights.xsodata/FLIGHTS?$format=json&amp;amp;&lt;br /&gt;                                      $filter=CARRNAME%20eq%20&quot;;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Object containing qualitative description of weather as well as temperature in Fahrenheit.&lt;br /&gt;     */&lt;br /&gt;    public static class FlightsData {&lt;br /&gt;&lt;br /&gt;        public final String carrierName;&lt;br /&gt;        public final String price;&lt;br /&gt;&lt;br /&gt;        public FlightsData(String carrierName, String price) {&lt;br /&gt;            this.carrierName = carrierName;&lt;br /&gt;            this.price = price;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public interface Callback {&lt;br /&gt;        void onFlightsData(FlightsData flightsData);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;      public static void getFlightsData(String carrierName, RequestQueue queue, final Callback callback) {&lt;br /&gt;        URI uri = null;&lt;br /&gt;        try {&lt;br /&gt;            uri = new URI(carrierName.replaceAll(&quot; &quot;, &quot;%20&quot;));&lt;br /&gt;        } catch (URISyntaxException e) {&lt;br /&gt;            // TODO Auto-generated catch block&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;        queue.add(new JsonObjectRequest(URL + &quot;%27&quot; + uri + &quot;%27&quot;, null,&lt;br /&gt;                new Response.Listener&amp;lt;JSONObject&amp;gt;() {&lt;br /&gt;                    @Override&lt;br /&gt;                    public void onResponse(JSONObject response) {&lt;br /&gt;                        String carrier = &quot;&quot;;&lt;br /&gt;                        String price = &quot;&quot;;&lt;br /&gt;                        try {&lt;br /&gt;                            JSONObject results = (JSONObject) response.getJSONObject(&quot;d&quot;).getJSONArray(&quot;results&quot;).get(0);&lt;br /&gt;                            carrier = results.getString(&quot;CARRNAME&quot;);&lt;br /&gt;                            price = results.getString(&quot;PRICE&quot;);&lt;br /&gt;                        } catch (JSONException e) {&lt;br /&gt;                            e.printStackTrace();&lt;br /&gt;                        }&lt;br /&gt;                        callback.onFlightsData(new FlightsData(carrier, price));&lt;br /&gt;                    }&lt;br /&gt;                }, new Response.ErrorListener() {&lt;br /&gt;            @Override&lt;br /&gt;            public void onErrorResponse(VolleyError error) {&lt;br /&gt;                Log.e(&quot;onErrorResponse&quot;, error.getMessage());&lt;br /&gt;            }&lt;br /&gt;        }) {&lt;br /&gt;&lt;br /&gt;            @Override&lt;br /&gt;            public Map&amp;lt;String, String&amp;gt; getHeaders() throws AuthFailureError {&lt;br /&gt;                HashMap&amp;lt;String, String&amp;gt; headers = new HashMap&amp;lt;String, String&amp;gt;();&lt;br /&gt;                String creds = String.format(&quot;%s:%s&quot;, &quot;SYSTEM&quot;, &quot;YourPassword&quot;);&lt;br /&gt;                String auth = &quot;Basic &quot; + Base64.encodeToString(creds.getBytes(), Base64.DEFAULT);&lt;br /&gt;                headers.put(&quot;Authorization&quot;, auth);&lt;br /&gt;                return headers;&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Vamos al segundo archivo build.gradle (el que dice “Module.app”) y agregamos esto...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Module.app&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;dependencies {&lt;br /&gt;    compile fileTree(dir: 'libs', include: ['*.jar'])&lt;br /&gt;    compile 'com.mcxiaoke.volley:library:1.0.+'&lt;br /&gt;    androidTestCompile 'org.hamcrest:hamcrest-all:1.3'&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Esto va a agregar la&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://developer.android.com/training/volley/index.html&quot;&gt;Volley library&lt;/a&gt; la cual es una librería HTTP diseñana para hacer que las aplicaciones de networking con Android sean más sencillas y más veloces.&lt;br /&gt;&lt;br /&gt;Abrimos el archivo “voice_trigger.xml” y copiamos el siguiente código...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;voice_trigger.xml&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;trigger keyword=&quot;Flight Report&quot;&amp;gt;&lt;br /&gt;    &amp;lt;input prompt=&quot;Which Carrier?&quot;/&amp;gt;&lt;br /&gt;&amp;lt;/trigger&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Abrimos el archivo “strings.xml” y copiamos el siguiente código...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;strings.xml&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;resources&amp;gt;&lt;br /&gt;    &amp;lt;string name=&quot;app_name&quot;&amp;gt;Flights Report&amp;lt;/string&amp;gt;&lt;br /&gt;    &amp;lt;string name=&quot;glass_voice_trigger&quot;&amp;gt;flights report&amp;lt;/string&amp;gt;&lt;br /&gt;    &amp;lt;string name=&quot;glass_voice_prompt&quot;&amp;gt;which carrier?&amp;lt;/string&amp;gt;&lt;br /&gt;&amp;lt;/resources&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Abrimos el archivo “AndroidManifest.xml” y copiamos el siguiente código&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;AndroidManifest.xml&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;    package=&quot;glass.app.com.flightsreport&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;uses-permission android:name=&quot;com.google.android.glass.permission.DEVELOPMENT&quot;/&amp;gt;&lt;br /&gt;    &amp;lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;application&lt;br /&gt;        android:allowBackup=&quot;true&quot;&lt;br /&gt;        android:icon=&quot;@drawable/ic_launcher&quot;&lt;br /&gt;        android:label=&quot;Flights Report&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;activity android:name=&quot;.MainActivity&quot;&amp;gt;&lt;br /&gt;            &amp;lt;intent-filter&amp;gt;&lt;br /&gt;                &amp;lt;action android:name=&quot;com.google.android.glass.action.VOICE_TRIGGER&quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/intent-filter&amp;gt;&lt;br /&gt;            &amp;lt;meta-data&lt;br /&gt;                android:name=&quot;com.google.android.glass.VoiceTrigger&quot;&lt;br /&gt;                android:resource=&quot;@xml/voice_trigger&quot;/&amp;gt;&lt;br /&gt;        &amp;lt;/activity&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;/application&amp;gt;&lt;br /&gt;&amp;lt;/manifest&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Estamos casi listos…necesitamos conectar nuestro Google Glass y asegurárnos de que está en Debug On.&lt;br /&gt;&lt;br /&gt;Navegamos hasta “Settings” e ingresamos.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-4jmOFKO7H4Q/VfOLNsiAkYI/AAAAAAAAEl0/ywu8ksp4QK8/s1600/Glass_Settings.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;223&quot; src=&quot;http://2.bp.blogspot.com/-4jmOFKO7H4Q/VfOLNsiAkYI/AAAAAAAAEl0/ywu8ksp4QK8/s400/Glass_Settings.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Navegamos hasta “Device info” y lo seleccionamos&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-lV5ym9SF3Jg/VfOLVta2VUI/AAAAAAAAEl8/FvFho6lzbIE/s1600/Glass_DeviceInfo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;221&quot; src=&quot;http://1.bp.blogspot.com/-lV5ym9SF3Jg/VfOLVta2VUI/AAAAAAAAEl8/FvFho6lzbIE/s400/Glass_DeviceInfo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Navegamos hasta “Turn on debug” y lo seleccionamos. Debería convertirse en “Turn off debug”&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-KGmqhP63FTI/VfOLb18miSI/AAAAAAAAEmE/ccg3zmnsC-4/s1600/Glass_Debug.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;http://4.bp.blogspot.com/-KGmqhP63FTI/VfOLb18miSI/AAAAAAAAEmE/ccg3zmnsC-4/s400/Glass_Debug.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Con eso podremos ser capacer de enlazar nuestro Google Glass con nuestro proyecto en Android Studio. Simplimente lo ejecutamos y lo veremos en Google Glass.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;background-color:white;color:#333333;font-family:Calibri, sans-serif;font-size:14.6667px;line-height:22px;text-align:left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-rulahZYfuGM/VfOLilTy2yI/AAAAAAAAEmM/ZTwxE3zOzpk/s1600/Flight_Report.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;http://1.bp.blogspot.com/-rulahZYfuGM/VfOLilTy2yI/AAAAAAAAEmM/ZTwxE3zOzpk/s400/Flight_Report.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Hacemos click para entrar y veremos la pantalla principal&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-M9DSdO0ppak/VfOLqj84jPI/AAAAAAAAEmU/vNY40e1Kay8/s1600/Flight_Report_Carrier.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;http://1.bp.blogspot.com/-M9DSdO0ppak/VfOLqj84jPI/AAAAAAAAEmU/vNY40e1Kay8/s400/Flight_Report_Carrier.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Di el nombre de una aerolínea como “American Airlines”&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;background-color:white;color:#333333;font-family:Calibri, sans-serif;font-size:14.6667px;line-height:22px;text-align:left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-Bw80auemu6E/VfOLzVypPLI/AAAAAAAAEmc/q-JY0TiJyvo/s1600/Flight_Report_AA.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;http://2.bp.blogspot.com/-Bw80auemu6E/VfOLzVypPLI/AAAAAAAAEmc/q-JY0TiJyvo/s400/Flight_Report_AA.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Espera y la aplicación se conectará con nuestro ODATA en SAP HANA y mostrará el resultado&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-drnwXBR2Tc8/VfOL8mt8fiI/AAAAAAAAEmk/1vd4HAwcs0M/s1600/Flight_Report_AA_Result.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;222&quot; src=&quot;http://2.bp.blogspot.com/-drnwXBR2Tc8/VfOL8mt8fiI/AAAAAAAAEmk/1vd4HAwcs0M/s400/Flight_Report_AA_Result.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Ahora, para no hacerlos pensar que me estoy inventándo esto…intentemos con otra…como “Lufthansa”&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-XF9B0XxFsYE/VfOMFwEaRTI/AAAAAAAAEms/x84UQ53c_q8/s1600/Flight_Report_Lufthansa.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;221&quot; src=&quot;http://3.bp.blogspot.com/-XF9B0XxFsYE/VfOMFwEaRTI/AAAAAAAAEms/x84UQ53c_q8/s400/Flight_Report_Lufthansa.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Esperen a ver el resultado…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-3aC71Evt3_I/VfOMPHQ0_LI/AAAAAAAAEm0/Y3750TpLum4/s1600/Flight_Report_Lufthansa_Result.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;http://3.bp.blogspot.com/-3aC71Evt3_I/VfOMPHQ0_LI/AAAAAAAAEm0/Y3750TpLum4/s400/Flight_Report_Lufthansa_Result.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Bueno, no? También pueden preguntar por “Delta Airlines” o “United Airlines”…si preguntamos por algo más, nos dará el resultado del nombre más aproximado o el del valor por defecto.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Estoy lo suficientemente feliz con este pequeño proyecto -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Saludos,&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Development Culture.&lt;/div&gt;</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-3642527932860633233</guid>
         <pubDate>Fri, 11 Sep 2015 20:29:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s72-c/d_shop_blog_logo.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Amazon Alexa y SAP HANA</title>
         <link>http://atejada.blogspot.com/2015/09/amazon-alexa-y-sap-hana.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;Este post fué posteado originalmente en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/10/amazon-alexa-and-sap-hana&quot;&gt;Amazon Alexa and SAP HANA&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s1600/d_shop_blog_logo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s400/d_shop_blog_logo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;b&gt;Si eres empleado de SAP, por favor siguenos en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/about_page/sh2Kp26QQkHwkMPFAEqAD9&quot;&gt;Jam&lt;/a&gt;.&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://en.wikipedia.org/wiki/Amazon_Echo&quot;&gt;Amazon Alexa&lt;/a&gt; (Antes conocido como Amazon Echo) es una impresionante tecnología que te permite dar comándos de voz y recibir asombrosas respuestas. Sí…es como Siri pero de Amazon. Además, no vive en tu celular, puesto que Alexa es un cilindro negro cargado con 7 micrófonos y parlamentes muy ruidosos.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-HERh3THnUoQ/VfDw_QeNQBI/AAAAAAAAEio/KWaY-7kPWMY/s1600/Alexa.jpeg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-HERh3THnUoQ/VfDw_QeNQBI/AAAAAAAAEio/KWaY-7kPWMY/s1600/Alexa.jpeg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-9-KldUa5isU/VfDw_r2uTLI/AAAAAAAAEis/iDS3idXoZ9Y/s1600/Alexa_Herself.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;210&quot; src=&quot;http://3.bp.blogspot.com/-9-KldUa5isU/VfDw_r2uTLI/AAAAAAAAEis/iDS3idXoZ9Y/s400/Alexa_Herself.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Acabamos de recibir uno en el d-shop hace casi una semana…así que por supuesto…necesitaba hackearlo y hacer que funciones con SAP HANA -;)&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Primero, necesitamos crear un Calculation View y llamarlo “FLIGHTS_BY_CARRIER”. Estará compuesto por dos tablas, SCARR y SFLIGHT.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Primero, debemos crear un objeto Join y asociar la tabla por MANDT y CARRID. De ahí, seleccionar los siguientes campos como output MANDT, CARRID, CARRNAME, PRICE yCURRENCY.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Luego crear un objeto Aggregation seleccionándo los campos CARRNAME, PRICE (Como columnas agregadas) y CURRENCY. Debemos filtrar el campo CURRENCY por ‘USD’.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Luego, debemos crear un objeto Projection y seleccionar solo PRICE y CARRNAME.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;En el objeto Semantics asegúrense de marcar &amp;nbsp;“CROSS CLIENT” como cliente por defecto.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-YyaI9OOCdTw/VfDxMTlBIvI/AAAAAAAAEi4/oyZoAaeoigQ/s1600/Calculation_View.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://4.bp.blogspot.com/-YyaI9OOCdTw/VfDxMTlBIvI/AAAAAAAAEi4/oyZoAaeoigQ/s400/Calculation_View.jpg&quot; width=&quot;215&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Ahora, cambiemos a la vista SAP HANA Development y creemos un nuevo repositorio. Lo llamaremos“Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un proyecto “XS Engine” y también lo llamamos “Flights”. Lo enlazamos con el repositorio “Flights”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un archivo vacio llamado “.xsapp”.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Creamos un archivo llamado “.xsaccess” con el siguente código.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;.xsaccess&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;          &quot;exposed&quot; : true,&lt;br /&gt;          &quot;authentication&quot; : [ { &quot;method&quot; : &quot;Basic&quot; } ]&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;font-size:11pt;line-height:115%;&quot;&gt;Finalmente creamos un archivo llamado “flights.xsodata” con el siguiente código&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Flights.xodata&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;service {&lt;br /&gt;          &quot;Blag/FLIGHTS_BY_CARRIER.calculationview&quot; as &quot;FLIGHTS&quot; keys &lt;br /&gt;                                                        generate local &quot;Id&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Activamos el proyecto y lanzamos nuestro browser...deberíamos ver algo como esto…&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-h0MZOwZaIog/VfDyh1sNjbI/AAAAAAAAEjI/J2vg4BOBjd4/s1600/XSProject.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;http://4.bp.blogspot.com/-h0MZOwZaIog/VfDyh1sNjbI/AAAAAAAAEjI/J2vg4BOBjd4/s400/XSProject.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;La parte de SAP HANA está lista…así que ahora podemos movernos a la parte de Amazon Alexa…&lt;br /&gt;&lt;br /&gt;Debo agradecer a este blog&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://tobuildsomething.com/2015/08/14/Amazon-Echo-Alexa-Tutorial-The-Definitive-Guide-to-Coding-an-Alexa-Skill/&quot;&gt;Alexa Skills Tutorial: The Definitive Guide to Coding for the Amazon Echo&lt;/a&gt; puesto que realmente me ayudo para poder escribir mi propio blog -;)&lt;br /&gt;&lt;br /&gt;Para poder programar para Amazon Alexa, podemos usar un nuevo y asombroso servicio de Amazon llamado Amazon Lambda…que basicamente te permite definir un servicio NodeJS que se va a ejecutar solemente cuando lo necesitemos…y también te permite realizar las primeras millón de llamadas gratis por mes…&lt;br /&gt;&lt;br /&gt;Primero…logeate en tu cuenta de Amazon Web Services y entra en Amazon Lambda. Asegurate de que estás en la región de &amp;nbsp;North Virginia…de otra manera no va a funcionar…&lt;br /&gt;&lt;br /&gt;Una vez allí…crea una nueva función lambda function y selecciona alexa-skills-kit-color-expert&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-zaYNG2QeXco/VfDzCZtjAKI/AAAAAAAAEjM/MPPKC_iIMdk/s1600/Lambda_Function.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;226&quot; src=&quot;http://4.bp.blogspot.com/-zaYNG2QeXco/VfDzCZtjAKI/AAAAAAAAEjM/MPPKC_iIMdk/s400/Lambda_Function.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Luego, selecciona el “Alexa Skills Kit” Event Source Type…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-vxP9H-twdjk/VfDzUSxJx-I/AAAAAAAAEjU/5XBBIs8zj68/s1600/Event_Sources.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;96&quot; src=&quot;http://1.bp.blogspot.com/-vxP9H-twdjk/VfDzUSxJx-I/AAAAAAAAEjU/5XBBIs8zj68/s400/Event_Sources.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;De ahí, necesitamos configurar nuestra función…lo cual significa, debemos darle un nombre…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-ivEbPQuxPpI/VfD0fMr9RYI/AAAAAAAAEjg/VSioW3sM0e0/s1600/Configure_Function_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;102&quot; src=&quot;http://3.bp.blogspot.com/-ivEbPQuxPpI/VfD0fMr9RYI/AAAAAAAAEjg/VSioW3sM0e0/s400/Configure_Function_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Deja la parte del código de lado por un momento y escoje un rol…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-pLQywCxUf60/VfD0p4f4deI/AAAAAAAAEjo/kcKSmDbvdYE/s1600/Configure_Function_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;151&quot; src=&quot;http://1.bp.blogspot.com/-pLQywCxUf60/VfD0p4f4deI/AAAAAAAAEjo/kcKSmDbvdYE/s400/Configure_Function_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Escoge Basic execution role y una ventana se abrir automáticamente…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-1Rk-wfax_lk/VfD024r7_GI/AAAAAAAAEjw/_l-OK80sHTA/s1600/Configure_Function_03.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;173&quot; src=&quot;http://1.bp.blogspot.com/-1Rk-wfax_lk/VfD024r7_GI/AAAAAAAAEjw/_l-OK80sHTA/s400/Configure_Function_03.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Presiona el botón “Allow it” que está al final. Continúa y finalmente presiona el botón “Create Function”. Un número ARN va a ser generado para tu función, toma nota puesto que va a ser necesario en un próximo paso.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Ahora, debemos ir a &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://developer.amazon.com/&quot;&gt;http://developer.amazon.com&lt;/a&gt; y logearnos.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Escoge Apps &amp;amp; Services --&amp;gt; Alexa --&amp;gt; Alexa Skills Set.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-z0OseJmop-s/VfD1D_rUE_I/AAAAAAAAEj4/ylaYTdcNr48/s1600/Alexa_Dashboard.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;http://1.bp.blogspot.com/-z0OseJmop-s/VfD1D_rUE_I/AAAAAAAAEj4/ylaYTdcNr48/s400/Alexa_Dashboard.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;Presiona el botón “Add New Skill” e ingresa un Nombre, Nombre de Invocación (Como vamos a llamarlo desde Alexa), versión y el Endpoint (En este caso, el número ARN de nuestra función Lambda)…&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-0kLzf6wshmk/VfD1P8D_XaI/AAAAAAAAEkA/GFJSMO5ZEVo/s1600/Create_New_Skill.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;193&quot; src=&quot;http://3.bp.blogspot.com/-0kLzf6wshmk/VfD1P8D_XaI/AAAAAAAAEkA/GFJSMO5ZEVo/s400/Create_New_Skill.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Cuando presionamos &quot;Next&quot;, un Application Id number será generado. Toma nota de este número puesto que lo necesitaremos para la parte del código…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;La sección de Interaction Model es muy importante puesto que aquí vamos a definir el “Intent Schema” y el “Sample Utterances”…el primero definirá los parámetros que vamos a mandar a Alexa y el segundo es como vamos a llamar a nuestra aplicación.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Intent Schema&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;{&lt;br /&gt;  &quot;intents&quot;: [&lt;br /&gt;    {&lt;br /&gt;      &quot;intent&quot;: &quot;GetSAPHANAIntent&quot;,&lt;br /&gt;      &quot;slots&quot;: [&lt;br /&gt;        {&lt;br /&gt;          &quot;name&quot;: &quot;airline&quot;,&lt;br /&gt;          &quot;type&quot;: &quot;LITERAL&quot;&lt;br /&gt;        }&lt;br /&gt;      ]&lt;br /&gt;    },&lt;br /&gt;    {&lt;br /&gt;      &quot;intent&quot;: &quot;HelpIntent&quot;,&lt;br /&gt;      &quot;slots&quot;: []&lt;br /&gt;    }&lt;br /&gt;  ]&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;Nuestra variable se va a llamar “airline” y va a ser un LITERAL…otros tipos son NUMBER, DATE, TIME y DURATION. El &quot;intent&quot; es el método que vamos a llamar en nuestra aplicación…&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Sample Utterances&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;GetSAPHANAIntent get total amount for airline {American Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get total amount for airline {United Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get total amount for airline {Delta Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get total amount for airline {Lufthansa Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get amount for {Delta Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get amount for {Lufthansa|airline}&lt;br /&gt;GetSAPHANAIntent get amount for {United Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get amount for {American Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get {United Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get {Lufthansa|airline}&lt;br /&gt;GetSAPHANAIntent get {Delta Airlines|airline}&lt;br /&gt;GetSAPHANAIntent get {American Airlines|airline}&lt;br /&gt;&lt;br /&gt;HelpIntent help&lt;br /&gt;HelpIntent help me&lt;br /&gt;HelpIntent what can I ask you&lt;br /&gt;HelpIntent get help&lt;br /&gt;HelpIntent to help&lt;br /&gt;HelpIntent to help me&lt;br /&gt;HelpIntent what commands can I ask&lt;br /&gt;HelpIntent what commands can I say&lt;br /&gt;HelpIntent what can I do&lt;br /&gt;HelpIntent what can I use this for&lt;br /&gt;HelpIntent what questions can I ask&lt;br /&gt;HelpIntent what can you do&lt;br /&gt;HelpIntent what do you do&lt;br /&gt;HelpIntent how do I use you&lt;br /&gt;HelpIntent how can I use you&lt;br /&gt;HelpIntent what can you tell me&lt;br /&gt;HelpIntent how do i get an amount&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Calibri, sans-serif;font-size:11pt;line-height:115%;&quot;&gt;La sección Test es donde podemos probar nuestra aplicación enviándole un utterance como“get American Airlines”…debemos crear el código de nuestra función antes de poder hacer las pruebas…así que no se preocupen mucho por esto por ahora…&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-tkDsP7kzqXY/VfD70SW2d2I/AAAAAAAAEkQ/y22h4W54Zsg/s1600/Test_Section.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;392&quot; src=&quot;http://3.bp.blogspot.com/-tkDsP7kzqXY/VfD70SW2d2I/AAAAAAAAEkQ/y22h4W54Zsg/s400/Test_Section.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;No hagan caso de la sección Publishing Information a menos que de verdad quieran publicar su aplicación…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Debemos crear una carpeta y llamarla “Alexa_HANA” o algo parecido…luego debemos crear una carpeta llamada “src”. Copia el código de &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://github.com/dustincoates/alexa-bus-schedule/blob/master/src/index.js&quot;&gt;aquí&lt;/a&gt;&amp;nbsp;y crea un archivo llamado “AlexaSkills.js”&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Vamos a necesitar instalar el paquete node-rest-client en nuestra función, así que debemos hacer lo siguiente en el terminal&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;b&gt;sudo npm install --prefix=~/Alexa_HANA/src node-rest-client&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;Esto va a crear un folder llamado “node_modules” con el paquete en nuestra carpeta de proyecto…luego debemos crear un archivo llamado “index.js” y copiar y pegar el siguiente código…&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;index.js&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;var Client = require('node-rest-client').Client&lt;br /&gt;  , AlexaSkill = require('./AlexaSkill')&lt;br /&gt;  , APP_ID     = 'amzn1.echo-sdk-ams.app.XXX';&lt;br /&gt;&lt;br /&gt;var error = function (err, response, body) {&lt;br /&gt;    console.log('ERROR [%s]', err);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;function toTitleCase(str)&lt;br /&gt;{&lt;br /&gt;    return str.replace(/&amp;#92;w&amp;#92;S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var getJsonFromHANA = function(airline, callback){&lt;br /&gt; var sAirline = toTitleCase(airline);&lt;br /&gt; var options_auth={user:&quot;SYSTEM&quot;,password:&quot;YourPassword&quot;};&lt;br /&gt; client = new Client(options_auth);&lt;br /&gt; client.get(&quot;http://YourServer:8000/Flights/flights.xsodata/FLIGHTS?$format=json&amp;amp;$filter=CARRNAME eq &amp;#92;'&quot; +&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;                    sAirline + &quot;&amp;#92;'&quot;, function(data, response){&lt;/pre&gt;&lt;pre&gt;  if (data.d.results[0] != undefined){&lt;br /&gt;   var Amount = data.d.results[0].PRICE; &lt;br /&gt;  }else{&lt;br /&gt;   var Amount = &quot;Sorry I coudln't find that airline&quot;; &lt;br /&gt;  }&lt;br /&gt;  callback(Amount);&lt;br /&gt; }).on('error',function(err){&lt;br /&gt;            callback(&quot;Sorry there was a connection error&quot;);&lt;br /&gt;       });&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var handleHANARequest = function(intent, session, response){&lt;br /&gt;  getJsonFromHANA(intent.slots.airline.value, function(data){&lt;br /&gt; var text = data;&lt;br /&gt;    var cardText = 'Total sales are: ' + text;&lt;br /&gt;&lt;br /&gt;    var heading = 'Total sales for: ' + intent.slots.airline.value;&lt;br /&gt;    response.tellWithCard(text, heading, cardText);&lt;br /&gt;  });&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;var HANA = function(){&lt;br /&gt;  AlexaSkill.call(this, APP_ID);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;HANA.prototype = Object.create(AlexaSkill.prototype);&lt;br /&gt;HANA.prototype.constructor = HANA;&lt;br /&gt;&lt;br /&gt;HANA.prototype.eventHandlers.onSessionStarted = function(sessionStartedRequest, session){&lt;br /&gt;  console.log(&quot;onSessionStarted requestId: &quot; + sessionStartedRequest.requestId&lt;br /&gt;      + &quot;, sessionId: &quot; + session.sessionId);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;HANA.prototype.eventHandlers.onLaunch = function(launchRequest, session, response){&lt;br /&gt;  // This is when they launch the skill but don't specify what they want.&lt;br /&gt;  var output = 'Welcome to S A P HANA. ' +&lt;br /&gt;    'Say an Airline Name.';&lt;br /&gt;&lt;br /&gt;  var reprompt = 'Which Airline would you like?';&lt;br /&gt;&lt;br /&gt;  response.ask(output, reprompt);&lt;br /&gt;&lt;br /&gt;  console.log(&quot;onLaunch requestId: &quot; + launchRequest.requestId&lt;br /&gt;      + &quot;, sessionId: &quot; + session.sessionId);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;HANA.prototype.intentHandlers = {&lt;br /&gt;  GetSAPHANAIntent: function(intent, session, response){&lt;br /&gt;    handleHANARequest(intent, session, response);&lt;br /&gt;  },&lt;br /&gt;&lt;br /&gt;  HelpIntent: function(intent, session, response){&lt;br /&gt;    var speechOutput = 'Get the total amount for any airline. ' +&lt;br /&gt;      'Which Airline would you like?';&lt;br /&gt;    response.ask(speechOutput);&lt;br /&gt;  }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;exports.handler = function(event, context) {&lt;br /&gt;    var skill = new HANA();&lt;br /&gt;    skill.execute(event, context);&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Una vez que hemos terminado, debemos comprimir los archivo en un .zip…así que vamos a la carpeta “src” y debemos crear un archivo .zip con la carpeta “node_modules”, el archivo AlexaSkills.js y el archvo index.js…podemos llamar al archivo .zip “SAPHANA.zip”.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;Ahora, regresamos a la función de Amazon Lambda y escojemos la pestaña Code. Luego escojemos “Upload a .ZIP file” y presionamos Upload. Escogemos el archivo SAPHANA.zip y luego presionamos el boton &quot;Save&quot;.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-xLQUypWzJKE/VfD9b9VIxCI/AAAAAAAAEkc/a-Ed8twikOo/s1600/Upload_Code.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;236&quot; src=&quot;http://4.bp.blogspot.com/-xLQUypWzJKE/VfD9b9VIxCI/AAAAAAAAEkc/a-Ed8twikOo/s400/Upload_Code.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Con eso…deberíamos estar listo para seguir adelánte -;)&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;Ahora podemos utilizar la sección Test de nuestro Alexa Skill…&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size:11.0pt;line-height:115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-jM0UnXO4CMc/VfD9jvRjH2I/AAAAAAAAEkk/UJFqxrd7_uI/s1600/Test_Done.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;366&quot; src=&quot;http://3.bp.blogspot.com/-jM0UnXO4CMc/VfD9jvRjH2I/AAAAAAAAEkk/UJFqxrd7_uI/s400/Test_Done.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Una vez que sabemos que está funcionando…podemos probar nuestra nueva aplicación en Amazon Alexa diciéndo…&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;b&gt;“Alexa ask get hana”&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Y luego “get American Airlines” o “get total amount for Delta Airlines”&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Aquí hay un video para demostrárles como funciona -:)&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;span style=&quot;font-family:Wingdings;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Como puesden ver…es en realidad bastante sencillo pero hay algo que deben tener en cuenta…Alexa no va a poder ser capaz de entender todo lo que le digamos…así que debemos ser cuidadosos con nuestros utterances…también…en SAP HANA tenemos “American Airlines” pero Alexa va a entenderlo como “american airlines”…es por eso que tuve que capitalizar la primera letra puesto que de lo contrario, ambos son diferente nombres de línea aerea -;)&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Saludos,&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align:justify;&quot;&gt;Development Culture.&lt;/div&gt;</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-2390624862450499486</guid>
         <pubDate>Wed, 09 Sep 2015 21:35:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s72-c/d_shop_blog_logo.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Fuego! (BeagleBone Black, WebCam, Missile Launcher y OpenCV)</title>
         <link>http://atejada.blogspot.com/2015/09/fuego-beaglebone-black-webcam-missile.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;Este post fué posteado originalmente en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/09/firing-up-beaglebone-black-webcam-missile-launcher-and-opencv&quot;&gt;Firing Up (BeagleBone Black, WebCam, Missile Launcher and OpenCV)&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s1600/d_shop_blog_logo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s400/d_shop_blog_logo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;b&gt;Si eres un empleado de SAP, por favor siguenos en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/about_page/sh2Kp26QQkHwkMPFAEqAD9&quot;&gt;Jam&lt;/a&gt;.&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Mi buen amigo John Astill vino a visitarnos al d-shop hace algún tiempo…y vió el Thunder Missile Launcher que compré como un regalo de navidad Christmas para la cena de mi equipo. El me dijo…”Blag…deberías hacer una aplicación que hace que el lanza misiles dispare cuando pones un color u objeto en frente de la camara”…eso me dejó pensándo por supuesto -;)&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-oJIKVCfAl00/VfB-jp6BmqI/AAAAAAAAEgU/l_i3jQAIGa8/s1600/DreamCheeky.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://3.bp.blogspot.com/-oJIKVCfAl00/VfB-jp6BmqI/AAAAAAAAEgU/l_i3jQAIGa8/s320/DreamCheeky.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Así que John…este post es para ti...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Así que, vamos a comenzar…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Vamos a necesitar tener el OpenCV instalado…así que la manera regular debería funcionar…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;b&gt;sudo apt-get install opencv&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Y OpenCV debería estar instalado y listo para usarse…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Después…necesitaba hackear el Missile Launcher para poder hacer que dispare…así que aquí es donde la diversión comienza…conecté el Missile Launcher a mi Linux en VMWare he hice un comando&amp;nbsp;&lt;b&gt;lsusb -vv &lt;/b&gt;para obtener la información del dispositivo USB…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-fDT3p5TgE9M/VfB-wPqglKI/AAAAAAAAEgc/8ppKuraoLSI/s1600/lsusb.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;266&quot; src=&quot;http://3.bp.blogspot.com/-fDT3p5TgE9M/VfB-wPqglKI/AAAAAAAAEgc/8ppKuraoLSI/s400/lsusb.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Aquí podemos ver que el IdVendor es 0x2123 y que el idProduct es 0x1010. Esto en realidad no ayuda en nada puesto que no sabemos cual es la información que debemos pasar para hacer que esto funcione…así que el siguiente paso es &quot;olfatear&quot; el dispositivo para poder obtener los comandos USB…para esto utilicé el&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://sourceforge.net/projects/usbsnoop/&quot;&gt;SnoopyPro&lt;/a&gt; un USB Sniffer para Windows…y me di cuenta de que no podía hacerlo funcionar bien en Windows 7, así que tuve que utilizar mi querido y ya viejo Windows XP en VMWare…e instalar el&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://dreamcheeky.com/download-support&quot;&gt;Dream Cheeky software&lt;/a&gt;...&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-NbLiPoidglw/VfCBXkchMWI/AAAAAAAAEgo/jjPJKWg-bMo/s1600/Thunder.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://1.bp.blogspot.com/-NbLiPoidglw/VfCBXkchMWI/AAAAAAAAEgo/jjPJKWg-bMo/s320/Thunder.jpg&quot; width=&quot;255&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Una vez que tuve el SnoopyPro ejecutándose, tuve que conectar el Missile Launcher y presionar en File --&amp;gt; Unpack Drivers…&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-KMjRv5LEh9M/VfCBfUNd4wI/AAAAAAAAEgw/PokVNWhhVrI/s1600/USB_Devices_Menu.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/-KMjRv5LEh9M/VfCBfUNd4wI/AAAAAAAAEgw/PokVNWhhVrI/s1600/USB_Devices_Menu.jpg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;Luego, tuve que buscar el IdVendor y IdProduct correctos y presionar click derecho y seleccionar Install and Restart.&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-la78zIeVgNQ/VfCBsR6CcxI/AAAAAAAAEg4/lAv0OTRkJHA/s1600/USB_Devices.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;271&quot; src=&quot;http://4.bp.blogspot.com/-la78zIeVgNQ/VfCBsR6CcxI/AAAAAAAAEg4/lAv0OTRkJHA/s400/USB_Devices.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Esto nos permite registrar todo lo que pasa cuando utilizámos el dispositivo USB. Por defecto, por lo menos para el Missile Launcher…va a hacer un log de 14 líneas que realmente no nos interesan mucho…pero cuando presionamos por el ejemplo el botón Up…entonces obtenemos información más interesánte…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-hfe6RR9r-Do/VfCB2FOfkiI/AAAAAAAAEhA/FP7ee6I2U4Q/s1600/UpButton.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;183&quot; src=&quot;http://1.bp.blogspot.com/-hfe6RR9r-Do/VfCB2FOfkiI/AAAAAAAAEhA/FP7ee6I2U4Q/s400/UpButton.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Esto nos dice basicamente que para hacer que el lanza misiles se mueva para arriba, debemos pasar lo siguiente…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;b&gt;0x02 0x02 0x00 0x00 0x00 0x00 0x00 0x00&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Ahora…la parte que nos interesa es la de disparar…así que vamos a explorarla…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-e0-IxPtakEg/VfCCAbaVgeI/AAAAAAAAEhI/77c48vutXhs/s1600/FireButton.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; src=&quot;http://2.bp.blogspot.com/-e0-IxPtakEg/VfCCAbaVgeI/AAAAAAAAEhI/77c48vutXhs/s400/FireButton.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Esta es&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;b&gt;0x02 0x10 0x00 0x00 0x00 0x00 0x00 0x00&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Perfecto!…ahora nos estamos acercándo…pero…hay una parte que nos está faltándo…como enviamos este comando? Fácil…solo debemos ver el comándo de transferencia…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-bgvq5vXR0W4/VfCCJP9k5RI/AAAAAAAAEhQ/Acst0Np7rMw/s1600/Transfer_Command.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;http://2.bp.blogspot.com/-bgvq5vXR0W4/VfCCJP9k5RI/AAAAAAAAEhQ/Acst0Np7rMw/s400/Transfer_Command.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Este comándo nos dice que debemos pasar la información así…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;b&gt;0x21 0x09 0 0&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Seguido de la acción que queremos realizar…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Para poder utilizar este dispositivo en nuestro BeagleBone…debemos instalar algo primero…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;b&gt;pip install pysub&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Esta librería nos permite conectárnos y más importánte, enviar comándos al dispositivo.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Como vamos a utilizar el lanza misilies y la camara, ambas al mismo tiempo…necesitamos un Hub USB con corriente externa…de otra manera, nunca va a funcionar…yo compré este de&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.amazon.com/gp/product/B00DQFGH80/ref=oh_aui_detailpage_o01_s00?ie=UTF8&amp;amp;psc=1&quot;&gt;Amazon&lt;/a&gt;.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Así que…conectamos el Hub USB y conectamos la camara Web y el lanza misiles, conectamos el Hub al BeagleBone Black y luego conectamos el BeagleBone a nuestra laptop…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Utilicen Nano u otro editor de su preferencia y creen el archivo Thunder.py&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Thunder.py&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;import cv2&lt;br /&gt;import numpy as np&lt;br /&gt;import usb.core&lt;br /&gt;&lt;br /&gt;cam = cv2.VideoCapture(-1)&lt;br /&gt;cam.set(3, 960)&lt;br /&gt;cam.set(4,720)&lt;br /&gt;s, img = cam.read()&lt;br /&gt;&lt;br /&gt;dev = usb.core.find(idVendor=0x2123,idProduct=0x1010)&lt;br /&gt;try:&lt;br /&gt;            dev.detach_kernel_driver(0)&lt;br /&gt;except Exception, e:&lt;br /&gt;            pass&lt;br /&gt;&lt;br /&gt;winName = &quot;Thunder&quot;&lt;br /&gt;cv2.namedWindow(winName, cv2.CV_WINDOW_AUTOSIZE)&lt;br /&gt;while s:&lt;br /&gt;        s, img = cam.read()&lt;br /&gt;        key = cv2.waitKey(10)&lt;br /&gt;        if key == 27:&lt;br /&gt;                cv.destroyWindow(winName)&lt;br /&gt;                break&lt;br /&gt;        hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)&lt;br /&gt;              lower_green = np.array([38, 100, 50])&lt;br /&gt;              upper_green = np.array([75, 255, 255])&lt;br /&gt;&lt;br /&gt;        mask = cv2.inRange(hsv, lower_green, upper_green)&lt;br /&gt;        res = cv2.bitwise_and(img,img, mask=mask)&lt;br /&gt;        cv2.imshow(winName, res)&lt;br /&gt;&lt;br /&gt;        if cv2.countNonZero(mask) &amp;gt; 61000:&lt;br /&gt;                dev.ctrl_transfer(0x21, 0x09, 0, 0,&lt;br /&gt;                                  [0x02, 0x010, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Este código va a basicamente abrir la conexión de la camara, y mostrar un fondo negro para que solo el color que queremos sea mostrado. En este caso, queremos disparar el lanza misilies solamente cuando veamos algo “verde”. Como pueden ver estamos pasándo el comándo de transferecia como un parámetro simple pero el comando de fuego como un arreglo.&lt;br /&gt;&lt;br /&gt;Ahora…el BeagleBone no tiene una pantalla…así que puedes agregar un monitor y un teclado o puedes hacer algo más interesánte y astuto…&lt;br /&gt;&lt;br /&gt;Vamos a instalar el Tight VNC Server&lt;br /&gt;&lt;br /&gt;&lt;b&gt;sudo apt-get install tightvncserver&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;La primera vez que lo ejecutas, te va preguntar por un password para el usuario actual, así que proporcionale uno…&lt;br /&gt;&lt;br /&gt;Y va a comenzar a ejecutarse…así que vamos a poder abrir una conexión de escritorio remoto para nuestro BeagleBone…ahora solo necesitamos un cliente para poder conectarnos...&lt;br /&gt;&lt;br /&gt;Si estás utilizándo Windows puedes descargar el cleinte TightVNC de aquí…&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.tightvnc.com/download/2.7.10/tightvnc-2.7.10-setup-64bit.msi&quot;&gt;http://www.tightvnc.com/download/2.7.10/tightvnc-2.7.10-setup-64bit.msi&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.tightvnc.com/download/2.7.10/tightvnc-2.7.10-setup-32bit.msi&quot;&gt;http://www.tightvnc.com/download/2.7.10/tightvnc-2.7.10-setup-32bit.msi&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Si estás utilizándo Linux simplemente puedes descargarlo utilizándo apt-get install así…&lt;br /&gt;&lt;br /&gt;&lt;b&gt;sudo apt-get install xtightvncviewer&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Ejecútalo en el terminal...&lt;br /&gt;&lt;br /&gt;Solo debes proporcionar el IP de tu BeagleBone que debería de ser 192.168.7.2:1 en la pequeña pantalla que va a aparecer, provee el password que creaste para el VNCServer en la pantalla siguiente y estaremos listos…&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-M01-Ek5ephU/VfCC1E_PTEI/AAAAAAAAEhY/luI711_xl68/s1600/VNC_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-M01-Ek5ephU/VfCC1E_PTEI/AAAAAAAAEhY/luI711_xl68/s1600/VNC_01.jpg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-2BI2E0_HlNY/VfCC1N4ht5I/AAAAAAAAEhg/zlPeDS7PrVI/s1600/VNC_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://2.bp.blogspot.com/-2BI2E0_HlNY/VfCC1N4ht5I/AAAAAAAAEhg/zlPeDS7PrVI/s1600/VNC_02.jpg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-uKEeANjT7rw/VfCC1FP6NCI/AAAAAAAAEhc/ovHZssbu9Ok/s1600/VNC_03.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;248&quot; src=&quot;http://1.bp.blogspot.com/-uKEeANjT7rw/VfCC1FP6NCI/AAAAAAAAEhc/ovHZssbu9Ok/s320/VNC_03.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Si estás utilizándo Windows…simplemente haz doble click en el tightvnc-jviewer.jar e introduce la siguiente información…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-kLajuYLFwPo/VfCC_qWDwiI/AAAAAAAAEhw/dK3pyn5EI5Q/s1600/VNC_Win_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;187&quot; src=&quot;http://1.bp.blogspot.com/-kLajuYLFwPo/VfCC_qWDwiI/AAAAAAAAEhw/dK3pyn5EI5Q/s320/VNC_Win_01.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-5c5WQH_B1gU/VfCC_tYmz2I/AAAAAAAAEh0/coB0zjx90DY/s1600/VNC_Win_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;188&quot; src=&quot;http://4.bp.blogspot.com/-5c5WQH_B1gU/VfCC_tYmz2I/AAAAAAAAEh0/coB0zjx90DY/s320/VNC_Win_02.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-RFRUeoI2Btg/VfCC_hUwdEI/AAAAAAAAEh8/WyLTDyt5y8E/s1600/VNC_Win_03.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;257&quot; src=&quot;http://2.bp.blogspot.com/-RFRUeoI2Btg/VfCC_hUwdEI/AAAAAAAAEh8/WyLTDyt5y8E/s320/VNC_Win_03.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Para poder probar esto, solo necesitamos imprimir una bonita caja verde…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-1IolFmUtoEY/VfCDL3uVQgI/AAAAAAAAEiI/NXaGyA4cJGw/s1600/Green_Box.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://2.bp.blogspot.com/-1IolFmUtoEY/VfCDL3uVQgI/AAAAAAAAEiI/NXaGyA4cJGw/s400/Green_Box.jpg&quot; width=&quot;300&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Luego, podemos ejecutar la aplicación…&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-4kuPLsDZ9wM/VfCDTt5KAgI/AAAAAAAAEiQ/YEp-ED_Kq5c/s1600/Running_App.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://2.bp.blogspot.com/-4kuPLsDZ9wM/VfCDTt5KAgI/AAAAAAAAEiQ/YEp-ED_Kq5c/s400/Running_App.jpg&quot; width=&quot;300&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;Y poner la caja verde en frente de la camara -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;span style=&quot;background-color:white;color:#333333;font-family:Arial, Helvetica, clean, sans-serif;font-size:14px;line-height:21px;text-align:left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-dIlB61P_mVg/VfCDadFqfxI/AAAAAAAAEiY/AqcKQoiU9v0/s1600/Firing_Up.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://3.bp.blogspot.com/-dIlB61P_mVg/VfCDadFqfxI/AAAAAAAAEiY/AqcKQoiU9v0/s400/Firing_Up.jpg&quot; width=&quot;300&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;Disculpen por la foto media movida…pero el lanza misiles estaba disparándo y tenía mi celular en una mano y la hoja con la caja verde en la otra -;) &lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;Saludos,&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:left;&quot;&gt;Development Culture.&lt;/div&gt;</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-1727372679379481672</guid>
         <pubDate>Wed, 09 Sep 2015 12:42:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s72-c/d_shop_blog_logo.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Nest Thermostat y R - Creándo un Dashboard con Shiny</title>
         <link>http://atejada.blogspot.com/2015/09/nest-thermostat-y-r-creando-un.html</link>
         <description>&lt;h2 style=&quot;text-align:center;&quot;&gt;&lt;b&gt;Este post fué posteado originalmente en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://scn.sap.com/community/innovation-management/blog/2015/09/09/nest-thermostat-and-r--creating-a-shiny-dashboard&quot;&gt;Nest Thermostat and R - Creating a Shiny dashboard&lt;/a&gt;.&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s1600/d_shop_blog_logo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s400/d_shop_blog_logo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;b&gt;Si eres un empleado de SAP, por favor siguenos en&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://jam4.sapjam.com/groups/about_page/sh2Kp26QQkHwkMPFAEqAD9&quot;&gt;Jam&lt;/a&gt;.&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:center;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align:justify;&quot;&gt;&lt;div&gt;En el d-shop siempre estamos buscándo jugar con las últimas tecnologías...y &amp;nbsp;pesar de que el&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://nest.com/thermostat/meet-nest-thermostat/&quot;&gt;Nest Thermostat&lt;/a&gt; no es realmente &quot;nuevo&quot;, estámos en el proceso de adquirir uno.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Por ahora, estamos felices de poder jugar un poco con el&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://developer.nest.com/documentation/cloud/home-simulator/&quot;&gt;Nest Home Simulator&lt;/a&gt; disponible en la tienda de Google Chrome.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;En este blog, vamos a utilizar el Nest Home Simulator, el lenguaje de programación estadístico&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.r-project.org/&quot;&gt;R&lt;/a&gt; y el&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://shiny.rstudio.com/&quot;&gt;Shiny package&lt;/a&gt;, que nos permite crear impresionántes páginas web para manejar datos. También, vamos a necesitar el&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://cran.r-project.org/web/packages/rjson/index.html&quot;&gt;RJson package&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;El primer paso va a ser crear un usuario en el &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://developer.nest.com/&quot;&gt;Nest Developer Program&lt;/a&gt; e instalar Nest Home Simulator.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-QktSfZ3bB5A/VfByhEUUI8I/AAAAAAAAEfY/x9vjePi-v6U/s1600/Nest_Simulator.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;176&quot; src=&quot;http://3.bp.blogspot.com/-QktSfZ3bB5A/VfByhEUUI8I/AAAAAAAAEfY/x9vjePi-v6U/s400/Nest_Simulator.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Cuándo nos logeamos en el Simulador, vamos a poder crear un termóstato para poder comenzar a jugar con las temperaturas actual y proyectada...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-GbglmE1LJBM/VfByqrzgwfI/AAAAAAAAEfg/Vm0DZJVX4wM/s1600/Nest_Simulator_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;287&quot; src=&quot;http://2.bp.blogspot.com/-GbglmE1LJBM/VfByqrzgwfI/AAAAAAAAEfg/Vm0DZJVX4wM/s400/Nest_Simulator_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;El segundo punto importánte, es que cuando estemos logeados en el Nest Developer Program vamos a poder crear un cliente que se va a comunicar con nuestro termostato y también, vamos a poder generar un número especial con el cual vamos a poder interactuar con el mismo.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-IGkcRf_e2Y0/VfByz7RI2DI/AAAAAAAAEfo/qoV_sHnLzjQ/s1600/Nest_Developers.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;236&quot; src=&quot;http://3.bp.blogspot.com/-IGkcRf_e2Y0/VfByz7RI2DI/AAAAAAAAEfo/qoV_sHnLzjQ/s400/Nest_Developers.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Solo necesitamos copiar y pegar el URL del Authorization URL y luego de aceptar las condiciones un número va a ser presentado...vamos a necesitar este número para nuestro código en R...pero tengan en cuenta que una vez que se cierra la conexión, vamos a tener que generar un número nuevo...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/--96GZNoT2xY/VfBy-46kkWI/AAAAAAAAEfw/38pfCh-G9dU/s1600/Works_with_Nest.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://2.bp.blogspot.com/--96GZNoT2xY/VfBy-46kkWI/AAAAAAAAEfw/38pfCh-G9dU/s400/Works_with_Nest.jpg&quot; width=&quot;322&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Ahora, estamos listos para poder comenzar a programar un poco...cuando trabajamos con R, es siempre mejor utilizar&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.rstudio.com/&quot;&gt;RStudio&lt;/a&gt;...así que copien y peguen este código...y recuerden reemplazar el valir de la variable code con su propio número...también van a tener que reemplazar el Client ID y el Client Secret con la información del Cliente de su Nest Developer Program...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Nest_Dashboard.R&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;library(&quot;shiny&quot;)&lt;br /&gt;library(&quot;rjson&quot;)&lt;br /&gt;&lt;br /&gt;if(!exists(&quot;access_code&quot;)){&lt;br /&gt;  code&amp;lt;-&quot;XXX&quot;&lt;br /&gt;  info_data&amp;lt;-data.frame(Humidity=integer(),&lt;/pre&gt;&lt;pre&gt;  Current_Temperature=integer(),Target_Temperature=integer(),Times=character())&lt;br /&gt;  access_code&amp;lt;-system(sprintf('curl -X POST&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;  &quot;https://api.home.nest.com/oauth2/access_token?client_id=XXX&amp;amp;code=%s&amp;amp;&lt;/pre&gt;&lt;pre&gt;  client_secret=XXX&amp;amp;grant_type=authorization_code&quot;',code),intern=T)&lt;br /&gt;  document&amp;lt;-fromJSON(access_code)&lt;br /&gt;  access&amp;lt;-document$access_token&lt;br /&gt;  devices&amp;lt;-paste(&quot;https://developer-api.nest.com/devices?auth=&quot;,access,sep=&quot;&quot;)&lt;br /&gt;  all_devices&amp;lt;-system(sprintf('curl -L -X GET -H &quot;Accept: application/json&quot; &quot;%s&quot;',devices),intern=T)&lt;br /&gt;  device&amp;lt;-gsub(&quot;thermostats|:|{|&amp;#92;&quot;|humidity.*&quot;,&quot;&quot;,all_devices,perl=T)&lt;br /&gt;  themostat_code&amp;lt;-paste(&quot;https://developer-api.nest.com/devices/thermostats/&quot;,device,&quot;?auth=&quot;,access,sep=&quot;&quot;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;get_nest_info = function(info_data){&lt;br /&gt;    thermostat&amp;lt;-system(sprintf('curl -L -X GET -H &quot;Accept: application/json&quot; &quot;%s&quot;',themostat_code),intern=T)&lt;br /&gt;    info&amp;lt;-fromJSON(thermostat)&lt;br /&gt;    timeframe&amp;lt;-Sys.time()&lt;br /&gt;    timeframe&amp;lt;-gsub(&quot;&amp;#92;&amp;#92;d+-&amp;#92;&amp;#92;d+-&amp;#92;&amp;#92;d+&amp;#92;&amp;#92;s&quot;,&quot;&quot;,timeframe)&lt;br /&gt;    new_data&amp;lt;-data.frame(Humidity=info$humidity,Current_Temperature=info$ambient_temperature_f,&lt;/pre&gt;&lt;pre&gt;    Target_Temperature=info$target_temperature_f,Times=timeframe,stringsAsFactors = F)&lt;br /&gt;    if(nrow(info_data)==10){&lt;br /&gt;      info_data&amp;lt;-info_data[-1,]&lt;br /&gt;    }&lt;br /&gt;    info_data&amp;lt;-rbind(info_data,new_data)&lt;br /&gt;  return(info_data)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;runApp(list(&lt;br /&gt;  ui = pageWithSidebar(    &lt;br /&gt;    &lt;br /&gt;    headerPanel(&quot;Nest Dashboard&quot;),&lt;br /&gt;    &lt;br /&gt;    sidebarPanel(&lt;br /&gt;    ),&lt;br /&gt;    &lt;br /&gt;    mainPanel(&lt;br /&gt;      plotOutput(&quot;nestPlot&quot;)&lt;br /&gt;    )&lt;br /&gt;  ),&lt;br /&gt;  server =function(input, output, session) {&lt;br /&gt;    autoInvalidate &amp;lt;- reactiveTimer(10000, session)&lt;br /&gt;      output$nestPlot &amp;lt;- renderPlot({&lt;br /&gt;        autoInvalidate()&lt;br /&gt;        info_data&amp;lt;&amp;lt;-get_nest_info(info_data) &lt;br /&gt;        plot(info_data$Current_Temperature,type=&quot;n&quot;,axes=F,ann=F)&lt;br /&gt;        lines(info_data$Current_Temperature,col=&quot;blue&quot;)&lt;br /&gt;        lines(info_data$Target_Temperature,col=&quot;red&quot;)&lt;br /&gt;        points(info_data$Current_Temperature, pch=21, bg=&quot;lightcyan&quot;, cex=1.25)&lt;br /&gt;        points(info_data$Target_Temperature, pch=21, bg=&quot;lightcyan&quot;, cex=1.25)&lt;br /&gt;        box()&lt;br /&gt;        xy&amp;lt;-length(info_data$Times)&lt;br /&gt;        axis(2, col.axis=&quot;blue&quot;, las=1)&lt;br /&gt;        axis(1, at=1:xy, lab=info_data$Times, col.axis=&quot;purple&quot;)&lt;br /&gt;        legend(&quot;topright&quot;,c(&quot;Current Temp&quot;,&quot;Target Temp&quot;),lty=c(1,1),col=c(&quot;blue&quot;,&quot;red&quot;),bty=&quot;n&quot;)&lt;br /&gt;    })&lt;br /&gt;  }&lt;br /&gt;))&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Este código va a obtener 10 medidas antes de refrescarse a si mismo y obtener 10 nuevas medidas. Así que podemos actualizar las temperaturas actuales y proyectadas para poder ver como el Dashboard cambia...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-zQhCtp8d6rw/VfB0Xfc5_AI/AAAAAAAAEf8/-JZ70hsVUsg/s1600/Nest_Dashboard_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;324&quot; src=&quot;http://1.bp.blogspot.com/-zQhCtp8d6rw/VfB0Xfc5_AI/AAAAAAAAEf8/-JZ70hsVUsg/s640/Nest_Dashboard_01.jpg&quot; width=&quot;640&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-2QIvhjhUFZ8/VfB0XBZIsAI/AAAAAAAAEgA/conE1er5OC4/s1600/Nest_Dashboard_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;324&quot; src=&quot;http://3.bp.blogspot.com/-2QIvhjhUFZ8/VfB0XBZIsAI/AAAAAAAAEgA/conE1er5OC4/s640/Nest_Dashboard_02.jpg&quot; width=&quot;640&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.&lt;/div&gt;&lt;/div&gt;</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-5103457360713267239</guid>
         <pubDate>Wed, 09 Sep 2015 11:18:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-NDPJAvVqxXM/VfBx6-s4OuI/AAAAAAAAEfQ/-xuDIexUihM/s72-c/d_shop_blog_logo.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED es mi nuevo Hello World - Tiempo de Mercury</title>
         <link>http://atejada.blogspot.com/2015/08/led-es-mi-nuevo-hello-world-tiempo-de.html</link>
         <description>Este fué un poco complicado y más extenso de lo que había planeado...además...me forzó a pasar bastante tiempo leyendo la documentación puesto que no hay muchos tutoriales o libros sobre Mercury...&lt;br /&gt;&lt;br /&gt;En fín...a las finales está funcionando bien, así que estoy bastánte feliz -:)&lt;br /&gt;&lt;br /&gt;Mercury tiene muchas funciones bastante convenientes...solo tienes que encontrárlas -;)&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;led_numbers.m&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;:- module led_numbers.&lt;br /&gt;:- interface.&lt;br /&gt;:- import_module io.&lt;br /&gt;&lt;br /&gt;:- pred main(io::di, io::uo) is det.&lt;br /&gt;&lt;br /&gt;:- implementation.&lt;br /&gt;:- import_module list, string, int, array, char.&lt;br /&gt;&lt;br /&gt;:- pred get_leds(list.list(character)::in, list.list(character)::in, &lt;br /&gt;                 int::in, list.list(string)::out ) is det.&lt;br /&gt; &lt;br /&gt;get_leds(LDIGITS, LDIGITS_AUX, N, RESPONSE) :-&lt;br /&gt; (&lt;br /&gt;  LEDS = array([array([&quot; _  &quot;,&quot;| | &quot;,&quot;|_| &quot;]),&lt;br /&gt;                array([&quot;  &quot;,&quot;| &quot;,&quot;| &quot;]),&lt;br /&gt;                array([&quot; _  &quot;,&quot; _| &quot;,&quot;|_  &quot;]),&lt;br /&gt;                array([&quot;_  &quot;,&quot;_| &quot;,&quot;_| &quot;]),&lt;br /&gt;                array([&quot;    &quot;,&quot;|_| &quot;,&quot;  | &quot;]),&lt;br /&gt;                array([&quot; _  &quot;,&quot;|_  &quot;,&quot; _| &quot;]),&lt;br /&gt;                array([&quot; _  &quot;,&quot;|_  &quot;,&quot;|_| &quot;]),&lt;br /&gt;                array([&quot;_   &quot;,&quot; |  &quot;,&quot; |  &quot;]),&lt;br /&gt;                array([&quot; _  &quot;,&quot;|_| &quot;,&quot;|_| &quot;]),&lt;br /&gt;                array([&quot; _  &quot;,&quot;|_| &quot;,&quot; _| &quot;])&lt;br /&gt;               ]),&lt;br /&gt;  list.length(LDIGITS,LEN),&lt;br /&gt;  ( if LEN &amp;gt; 0 then&lt;br /&gt;   HEAD = det_head(LDIGITS),&lt;br /&gt;   TAIL = det_tail(LDIGITS),&lt;br /&gt;   char.to_int(HEAD, HEAD_I:int),&lt;br /&gt;   HEAD_N:int = HEAD_I - 48,&lt;br /&gt;   LINE = elem(HEAD_N, LEDS),&lt;br /&gt;   SUB_LINE = elem(N, LINE),&lt;br /&gt;   get_leds(TAIL, LDIGITS_AUX, N, RESULT),&lt;br /&gt;   RESPONSE = [SUB_LINE] ++ RESULT&lt;br /&gt;    else if N &amp;lt; 2 then&lt;br /&gt;   get_leds(LDIGITS_AUX, LDIGITS_AUX, N+1, RESULT),&lt;br /&gt;   RESPONSE = [&quot;&amp;#92;n&quot;]  ++ RESULT&lt;br /&gt;    else if N = 2 then&lt;br /&gt;   RESPONSE = [&quot;&amp;#92;n&quot;]&lt;br /&gt;    else&lt;br /&gt;   RESPONSE = [] )&lt;br /&gt; ). &lt;br /&gt; &lt;br /&gt;main(!IO) :-&lt;br /&gt; io.write_string(&quot;Enter a number: &quot;,!IO),&lt;br /&gt; io.read_line_as_string(Result, !IO),&lt;br /&gt; ( if&lt;br /&gt;   Result = ok(String),&lt;br /&gt;   NUM = string.strip(String),&lt;br /&gt;   to_char_list(NUM,LDIGITS),&lt;br /&gt;   get_leds(LDIGITS, LDIGITS, 0, RESPONSE)&lt;br /&gt;  then&lt;br /&gt;   io.write_string(string.join_list(&quot;&quot;, RESPONSE), !IO)&lt;br /&gt;  else&lt;br /&gt;   io.write_string(&quot;Not a number...&quot;,!IO)&lt;br /&gt; ).&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;En fín...aquí están las pantallas -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-YMD8zf9pVqs/VciweojZ6OI/AAAAAAAAEeo/TJ9M45ig1Uw/s1600/LED_Mercury_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;242&quot; src=&quot;http://3.bp.blogspot.com/-YMD8zf9pVqs/VciweojZ6OI/AAAAAAAAEeo/TJ9M45ig1Uw/s400/LED_Mercury_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-d5hbBFSnNUk/VciwiXhUegI/AAAAAAAAEe0/Y9SyEoYsL4I/s1600/LED_Mercury_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;227&quot; src=&quot;http://4.bp.blogspot.com/-d5hbBFSnNUk/VciwiXhUegI/AAAAAAAAEe0/Y9SyEoYsL4I/s400/LED_Mercury_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Espero que les guste -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Saludos,&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Development Culture.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-3331077588257082313</guid>
         <pubDate>Mon, 10 Aug 2015 07:15:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://3.bp.blogspot.com/-YMD8zf9pVqs/VciweojZ6OI/AAAAAAAAEeo/TJ9M45ig1Uw/s72-c/LED_Mercury_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Mi primer post en Mercury</title>
         <link>http://atejada.blogspot.com/2015/08/mi-primer-post-en-mercury.html</link>
         <description>Así que...mi nuevo lenguaje para el próximo par de semanas...es &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://www.mercurylang.org/index.html&quot;&gt;Mercury&lt;/a&gt; -:)&lt;br /&gt;&lt;br /&gt;Seguro se preguntarán...qué es Mercury?&lt;br /&gt;&lt;br /&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;b&gt;Mercury se ve como Prolog, pero se siente como un Haskell estricto o un OCaml puro.&lt;/b&gt;&lt;/blockquote&gt;En otras palabras, es un lenguaje de programación lógico, funcional y orientado a objetos...&lt;br /&gt;&lt;br /&gt;Como siempre...necesitaba crear una aplicación para poder aprender a usarlo...y a pesar de que me dió más de un dolor de cabeza...aquí está -;)&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;fibo.m&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;:- module fibo.&lt;br /&gt;:- interface.&lt;br /&gt;:- import_module io.&lt;br /&gt;&lt;br /&gt;:- pred main(io::di, io::uo) is det.&lt;br /&gt;&lt;br /&gt;:- implementation.&lt;br /&gt;:- import_module string, int.&lt;br /&gt;&lt;br /&gt;:- pred fibo(int::in, int::in, int::in, string::out) is det.&lt;br /&gt;&lt;br /&gt;fibo(NUM, A, B, FIBS) :-&lt;br /&gt; ( &lt;br /&gt;  if A = 0 &lt;br /&gt;  then fibo(NUM-1,A+B,B,FIB), FIBS = int_to_string(A) ++ &quot; &quot; ++ int_to_string(B) ++ &lt;br /&gt;                                     &quot; &quot; ++ int_to_string(A+B) ++ &quot; &quot; ++ FIB&lt;br /&gt;  else if A &amp;gt; 0, NUM &amp;gt; 1&lt;br /&gt;  then fibo(NUM-1,A+B,A,FIB), FIBS = int_to_string(A+B) ++ &quot; &quot; ++ FIB&lt;br /&gt;  else FIBS = &quot;&quot;&lt;br /&gt; ).&lt;br /&gt; &lt;br /&gt;main(!IO) :-&lt;br /&gt; io.write_string(&quot;Enter a number: &quot;,!IO),&lt;br /&gt; io.read_line_as_string(Result, !IO),&lt;br /&gt; ( if&lt;br /&gt;   Result = ok(String),&lt;br /&gt;   string.to_int(string.strip(String), N)&lt;br /&gt;  then&lt;br /&gt;   fibo(N,0,1,FIBS),&lt;br /&gt;   io.write_string(FIBS,!IO)&lt;br /&gt;  else&lt;br /&gt;   io.write_string(&quot;Not a number...&quot;,!IO)&lt;br /&gt; ).&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Lo que me encantá de Mercury es que te obliga a no dejar que tu aplicación falle...puesto que el &quot;else&quot; es obligatorio...si ingresas un número entonces está bien...pero si ingresas una letra, estás obligado a hacer algo...&lt;br /&gt;&lt;br /&gt;Aquí están las imágenes...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-QRWCfoJIdck/VcJVZnvbKvI/AAAAAAAAEeI/8pJpiA89gtg/s1600/Mercury_Fibo_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;206&quot; src=&quot;http://1.bp.blogspot.com/-QRWCfoJIdck/VcJVZnvbKvI/AAAAAAAAEeI/8pJpiA89gtg/s400/Mercury_Fibo_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-CfOh1EmIpWM/VcJVdno_sZI/AAAAAAAAEeQ/w72Dk0M4M3w/s1600/Mercury_Fibo_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;208&quot; src=&quot;http://3.bp.blogspot.com/-CfOh1EmIpWM/VcJVdno_sZI/AAAAAAAAEeQ/w72Dk0M4M3w/s400/Mercury_Fibo_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;Ahora...solo tengo que romperme la cabeza un poco más tratando de hacer mi aplicación de Números LED -:D&lt;br /&gt;&lt;br /&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-5006547321289160545</guid>
         <pubDate>Wed, 05 Aug 2015 11:35:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-QRWCfoJIdck/VcJVZnvbKvI/AAAAAAAAEeI/8pJpiA89gtg/s72-c/Mercury_Fibo_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED es mi nuevo Hello World - Tiempo de Zonnon</title>
         <link>http://atejada.blogspot.com/2015/07/led-es-mi-nuevo-hello-world-tiempo-de_31.html</link>
         <description>Sabían que esto se venía...no? -;)&lt;br /&gt;&lt;br /&gt;Aquí...tuve que tomar otro formato porque Zonnon no tiene un comando split como parte de su sintáxis...y también porque no estoy seguro de como crear un array de arrays y porque no pude hacer que mi procedimiento retorno un array para luego asignarlo a otro array -:(&lt;br /&gt;&lt;br /&gt;Aún así...estoy bastante feliz con el resultado -:D&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;LED_Numbers.znn&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;module LED_Numbers;&lt;br /&gt;&lt;br /&gt;var num, text, concat:string;&lt;br /&gt;var leds:array 10 of string;&lt;br /&gt;var led:array 3 of string;&lt;br /&gt;var i, j, z, len, lenled:integer; &lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt; leds[0]:=&quot; _  ,| | ,|_| ,&quot;;&lt;br /&gt; leds[1]:=&quot;  ,| ,| ,&quot;;&lt;br /&gt; leds[2]:=&quot; _  , _| ,|_  ,&quot;;&lt;br /&gt; leds[3]:=&quot;_  ,_| ,_| ,&quot;;&lt;br /&gt; leds[4]:=&quot;    ,|_| ,  | ,&quot;;&lt;br /&gt; leds[5]:=&quot; _  ,|_  , _| ,&quot;;&lt;br /&gt; leds[6]:=&quot; _  ,|_  ,|_| ,&quot;;&lt;br /&gt; leds[7]:=&quot;_   , |  , |  ,&quot;;&lt;br /&gt; leds[8]:=&quot; _  ,|_| ,|_| ,&quot;;&lt;br /&gt; leds[9]:=&quot; _  ,|_| , _| ,&quot;;&lt;br /&gt; write(&quot;Enter a number: &quot;);readln(num);&lt;br /&gt; len:=num.Length;&lt;br /&gt; for j:=0 to len - 1 do&lt;br /&gt;  i:=0;&lt;br /&gt;  text:=leds[integer(num[j])-48];&lt;br /&gt;  lenled:=text.Length;&lt;br /&gt;  for z:= 0 to lenled - 1 do&lt;br /&gt;   if text[z] # &quot;,&quot; then&lt;br /&gt;    concat:= concat + string(text[z]);&lt;br /&gt;   else&lt;br /&gt;    led[i]:=led[i] + concat;&lt;br /&gt;    concat:=&quot;&quot;;&lt;br /&gt;    i:= i + 1;&lt;br /&gt;   end;&lt;br /&gt;  end;&lt;br /&gt; end; &lt;br /&gt; writeln(led[0]);&lt;br /&gt; writeln(led[1]);&lt;br /&gt; writeln(led[2]);&lt;br /&gt;end LED_Numbers.&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;En fín...aquí hay algunas imagnes -;)&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-va6bZjHYUlE/Vbvr8B4U-nI/AAAAAAAAEdk/vM_bnk175-4/s1600/Zonnon_LED_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;266&quot; src=&quot;http://3.bp.blogspot.com/-va6bZjHYUlE/Vbvr8B4U-nI/AAAAAAAAEdk/vM_bnk175-4/s400/Zonnon_LED_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-ipL7FfovJIg/Vbvr_3T7BNI/AAAAAAAAEds/GrOa6VkHCrk/s1600/Zonnon_LED_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;268&quot; src=&quot;http://1.bp.blogspot.com/-ipL7FfovJIg/Vbvr_3T7BNI/AAAAAAAAEds/GrOa6VkHCrk/s400/Zonnon_LED_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-4704226264298642957</guid>
         <pubDate>Fri, 31 Jul 2015 14:47:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://3.bp.blogspot.com/-va6bZjHYUlE/Vbvr8B4U-nI/AAAAAAAAEdk/vM_bnk175-4/s72-c/Zonnon_LED_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Mi primer post en Zonnon</title>
         <link>http://atejada.blogspot.com/2015/07/mi-primer-post-en-zonnon.html</link>
         <description>Como siempre...estaba buscándo nuevos y emocionantes lenguajes de programación para aprender...y &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://twitter.com/thulium3&quot;&gt;Mark Teichmann&lt;/a&gt; me pasó el dato de un muy bueno -;) El lenguaje de programación&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.zonnon.ethz.ch/&quot;&gt;Zonnon&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;Así que...que es Zonnon?&amp;nbsp;Zonnon es un lenguaje de programación multi-propósito en la familia de Pascal, Modula-2 y Oberon...y corre en .NET/Mono...&lt;br /&gt;&lt;span style=&quot;background-color:white;font-family:arial, helvetica, geneva;font-size:13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:arial, helvetica, geneva;&quot;&gt;&lt;span style=&quot;font-size:13.3333px;&quot;&gt;Ha pasado bastante tiempo desde la última vez que utilicé&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://en.wikipedia.org/wiki/Pascal_(programming_language)&quot;&gt;Pascal&lt;/a&gt; o&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://en.wikipedia.org/wiki/Delphi_(programming_language)&quot;&gt;Delphi&lt;/a&gt;...pero...tal como montar una bicicleta...el conocimiento regresó a mi apenas comencé a programar algunas líneas -;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial, helvetica, geneva;&quot;&gt;&lt;span style=&quot;font-size:13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family:arial, helvetica, geneva;&quot;&gt;&lt;span style=&quot;font-size:13.3333px;&quot;&gt;Ahora...el único problema que tengo con Zonnon...es que practicamente no hay documentación...y lo que está disponible está en Ruso...así que...me ayudó bastante Google...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial, helvetica, geneva;&quot;&gt;&lt;span style=&quot;font-size:13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:13.3333px;&quot;&gt;&lt;span style=&quot;background-color:white;font-family:arial, helvetica, geneva;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial, helvetica, geneva;&quot;&gt;&lt;span style=&quot;font-size:13.3333px;&quot;&gt;Aquí esta la aplicación de números Fibonacci Numbers...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color:white;font-family:arial, helvetica, geneva;font-size:13.3333px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;  &lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Fibo.znn&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;module Fibo;&lt;br /&gt;var num: integer;&lt;br /&gt;var a, b: integer;&lt;br /&gt;&lt;br /&gt;procedure fib (var num, a, b : integer): string;&lt;br /&gt;var result: string;&lt;br /&gt;var ab: integer;&lt;br /&gt;begin&lt;br /&gt; result := &quot;&quot;;&lt;br /&gt; if (a &amp;gt; 0) &amp;amp; (num &amp;gt; 1) then&lt;br /&gt;  num := num - 1;&lt;br /&gt;  ab := a + b;&lt;br /&gt;  result := result + string(ab) + &quot; &quot; + fib(num, ab, a);&lt;br /&gt; elsif a == 0 then&lt;br /&gt;  num := num - 1;&lt;br /&gt;  ab := a + b;&lt;br /&gt;  result := string(a) + &quot; &quot; + string(b) + &quot; &quot; + string(ab) + &quot; &quot; + fib(num, ab, b);&lt;br /&gt; end;&lt;br /&gt; return result;&lt;br /&gt;end fib;&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt; a := 0;&lt;br /&gt; b := 1;&lt;br /&gt; write(&quot;Enter a number: &quot;);readln(num);&lt;br /&gt; writeln(fib(num,a,b));&lt;br /&gt; writeln(&quot;&quot;);&lt;br /&gt;end Fibo.&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Y un par de imágenes...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-u2c0Ms3wFSk/VbvgA1izGII/AAAAAAAAEdM/Gz_fw74WCLQ/s1600/Zonnon_Fibo_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;238&quot; src=&quot;http://4.bp.blogspot.com/-u2c0Ms3wFSk/VbvgA1izGII/AAAAAAAAEdM/Gz_fw74WCLQ/s400/Zonnon_Fibo_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/--lugSd_vnLg/VbvgHMVPFpI/AAAAAAAAEdU/mBQBSb0UlYI/s1600/Zonnon_Fibo_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;235&quot; src=&quot;http://2.bp.blogspot.com/--lugSd_vnLg/VbvgHMVPFpI/AAAAAAAAEdU/mBQBSb0UlYI/s400/Zonnon_Fibo_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Necesito seguir jugándo y explorándo Zonnon...aún hay muchas cosas emocionántes que se me están escondiendo -;)&lt;br /&gt;&lt;br /&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-2737820467619918469</guid>
         <pubDate>Fri, 31 Jul 2015 14:10:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-u2c0Ms3wFSk/VbvgA1izGII/AAAAAAAAEdM/Gz_fw74WCLQ/s72-c/Zonnon_Fibo_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED es mi nuevo Hello World - Tiempo de Forth</title>
         <link>http://atejada.blogspot.com/2015/07/led-es-mi-nuevo-hello-world-tiempo-de.html</link>
         <description>Justo como lo estaban esperándo...es nuevamente hora de mi aplicación de Números LED...esta vez...utilizándo Forth -:)&lt;br /&gt;&lt;br /&gt;El código es un poco más largo de lo que hubiera esperado...pero supongo que es porque aún soy un novato en Forth...o porque Forth siendo un lenguaje de programación basado en stack tiene su propia forma de tratar con este tipo de aplicaciones...&lt;br /&gt;&lt;br /&gt;Aquí está el código fuente...disfruténlo! -;)&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;LED_Numbers.fth&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;VARIABLE picky&lt;br /&gt;&lt;br /&gt;: COLLECT_PICKY DUP 1- picky ! ;&lt;br /&gt;&lt;br /&gt;: NPICK COLLECT_PICKY 2 * 0 ?DO picky @ PICK LOOP ;&lt;br /&gt;&lt;br /&gt;: SPLIT BEGIN DUP WHILE 10 /MOD REPEAT DROP DEPTH ;&lt;br /&gt;&lt;br /&gt;: First_Line&lt;br /&gt;  CASE&lt;br /&gt;  0 OF SPACE .&quot; _  &quot; ENDOF 1 OF SPACE SPACE ENDOF&lt;br /&gt;  2 OF SPACE .&quot; _  &quot; ENDOF 3 OF .&quot; _  &quot; ENDOF&lt;br /&gt;  4 OF SPACE SPACE SPACE SPACE ENDOF 5 OF SPACE .&quot; _  &quot; ENDOF&lt;br /&gt;  6 OF SPACE .&quot; _  &quot;ENDOF 7 OF .&quot; _   &quot;  ENDOF &lt;br /&gt;  8 OF SPACE .&quot; _  &quot; ENDOF 9 OF SPACE .&quot; _  &quot; ENDOF&lt;br /&gt;  ENDCASE ;&lt;br /&gt;  &lt;br /&gt;: Second_Line&lt;br /&gt;  CASE&lt;br /&gt;  0 OF .&quot; | | &quot; ENDOF 1 OF .&quot; | &quot; ENDOF&lt;br /&gt;  2 OF SPACE .&quot; _| &quot; ENDOF 3 OF .&quot; _| &quot; ENDOF&lt;br /&gt;  4 OF .&quot; |_| &quot; ENDOF 5 OF .&quot; |_  &quot; ENDOF&lt;br /&gt;  6 OF .&quot; |_  &quot;ENDOF 7 OF SPACE .&quot; |  &quot;  ENDOF &lt;br /&gt;  8 OF .&quot; |_| &quot; ENDOF 9 OF .&quot; |_| &quot; ENDOF&lt;br /&gt;  ENDCASE ;&lt;br /&gt;  &lt;br /&gt;: Third_Line&lt;br /&gt;  CASE&lt;br /&gt;  0 OF .&quot; |_| &quot; ENDOF 1 OF .&quot; | &quot; ENDOF&lt;br /&gt;  2 OF .&quot; |_  &quot; ENDOF 3 OF .&quot; _| &quot; ENDOF&lt;br /&gt;  4 OF SPACE SPACE .&quot; | &quot; ENDOF 5 OF SPACE .&quot; _| &quot; ENDOF&lt;br /&gt;  6 OF .&quot; |_| &quot;ENDOF 7 OF SPACE .&quot; |  &quot;  ENDOF &lt;br /&gt;  8 OF .&quot; |_| &quot; ENDOF 9 OF SPACE .&quot; _| &quot; ENDOF&lt;br /&gt;  ENDCASE ;&lt;br /&gt;&lt;br /&gt;: LED &lt;br /&gt;  SPLIT&lt;br /&gt;  NPICK&lt;br /&gt;  DEPTH 3 / 0 ?DO First_Line LOOP CR&lt;br /&gt;  DEPTH 2 / 0 ?DO Second_Line LOOP CR&lt;br /&gt;  DEPTH 0 ?DO Third_Line LOOP ;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Y por supuesto...quieren ver una imagen...así que aquí les va -;)&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-N1IezKYXBwc/VbEnTFP9WpI/AAAAAAAAEco/miO-F0fONIo/s1600/LED_Numbers_Forth.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;313&quot; src=&quot;http://4.bp.blogspot.com/-N1IezKYXBwc/VbEnTFP9WpI/AAAAAAAAEco/miO-F0fONIo/s400/LED_Numbers_Forth.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Espero que les guste... -:D&lt;br /&gt;&lt;br /&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-5235447687585708039</guid>
         <pubDate>Thu, 23 Jul 2015 10:46:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-N1IezKYXBwc/VbEnTFP9WpI/AAAAAAAAEco/miO-F0fONIo/s72-c/LED_Numbers_Forth.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Mi primer post en Forth</title>
         <link>http://atejada.blogspot.com/2015/07/mi-primer-post-en-forth.html</link>
         <description>Así que...después de mucho tiempo...finalmente me decidí a aprender&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.forth.com/&quot;&gt;Forth&lt;/a&gt;...y si pensé que habría tratado con lenguajes de programación complicados antes...estaba como Jon Snow...no sabía nada -:(&lt;br /&gt;&lt;br /&gt;Forth es un lenguaje de programación basado en stack...lo cual significa que trabaja con un stack basado en la funcionalidad LIFO...Last In - First Out...(Último en entrar - Primero en salir)&lt;br /&gt;&lt;br /&gt;Algo como esto...ingresas 1 2 3 y Forth va a devolverte 3 2 1...extraño, no?&lt;br /&gt;&lt;br /&gt;Por supuesto...comenzé a leer un libro...y a diferencia de las otras veces...lo he terminado hace tiempo...pero con Forth...un solo libro no es suficiente...he estado leyendo y programando como loco...&lt;br /&gt;&lt;br /&gt;El libro es&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.forth.com/starting-forth/&quot;&gt;Starting Forth&lt;/a&gt; por Leo Brodie...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.forth.com/starting-forth/&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://2.bp.blogspot.com/-Fgu6Qdt3COs/Va7ZKqI_1II/AAAAAAAAEcE/tmNntp9ykOs/s400/Starting_Forth.jpg&quot; width=&quot;300&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;El libro en si es bastante bueno...son 166 páginas así que no es muy largo y te da una muy buena introducción al mundo de Forth...por supuesto...como ya lo he dicho...un libro no es suficiente...y aún cuando este libro es muy bueno y altamente recomendado...Forth es un muy dificil de aprender pero aprenderlo es alucinante -:)&lt;br /&gt;&lt;br /&gt;Me tomo mucho tiempo pero finalmente pude terminar el ejempo de mi ya &quot;famoso&quot; Fibonacci Numbers...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Fibo.fth&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;: FIBO &lt;br /&gt;   1 SWAP &lt;br /&gt;   0 DUP . &lt;br /&gt;   ?DO &lt;br /&gt;      DUP . OVER OVER + ROT DROP &lt;br /&gt;   LOOP &lt;br /&gt;   DROP DEPTH &lt;br /&gt;   DEPTH 2 = IF 2DROP 0 THEN &lt;br /&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Se los dije...Forth no es para nada un lenguaje sencillo...y en realidad escribí el código en una sola línea...pero aquí lo puse en líneas diferentes para que sea más claro...&lt;br /&gt;&lt;br /&gt;Veamos una imagen...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-hXpVYCIMdt4/Va7b4htOkFI/AAAAAAAAEcQ/s1tPaFE48wg/s1600/Forth_Fibo.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;262&quot; src=&quot;http://3.bp.blogspot.com/-hXpVYCIMdt4/Va7b4htOkFI/AAAAAAAAEcQ/s1tPaFE48wg/s400/Forth_Fibo.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Estoy seguro de que voy a pasar mucho más tiempo con Forth...puesto que sé que hay mucho por aprender...si te gusta lo que ves...apréndelo también -;) De otro modo...busca algo menos extraño -:)&lt;br /&gt;&lt;br /&gt;Por siacaso...estoy utilizándo pForth...usé gForth cuando recién estaba empezándo pero creo que pForth es más compatible el standard de Forth...&lt;br /&gt;&lt;br /&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-318093797011947366</guid>
         <pubDate>Tue, 21 Jul 2015 17:14:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://2.bp.blogspot.com/-Fgu6Qdt3COs/Va7ZKqI_1II/AAAAAAAAEcE/tmNntp9ykOs/s72-c/Starting_Forth.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Explorando SparkR</title>
         <link>http://atejada.blogspot.com/2015/06/explorando-sparkr.html</link>
         <description>Un compañero de trabajo, me pidió que investigara sobre&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://spark.apache.org/&quot;&gt;Spark&lt;/a&gt;&amp;nbsp;y&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.r-project.org/&quot;&gt;R&lt;/a&gt;. Así que lo más obvio era investigar sobre&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://amplab-extras.github.io/SparkR-pkg/&quot;&gt;SparkR&lt;/a&gt; -;)&lt;br /&gt;&lt;br /&gt;Instalé Scala, Hadoop, Spark y SparkR...no estoy seguro si Hadoop es necesario en este caso...pero quería tener la imagen completa -:)&lt;br /&gt;&lt;br /&gt;En fín...me encontré con un código que lee líneas de un archivo y cuenta cuantas líneas tienen una &quot;a&quot; y cuantas lineas tienen una &quot;b&quot;...&lt;br /&gt;&lt;br /&gt;Para este código utilicé la letra de&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.azlyrics.com/lyrics/afi/girlsnotgrey.html&quot;&gt;Girls Not Grey&lt;/a&gt;&amp;nbsp;por&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://afireinside.net/&quot;&gt;AFI&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;SparkR.R&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;library(SparkR)&lt;br /&gt;&lt;br /&gt;start.time &amp;lt;- Sys.time()&lt;br /&gt;sc &amp;lt;- sparkR.init(master=&quot;local&quot;)&lt;br /&gt;logFile &amp;lt;- &quot;/home/blag/R_Codes/Girls_Not_Grey&quot;&lt;br /&gt;logData &amp;lt;- SparkR:::textFile(sc, logFile)&lt;br /&gt;numAs &amp;lt;- count(SparkR:::filterRDD(logData, function(s) { grepl(&quot;a&quot;, s) }))&lt;br /&gt;numBs &amp;lt;- count(SparkR:::filterRDD(logData, function(s) { grepl(&quot;b&quot;, s) }))&lt;br /&gt;paste(&quot;Lines with a: &quot;, numAs, &quot;, Lines with b: &quot;, numBs, sep=&quot;&quot;)&lt;br /&gt;end.time &amp;lt;- Sys.time()&lt;br /&gt;time.taken &amp;lt;- end.time - start.time&lt;br /&gt;time.taken&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-4sG8CwMAOqQ/VZIjoP1SVpI/AAAAAAAAEao/gzx04LKEwXw/s1600/SparkR_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;221&quot; src=&quot;http://2.bp.blogspot.com/-4sG8CwMAOqQ/VZIjoP1SVpI/AAAAAAAAEao/gzx04LKEwXw/s400/SparkR_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;0.3167355 segundos...bastante rápido...me pregunto como le iría al R regular?&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;PlainR.R&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;library(&quot;stringr&quot;)&lt;br /&gt;&lt;br /&gt;start.time &amp;lt;- Sys.time()&lt;br /&gt;logFile &amp;lt;- &quot;/home/blag/R_Codes/Girls_Not_Grey&quot;&lt;br /&gt;logfile&amp;lt;-read.table(logFile,header = F, fill = T)&lt;br /&gt;logfile&amp;lt;-apply(logfile[,], 1, function(x) paste(x, collapse=&quot; &quot;))&lt;br /&gt;df&amp;lt;-data.frame(lines=logfile)&lt;br /&gt;a&amp;lt;-sum(apply(df,1,function(x) grepl(&quot;a&quot;,x)))&lt;br /&gt;b&amp;lt;-sum(apply(df,1,function(x) grepl(&quot;b&quot;,x)))&lt;br /&gt;paste(&quot;Lines with a: &quot;, a, &quot;, Lines with b: &quot;, b, sep=&quot;&quot;)&lt;br /&gt;end.time &amp;lt;- Sys.time()&lt;br /&gt;time.taken &amp;lt;- end.time - start.time&lt;br /&gt;time.taken&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-SQk2tpVAWwg/VZIf5kV92UI/AAAAAAAAEaE/jFOfoVONips/s1600/PlainR_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;http://4.bp.blogspot.com/-SQk2tpVAWwg/VZIf5kV92UI/AAAAAAAAEaE/jFOfoVONips/s400/PlainR_01.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Que bueno...0.01522398 segundos...espera...qué? No se supone que Spark sea mucho más veloz? Bueno...recuerdo haber leído en algun lado que Spark brilla con archivos grandes...&lt;br /&gt;&lt;br /&gt;Bueno...preparé un archivo con 5 columnas y 1 millón de registros...veamos como vá...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;SparkR.R&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;library(SparkR)&lt;br /&gt;&lt;br /&gt;start.time &amp;lt;- Sys.time()&lt;br /&gt;sc &amp;lt;- sparkR.init(master=&quot;local&quot;)&lt;br /&gt;logFile &amp;lt;- &quot;/home/blag/R_Codes/Doc_Header.csv&quot;&lt;br /&gt;logData &amp;lt;- SparkR:::textFile(sc, logFile)&lt;br /&gt;numAs &amp;lt;- count(SparkR:::filterRDD(logData, function(s) { grepl(&quot;a&quot;, s) }))&lt;br /&gt;numBs &amp;lt;- count(SparkR:::filterRDD(logData, function(s) { grepl(&quot;b&quot;, s) }))&lt;br /&gt;paste(&quot;Lines with a: &quot;, numAs, &quot;, Lines with b: &quot;, numBs, sep=&quot;&quot;)&lt;br /&gt;end.time &amp;lt;- Sys.time()&lt;br /&gt;time.taken &amp;lt;- end.time - start.time&lt;br /&gt;time.taken&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-5ERthZK7nXM/VZIhI0yq4JI/AAAAAAAAEaQ/9fZtimjAC0s/s1600/SparkR_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;http://2.bp.blogspot.com/-5ERthZK7nXM/VZIhI0yq4JI/AAAAAAAAEaQ/9fZtimjAC0s/s400/SparkR_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;26.45734 segundos para 1 millón de registros? Buen trabajo -:) Veamos si el R regular gana nuevamente...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;PlainR.R&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;library(&quot;stringr&quot;)&lt;br /&gt;&lt;br /&gt;start.time &amp;lt;- Sys.time()&lt;br /&gt;logFile &amp;lt;- &quot;/home/blag/R_Codes/Doc_Header.csv&quot;&lt;br /&gt;logfile&amp;lt;-read.csv(logFile,header = F)&lt;br /&gt;logfile&amp;lt;-apply(logfile[,], 1, function(x) paste(x, collapse=&quot; &quot;))&lt;br /&gt;df&amp;lt;-data.frame(lines=logfile)&lt;br /&gt;a&amp;lt;-sum(apply(df,1,function(x) grepl(&quot;a&quot;,x)))&lt;br /&gt;b&amp;lt;-sum(apply(df,1,function(x) grepl(&quot;b&quot;,x)))&lt;br /&gt;paste(&quot;Lines with a: &quot;, a, &quot;, Lines with b: &quot;, b, sep=&quot;&quot;)&lt;br /&gt;end.time &amp;lt;- Sys.time()&lt;br /&gt;time.taken &amp;lt;- end.time - start.time&lt;br /&gt;time.taken&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-d4z0V2tHHtQ/VZIiKJYhRnI/AAAAAAAAEac/U_BBoXJ7n5c/s1600/PlainR_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;http://3.bp.blogspot.com/-d4z0V2tHHtQ/VZIiKJYhRnI/AAAAAAAAEac/U_BBoXJ7n5c/s400/PlainR_02.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;48.31641 segundos? Parece que Spark fué prácticamente el doble de rápido esta vez...y este es un ejemplo de lo más sencillo...estoy seguro de que cuando la complejidad aumenta...la brecha es aún más grande...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Y seguro...Yo sé que mucha gente puede tomar mi código en &amp;nbsp;R y hacerlo aún más veloz que Spark...pero...este es mi blog...no el de ellos -;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Regresaré apenas sepa más sobre SparkR -:D&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Saludos,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Blag.&lt;/div&gt;&lt;div&gt;Development Culture.&lt;/div&gt;</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-7049230505360676851</guid>
         <pubDate>Mon, 29 Jun 2015 22:20:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://2.bp.blogspot.com/-4sG8CwMAOqQ/VZIjoP1SVpI/AAAAAAAAEao/gzx04LKEwXw/s72-c/SparkR_01.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED es mi nuevo Hello World - Tiempo de Lua</title>
         <link>http://atejada.blogspot.com/2015/06/led-es-mi-nuevo-hello-world-tiempo-de_18.html</link>
         <description>Continúando con mi tradición de escribir una aplicación de LED para cada uno de los lenguajes de programación que aprendo...es tiempo de Lua -;)&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;LedNumbers.lua&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;local function split(s,delim)&lt;br /&gt; local result = {}&lt;br /&gt; for match in (s..delim):gmatch(&quot;(.-)&quot;..delim) do&lt;br /&gt;  table.insert(result,match)&lt;br /&gt; end&lt;br /&gt; return result&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;leds = {[0] = &quot; _  ,| | ,|_| &quot;,&lt;br /&gt;        [1] = &quot;  ,| ,| &quot;,&lt;br /&gt;        [2] = &quot; _  , _| ,|_  &quot;,&lt;br /&gt;        [3] = &quot;_  ,_| ,_| &quot;,&lt;br /&gt;        [4] = &quot;    ,|_| ,  | &quot;,&lt;br /&gt;        [5] = &quot; _  ,|_  , _| &quot;,&lt;br /&gt;        [6] = &quot; _  ,|_  ,|_| &quot;,&lt;br /&gt;        [7] = &quot;_   , |  , |  &quot;,&lt;br /&gt;        [8] = &quot; _  ,|_| ,|_| &quot;,&lt;br /&gt;        [9] = &quot; _  ,|_| , _| &quot;}&lt;br /&gt;&lt;br /&gt;io.write(&quot;Enter a number: &quot;)&lt;br /&gt;num = io.read()&lt;br /&gt;for i = 1,3 do&lt;br /&gt; for j = 1, #num do&lt;br /&gt;  line=split(leds[tonumber(string.sub(num,j,j))],&quot;,&quot;)&lt;br /&gt;  io.write(line[i])&lt;br /&gt; end&lt;br /&gt; print(&quot;&quot;)&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Lo que pueden ver inmediatamente...y es algo que realmente me sorprendió...es que Lua no proveé un comando de &quot;split&quot; o &quot;explode&quot; como parte de su core, así que tienes que hacerlo por tu cuenta...en realidad...lo mismo aplica para Haskell...pero para mí...los lenguajes funcionales están en otro nivel...y de todos modos...la implementación en Haskell de la función split es mucho más corta...&lt;br /&gt;&lt;br /&gt;Aquí está el resultado...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-eT8qYGsvMzU/VYMHAPbtzpI/AAAAAAAAEZk/m0RveeZdoZM/s1600/LedNumbers_Lua.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;246&quot; src=&quot;http://1.bp.blogspot.com/-eT8qYGsvMzU/VYMHAPbtzpI/AAAAAAAAEZk/m0RveeZdoZM/s400/LedNumbers_Lua.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-21107697735697850</guid>
         <pubDate>Thu, 18 Jun 2015 11:06:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-eT8qYGsvMzU/VYMHAPbtzpI/AAAAAAAAEZk/m0RveeZdoZM/s72-c/LedNumbers_Lua.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Mi primer post en Lua</title>
         <link>http://atejada.blogspot.com/2015/06/mi-primer-post-en-lua.html</link>
         <description>&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.lua.org/&quot;&gt;Lua&lt;/a&gt; es un lenguaje de programación que siempre me ha intrigado pero que nunca me he dado un tiempo para tratar de aprenderlo...&lt;br /&gt;&lt;br /&gt;Esto ha cambiado por supuesto -;) Porque he comenzado a leer&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.amazon.com/dp/0470069171/?tag=googhydr-20&amp;amp;hvadid=51346705265&amp;amp;hvpos=1t1&amp;amp;hvexid=&amp;amp;hvnetw=g&amp;amp;hvrand=15084709288727832319&amp;amp;hvpone=29.93&amp;amp;hvptwo=&amp;amp;hvqmt=b&amp;amp;hvdev=c&amp;amp;ref=pd_sl_1xdmgf8e7v_b&quot;&gt;Beginning Lua Programming&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.amazon.com/dp/0470069171/?tag=googhydr-20&amp;amp;hvadid=51346705265&amp;amp;hvpos=1t1&amp;amp;hvexid=&amp;amp;hvnetw=g&amp;amp;hvrand=15084709288727832319&amp;amp;hvpone=29.93&amp;amp;hvptwo=&amp;amp;hvqmt=b&amp;amp;hvdev=c&amp;amp;ref=pd_sl_1xdmgf8e7v_b&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;http://4.bp.blogspot.com/-bKBEsqeLvp8/VXtlO8ouA-I/AAAAAAAAEY4/jbeprKyXEvU/s400/BeginningLua.jpg&quot; width=&quot;316&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Así que...que es Lua exactamente? Bueno...es un lenguaje script embedible (si tienen una mejor traducción para &quot;embeddable&quot; me avisan), poderoso, rápido y ligero.&lt;br /&gt;&lt;br /&gt;Una descripción simple para un lenguaje simple...y no...no estoy implicándo simple como &quot;inútil&quot; sino como simple en su curva de aprendizaje y diseño...Lua es en realidad extremadamente poderoso y se que se quedarían más que sorprendidos si supieran donde es utilizado...solo busquen y veran a que me refiero -;)&lt;br /&gt;&lt;br /&gt;La sintaxis me recuerda bastante a Python o Julia...así que es bastante sencillo acostumbrarse...&lt;br /&gt;&lt;br /&gt;Como un ejemplo...aquí está mi ejemplo de números Fibonacci...&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;Fibonacci.lua&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;function fib(num,a,b)&lt;br /&gt; local result = &quot;&quot;&lt;br /&gt; if a &amp;gt; 0 and num &amp;gt; 1 then&lt;br /&gt;  result = result .. (a+b) .. &quot; &quot; .. fib(num-1,a+b,a)&lt;br /&gt; elseif a == 0 then&lt;br /&gt;  result = a .. &quot; &quot; .. b .. &quot; &quot; .. (a+b) .. &quot; &quot; .. fib(num-1,a+b,b)&lt;br /&gt; end&lt;br /&gt; return result&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;io.write(&quot;Enter a number: &quot;)&lt;br /&gt;num = tonumber(io.read())&lt;br /&gt;print(fib(num,0,1))&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Aquí hay un par de pruebas -:)&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-AYksnhJMKO4/VXtoE-FQGXI/AAAAAAAAEZE/PqB0vWHV0oM/s1600/LuaFib_01.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-AYksnhJMKO4/VXtoE-FQGXI/AAAAAAAAEZE/PqB0vWHV0oM/s1600/LuaFib_01.jpg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-ZPwUYv0YR7s/VXtoI84P05I/AAAAAAAAEZM/4vP7A_Tt79Q/s1600/LuaFib_02.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;187&quot; src=&quot;http://3.bp.blogspot.com/-ZPwUYv0YR7s/VXtoI84P05I/AAAAAAAAEZM/4vP7A_Tt79Q/s320/LuaFib_02.jpg&quot; width=&quot;320&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-3994918693590287289</guid>
         <pubDate>Fri, 12 Jun 2015 16:27:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-bKBEsqeLvp8/VXtlO8ouA-I/AAAAAAAAEY4/jbeprKyXEvU/s72-c/BeginningLua.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED es mi nuevo Hello World - Tiempo de OpenEuphoria</title>
         <link>http://atejada.blogspot.com/2015/06/led-es-mi-nuevo-hello-world-tiempo-de_12.html</link>
         <description>Comencé a utilizar&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://openeuphoria.org/&quot;&gt;OpenEuphoria&lt;/a&gt;&amp;nbsp;hace bastante tiempo...cuando se llamaba&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.rapideuphoria.com/&quot;&gt;RapidEuphoria&lt;/a&gt;...pero...dejé de utilizarlo puesto que comencé a utilizar otros lenguajes...&lt;br /&gt;&lt;br /&gt;Ayer...de pronto...me di cuenta de que es en realidad un muy buen lenguaje, así que quería refrescar mis conocimientos y que mejor que programar mi ejemplo de LED una vez más -;)&lt;br /&gt;&lt;br /&gt;Así que...aquí está -:)&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;LedNumbers.ex&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;include get.e&lt;br /&gt;include std/map.e&lt;br /&gt;include std/convert.e&lt;br /&gt;include std/sequence.e&lt;br /&gt;&lt;br /&gt;sequence num&lt;br /&gt;sequence snum&lt;br /&gt;object onum&lt;br /&gt;atom anum&lt;br /&gt;map leds = new()&lt;br /&gt;   put(leds, 0, {&quot; _  &quot;,&quot;| | &quot;,&quot;|_| &quot;})&lt;br /&gt;   put(leds, 1, {&quot;  &quot;,&quot;| &quot;,&quot;| &quot;})&lt;br /&gt;   put(leds, 2, {&quot; _  &quot;,&quot; _| &quot;,&quot;|_  &quot;})&lt;br /&gt;   put(leds, 3, {&quot;_  &quot;,&quot;_| &quot;,&quot;_| &quot;})&lt;br /&gt;   put(leds, 4, {&quot;    &quot;,&quot;|_| &quot;,&quot;  | &quot;})&lt;br /&gt;   put(leds, 5, {&quot; _  &quot;,&quot;|_  &quot;,&quot; _| &quot;})&lt;br /&gt;   put(leds, 6, {&quot; _  &quot;,&quot;|_  &quot;,&quot;|_| &quot;})&lt;br /&gt;   put(leds, 7, {&quot;_   &quot;,&quot; |  &quot;,&quot; |  &quot;})&lt;br /&gt;   put(leds, 8, {&quot; _  &quot;,&quot;|_| &quot;,&quot;|_| &quot;})&lt;br /&gt;   put(leds, 9, {&quot; _  &quot;,&quot;|_| &quot;,&quot; _| &quot;})&lt;br /&gt;   &lt;br /&gt;num = prompt_string(&quot;Enter a number: &quot;)&lt;br /&gt;snum = breakup(num,1)&lt;br /&gt;for i = 1 to 3 do&lt;br /&gt;        for j = 1 to length(num) do&lt;br /&gt;            anum = to_number(snum[j])&lt;br /&gt;            onum = map:get(leds,anum)&lt;br /&gt;            puts(1,onum[i])&lt;br /&gt;        end for&lt;br /&gt;        puts(1,&quot;&amp;#92;n&quot;)&lt;br /&gt;end for&lt;br /&gt;puts(1,&quot;&amp;#92;n&quot;)&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Por supuesto...quiren verlo en acción -:D&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-3_mDvTlK9oU/VXsWc1LoHCI/AAAAAAAAEYk/NR5USpnT9nY/s1600/Euphoria_LED.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;278&quot; src=&quot;http://4.bp.blogspot.com/-3_mDvTlK9oU/VXsWc1LoHCI/AAAAAAAAEYk/NR5USpnT9nY/s400/Euphoria_LED.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Si aún no lo han hecho...prueben OpenEuphoria...es bastante divertido -;)&lt;br /&gt;&lt;br /&gt;Saludos,&lt;br /&gt;&lt;br /&gt;Blag.&lt;br /&gt;Development Culture.</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-1218151703925539635</guid>
         <pubDate>Fri, 12 Jun 2015 10:34:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-3_mDvTlK9oU/VXsWc1LoHCI/AAAAAAAAEYk/NR5USpnT9nY/s72-c/Euphoria_LED.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>LED es mi nuevo Hello World - Tiempo de Pony</title>
         <link>http://atejada.blogspot.com/2015/06/led-es-mi-nuevo-hello-world-tiempo-de.html</link>
         <description>Como saben...siempre estoy en la búsqueda de nuevos, extraños y excitantes lenguajes de programación...bueno...esta vez...el lenguaje vino a mi -;)&lt;br /&gt;&lt;br /&gt;Me contactó&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.twitter.com/scblessing&quot;&gt;@scblessing&lt;/a&gt; para avisarme de un nuevo lenguaje en el cual su compañía está trabajando...llamado...&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.ponylang.org/&quot;&gt;Pony&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Así que...que es Pony exactamente?&amp;nbsp;&lt;b&gt;Pony es un lenguaje de alto rendimiento, orientado a objetos, actor-modelo y con seguridad en las capacidades .&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;Algo así como una mezcla entre C++ y Erlang -;)&lt;br /&gt;&lt;br /&gt;La&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://tutorial.ponylang.org/&quot;&gt;documentación&lt;/a&gt;&amp;nbsp;aún no está completa...pero es un buen punto de partida...y además...nos proporciona un&amp;nbsp;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://sandbox.ponylang.org/&quot;&gt;Sandbox&lt;/a&gt; donde puedes leer el código fuente de las librerías de Pony y ejecutar algunos interesántes ejemplos...&lt;br /&gt;&lt;br /&gt;Así que, por supuesto...no podía quedarme feliz con solo leer y jugar un poco...tenía que programar mi LED tal como le hecho con todos los demás lenguajes...así que aquí está -;)&lt;br /&gt;&lt;br /&gt;&lt;table align=&quot;center&quot; style=&quot;width:600px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor=&quot;#6690BC&quot;&gt;main.pony&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;actor Main&lt;br /&gt; var _env: Env&lt;br /&gt; &lt;br /&gt; new create(env: Env) =&amp;gt;&lt;br /&gt;  _env = env&lt;br /&gt;  let leds: Array[Array[String]] = [[&quot; _  &quot;,&quot;| | &quot;,&quot;|_| &quot;],&lt;br /&gt;        [&quot;  &quot;,&quot;| &quot;,&quot;| &quot;],&lt;br /&gt;        [&quot; _  &quot;,&quot; _| &quot;,&quot;|_  &quot;],&lt;br /&gt;        [&quot;_  &quot;,&quot;_| &quot;,&quot;_| &quot;],&lt;br /&gt;        [&quot;    &quot;,&quot;|_| &quot;,&quot;  | &quot;],&lt;br /&gt;        [&quot; _  &quot;,&quot;|_  &quot;,&quot; _| &quot;],&lt;br /&gt;        [&quot; _  &quot;,&quot;|_  &quot;,&quot;|_| &quot;],&lt;br /&gt;        [&quot;_   &quot;,&quot; |  &quot;,&quot; |  &quot;],&lt;br /&gt;        [&quot; _  &quot;,&quot;|_| &quot;,&quot;|_| &quot;],&lt;br /&gt;        [&quot; _  &quot;,&quot;|_| &quot;,&quot; _| &quot;]]&lt;br /&gt;&lt;br /&gt;  var num: String = try env.args(1) else &quot;&quot; end&lt;br /&gt;  var i: I64 = 0&lt;br /&gt;  var j: I64 = 0&lt;br /&gt;  var line: String = &quot;&quot;&lt;br /&gt;  while i &amp;lt; 3 do&lt;br /&gt;   while j &amp;lt; num.size().string().i64() do&lt;br /&gt;    try line = line.insert(line.size().string().i64(),&lt;br /&gt;             leds(num.substring(j,j).u64())(i.string().u64())) else &quot;&quot; end&lt;br /&gt;    j = j + 1&lt;br /&gt;   end&lt;br /&gt;   i = i + 1&lt;br /&gt;   j = 0&lt;br /&gt;   _env.out.print(line)&lt;br /&gt;   line = &quot;&quot;&lt;br /&gt;  end&lt;br /&gt;  _env.out.print(&quot;&quot;)&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Y aquí...pueden verlo en acción -:D&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://1.bp.blogspot.com/-_jlbZ5lFVxE/VXnIxAmys4I/AAAAAAAAEYQ/OeQqIcVlEXI/s1600/Pony_LED.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;333&quot; src=&quot;http://1.bp.blogspot.com/-_jlbZ5lFVxE/VXnIxAmys4I/AAAAAAAAEYQ/OeQqIcVlEXI/s400/Pony_LED.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Lo que yo pienso es que Pony aunque aún es un lenguaje muy joven, tiene mucho potencial y mi rápida experiencia con el no fué nada más que divertida y emocionante...voy a manterme atento para ver como se desarrolla -;)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Saludos,&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Development Culture.&lt;/div&gt;</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-3045936963230019380</guid>
         <pubDate>Thu, 11 Jun 2015 11:15:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-_jlbZ5lFVxE/VXnIxAmys4I/AAAAAAAAEYQ/OeQqIcVlEXI/s72-c/Pony_LED.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Clojure in Action - Review del Libro</title>
         <link>http://atejada.blogspot.com/2015/05/clojure-in-action-review-del-libro.html</link>
         <description>Acabo de terminar de leer este libro...así que aquí está mi pequeño review...&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.manning.com/rathore/&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://1.bp.blogspot.com/-HSxHxAppiO4/VV_Z5EEpkwI/AAAAAAAAEW8/VpGgU_A8vMw/s320/Clojure.jpg&quot; width=&quot;256&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;El libro es más o menos extenso...con 434 páginas...y es mi primer libro y mi primera aproximación a &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://clojure.org/&quot;&gt;Clojure&lt;/a&gt;.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Debo decirlo...no soy ningún fan entusiasta de Java...en realidad ni siquiera me gusta...pero Clojure...es algo más -:) Con su sintaxis a la Lisp y su orientación funcional...es un lenguaje de programación maravilloso...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;El libro en sí es una gran introducción para alistarnos para algo más...pero...como Clojure aún es un lenguaje joven...algunos de los ejemplos no funcionan principalmente porque algunos palabras claves o librerías se han vuelto obsoletas...afortunadamente, la mayoría de los ejemplos funcionan sin tener que hacer ningún cambio...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Hay muchos ejemplos que nos ayudan a comprender de que trata Clojure...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://3.bp.blogspot.com/-LhevBh08JM0/VV_cuXPEEJI/AAAAAAAAEXQ/bB0BQsEylAQ/s1600/Clojure_001.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;115&quot; src=&quot;http://3.bp.blogspot.com/-LhevBh08JM0/VV_cuXPEEJI/AAAAAAAAEXQ/bB0BQsEylAQ/s400/Clojure_001.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://2.bp.blogspot.com/-WXKfi-87bgg/VV_cuV4ssJI/AAAAAAAAEXI/V3ev3Q5voLA/s1600/Clojure_002.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;143&quot; src=&quot;http://2.bp.blogspot.com/-WXKfi-87bgg/VV_cuV4ssJI/AAAAAAAAEXI/V3ev3Q5voLA/s400/Clojure_002.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-m7rLZnfBOlM/VV_cudztGXI/AAAAAAAAEXM/qP65Oo15JB0/s1600/Clojure_003.jpg&quot; style=&quot;margin-left:1em;margin-right:1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;165&quot; src=&quot;http://4.bp.blogspot.com/-m7rLZnfBOlM/VV_cudztGXI/AAAAAAAAEXM/qP65Oo15JB0/s400/Clojure_003.jpg&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Si no han escuchado antes sobre closures, recursividad, funciones de alto orden o currying...este libro es para usteded...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Aunque planeo leer más libros sobre Clojure, puedo decir que es libro es la mejor manera de comenzar...&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Saludos,&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Blag.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:justify;&quot;&gt;Development Culture.&lt;/div&gt;&lt;br /&gt;</description>
         <author>Alvaro &quot;Blag&quot; Tejada Galindo</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-13698376.post-4728371335839752226</guid>
         <pubDate>Fri, 22 May 2015 19:00:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://1.bp.blogspot.com/-HSxHxAppiO4/VV_Z5EEpkwI/AAAAAAAAEW8/VpGgU_A8vMw/s72-c/Clojure.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
   </channel>
</rss>
<!-- fe8.yql.bf1.yahoo.com compressed/chunked Thu Oct  1 21:39:36 UTC 2015 -->
