Shared posts

25 Jul 18:44

http://changeyourliferideabike.blogspot.com/2014/07/blog-post_25.html

by caryl

25 Jul 07:23

Senator John Walsh plagiarism, color-coded

by Nathan Yau

John Walsh plagiarism

John Walsh, the U.S. Senator from Montana, is in the news lately for plagiarizing a large portion of his final paper towards his master's degree. The New York Times highlighted the portions that Walsh copied without attribution (red) and the portions he copied with improper attribution (yellow). About a third of the paper was just straight up lifted from others' works, including the final recommendations and conclusion, which is basically the grand finale.

See also: Visualizing Plagiarism by Gregor Aisch, which shows the plagiarized PhD thesis of Germany's former Minister of Defense.

25 Jul 17:15

BIV Column: “Port Coquitlam Mayor Moore is a driving force for better transit”

by pricetags

My Business in Vancouver column from July 7-14, 2014.  When written a month ago, the focus was on the big picture.  Last week, because of SkyTrain disruptions, the view would be different.   Either way, leadership will be essential.  Here’s my take on one of the leaders in this region.

.

There are very few times in politics when you will see a well-choreographed consensus emerge from a group of disparate politicians, each with a separate constituency, each with a different take on a contentious topic – like, say, transportation in Metro Vancouver.

Yet at the June 12 meeting of the Mayors’ Council on Regional, all but one of the 23 local leaders made a short and supportive statement in favour of the vision and investments that its subcommittee had spent the last 12 weeks strenuously assembling.

It was a masterful herding of the cats.  And even the lone stray, the mayor of Burnaby, had only a few weak reasons to position himself in opposition.

The need to get something on the minister’s desk by the middle of June may have achieved a consensus that might not otherwise have been possible. It certainly united every municipality in the region even if there were disagreements along the way. The result was something that more cynical critics could hardly believe was possible: leadership, co-operation, compromise and unity.

Greg Moore, the mayor of Port Coquitlam, who chaired the subcommittee, had proved to be the most effective regional leader since Gordon Campbell and George Puil. Only balder and nicer.

“I’ve been kind of a loudmouth on this issue,” said Moore in an interview at the beginning of May. “I’ve said to my colleagues: ‘We have to take charge of this; just give us the responsibility and we’ll pull it together.’ And part of my goal was to show the TransLink staff, the appointed board and the public that we were in charge.”

I asked him what he thought success would look like if they could deliver what the minister of transportation had asked for: a vision, a list of investments and a way to pay.

Success, he said, would be a plan that addresses the Regional Growth Strategy, the City of Vancouver’s Transport 2040 plan and local government contributions, presented in a nice package to the minister, with unanimous support.

And that’s pretty much what he got.

Moore is an intriguing combination of politician and planner.  As an urban geographer and planner, he spent a decade on staff at Port Coquitlam city hall before becoming a councillor, then the mayor, then chair of Metro Vancouver.

The planner in Moore has, by pulling together staff and politicians to work in a way that rarely happens, tabled a cohesive plan. As politician, he has found a consensus among regional leaders, with most of the strength in the suburbs.

The proposal has something for everyone, he affirms, “to really make a transit-oriented region. It’s a fork in the road: transit or roads. Transit is what everyone is talking and agreed to in the strategy.” And that’s what the investments reflect.

Yes, $7.5 billion – the amount for the total package – is a big number. But as Moore said, “If it fails, the default is roads and bridges” – and we’ve already committed $3.3 billion on the Port Mann and related works, with another $2 billion likely the minimum for the Massey Bridge and Highway 99. So already we’re at two-thirds of what a decade’s worth of transit and regional roads would cost – for just two bridges.

Antitax critics are criticizing the package as too ambitious, but what they’re really arguing is that half the province’s population should be satisfied with a second-rate transit system and a region unable to address the challenges of the next million people.

Moore’s thoughts on what happens next: “The first decision for the minister is whether he agrees with the report, its assumptions, funding and issues.

“If they disagree, what do they do? Give it back, or be prescriptive?

“If they agree, then I say, ‘Work with us to formulate a referendum question and date.’  They’ll have 21 cheerleaders saying to their citizens, ‘Vote in favour!’  If they rip it apart, then they’ll have 21 mayors who are your worst enemies, and it will fail.

“It’s critical that [the premier] wants it to win. We’ve had premiers say that it’s up to the citizens, but that’s not wise.  If you care about provincial and national economy, you’ll be a big champion.”

So we’ve got a choice, and so does the premier. If she unites with the mayors and supports the referendum and it wins, then the credit is hers too.

If, however, the premier’s agenda is really to frustrate Metro Vancouver’s ability to raise revenue and to discard the vision of a transit-oriented region, then the regional unity that has been created as a result of the process she demanded could well turn against her.


25 Jul 16:41

reviewinhaiku: Life Itself



reviewinhaiku:

Life Itself

25 Jul 16:12

Barcelona 11 – Impressions (2)

by pricetags

A nice touch: a place to dispose of cigarette butts, designed into the litter bins – small by our standards.

???????????????????????????????

.

On the other hand, large dumpsters for domestic refuse can be found throughout the city on the main streets.  There are no lanes to hide them off street, and the spaces of apartments are generally small – so a daily ritual of Barcelonans is the trip between 8 and 10 pm to dispose of garbage and recyclables into the gray behemoths that take up a lot of public real estate.  Capacity: 1,700 litres.

???????????????????????????????

 .

