domingo, março 29, 2015

Democratizing Web App Development: "Hello App Inventor!" by Paula Beer and Carl Simmons


Review:
Hello App Inventor!: Android programming for kids and the rest of us - Paula Beer, Carl Simmons
Published 2014

One of my long term goals is to teach my kids “Computers”, and I look forward to teaching them how to program. MIT's Scratch is to desktop/browser environments what App Inventor is to Development for Mobile Devices (Android OS).

If Harvard is also using the “scratch” framework in their Computer Science and Programming classes, why shouldn’t we use its equivalent in terms of Mobile Development? In this particular instantiation we are dealing with the Android OS. Despite having the Android Developer with Eclipse APP Inventor installed on several of my machines, App Inventor helps me to toss something together a lot quicker to see if it's going to be any good to develop. It also saves me a lot of time. I’m talking about prototyping here.

This kind of visual application framework is for inciting curiosity.  A GUI based app framework is also good for exposing the basic logic of the platform in a non-advanced way, without hours of programming study, which is inevitable at some point, but that point will come at a time where the developer has already formed a passion for it. And when you learn the nuts and bolts of a programing language or API or SDK or whatever with passion, then you just can't stop till you reach the guru level.

I came in contact with App Inventor in 2013 (still in version 1.0 at the time) and I was completely won over by it. I think the real value of this kind of App Development Framework is that it makes it easier to contribute value to what I do. What do I mean by "Value" in this particular context? Value always comes in many flavours be it poetry, science, political “science”, solving problems, etc. I haven’t been a professional developer for a long time. Why do I need to dabble with development frameworks at this particular juncture in time? For several reasons. Because I like programming even when I don’t do it in my day job; because I’m always on the lookout for new development frameworks, and last but not least, sometimes I just need to do something that involves putting together a small piece of code to fulfill my goal, be it something for my kids (e.g., a multiplication table that goes up to “20”), be it on how to display locations on a Google Map or be it explaining the encryption and decryption concepts when sending messages on the internet.

When perusing the Google Play Store I constantly cannot find the app I need. Due to the fact that and I'm too busy with a full family and a full time job to currently devote time to learning a new programming paradigm, I still have apps that I want/need, and that’s where App Inventor come in handy. My purpose is not to distribute my app in the Google Market, but just to use it for myself. Not every app needs to go on the Market.

I’m a strong advocate of adding Computer Skills to the usual set of Reading, Writing and Arithmetic skills. Raspberry Pi (HW), Scratch (Desktop Development) and App Inventor (Development for Mobile Android devices) may be the supporting vectors that allow this. Unfortunately only a tiny percentage of people ever consider learning to write source code. Not everyone needs to become a professional developer, but gaining a fundamental understanding of code on how software works, is quickly becoming a core skill needed in today’s workplace. With this framework I don’t need a ”main” program. On top of that it also hides all the “ugly engines” that come with Java, e.g., Java Listeners and other behind-the-scenes event-dispatching stuff.

I worked with the book at hand for 10 days. I wanted to code all the examples to see how I would fare even though I’ve a Computer Science degree. I must say I was quite surprised with the level of the language and the way the book is organized. The book’s organization mimics the App Inventor, i.e., it has chapters organized by the apps I can code, rather than programming topics like conditionals and iteration (those topics are ”hidden” within the chapters providing a painless introduction to the more hard-core concepts).

What seems most extraordinary is the framework’s ability to remove syntax portions from my own thought processes so I can focus on what I want the App to look like. I had serious doubts that my brain, coming from a more traditional Computer Science venue would rebel against it. It didn’t happen.

Having to remember complex structures while building an app is no longer a requirement… This app may be the first workable wysywig approach to computer programming when it comes to mobile Android devices.

On the whole I think the framework in itself is interesting and fun, but more as a toy and a way to learn programming the easy way. MIT needs to add extensions to correct the framework’s deficiencies (e.g., the frameworks inability to use third parties components; alas we can’t have everything even in a Visual Programming Framework). Saying this is a way for non-programmers to build apps is a bit misleading. The focus should be more on its use as a rapid development tool with hooks to extend it and build more professional applications than saying it’s a framework for non-programmers, i.e., it’s wrong to think that using visual blocks we don't have to understand programming; it’d be like thinking that FORTRAN programmers don't need to understand programming since FORTRAN uses English words.  Programmers still have to know how to program — be it in assembly, C++, Java, COBOL, or with little visual aids.

Bottom-line: I love App Inventor for the ability to explore many aspects of mobile computing as well as the ability I have in terms of prototype an app that I want to sketch rapidly. Nevertheless the framework has some serious drawbacks when it comes to developing applications for the real market. For starters without a library code it’s nigh on impossible to develop serious programming/applications.  But even with code reuse available, there are still some critical missing features, e.g, a "run-time library" which is essential. Without these “coding components” built on top of the language syntax, forget it.  I’m no longer in the business of reinventing the wheel programming-wise. Let me take just one example very dear to my heart: math functions. There are just a few in App Inventor, but NOT a single string manipulation function (MakeText is the closest we get).  In the long run, without nothing better to do than develop code it’d not bother me to write them into a re-useable library, but unfortunately there is nothing that lets me manipulate single characters.  I think the reason for this is that a library written in App Inventor would not be very performance efficient, even if I had the core ability to access strings as a list of characters.

Despite all of its drawbacks, App Inventor is still ideally suited to teaching kids how to develop some programming concepts and even produce some nice-looking mobile apps on Android.

Check out these examples on the Google Play Store I've developed using this framework.
Original post: antao.booklikes.com/post/1135973/democratizing-web-app-development-hello-app-inventor-by-paula-beer-and-carl-simmons

sexta-feira, março 27, 2015

Otherness instead of Alternateness: "The Eye With Which the Universe Beholds Itself" by Ian Sales

The Eye With Which The Universe Beholds Itself (Apollo Quartet) (Volume 2) - Ian Sales
Published January 20, 2013.

What would have happened if Neil Armstrong had aborted his lunar mission in the final stage leading the Russians to have the first man to walk on the Moon? Despite this “what-if-scenario”, this story goes beyond being mere alternate SF.

Is it possible to read mundane fiction as if it were SF?

As a SF devotee all my life, everything I do and read comes filtered through that particular lens. A lot of the mundane fiction I read, with no particular evident speculative content, makes me happy and satisfy me as a reader in the same way SF work will.

Even in the most run-of-the-mill SF, there is always something in the way the SFional elements interact with the style of the writer, and with the way the characters in the story deal with the world, that pulls me right in. Modernism reacts against the narrative conventions of classic fiction, while postmodernism fights against the formalism of modernism. On the other hand, the New Wave and Cyperpunk writers go against the narrative conventions of genre fiction. What about the so-called post-New-Wave and Cyperpunk writers? I think they need to reclaim those conventions. The “new” aesthetic in SF (for lack of a better name), is based less in a rejection of earlier forms than in the celebration of them. They tend to borrow tropes, language, popular culture, fable and folklore, as well as from alternate modes (film, music, graphic novels, etc), and integrate them into a “new” mode that quite resists labeling. That’s why I prefer to call this “new” narrative modes 21st stories. And that’s what Ian Sales writes.

This 2nd volume mixes an imaginary timeline with a real one, as well as places and science that finding where the story spins off from our own timeline is quite daunting.  
How can a novella be so much better than some of the longer works I’ve been reading in the last few years? Easy. Because it gives off a scent of coming from a different space and time. The little hints (and acronyms) dropped here and there in the story gave me a feeling of Otherness instead of Alternateness (I don’t go much for alternate-SF; I think these kind of SF is only adequate for lazy readers and writers…).

In the 1st volume of the series, I noted the absence of quotes when the characters used direct speech. In this 2nd volume another “thing” popped up: the use of the present tense narrative, which also imparted a certain kind of distancing of the reader from the characters, but not in a bad way. What makes this story so early in the year one of my highlights is the overall structure the story uses that enabled me to put forth an answer on how SF sustains my interest in the face of the alternate/impossible, i.e., the moment we realize that the accepted rules of our “reality” are in some distinct way being contradicted. And the answer lies in the way Sales goes about in his approach to the feeling of the impossible that always kept me engaged in his world even after the marvels ceased to appear.