There’s little graffiti to be seen, at least in the central city, and excepting on the night-time shutters.  The streets are remarkably clean and litter-free, despite the 24-hour public life of the city and the armies of tourists that pour in and out.  That might be because of the army of cleaners, outfitted in florescent green, that by hand and broom attend to its constant maintenance.

???????????????????????????????

 

???????????????????????????????

Centro Comercial Glòries
Centro Comercial Glòries

25 Jul 15:29

Weeknote 30/2014

by Doug Belshaw

This week I’ve been:

Next week I’ll be… ON HOLIDAY! We’re heading off on Tuesday for a couple of weeks, driving and camping around Europe. Don’t worry, my home will be protected by sharks with lasers. And my parents. ;-)

Image CC BY-NC NASA’s Marshall Space Flight Center

25 Jul 07:11

GitHub: Starred drdrang/flickr-stuff on GitHub

July 25, 2014
25 Jul 03:08

Firefox for Android: Collecting and Using Telemetry

by Mark Finkle

Firefox 31 for Android is the first release where we collect telemetry data on user interactions. We created a simple “event” and “session” system, built on top of the current telemetry system that has been shipping in Firefox for many releases. The existing telemetry system is focused more on the platform features and tracking how various components are behaving in the wild. The new system is really focused on how people are interacting with the application itself.

Collecting Data

The basic system consists of two types of telemetry probes:

  • Events: A telemetry probe triggered when the users takes an action. Examples include tapping a menu, loading a URL, sharing content or saving content for later. An Event is also tagged with a Method (how was the Event triggered) and an optional Extra tag (extra context for the Event).
  • Sessions: A telemetry probe triggered when the application starts a short-lived scope or situation. Examples include showing a Home panel, opening the awesomebar or starting a reading viewer. Each Event is stamped with zero or more Sessions that were active when the Event was triggered.

We add the probes into any part of the application that we want to study, which is most of the application.

Visualizing Data

The raw telemetry data is processed into summaries, one for Events and one for Sessions. In order to visualize the telemetry data, we created a simple dashboard (source code). It’s built using a great little library called PivotTable.js, which makes it easy to slice and dice the summary data. The dashboard has several predefined tables so you can start digging into various aspects of the data quickly. You can drag and drop the fields into the column or row headers to reorganize the table. You can also add filters to any of the fields, even those not used in the row/column headers. It’s a pretty slick library.

uitelemetry-screenshot-crop

Acting on Data

Now that we are collecting and studying the data, the goal is to find patterns that are unexpected or might warrant a closer inspection. Here are a few of the discoveries:

Page Reload: Even in our Nightly channel, people seem to be reloading the page quite a bit. Way more than we expected. It’s one of the Top 2 actions. Our current thinking includes several possibilities:

  1. Page gets stuck during a load and a Reload gets it going again
  2. Networking error of some kind, with a “Try again” button on the page. If the button does not solve the problem, a Reload might be attempted.
  3. Weather or some other update-able page where a Reload show the current information.

We have started projects to explore the first two issues. The third issue might be fine as-is, or maybe we could add a feature to make updating pages easier? You can still see high uses of Reload (reload) on the dashboard.

Remove from Home Pages: The History, primarily, and Top Sites pages see high uses of Remove (home_remove) to delete browsing information from the Home pages. People do this a lot, again it’s one of the Top 2 actions. People will do this repeatably, over and over as well, clearing the entire list in a manual fashion. Firefox has a Clear History feature, but it must not be very discoverable. We also see people asking for easier ways of clearing history in our feedback too, but it wasn’t until we saw the telemetry data for us to understand how badly this was needed. This led us to add some features:

  1. Since the History page was the predominant source of the Removes, we added a Clear History button right on the page itself.
  2. We added a way to Clear History when quitting the application. This was a bit tricky since Android doesn’t really promote “Quitting” applications, but if a person wants to enable this feature, we add a Quit menu item to make the action explicit and in their control.
  3. With so many people wanting to clear their browsing history, we assumed they didn’t know that Private Browsing existed. No history is saved when using Private Browsing, so we’re adding some contextual hinting about the feature.

These features are included in Nightly and Aurora versions of Firefox. Telemetry is showing a marked decrease in Remove usage, which is great. We hope to see the trend continue into Beta next week.

External URLs: People open a lot of URLs from external applications, like Twitter, into Firefox. This wasn’t totally unexpected, it’s a common pattern on Android, but the degree to which it happened versus opening the browser directly was somewhat unexpected. Close to 50% of the URLs loaded into Firefox are from external applications. Less so in Nightly, Aurora and Beta, but even those channels are almost 30%. We have started looking into ideas for making the process of opening URLs into Firefox a better experience.

Saving Images: An unexpected discovery was how often people save images from web content (web_save_image). We haven’t spent much time considering this one. We think we are doing the “right thing” with the images as far as Android conventions are concerned, but there might be new features waiting to be implemented here as well.

Take a look at the data. What patterns do you see?

Here is the obligatory UI heatmap, also available from the dashboard:
uitelemetry-heatmap

24 Jul 19:30

Manifesto in the Making

Holy time warp, batman. It’s been awhile since I’ve written here. Don’t take that as a sign that there isn’t anything to write about, more as the by product of trying to do this: 

As this first cycle of working groups and first phases of the Badge Aliiance enters the homestretch, you can expect more from me here on the things we’ve learned so far, goals we have moving forward and general thoughts and reflections on the badging work at this point in time. 

One of the core things we’ve been working on is a manifesto for the Badge Alliance, the network and the work overall. We’ll share a version of that in the next few weeks, but in the meantime, I wanted to share some of the raw data that is going into that work and also ask for your input.

We led some exercises with our Steering Committee a few months ago to get a sense of what values and descriptors they felt had the most relevancy and weight. This fun little wordle (remember wordle?! remember Java?!) captures the outcome of that work:

image

Obviously, Interoperability was a big theme, as well as the expected ones like Open, Network, Stewards, Connectors, Visionaries. But others emerged that were not necessarily the first thing we’ve included in the past but feel right as well: Prosocial, Dependable, Credible, Inclusive. Also included in here were other important values like Equity, Commitment-to-action and Volunteers that all will be important pieces of a success story. 

One point of possible tension is honoring things like inclusiveness with things like open or interoperable. I think we will need to draw a few lines in the sand to say these are the values that everyone in the network needs to abide by, even if its only that the badges must align with the standard and not be silo’d from the broader ecosystem. But even those two statements alone, while ensuring interoperability and healthy growth of the ecosystem, will start to make this a bit less inclusive. So we’ll need to consider those values carefully as we zero in on this manifesto. 

That’s the royal we, because we need your help.

The exercise we did with our Steering Committee was hugely helpful in both affirming our own assumptions, but also bringing new ideas to the table, so its important to me that we do that with the broader network (you) as well before finalizing something that we all can get behind. 

So, we’d love it if you could take a few minutes to fill out this short form on what the BA means to you, which values or descriptors ring true for you, etc. Your input is critical and appreciated. 

Here’s that link again: http://bit.ly/manifesto-survey

Onwards!

-E

24 Jul 21:12

Stop Refactoring and Start Factoring

Summary: Refactoring is focused on the quality of code, while factoring aims to uncover the underlying beauty of the problem domain, as expressed in code. Instead of cleaning up your code, try factoring.

You have some code. You notice that it's not too readable. Maybe it's a little messy. There are some obvious code smells: some repeated code and large functions.

You start refactoring. After a while, it's a clean, neat bit of code. It's very understandable and will be cheaper to modify next time.

But is it correct?

I don't mean in the "all-the-tests-pass" kind of way, because refactoring takes care of that. I mean: does the code do what it should? Refactoring only says that it does not modify the outward behavior of the code, not make it more correct. And although it's clear what the code does (thanks to all that cleanup), it's not clear that the code does what it should.

I am a big fan of the book Refactoring by Martin Fowler. It's an edifice of analytical thinking and presentation. Go read it now. It will make you a better thinker and programmer. However, I have a slight, semantic beef with refactoring. Here's Fowler's definition from the book:

noun: a change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior

verb: to restructure software by applying a series of refactorings without changing its observable behavior

That's a great definition of refactoring. My beef is not with the definition. My beef is with its purpose, which is to "make it easier to understand and cheaper to modify". Again, it's a great thing to make your code easier to understand and cheaper to modify. But that's not what I'm after, most of the time.

What I'm after is code that models the problem. This is the only reliable way to make software that works. Code that inadequately models the problem is littered with nested conditionals for special cases, is unnecessarily bound in time and context, and is generally obtuse. You might be able to understand what the code is doing, but it's unclear whether it should be doing it.

The only known way to write code that models the problem is to factor. Let's get a definition:

verb: to decompose code to reveal the structure of the problem

Factoring is inherently about decomposition. It means splitting functions into smaller functions (along the structural lines of the problem). It means finding those functions which are fundamental to the problem (you can tell they are fundamental because they are used in multiple places). It means revealing symmetries. It means separating concerns. Factoring is about uncovering structural beauty in problem domains.1 Symmetry, proportion, and harmony.

The problem with factoring is that it takes a long time. And you actually have to understand the domain. You have to explore the problem a lot longer, perhaps trying different variations in the code, before you can be satisfied that the code models the problem. Time is not something we have in our "Just ship it!" modern world.

The feeling of refactoring is like bringing order to a room: you put things away, you label things clearly, you might even throw out some old junk. But the feeling of factoring is like rebuilding a room for a specific purpose. Refactoring is cleaning up the kitchen. Factoring is taking the kitchen apart and building a new kitchen better suited to the styles of the individual chef. It's not practical to rebuild your kitchen all the time, though it is practical to tidy up. But when you do it, it makes all the difference.

That metaphor gets at the other fundamental difference between factoring and refactoring: refactoring does not change the behavior of the code, while factoring might. It might because the code might turn out to be incorrect for the problem. Refactoring can reveal bugs. But if you're going to fix the bug, you've stopped refactoring and gone to something else. In factoring, changing the behavior is just part of the process. From the factoring perspective, you're not fixing a bug. You're correcting the expression of your problem.

Refactoring by design and definition is focused on the code itself. Factoring is more of a process. It's a journey the programmer takes into the heart of the problem. In its wake, the hills and valleys of the problem are mapped out in the code. And the programmer ends, like in most journeys, a different person.

If you like this article, you might want to receive the free Clojure Gazette.

Learn More

  1. I suggest you choose a good notation.

<λ>

You may also be interested in the Clojure Gazette, a free, weekly email newsletter to inspire Clojure programmers.

23 Jul 23:19

Add-on Compatibility With Multi-Process Firefox – Friday, August 1st, 2014

by juanb

Hi everyone! On Friday, August 1st we will host a testday where we will focus on checking add-on compatibility while using Firefox Nightly in multi-process mode. Detailed instructions on how to help us test can be found in the testday etherpad.

Mozilla has been working a project called “Electrolysis” or “e10s” that allows users to open tabs each into a separate process. The aim is to help us improve the browser’s responsiveness and security. There is still a bit of work before the project can be tested by a larger audience, but one of the areas where we could use some help is add-on compatibility.