SF that successfully leads me all the way to this deeper engagement with the text/world/whatever are very rare. Also the relation between narrative and the non-fictional elements that allows the extrapolative method not to be bracketed off as supplementary, rather followed directly from the narrative, which is something I haven’t seen done so well in recent years.

And I must say I love the titles of the stories. They impart a sort of universal wonder in me. Apart from the sense they give me, they also work as a way to creating a connected milieu.

SF = Speculative Fiction

domingo, março 22, 2015

Android App: "Encryption e Decryption"





I implemented it in tandem while reading Simon Singh's book: "The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography".

AES Algorithm implementation.

Android App: "Sending and receiving Encrypted SMS"





Uses a substitution algorithm. It can be replaced with any other encryption algorithm: AES, HMAC-SHA1, etc.


It allows the recipient selection which means he or she have got to have the app instaled in order to decrypt the SMS. 
I developed this app while reading the book "The Code Book - The Science of Secrecy from Ancient Egypt to Quantum Cryptography" by Simon Singh just to see whether I was able to and to see whether Singh was not selling me a lot of bullshit...

Android App: "Generating Multiplication Tables"



To help my daughters with the multiplication tables... 
Generalized for numbers bigger than 10.


Android App: "Number of Days Between Dates"


Comes in handy to calculate the number of project days in order to register the PDU's regarding the PMP renewal.

sábado, março 21, 2015

Android App: "My Favourite Radio Stations"




In order to have all of my radio stations websites in one place, I just had to build an aggregate app to save me some work.

Favourite Radio Stations: "Rock Melodic Rock" (AOR), "Munich's Hardest Hits" (AOR), "Antena 2" (Classical), Rádio Radar (Alternative), ...

There are still a few radio stations missing, but I'll correct that in due course.

sexta-feira, março 20, 2015

You Don't Love the Same Woman Twice: "The Alienist and Other Stories of Nineteenth-Century Brazil" by Machado de Assis, John Charles Chasteen (translator)

The Alienist and Other Stories of Nineteenth-Century Brazil - Machado de AssisPublished 2013.

Let’s talk about luxury. Not that one, but the one that goes through the objects that I covet. One of these objects is the 1600-page-book “Os Romances de Machado de Assis” (the Novels of Machado de Assis) edited by the Glaciar publishing House, containing among others “Memórias Póstumas de Brás Cubas”, “Memorial de Aires” e “Dom Casmurro”, “Quincas Borba”, “Esaú e Jacob”, “Helena”, … This beast of a book waits for me (or I’m waiting for it; take your pick). Being neigh on impossible to find it despite having been published quite recently, I just had to make do with Chasteen’s translated collection. After having finished it, it’s also become a cult object.

Contents:

  1. “To be Twenty Years Old” (Vinte anos! Vinte anos!)
  2. “The Education of a Poser” (Teoria do medalhão), my favourite story; the poser in the story resembles a few Portuguese politicians from the here and now, but I won’t name them in case one of them is reading this…I’m sure I could find further examples from other political milieus
  3. “The Looking Glass” (O espelho)
  4. “Chapter of Hats” (Capítulo dos chapéus)
  5. “A Singular Occurrence” (Singular Ocorrência)
  6. “Terspischore” (Terpsícore)
  7. “Father Against Mother” (Pai contra mãe)
  8. “The Alienist” (O Alienista)

Assis is the master of portraying everyday life, popular culture, women, male power and pretensions, and the politics of the elite. His short stories were written mostly for and about the Brazilian ruling class, exploring its psychology, holding up a mirror in which it could recognize and laugh at itself. Assis did that in a Portuguese prose of such pristine elegance and felicity, that Brazilians (and Portuguese readers) came to love his narratives that always seemed to unearth something profoundly true about themselves.

In 2008 I attended a conference at Calouste Gulbenkian where the theme under discussion was the Centennial of Machado de Assis’ death. Seven years later what I remember from that conference was the fact that someone wrote an essay about the inexistence of the Novel of Manners in Assis’ work, which is a thesis I tend to agree with. (Re)-reading Assis all this time later (I haven’t “touched” him since 2008) I’m all the more convinced of this. In this beautifully collection translated from the Portuguese by John Charles Chasteen we can see several instantiations of this thesis. What we constantly see is Assis’ attempt at establishing contrasts between characters, i.e., it is all about a character study that tries to deepen the characteristics of each character and the situations they go through. The driver here is not mere entertainment:

“For starters, we don’t have just one soul, but two.”
“Two?”
“That’s right, two. Every human being has two souls, one that’s inside, facing out, and another that’s outside, facing in. [ ] the second, external soul can be almost anything: a fluid, an object, an action, another person. For example, the buttons on a shirt can function as a person’s external soul, so can a polka, a card game, a book, a drum, or a pair of boots. The second soul has the same life-giving function as the first. Together, they complete the human spirit in the way that two halves complete a walnut. [ ] Not uncommonly, the loss of an external soul becomes life threatening. Remember Shylock, the Shakespearean character? ‘Thou stick’st a dagger in my heart,’ says Shylock when he loses his gold. His gold was his external soul, you see, and losing it meant death to him.”

In the original in Portuguese:

(
Em primeiro lugar, não há uma só alma, há duas...
- Duas?
- Nada menos de duas almas. Cada criatura humana traz duas almas consigo: uma que olha de dentro para fora, outra que olha de fora para entro... [] A alma exterior pode ser um espírito, um fluido, um homem, muitos homens, um objeto, uma operação. Há casos, por exemplo, em que um simples botão de camisa é a alma exterior de uma pessoa; - e assim também a polca, o voltarete, um livro, uma máquina, um par de botas, uma cavatina, um tambor, etc. Está claro que o ofício dessa segunda alma é transmitir a vida, como a primeira; as duas completam o homem, que é, metafisicamente falando, uma laranja. Quem perde uma das metades, perde naturalmente metade da existência; e casos há, não raros, em que a perda da alma exterior implica a da existência inteira. Shylock, por exemplo. A alma exterior aquele judeu eram os seus ducados; perdê-los equivalia a morrer. "Nunca mais verei o meu ouro, diz ele a Tubal; é um punhal que me enterras no coração." Vejam bem esta frase; a perda dos ducados, alma exterior, era a morte para ele.
)
Source: “Obra Completa, de Machado de Assis, vol. II, Nova Aguilar, Rio de Janeiro, 1994.

Watch the way Chasteen transposes the above dialogue into English. It’s nothing short of masterful.

Also worth mentioning is Chasteen’s introduction to Assis’ work, because it gives a cultural and an historical snapshot under which we can read this 7 short stories and one novella collection (“The Alienist”). Also as a bonus is Chasteen’s introductions to each of the individual pieces.

This the first time I’ve read Machado de Assis in a language other than Portuguese. I was curious on how well the translated Assis would look like in that other language. I must say I was rather positively surprised with the result. I was expecting a clunky and awkward translation, but what I got was a discourse in English that was able to capture Assis’ narrative shifts and reversals with great timing, something I always thought not to be possible in a language other than Portuguese. Where lies Assis’ art? It’s in his ability to seamlessly shift character perspectives in the narrative: it’s up to the reader to discern what the sometimes unreliable narrator of the story says happened, but it’s an entirely different matter to decide what the reader think really happened.

For those of you able to read Portuguese, reading this collection gives the added bonus of providing several “readings” on Machado de Assis: (1) reading him in English and trying to remember some of the most original phrases in the original and reading him side-by-side in a Portuguese vs English translation and (2) trying to understand some of the choices/liberties Chasteen had to take to express Machado de Assis in another language, like the abovementioned example.

Machado de Assis has always something in store upon re-reading. This revisitation of the “The Alienist” for the umpteenth time made me realize there's more to Dr. Simão Bacamarte (surname with a double meaning in Portuguese…) than meets the eye.

Who’s crazy and who’s normal? Assis makes us suspicious, doubtful. Along with that the usual irony and sarcasm are also present throughout all the stories.

For those of you who never read Machado de Assis, do yourself a favour, read him, especially if you hate those novels of today’s fiction where the narrator believes the reader is a moron and keeps on explaining (showing instead of telling) what’s happening in the story…

segunda-feira, março 16, 2015

Android App: "Zombie Alarm"


Due to my baby boy's birth, and because we haven't been sleeping much, during the hour of the wolf, I developed an Android App to help us, in a funny way, not to oversleep...

sexta-feira, março 13, 2015