This is the list of add-ons we will be working with: http://arewee10syet.com/

No previous testing experience is required so feel free to join via #testday IRC channel and our moderators will offer you guidance and answer your questions.

When:
Starts: August 1, 2014, 1:00 am
Ends: August 1, 2014, 5:00 pm

24 Jul 13:00

Members Only: How to Make an Interactive Treemap

by Nathan Yau

Treemaps are useful to view and explore hierarchical data. Interaction can help you look at the data in greater detail.

Interactive treemap

Continue reading →

23 Jul 18:06

Editing photos as if they were audio files

by Nathan Yau

paris-echo

Masuma Ahuja and Denise Lu for the Washington Post applied a technique called databending to a bunch of photos. The idea is that computer files — even though they represent different things like documents, images, and audio — encode data in one form or another. It's just that sound files encode beats, notes, and rhythms, whereas image files encode hue, saturation, and brightness. So when you treat image files as if they were audio, you get some interesting results.

See Jamie Boulton's post from a couple of years ago for a detailed description on how to do this yourself with Audacity Effects.

23 Nov 01:40

Tutorial – Send email with the Arduino Yún

by John Boxall

Introduction

This is the third in a series of tutorials examining various uses of the Arduino Yún. In this article we’ll examine how your Arduino Yún can send email from a Google email account. Doing so gives you a neat and simple method of sending data captured by the Arduino Yún or other notifications.

Getting Started

If you haven’t already done so, ensure your Arduino Yún can connect to your network via WiFi or cable – and get a Temboo account (we run through this here). And you need (at the time of writing) IDE version 1.5.4 which can be downloaded from the Arduino website.

Finally, you will need a Google account to send email from, so if you don’t have one – sign up here. You might want to give your Arduino Yún an email address of its very own.

Arduino Yun Yún front

Testing the Arduino Yún-Gmail connection

In this first example we’ll run through the sketch provided by Temboo so you can confirm everything works as it should. This will send a simple email from your Arduino Yún to another email address. First, copy the following sketch into the IDE but don’t upload it yet:

/*
  SendAnEmail

  Demonstrates sending an email via a Google Gmail account using the Temboo Arduino Yun SDK.

  This example code is in the public domain.
*/

#include <Bridge.h>
#include <Temboo.h>
#include "TembooAccount.h" // contains Temboo account information

/*** SUBSTITUTE YOUR VALUES BELOW: ***/

// Note that for additional security and reusability, you could
// use #define statements to specify these values in a .h file.

// your Gmail username, formatted as a complete email address, eg "bob.smith@gmail.com"
const String GMAIL_USER_NAME = "sender@gmail.com";

// your Gmail password
const String GMAIL_PASSWORD = "gmailpassword";

// the email address you want to send the email to, eg "jane.doe@temboo.com"
const String TO_EMAIL_ADDRESS = "recipient@email.com";

boolean success = false; // a flag to indicate whether we've sent the email yet or not

void setup() {
  Serial.begin(9600);

  // for debugging, wait until a serial console is connected
  delay(4000);
  while(!Serial);

  Bridge.begin();
}

void loop()
{
  // only try to send the email if we haven't already sent it successfully
  if (!success) {

    Serial.println("Running SendAnEmail...");

    TembooChoreo SendEmailChoreo;

    // invoke the Temboo client
    // NOTE that the client must be reinvoked, and repopulated with
    // appropriate arguments, each time its run() method is called.
    SendEmailChoreo.begin();

    // set Temboo account credentials
    SendEmailChoreo.setAccountName(TEMBOO_ACCOUNT);
    SendEmailChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
    SendEmailChoreo.setAppKey(TEMBOO_APP_KEY);

    // identify the Temboo Library choreo to run (Google > Gmail > SendEmail)
    SendEmailChoreo.setChoreo("/Library/Google/Gmail/SendEmail");

    // set the required choreo inputs
    // see https://www.temboo.com/library/Library/Google/Gmail/SendEmail/ 
    // for complete details about the inputs for this Choreo

    // the first input is your Gmail email address
    SendEmailChoreo.addInput("Username", GMAIL_USER_NAME);
    // next is your Gmail password.
    SendEmailChoreo.addInput("Password", GMAIL_PASSWORD);
    // who to send the email to
    SendEmailChoreo.addInput("ToAddress", TO_EMAIL_ADDRESS);
    // then a subject line
    SendEmailChoreo.addInput("Subject", "Email subject line here");

     // next comes the message body, the main content of the email   
    SendEmailChoreo.addInput("MessageBody", "Email content");

    // tell the Choreo to run and wait for the results. The 
    // return code (returnCode) will tell us whether the Temboo client 
    // was able to send our request to the Temboo servers
    unsigned int returnCode = SendEmailChoreo.run();

    // a return code of zero (0) means everything worked
    if (returnCode == 0) {
        Serial.println("Success! Email sent!");
        success = true;
    } else {
      // a non-zero return code means there was an error
      // read and print the error message
      while (SendEmailChoreo.available()) {
        char c = SendEmailChoreo.read();
        Serial.print(c);
      }
    } 
    SendEmailChoreo.close();

    // do nothing for the next 60 seconds
    delay(60000);
  }
}

Before uploading you need to enter five parameters – the email address to send the email with, the password for that account, the recipient’s email address, and the email’s subject line and content. These can be found in the following lines in the sketch – for example:

const String GMAIL_USER_NAME = "sender@gmail.com";
const String GMAIL_PASSWORD = "emailpassword";
const String TO_EMAIL_ADDRESS = "recipient@email.com";
SendEmailChoreo.addInput("Subject", "This is the subject line of the email");
SendEmailChoreo.addInput("MessageBody", "And this is the content of the email");

So enter the required data in the fields above. If you’re sending from a Google Apps account instead of a Gmail account – that’s ok, just enter in the sending email address as normal. Temboo and Google will take care of the rest.

Finally, create your header file by copying the the header file data from here (after logging to Temboo) into a text file and saving it with the name TembooAccount.h in the same folder as your sketch from above. You know this has been successful when opening the sketch, as you will see the header file in a second tab, for example:

arduino yun temboo header file

Now you can upload the sketch, and after a few moments check the recipient’s email account. If all goes well you will be informed by the IDE serial monitor as well (if your Yún is connected via USB). It’s satisfying to see an email come from your Arduino Yún, for example in this short video.

If your email is not coming through, connect your Arduino Yún via USB (if not already done so) and open the serial monitor. It will let you know if there’s a problem in relatively plain English – for example:

Error
A Step Error has occurred: “An SMTP error has occurred. Make sure that your credentials are correct and that you’ve provided a fully qualified Gmail
username (e.g., john.smith@gmail.com) for the Username input. When using Google 2-Step Verification, make sure to
provide an application-specific password. If this problem persists, Google may be restricting access to your account, and you’ll need to
explicitly allow access via gmail.com.”. The error occurred in the Stop (Authentication error) step.
HTTP_CODE
500

So if this happens, check your email account details in the sketch, and try again.

Sending email with customisable subject and content data

The example sketch above is fine if you want to send a fixed message. However what if you need to send some data? That can be easily done. For our example we’ll generate some random numbers, and integrate them into the email subject line and content. This will give you the framework to add your own sensor data to emails from your Arduino Yún. Consider the following sketch:

/*
  SendAnEmail

  Demonstrates sending an email via a Google Gmail account using the Temboo Arduino Yun SDK.

  This example code is in the public domain.
*/

#include <Bridge.h>
#include <Temboo.h>
#include "TembooAccount.h" // contains Temboo account information

/*** SUBSTITUTE YOUR VALUES BELOW: ***/

// Note that for additional security and reusability, you could
// use #define statements to specify these values in a .h file.

// your Gmail username, formatted as a complete email address, eg "bob.smith@gmail.com"
const String GMAIL_USER_NAME = "sender@gmail.com";

// your Gmail password
const String GMAIL_PASSWORD = "gmailpassword";

// the email address you want to send the email to, eg "jane.doe@temboo.com"
const String TO_EMAIL_ADDRESS = "recipient@email.com";

int a,b; // used to store our random numbers
boolean success = false; // a flag to indicate whether we've sent the email yet or not

void setup() 
{
  Serial.begin(9600);
  // for debugging, wait until a serial console is connected
  delay(4000);
  while(!Serial);
  Bridge.begin();
  randomSeed(analogRead(0)); // fire up random number generation
}

void loop()
{
  // generate some random numbers to send in the email
  a = random(1000);
  b = random(1000);
  // compose email subject line into a String called "emailSubject"
  String emailSubject("The random value of a is: ");
  emailSubject += a;
  emailSubject += " and b is: ";
  emailSubject += b;  
  // compose email content into a String called "emailContent"
  String emailContent("This is an automated email from your Arduino Yun. The random value of a is: ");
  emailContent += a;
  emailContent += " and b is: ";
  emailContent += b;  
  emailContent += ". I hope that was of some use for you. Bye for now.";  

  // only try to send the email if we haven't already sent it successfully
  if (!success) {

    Serial.println("Running SendAnEmail...");

    TembooChoreo SendEmailChoreo;

    // invoke the Temboo client
    // NOTE that the client must be reinvoked, and repopulated with
    // appropriate arguments, each time its run() method is called.
    SendEmailChoreo.begin();

    // set Temboo account credentials
    SendEmailChoreo.setAccountName(TEMBOO_ACCOUNT);
    SendEmailChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
    SendEmailChoreo.setAppKey(TEMBOO_APP_KEY);

    // identify the Temboo Library choreo to run (Google > Gmail > SendEmail)
    SendEmailChoreo.setChoreo("/Library/Google/Gmail/SendEmail");

    // set the required choreo inputs
    // see https://www.temboo.com/library/Library/Google/Gmail/SendEmail/ 
    // for complete details about the inputs for this Choreo

    // the first input is your Gmail email address
    SendEmailChoreo.addInput("Username", GMAIL_USER_NAME);
    // next is your Gmail password.
    SendEmailChoreo.addInput("Password", GMAIL_PASSWORD);
    // who to send the email to
    SendEmailChoreo.addInput("ToAddress", TO_EMAIL_ADDRESS);
    // then a subject line
    SendEmailChoreo.addInput("Subject", emailSubject); // here we send the emailSubject string as the email subject

     // next comes the message body, the main content of the email   
    SendEmailChoreo.addInput("MessageBody", emailContent); // and here we send the emailContent string

    // tell the Choreo to run and wait for the results. The 
    // return code (returnCode) will tell us whether the Temboo client 
    // was able to send our request to the Temboo servers
    unsigned int returnCode = SendEmailChoreo.run();

    // a return code of zero (0) means everything worked
    if (returnCode == 0) {
        Serial.println("Success! Email sent!");
        success = true;
    } else {
      // a non-zero return code means there was an error
      // read and print the error message
      while (SendEmailChoreo.available()) {
        char c = SendEmailChoreo.read();
        Serial.print(c);
      }
    } 
    SendEmailChoreo.close();

    // do nothing for the next 60 seconds
    delay(60000);
  }
}