Literary-Hard-SF: "Adrift on the Sea of Rains" by Ian Sales

Adrift on the Sea of Rains - Ian Sales
Published 2013

I’ve been getting pushes from a lot of my SF buddy-reading friends to tackle the Quartet series (the 4 books). Here I’m limiting myself reviewing-wise to just the first book for now (more later on). What we have here is SF at its finest. If there’s a heaven and a hell for SF works, this one definitely belongs to the high spheres. The novel’s subject matter: The Apollo programme went much further than in reality, and it was also used to establish a reality-shattering technology that aimed to switch between universes. Seems easy and belonging to the mundane spectrum of SF, right? No.

The one thing I for one know for sure about the future is that it won’t be easy. For this reason, Sales’ highly alternate reality carry conviction. He and I also suspect that the future will be a different country and in there they’ll talk a different language as well. The story’s heavy larding of this imagined-mixed-with-reality-slang does yield to patient study, but not, I fear, before Sales lost a fair percentage of his readership. Why? This is SF of the hardest type (the one closest to my heart). The novel seems just an old and familiar story. Too many SF writers try to entertain me with pseudo-conflicts which turn on arbitrary pseudo-answers to pseudo-problems. That’s not my kind of SF. I know I’m sometimes duly entertained, even if one hour later I don’t remember much of what I read. That’s my issue with much of the SF of nowadays. Only a few seem to devise realistic and complex answers to problems. Those who pose good strong problems later on take them out of the picture with a wisp of imaginary physics. My kind of SF might not be the hard kind (might even belong to the so-called soft sciences; e.g., China Mountain Zhang by Maureen F. McHugh).  What matters to me is not the main character’s ability to solve the problem down there at the heart of the spaceship (as it’s the case here), or the asteroid, or the planet, or the nebula, or some such. Sometimes this is what puts “outsiders” off the SF genre (that’s why some readers find SF’s hardest kind so off-putting at times). What Sales accomplishes here is very rare in SF. The story here is not about understanding the physics or the technology, or believing the tilted outcome of this particular universe/alternate reality, because we are living in a reality so tilted as to lose the reader. Sales makes me believe in his reality, and there’s no other form of SF that generates so intense a feeling that the world we inhabit for the duration of the novel belongs by right to those who can relate.

For an interesting debate on the nature of SF vs Literary Fiction cf. Juliet McKenna’s essay from the Guardian: “Genre fiction is no different from literary fiction.”

It’s hard not to get in the mood by Sales’ enthusiasm for the science behind the fiction, even when he doesn't used quotation marks in the dialogues. This style is not new in SF (c.f., Margaret Atwood’s “The Blind Assassin”, José Saramago’s “Blindness” and The Elephant's Journey - my favourite novel from him -, Hal Duncan's “Vellum”, etc.  I’m a sucker for this kid of technique. It makes the narrative more distanced, putting us very much as an observer in the story.  Also quite effective was the way Sales “narrated” Peterson's past throughout the novella (in italics).

Downside to the story: the Wunderwaffe. It came off as a bit of deus ex machina. I’m not sure this way the best way to introduce String Theory and allowing for the possibility of alternate realities.   

From now on Neal Stephenson is not alone as the master of the infodump and the “show-don’t-tell” type of SF. They can both tell rather than show. One of many examples from this book:  “Peterson put one hand on his stick and the other to the throttle, and stared so hard at the TV screen his vision blurred until he was looking at an impressionist landscape of clouds lit by a pointillist sun.”

This is the kind of story that makes me believes SF won’t turn into a continuous utterly- anachronistic-Miles-Vorkosigan-Adventure or into a mercenaries-that-save-young-monarchs-and-solve-riddles-at-strange-foreign milieus. I don’t want to live in a world where this malady exists in SF…

SF = Speculative Fiction

quinta-feira, março 12, 2015

Project 18: Raspbery Pi vs Pizazz Robot

Raspberry Pi meets Pizazz Robot

Pizazz Assembly:









After assembly:











Pizazz and his older "brother", built with my oldest daughter when she was 5 years old...








Unfortunately "older brother" no longer workds, otherwise I'd promote a robot fight between them to see which one would come out as the winner.

NB: Thanks to my friend Luis Franco for putting the Pizazz in my line of sight...