Review the first section at the start of void loop(). We have generated two random numbers, and then appended some text and the numbers into two Strings – emailContent and emailSubject.

These are then inserted into the SendEmailChoreo.addInput lines to be the email subject and content. With a little effort you can make a neat email notification, such as shown in this video and the following image from a mobile phone:

arduino yun email demonstration

Conclusion

It’s no secret that the Yún isn’t the cheapest development board around, however the ease of use as demonstrated in this tutorial shows that the time saved in setup and application is more than worth the purchase price of the board and extra Temboo credits if required.

And if you’re interested in learning more about Arduino, or want to introduce someone else to the interesting world of Arduino – check out my book (now in a third printing!) “Arduino Workshop” from No Starch Press.

tronixstuff

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

The post Tutorial – Send email with the Arduino Yún appeared first on tronixstuff.

25 Jul 00:46

12 things product managers should do in their first 30 days at a new company

by Boris Mann
12 things product managers should do in their first 30 days at a new company by Ken Norton, thenextweb.com
24 Jul 00:00

Don't Send Your Kid to the Ivy League


William Deresiewicz, http://www.newrepublic.com/article/118747/ivy-league-schools-are-overrated-send-your-kids-elsewhere, Jul 27, 2014


As I commented on Twitter the other day, I rarely agree with what I read in New Republic, but this article hits much more than it misses. So while you shouldn't consider this post to be a blanket endorsement of everything in the article, it is certainly recommended. "The more prestigious the school, the more unequal its student body is apt to be," writes William Deresiewicz. And as the selection process bcomes more rigorous it becomes more unequal as parents spend the time and money necessary to position their children for admission. "Elite colleges are not just powerless to reverse the movement toward a more unequal society; their policies actively promote it."

[Link] [Comment]
24 Jul 18:31

When journalists become politicians — the perks and perils for Kirk LaPointe, Michael Valpy, Rene Levesque, Nicole Parton, and more,

by Frances Bula

Got to talk to yet another one of my former bosses, Mel Rothenburger of the once-great Kamloops Daily News, about what it’s like to go from journalist to politician. Do your former colleagues give you the kid-glove treatment? (No) Is it more rewarding than journalism in some ways? (Yes, because you get things done instead of just saying they should be done.) Is it harder than it looks? (Yes)

Here was my story in the Globe last week on this.

25 Jul 06:40

Riding the Juggernaut That Left Print Behind

Riding the Juggernaut That Left Print Behind:

I linked to this the other day, but what the hell, I’m linking again. David Carr:

For the last six months, my magazines, once a beloved and essential part of my media diet, have been piling up, patiently waiting for some mindshare, only to be replaced by yet another pile that will go unread. I used to think that people who could not keep up with The New Yorker were shallow individuals with suspect priorities. Now I think of them as just another desperate fellow traveler, bobbing in a sea of information none of us will see to the bottom of. We remain adrift.

I’m someone who used to rush home from school on days that I new the newest copy of a magazine I subscribed to was due to arrive at my home. I still subscribed to many of those magazines, on my iPad, and I basically never open them.

I really can’t remember the last time I read one. Maybe 18 months ago?

25 Jul 05:39

"Time and time again, however, the Fire Phone has reminded me that there’s a difference between good..."

“Time and time again, however, the Fire Phone has reminded me that there’s a difference between good ideas about phones and good phones. A big difference.”

- David Pierce, talking about Amazon’s Fire Phone, which The Verge, like basically everyone else, panned. 
24 Jul 21:52

The New Minivan: Neil, Rafe and the Bakfiets

by pricetags

Chris Bruntlett has a new piece for Vancouver is Awesome, starring Neil Salmond (PT readers will recognize him as Neil21) and his son Rafe (below).  Neil was in the market for a bakfiets (Dutch for “box bike’) – another sign of a steadily maturing bike culture - and Chris tells the story here of their New Minivan.

.

Neil

.

UPDATE: Ron Richings provides news about a similar innovation – the HouseTrike. Again from the Dutch!

From urbanvelo:

Bike camping seems to be the rage right now, but for slower traveling nomads or those living in the city, popping up a tent in public gets you in trouble almost immediately.

An Amsterdam artist, Bas Sprakel, has considered this dilemma and created an intermediate between bike camping and homeless domiciles, called the HouseTrike. The mobile temporary home includes a bed with an internal locking mechanism for safety. Sprakel is considering making adjustments in the next fabrication and taking the bike on a tour of Europe to show it’s practical nature.


24 Jul 20:49

Rhetoric and Resiliency: Lessons from this week on TransLink

by pricetags

Tim Yzerman draws attention to Nathan Pachal’s comments on the TransLink system failure in his South Fraser Blog - worth excerpting:.

The dangers of having a too efficient transit system: the SkyTrain meltdown

During the system failure yesterday, I saw some truly silly comments from the anti-tax, anti-transit crowd saying that if TransLink didn’t have a new head office, executive staff, public arts, police, or a facility to refurbish old SkyTrain cars, there wouldn’t have been a system failure on Thursday or Monday. The implication was that TransLink was spending money on these items instead of keeping the system in a state of good repair; this couldn’t be further from the truth.

I take the SkyTrain from Surrey to Main Street Station at least five days a week, and sometime after 8 pm. Because TransLink is replacing the power rails along the entire Expo Line to keep the system a state of good repair, it takes me an extra 15 minutes to get home if I’m working the late shift.

[Other examples follow.]

… when I hear people claim that the SkyTrain failures of the last few days are due mismanaged priorities, I have to question the credibility of the people making these claims.

Ironically, the people campaigning to strip TransLink of funding in the name of efficiency may be responsible for the time it took to get service restored and get people moving over the last few days. …

Due to the provincially mandated requirement to become more efficient, TransLink has reduced the resiliency of the system.

For example, TransLink didn’t purchase a $20 million backup system that may have allowed SkyTrain service to be restored faster on Thursday. Also, TransLink doesn’t have the long-term funding to pay for the over $1 billion in upgrades that will be required to keep the SkyTrain from becoming overcrowded and running as reliably as possible over the coming decades.

TransLink has tightened up the amount of spare buses and staffing on the bus network. This means that when emergency bus service is needed, there are fewer people available to drive these buses, and few buses available.

What should be apparent from the last few days is that having a resilient transit system is important. …

.

Observations:

The object of those who wish to defund TransLink, certainly to ensure it gets no more tax dollars, is to convince people to act against their self-interest by reinforcing the hate-on of TransLink among its users.

So appreciate the irony: By trying to meet the mandate of efficiency in order to respond to the demands of the provincial government, placate its critics and live within constraints, it lacks the resiliency to respond to the kind of incidents that occurred this last week.  Thereby justifying more criticism and less resources, likely resulting in more incidents in the future and less ability to respond.  Thereby justifying more criticism … etc.   This is how the region ends up with a decaying transit system over time.

Secondly, why is it left to Nathan Pachal to make these points.  Where, in particular, is the Chair of the TransLink board and its members?  Why are they silent at times like this?


24 Jul 17:37

Pre-Motordom: “”When the streets were your playground!”

by pricetags

North London, 1954

.

London

.

That was 60 years ago – less than a single lifetime. (How long to undo Motordom?)  Of course, looking forward from 60 years before that … and you might have come up with this, as a French illustrator did in 1910:

.

1910

What the Year 2000 would be like.


24 Jul 16:40

The Daily Scot

by pricetags

Scot recommends this from buzzbuzznews:

.

Mind the gap: The price difference between a house and condo in Canada just got bigger

The price gap between a standard two-storey house and condo in Vancouver just hit $712,027. If you had that kind of money sitting in the bank, you could either upgrade your suite to a single family home in the city, or you could buy additional condos in Winnipeg (average price $209,023), Ottawa ($257,500) and Halifax ($217,500) – and still have cash leftover.

.

buzz

Click to enlarge. 

 

 

 


24 Jul 17:26

Quote: Taras Grescoe on self-driving cars

by pricetags

The more I read about self-driving cars, the more I realize that nobody knows what they’ll mean for our cities.

(a) Self-Driving Cars Will Mean More Traffic

(b) Self-Driving Cars Will Crash Less, Reduce Traffic & Cut Pollution 


23 Jul 23:33

And how’s your week going?

by pricetags

Better than SkyTrain’s, I’m guessing.

Is the near-30 year-old showing its age?  As a reminder of its cutting-edge technology, reporter Jon Woodward passed along this documentary from 1985:

Going to Town is a 30 minute 1985 documentary by JEM Productions for B.C. Transit, capturing the genesis of the SkyTrain project and its construction. Featuring James “Quick” Parker of the B.C. Lions and a killer sax-filled soundtrack! (The solo is at 26:45.)

.

A few thoughts:

  • The more reliable the technology, the less tolerance we have for its failure.
  • We hold transit to a different standard than car-based transportation.  Radio stations, every weekday from 4 to 7 pm, will report all the failures on roads throughout Metro.  A fan-belt breaking on a bridge or tunnel can result in delays for thousands – and that’s just a typical day.
  • I thought it might be faster to take a taxi this morning than transit.  After waiting without notice for 30 minutes for the taxi to show, I gave up.  Unfortunately, there wasn’t a door to break open – and it only affected me.  I will, however, take taxis again.
  • The only thing that will restore trust is continued reliable performance of the SkyTrain system.  But for the confidence of the public, a review is in order by a trusted third party: to explain what happened, to suggest improvements in response, and, most importantly, to project what will be needed to maintain a high level of performance as the transit system ages and is subject to ever-increasing demand.

Any other thoughts, readers?


23 Jul 23:02

Affordable Housing in San Francisco

by pricetags

Ray Spaxman passes on this piece from dezeen:

Brooklyn artist Mark Reigelman and San Francisco architect Jenny Chapman have installed a wooden hut in an unusual city location – suspended on the side of a San Francisco hotel like a bird box.

.

dezeen_Manifest-Destiny-by-Mark-Reigelman_1

.

The concept:

Manifest Destiny! is about our God-given imperative as modern explorers, to seek out parcels of unclaimed territory and boldly establish a new home front in the remaining urban voids of San Francisco.

Lights visible through the windows give the impression that someone is home with electricity generated from a solar panel mounted onto the roof.

.

dezeen_Manifest-Destiny-by-Mark-Reigelman_4


24 Jul 06:50

Twitter Favorites: [ReneeStephen] Oh, Drupal.

Renée Stephen @ReneeStephen
Oh, Drupal.
24 Jul 15:00

Trimming In Public Post 6

by Ricky
This entry is part 7 of 10 in the series Trimming In Public

The Trimming In Public series is a way for me to share my RSS feeds with you, while at the same time, cleaning the list out for feeds that are dead or no longer of interest. Hopefully, you’ll find something new along the way that you’d like to add to your subscriptions.

Trimming In Public 6

101. Mobileways.de – This was the home of Jan Ole Sur, the creator of Gravity, the best Twitter (and overall social) app for Symbian devices. He’s still doing his thing, but obviously, no one cares anymore (cause Symbian is dead, if you haven’t picked up on that theme). Tragic, cause he was great. He should create Android apps. *I should caveat this with the fact that right now, I’m using my old N95-3 as a hold-over until my new phone arrives, and Janole is still supporting Gravity users, and more importantly, Gravity still works. Amazing.*

Determination: ELIMINATE

102. MocoNews.net – This used to be MocoNews.net, then apparently it became PaidContent.org, and now it’s GigaOm, which I already have subscribed.

Determination: ELIMINATE

103. moubail – No clue what this used to be, but now it redirects to “Who What Wear” with a focus on Samsung style, which I have no use for.

Determination: ELIMINATE

104. Mozilla Labs – Website for Mozilla Labs, primarily focused around Firefox, with other stuff sprinkled in. I don’t use a single thing that Mozilla makes anymore, so I don’t need this.

Determination: ELIMINATE

105. mTrends – Personal blog of Rude De Waele, another friend I met while running Symbian-Guru.com. Rudy recently relocated to London, and is an accomplished author. He’s always got something insightful to share.

Determination: KEEP

106. Murphy’s Milestones – This was the family blog of a personal friend. Hasn’t updated since 2010…so…..yeah.

Determination: ELIMINATE

107. Murray Cumming – Primarily focused on coding and C++ and that sort of thing. I believe I followed during the 2 weeks that Maemo was interesting.

Determination: ELIMINATE

108. My Nokia Blog – MyNokiaBlog is primarily run by Jay Montano, who, incidentally, also introduced me to Michael from MobileBurn.com and got me the job there. MyNokiaBlog is one of the few blogs that successfully made the leap from Symbian to Windwos Phone with Nokia, and while niche and slightly fanboi, the team does a GREAT job keeping up with things.

Determination: KEEP

109. My Phone Book – This was a site for Andrew to detail the progress of his book “My Phone Book” covering all the phones that he owned, and his experiences with each of them. It’s an interesting read, especially since I also had most of the phones that he had. Now that the book is out, though, the site’s not being updated.

Determination: ELIMINATE

110. Nimbuzz – Nimbuzz was one of the early VOIP/IM clients for Symbian that has attempted to make the leap to other platforms. Since I exclusively use Hangouts for IM now, it’s useless and crowds my feeds.

Determination: ELIMINATE

111. Nokia Beta Labs Blog – Nokia Beta Labs – man, I used to freakin LOVE this site. This was a way for Nokia to release betas of projects they were working on to consumers, and you could provide feedback, etc. They did an awesome job of engaging the community, too. Unfortunately, with the move to Windows Phone, it’s been pretty bare.

Determination: ELIMINATE

112. Nokia Daily News – This was the site for the Nseries activity in the U.S. Makes me miss Nokia’s Nseries, but alas, it’s completely dead.

Determination: ELIMINATE

113. Nokia Experts – This was a site in the MObile Nations community, started and maintained by Matthew Miller (aka PalmSolo). Matthew’s a great guy, and really knows his way around mobile. However, he killed this site in 2011, shortly after I killed Symbian-Guru, and I follow him elsewhere anyways.

Determination: ELIMINATE

114. Nokia N97 Fanatics – Back when Nokia was launching 20+ phones/year, there was a time when the ‘cool’ thing to do was to launch device-specific blogs, get them up quickly with content, and just milk the traffic with ads. Not saying that’s EXACTLY what Mike did here, but it’s close. Either way, Mike writes elsewhere, and the N97 sucked.

Determination: ELIMINATE

115. Nokia Press Bulletin Board – This was the RSS feed for Nokia’s press releases. I needed this for Symbian-Guru.com, but obviously don’t anymore.

Determination: ELIMINATE

116. Nokia Users News Feed – NokiaUsers was one of the premier communities for….Nokia users, and their forum was, at one point, the best community. However, the site seems abandoned, like so many other Nokia sites in my feeds.

Determination: ELIMINATE

117. OffTheBeatenPath – I’m a blogger, so my wife wanted a blog of her own, too. To her credit, she maintained it much longer than I thought she would, but hasn’t updated it in a year, and probably doesn’t remember the password, anyways.

Determination: ELIMINATE

118. OfficeTally – This was a fan blog for The Office (U.S. version). Since the show is now over, I can’t fathom what on earth they would have to talk about.

Determination: ELIMINATE

119. Official Android Blog – This is the official blog of the Android team. Definitely a keeper.

Determination: KEEP

120. Om Malik – I was introduced to Om Malik’s writing through Business 2.0 magazine, and I read him to this day. This is his personal blog, and it’s outstanding. Om is an old-school blogger who still understands the medium and sees the tremendous value in it. I *love* reading his stuff, and having a long coffee with Om is on my bucket list.

Determination: KEEP

 

24 Jul 13:17

What I Instagrammed Vs. What Was Really Happening, Or My Entire Life Is A Lie

by A Photo Editor

Do you want to know how my pictures I shot before I actually captured a photo that both accurately (and attractively) displayed how happy I was in this moment? 56. I hope you’re judging me, because I am.

via Bustle.

24 Jul 15:45

Google celebrating Chromecast’s 1st birthday by giving away All Access subscription for free

by Rajesh Pandey
The proud papa of Chromecast, Mario Queiroz, today announced that Google’s little experimental device has turned a year old today. Google had initially launched the Chromecast to allow users to quickly and easily watch their favorite TV shows or movies on the big screen with their Android device acting as a remote.  Continue reading →