Categories
Uncategorized

Tales from my job search: My “Silicon Valley” moments with Pebble

Here’s another interesting tidbit from my Magnum Opus Job Application that you might have missed…

You are watching Silicon Valley, aren’t you?

If you’re a regular reader of my personal blog, The Adventures of Accordion Guy in the 21st Century (and hey, it’s possible, what with over 27 million pageviews since its inception in 2001), there’s a slim chance that you might remember my Secret Side Trip in the summer of 2012.

The Pebble smartwatches of that time (2012).

As I write this, almost five years have passed since the Secret Side Trip. In that time, I have never revealed where I went or what the purpose of that trip was. It can now be told: I was in the San Francisco Bay Area (which I call “The Other Bay Area” since I live in Tampa) to interview for evangelism positions at a couple of companies that I’m quite sure you’ve heard of. One of them was the smartwatch company Pebble.

The importance of networking and writing good cold emails

I was in the Philippines in June 2012, and it was generally known in my professional social circle that I was looking for new opportunities. I didn’t have international roaming (I was still living in Toronto at the time, and didn’t want to pay the exorbitant data roaming rates that my mobile provider, Rogers, wanted), but still had online access thanks to hotel wifi.

One evening — which would’ve been morning on this side of the globe — I received a couple of messages on friends via social media telling me that they’d seen an announcement that Pebble was looking for a developer evangelist, and that they thought the role was made just for me. I never saw the announcement, and without my network, I never would’ve known about the opening.

I quickly jumped on the opportunity and wrote them an email, text text of which I’ve copied and pasted below:


Date: Mon, Jun 18, 2012 at 3:11 PM
From: joey@joeydevilla.com

Subject: I want to be Pebble’s developer evangelist!

Dear Pebble people:

I’m Joey deVilla, and I’d like to throw my hat into the ring for the position of developer evangelist promoting Pebble. Yours is an exciting project in my favourite field — mobile development — and I’d love to be involved!

I have a dozen years’ experience working either as a developer evangelist or playing that role as a programmer. I’ve been blogging actively since 2001 on my personal blog, The Adventures of Accordion Guy in the 21st Century (http://joeydevilla.com/) and my technical blog, Global Nerdy (http://globalnerdy.com/), has been around since 2006 and got 1.5 million pageviews last year. I’ve organized developer events ranging from small gatherings at coffee shops to cross-country conferences for thousands of developers and IT pros and I’ve delivered presentations at these events.

Among the companies for which I’ve held the developer evangelist role are:

– OpenCola, Cory Doctorow’s startup, where among other things, we helped popularize the concept of “Whuffie” (a unit of social capital, defined here: ). OpenCola’s development offices were in Toronto, while Cory and I worked out of the evangelism office in San Francisco.

– Tucows, where the position was called “Technical Community Development Coordinator”, the longest title I have ever held (it’s one syllable shy of a haiku). I shortened it to “TC/DC””.

– Microsoft, where I was hired from the open source world to reach out to developers who might not ordinarily consider using Microsoft tools and technologies. I promoted ASP.NET MVC, Windows Azure and was on the Windows Phone “Champs” team. I also helped organize events like “Make Web Not War”, a conference on Microsoft/open source interoperability.

– Shopify, where I most recently worked. I oversaw the Shopify Fund, a $1 million pool of money being used to encourage developers to build apps on the Shopify API and was Shopify’s representative on the 2011 BarCamp Tour, a group of startups that sponsored and actively participated in BarCamps across the country.

I’m also known for bringing my accordion — I call it “social hardware” — to developer conferences and gatherings. I play rock and pop accordion, from Nine Inch Nails to Britney Spears, and I use it as a tool for breaking the ice, livening up technical presentations and adding a little fun weirdness to conferences (here’s a video of me performing at the evening keynote of RailsConf 2007: https://www.globalnerdy.com/2007/05/24/playing-accordion-at-the-railsconf-keynote-or-theyd-never-let-me-do-this-at-javaone/)

I’m currently based in Toronto, but I’d be willing to relocate for the opportunity to promote Pebble. I’ve lived and worked in the Bay Area before (during the Bubble, at OpenCola) under a TN-1 visa. I still have my U.S. Social Security card and also have a NEXUS card, which cuts the time I spend in U.S. Customs down to 10 seconds.

I believe that I would be the perfect evangelist for you, and would love to talk to you about the opportunity to evangelize Pebble to developers. I’ve enclosed my resume with this email (PDF, 110K). If you have any questions, I would be very happy to answer them.

My LinkedIn profile:
http://linkedin.com/in/joeydevilla

My resume:
https://www.globalnerdy.com/wordpress/wp-content/uploads/2012/06/Joey-deVilla-2012-Resume.pdf

My technical blog:
http://globalnerdy.com/

My personal blog:
http://joeydevilla.com

My Twitter account: (@AccordionGuy)
https://twitter.com/#!/AccordionGuy

A mere four hours later, I got this reply from Pebble’s founder and CEO, Eric Migicovsky:

Date: Mon, Jun 18, 2012 at 7:02 PM
From: Eric Migicovsky
Subject:  Re: I want to be Pebble’s developer evangelist!

Hey Joey,
Thanks for sending all the info. It would be really good to chat soon. I’m in UK right now for Leweb, but do you want to Skype on Wednesday morning EST?


The next day, we were chatting on Skype, with him in a hotel room in London, and me in the business center of my hotel in Manila (The Ascott in Makati, which I highly recommend), both of us dealing with the sound occasionally dropping out and trying to work out dates for meeting up for an in-depth interview in Palo Alto.

“First world problems are the best,” I remember saying.

Two days in the Valley

Pebble flew me from Tampa to San Francisco on their dime…

An actual photo taken on the first leg of my flight from Tampa to San Francisco.

…and put me up for two nights at this hotel…

An actual photo taken in the hotel lobby on the evening I arrived.

…so that I could do two days’ worth of interviews at Pebble HQ.

In the summer of 2012, Pebble HQ and Eric’s house were one and the same. This isn’t all that different from the office setting in the TV series Silicon Valley, with Erlich Bachman’s house functioning as Pied Piper HQ…

The living room in Erlich Bachman’s house / Pied Pier HQ in Silicon Valley.

…except that rather than being like this…

The exterior of Erlich Bachman’s house / Pied Pier HQ in Silicon Valley.

…it was more like a townhouse, closer to the center of town, only a couple of blocks from University Avenue and the CalTrain station…

Google Street View of a street near Eric’s place.

…but if you replace the early 1960s house design in the Silicon Valley promo photo below with 1990s townhouse design, Pebble’s living-room-turned-into-office setup wasn’t all that different from Pied Piper’s:

The workspace in Erlich Bachman’s house / Pied Pier HQ in Silicon Valley.

The interview

I took the photo above on the first day of the two-day interview. I was overdressed, by Silicon Valley techie standards, but I’m a grown-ass man, and if you’re over 30, in a white-collar line of work, and not in a tropical climate, you should wear a jacket to your job more often than not. I also figured that I’d also stand out against most of the other people dropping by Pebble for a job, who would show up in the stereotypical startup schlub uniform of hoodie, T-shirt, and jeans.

I spent a good amount of my time with Eric brainstorming ideas for Pebble. A lot of people feel uncomfortable when this sort of thing happens; they see this as a company’s way of milking them for ideas for free, especially when the interview doesn’t result in their getting hired. I don’t, for the following reasons:

  • The job for which I was applying requires generating ideas. I needed to prove to them that I could do that.
  • I’d rather turn all my dials up to 11 in an interview and go all out. I think that putting in a half-hearted effort in order to prevent them from taking my precious ideas and running with them without my getting anything in return would guarantee a half-assed interview performance.
  • There’s a world of difference between having an idea and turning that idea into reality. As Thomas Edison said, “Genius is one percent inspiration and ninety-nine percent perspiration.”
  • The bigger danger to me was them not hearing my ideas, not Pebble “stealing” my ideas. To quote Tim O’Reilly, “Obscurity is a far greater threat to authors and creative artists than piracy.”

I’m particularly pleased with one of my answers that came up during the brainstorming session. It was in response to this question from Eric: “How would you suggest dealing with the watch’s one-bit resolution?” The classic Pebble watch screens were effectively black-and-white: no color, and all their pixels had only an “on” state and an “off” state.

Windell Oksay throws the right-hand rule physics gang sign.
Taken from this article about Atkinson dithering.

I answered by saying that they should think of their screens as “retro”, embrace their one-bit-ness, and borrow as many graphic tricks from the original Macintosh as they could, such as using dithering to simulate grayscale colors, as shown in the picture above.

I also spent a few hours on their programming challenge, which was to come up with a simple app for Pebble’s predecessor, the inPulse smartwatch, which was designed to be a BlackBerry accessory. They set me up at a coffee table, pointed me to where I could download the inPulse SDK, and said “see what you can come up with.”

The exercise required using things I’d never used before (Oracle VirtualBox, the inPulse SDK) and things I hadn’t used in ages (gcc and C), but in an afternoon, I not only had a working inPulse dev environment, but a working “Magic 8-Ball” app running on the SDK’s simulator.

Outcomes and output

If you know me personally, or if you look at my LinkedIn profile, you’ll know that I didn’t get the job. I think the interview went well, and I continued corresponding with Pebble after the interview, sending them writing samples and other artifacts of my developer evangelism at previous companies, but as July turned into August and then September, no responses came. I believe they ended up going with someone else for the role.

In September 2012, when my friend Katherine Hague was still running her quick-and-easy e-commerce service, ShopLocket (which has since been acquired), I introduced her to Eric via email, thinking that it would be beneficial to both ShopLocket and Pebble, and perhaps might even get my conversation with Pebble going again. As far as I know, nothing came of it.

One bit of my output from my Pebble interview lives on today: my inPulse Magic 8-Ball tutorial, located in my GitHub account. It’s one of a very few inPulse programming tutorials still on the web today, and in my opinion, it’s the most through, best-written, and best-designed one out there. Give it a look, and marvel at my programming and writing prowess!

Why you should hire me

If your organization needs someone with technical skills who can also communicate with a wide range of audiences — even to kids, with the assistance of a puppet c0-host — you may be interested to know that I’m available and looking for work.

If you’re looking for someone with desktop, web, mobile, and IoT development skills who can also communicate to technical and non-technical audiences, or a marketer or evangelist who also has a technology background and can code, you should talk to me.

If you’d like to learn more, you can:

Categories
Uncategorized

Tales from my job search: That time I had a children’s show about technology, complete with a puppet friend

The original version of my magnum opus job application, which was for a particular job at a particular company, failed in two respects:

  1. It failed to advance me to the next round of their candidate selection process. I got the “We get many quality applicants that we have to turn down, and you’re one of them — good luck in your future endeavors!” email on Friday. This sort of thing happens, and that’s why I posted a generalized version of the application on this blog. I didn’t want all the work I put into it to be for naught simply because it didn’t impress one prospective employer.
  2. It’s pretty big. There’s a lot of stuff in there because I’ve done a lot of stuff in my career, and it makes for a lot of reading.

There’s not much I can do about the first failure, but there is something I can do about the second. I’m going to highlight some of the items I featured in the magnum opus job application that may have been lost in its deluge of information, starting with this one…

Developer Jr., my short-lived children’s technology show

Back in 2010, when I was a Developer Evangelist at Microsoft, Kelly Bateman and Andy Walker approached me with hosting an web show jointly created by Microsoft Canada and the video tech tutorial site Butterscotch.com (a branch of Tucows). It was called Developer Jr., and it would show its young viewership — around the ages of 8 through 14 — how to make the most of everyday technology. Kelly managed to get funding for two episodes from her department, but we were both unable to find some group within Microsoft Canada that could cover the budget for more; nobody within that branch of the organization had a mandate to reach the show’s audience.

When preparing the show, we shot some test footage with a number of human co-hosts until someone suggested that we get puppeteer Brian Hogg to create a co-star just for the show. That’s how my co-host, Junior, was born.

Here’s the first episode, in which Junior and I walk the audience through building a simple game using the Windows/Xbox 360 game development system, Kodu. To this day, I still get emails from people who see the video and want to know more about Kodu:

In the second episode, Junior and I show our audience how to make their own movies, complete with closing credits, using Windows Movie Maker:

We also shot a couple of promo videos, such as this one where Junior and I are interviewed by Developer Jr.’s co-producer and director Matt Harris

…and this quick teaser promo with Junior and me:

Why you should hire me

If your organization needs someone with technical skills who can also communicate with a wide range of audiences — even to kids, with the assistance of a puppet c0-host — you may be interested to know that I’m available and looking for work.

If you’re looking for someone with desktop, web, mobile, and IoT development skills who can also communicate to technical and non-technical audiences, or a marketer or evangelist who also has a technology background and can code, you should talk to me.

If you’d like to learn more, you can:

Categories
Uncategorized

Tales from my job search: Taming Google with Python to prove that I can code


Regular readers of this blog or followers of my LinkedIn or Twitter accounts will know that I’m currently looking for a new job. I’ve been doing the requisite searching and networking, and have taken some less typical approaches such as publicizing my magnum opus job application (which was actually an application to a prospective employer, with information about that prospect sanitized out) and ramping up my activities at local events (such as the recent Makers Hustle Harder hackathon, and various local meetups).

In this article, I’m sharing a Python program that I wrote as my solution to a programming challenge issued to candidates for a developer marketer position. I didn’t land the job, but going through the challenge was still a worthwhile experience, and worth sharing here.

The position and the challenge

The position for which I was applying was that of Developer Marketing Manager at a company whose online service allows users to integrate or “glue” various web and other applications together to create new functionality, without programming, in a “when a certain event happens, perform this defined task in response” fashion. For example, you could use their service to tie together email and SMS so that you would be sent a text message whenever you received email from a specific email address. You’ve probably heard of this company.

They wanted someone who could wear both marketer and developer hats. To test the developer hat, part of the application required submitting a response to a programming challenge.

The challenge was to take a CSV file with the following contents…

…and write an application that does the following for each non-heading row:

  • Perform a Google search for the item in the first column
  • Write the link from the first result of that search into the second column

Once this has been done for all the rows, write the results into a new CSV file. For the example search terms, the resulting file should look like this:

They wanted it implemented in Python, which is the language they use to implement their main product. Although it’s been some time since I’ve done any Python coding — and even longer since I’ve written any Python code professionally, I was confident that my familiarity with its syntax and my knack for picking up programming languages I haven’t touched in ages (go to my GitHub account and see this repo, this repo, and this repo for examples) would serve me well.

Before you code: Determine what’s on their mind

Sigmund Freud, who turned reading things into what people do and say into an entire industry.

Before you even begin to think about how you’d tackle the programming problem given to you, think about the question that they’re trying to answer by giving you the assignment. That question will depend on where the company doing the hiring is on the spectrum:

  • On one end of the spectrum are organizations like Google, Microsoft, and Amazon, who are in the business of making software, and have whole departments, complete with dedicated people and well-defined processes, dedicated to finding and evaluating prospective employees. They’re often looking to fill a specialized role on a larger team, and the question they’re asking is “Is this person someone with the developer skills to fill a very specific, well-defined role to meet our very specific, well-defined set of needs?”
  • On the other end are businesses made up of a handful of people — or perhaps only one person — who have been given the task of finding a new programmer in addition to all their other day-to-day responsibilities. They’re often looking to find a techie who can wear many hats, and the question they’re asking is “Is this person someone with the developer skills to fill a number of related roles to meet our amorphous, general set of needs?”

You’ll need to determine where the people interviewing you are on this spectrum, and tailor your answer accordingly.

You should also think about the company’s “obsessions”, by which I mean the topics, issues, areas of expertise, and programming tools and technologies that are the driving forces behind their technology. Their obsessions will often dictate the sort of programming assignment that they give, and may even give you an idea of the sorts of problems they’re trying to solve and skills they’re looking for.

Here’s a short list of programming assignments I have been given in the course of job interviews and application processes. Note the connection between what a company does and the programming assignment it issues:

Company description Programming assignment description
A large company (about 50,000 employees worldwide) in the search engine business.

Build a class that stores an index of web pages by their urls, with methods for adding a web page and for returning only those web pages that contain a given search term. It would essentially be a very scaled-down version of their own application.

They didn’t care what programming language I used, although their preferred programming languages are C++, Java, JavaScript, Python, and a couple of programming languages they developed in-house.

A growing company (just under 1,500 employees) whose service lets you store and share files in the cloud, as well as synchronize those files in the cloud with your own local filesystems.

Build a program that would let you create a nested hierarchical store of key-value data and write methods to create, read, update, and delete from this store. It would essentially be a very scaled-down version of their own application.

The application was to be written in Python, as this was their preferred programming language, adn used extensively on both the server and desktop client sides.

A training company with dozens of instructors that was looking for people to teach Windows/.NET desktop development to beginner/intermediate developers.

Build an application that stores student information in a relational database. It should allow the user to create, read, update, and delete student information from the database. It would be the sort of application that graduates of their courses would need to learn how to write.

The application could be written in C# or Visual Basic, as these are preferred development languages for in-house line-of-business Windows desktop applications.

A consultancy of about 18 people that developed custom sites based on WordPress.

Build a plugin that would display the 5 most recent blog comments and links to them in the sidebar. They have to customize WordPress for their clients on a regular basis, and having a library of reusable plugins would help shorten the time it took to build custom sites.

The plugin was to be written in PHP, which is what WordPress is written in.

A three-person shop who needed a developer to help lighten the load.

FizzBuzz, that now-infamous programming exercise, which goes like this:

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

The guy who interviewed me had been burned by a couple of hires (and fires) who said that they could program, and interviewed well, but when it came time to actually code, they couldn’t. He was using it as a “can you program or not?” filter.

He didn’t care what programming language I used, so for maximum portability, I did it in JavaScript.

In the case of this programming challenge, the company was about 50 people in size at the time, and as I said earlier, their main product was a “if a certain thing happens, perform a certain action in response” kind of online service. Many techies are familiar with their service, but not they’re not yet a “household brand”. The question they were trying to answer with this challenge was “Can this person program, and can he explain it to other developers?”, so I wrote my response with that in mind.

Eat the frog

This expression comes from Mark Twain, who said “If the first thing you do in the morning is eat a live frog, you can go through the rest of the day knowing that the worst is behind you.”

It’s a suggestion to tackle the worst, most unpleasant task of the day at the start. In the case of this programming assignment, I’m using it to suggest that you tackle the part about which you know the least.

This assignment breaks down into three major parts:

  1. Reading the given CSV file
  2. Performing the Google search
  3. Writing a new CSV file

Reading and writing files is pretty straightforward stuff, but until this assignment, I’d never needed to perform a Google search programatically. I declared that programmatic Googling would be the frog. It was time to do some research.

Google used to provide an API for web search, but they announced its cancellation in 2010 and its last day of operation was September 29, 2014. These days, they offer the Custom Search API, which won’t work for the purposes of this application, as it’s limited to either:

  • Creating a search engine for a single site
  • Creating a search engine that focuses on a particular topic, but searches across a collection of websites

Without an API, doing Google searches programmatically involves sending GET requests to Google and “screen scraping” the results page. Programming screen scrapers is tedious, trial-and-error work. Luckily for me, someone’s already done the work, and the result is the google Python package.

The simplest way to install this package is to use pip, the Python package manager. With pip, installing the google package is as simple as entering this at the command line:

pip install google

If for some reason you don’t have pip installed, you can go to the google Python package page, and download the tarred-and-gzipped package. At the time of this writing, its filename is google-1.9.3.tar.gz. Once you’ve downloaded it, you’ll have a new directory named google-1.9.3. From the command line, go into the directory and run setup.py using the following command:

python setup.py install

The google package function that I was interested in was search, whose signature is:

search(query,  tld='com',  lang='en', num=10, start=0, stop=None, pause=2.0)

The function returns a generator that yields found URLs. Here’s a quick run-down of the parameters:

  • query: The query string, which must not be url-encoded.
  • tld: The top level domain, for which the default value is com.
  • lang: The language for the results, for which the default value is en.
  • num: Number of results per page.
  • start: An integer specifying the first result to retrieve.
  • stop: An integer specifying the last result to retrieve. The default is None, which means the search goes on forever.
  • pause: Time (in seconds) to wait between HTTP requests. Setting this too high slows down the search greatly, but setting it too low will annoy Google and may cause them to block your IP.

I installed the package using pip, and then took search for a test drive by opening a Python REPL and entering:

def search_test(search_term):
  from google import search
  for url in search(search_term, start=0, stop=10):
    print(url)

I expected that this test function would return the URLs for the first ten Google results for the given search term. I entered this at the Python prompt…

search_test('fizzbuzz')

…and got this:

http://wiki.c2.com/?FizzBuzzTest
https://en.wikipedia.org/wiki/Fizz_buzz
https://blog.codinghorror.com/why-cant-programmers-program/
https://www.rosettacode.org/wiki/FizzBuzz
http://www.tomdalling.com/blog/software-design/fizzbuzz-in-too-much-detail/
http://ditam.github.io/posts/fizzbuzz/
https://www.hackerrank.com/challenges/fizzbuzz
http://codingbat.com/doc/practice/fizzbuzz-code.html
http://softwareengineering.stackexchange.com/questions/15623/fizzbuzz-really
https://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/

It worked! Now it was time to code the function I actually needed: one that would return only the URL for the first Google result for the given search term:

def first_google_result_url(search_term):
  for url in search(search_term, start=0, stop=1):
    break
  return url

Remember, search doesn’t return a list, but a generator, so I set it to stop after one result, store the result in the variable url, and then return the value in that variable. The break statement is there because Python syntax doesn’t allow for empty loops, and to guarantee that the loop is exited after its first iteration.

I tested out the new function by entering…

first_google_result_url('fizzbuzz')

…and got this result:

'http://wiki.c2.com/?FizzBuzzTest'

The function works, but since it’s making an online request, it’s a good idea to put in some error handling. Since this is just a programming test assignment and not a production application, it doesn’t have to be a lot of error handling — just enough to make it clear to whoever’s evaluating your code that you’re mindful that this operation might fail.

Here’s what the function looks like with just enough error handing:

def first_google_result_url(search_term):
	from google import search
	try:
		for url in search(search_term, start=0, stop=1):
			break
		return url
	except Exception as e:
		print("Error getting results from Google: %s" % str(e))
		raise SystemExit

With the frog eaten, it was time to code the other parts of the program.

Reading search terms from the CSV file

I needed a method to read the CSV file, so I wrote this one. Given a filename for a two-column CSV file, it returns a list of two-element lists, each of which represents a row in the file:

def read_input_file(file):
	rows = []
	if os.path.exists(file):
		try:
			with open(file, 'r') as csvFile:
				for currentLine in list(csvFile):
					row = currentLine.strip().split(',')
					rows.append(row)
				return rows
		except IOError:
			print("I/O error -- Couldn't read from file \"%s\"." % input_file)
			raise SystemExit
	else:
		print("The file \"%s\" doesn't exist." % filename )
		raise SystemExit

The real work is done is the try block, where:

  • The file is read line by line.
  • Each line has any leading and trailing whitespace stripped from it, and then is converted into a list, with each element representing a column in our table.
  • The newly-created list is added to our list of rows.

Once again, to communicate that I can write code that can deal with Murphy’s Law, I wrote the method with just enough error handling for this sort of assignment. It deals with cases where the file with the given name doesn’t exists, as well as general file I/O errors that may crop up from time to time.

Getting search results for the file

I now had…

  • a method that reads the CSV file and returns a list of two-element lists (read_input_file), and
  • a method that given a search term, returns the URL for the first Google result (first_google_result_url).

I could now write this method, which would be used to take the results of read_input_file and feed them to first_google_result_url:

def get_search_results(rows):
	for currentRow in rows[1:]:
		currentRow[1] = first_google_result_url(currentRow[0])
	return rows

This method returns a list of two-element lists, where the first element contains a search term, and the second element contains the URL for the first Google result for that search term.

Writing the results to a file

I needed a method that would write the results of get_search_results to a CSV file. Here’s what I wrote:

def write_search_results(rows, file):
	try:
		with open(file, 'w') as newCsvFile:
			for currentRow in rows:
				newCsvFile.write("%s,%s\n" % (currentRow[0], currentRow[1]))
	except IOError:
		print("I/O error -- Couldn't write to file \"%s\"." % output_file)
		raise SystemExit

It takes these two arguments:

  • A list of two-element lists, which should be the result of get_search_results, and
  • the name for the file to be created.

Just as with read_input_file, I added just enough error handling to show that yes, I can write code that deals with the real world.

Tying it all together

I had all the methods I needed, so it was time to write a main method to tie them all together. I wanted the program to be called this way…

python search.py input_filename output_filename

…so I wrote it to accept two parameters when called…

def main():
	if len(sys.argv) != 3:
		print("Please provide an input and output file.")
		raise SystemExit
	(input_file, output_file) = (sys.argv[1], sys.argv[2])
	input_file_rows = read_input_file(input_file)
	search_result_rows = get_search_results(input_file_rows)
	write_search_results(search_result_rows, output_file)

…and once again, with just enough error handling.

With main defined, it was time to place this at the bottom of the file:

if __name__ == '__main__': 
	main()

This is a Pythonism that states “If this file is being executed directly rather than being imported, run the main method.” It encourages developers to write code in such a way that defined functionality is separate from function, and it also encourages code reuse.

Here’s the complete file:

# Python3

import sys, os

def read_input_file(file):
	rows = []
	if os.path.exists(file):
		try:
			with open(file, 'r') as csvFile:
				for currentLine in list(csvFile):
					row = currentLine.strip().split(',')
					rows.append(row)
				return rows
		except IOError:
			print("I/O error -- Couldn't read from file \"%s\"." % input_file)
			raise SystemExit
	else:
		print("The file \"%s\" doesn't exist." % filename )
		raise SystemExit

def first_google_result_url(search_term):
	from google import search
	try:
		for url in search(search_term, start=0, stop=1):
			break
		return url
	except Exception as e:
		print("Error getting results from Google: %s" % str(e))
		raise SystemExit

def get_search_results(rows):
	for currentRow in rows[1:]:
		currentRow[1] = first_google_result_url(currentRow[0])
	return rows

def write_search_results(rows, file):
	try:
		with open(file, 'w') as newCsvFile:
			for currentRow in rows:
				newCsvFile.write("%s,%s\n" % (currentRow[0], currentRow[1]))
	except IOError:
		print("I/O error -- Couldn't write to file \"%s\"." % output_file)
		raise SystemExit

def main():
	if len(sys.argv) != 3:
		print("Please provide an input and output file.")
		raise SystemExit
	(input_file, output_file) = (sys.argv[1], sys.argv[2])
	input_file_rows = read_input_file(input_file)
	search_result_rows = get_search_results(input_file_rows)
	write_search_results(search_result_rows, output_file)


if __name__ == '__main__': 
	main()

 

Are you looking for your next great hire?

I’m looking for my next great job! If you’re looking for someone with desktop, web, mobile, and IoT development skills who can also communicate to technical and non-technical audiences, or a marketer or evangelist who also has a technology background and can code, you should talk to me.

If you’d like to learn more, you can:

Categories
Current Events Tampa Bay Uncategorized

What’s happening in the Tampa Bay tech scene (week of Monday, March 27, 2017)

Here’s what’s happening in Tampa Bay and surrounding areas for developers, technologists, and tech entrepreneurs this week.

Monday, March 27

Tuesday, March 28

Tampa iOS Meetup is my Meetup group aimed at people new to software development or new to iOS development. Rather than study just a single aspect of iOS development, each Tampa iOS Meetup session is devoted to developing a complete app, and learning various things along the way.

On Tuesday, we’ll build a relaxation/mindfulness app at Tampa iOS Meetup, and in the process, learn about:

  • Error handling in Swift: responding to errors gracefully rather than having the app come to a crashing halt and annoying the user.
  • Playing sounds: Playing both short sound cues and effects, as well as longer recordings.
  • Auto layout: Building user interfaces that adjust themselves to the screen size, from the (relatively) tiny iPhone 4S all the way to the large iPad Pro.

Join me, next Tuesday, March 28th at 6:30 p.m. at the Wolters Kluwer office (1410 N Westshore Blvd, Tampa) in Westshore for Tampa iOS Meetup’s session on building a guided meditation audio app! We’ll provide food and drink — bring your Mac laptop, and be ready to code!

To register for this event, visit the event page. Registration is free! Please register by Monday, March 27th at 12 noon so that we can determine how much food and drink we’ll need.

 

Tuesday’s events:

Wednesday, March 29

Microsoft is hosting virtual bootcamps on building IoT solutions this week, where they’ll talk about Windows 10, Azure, and how they fit with IoT, complete with presentations and hands-on labs led by Microsoft presenters as well as these IoT industry speakers:

You can catch these bootcamps in the company of other Tampa Bay area people interested in IoT at Tampa Hackerspace — check out their events, which are taking place Tuesday, Wednesday, and Thursday.

 

Wednesday’s events:

Thursday, March 30

Google has reached out to the TampaDev Meetup group and offered a free half-day seminar on the Google Cloud Platform. They’ll talk about the platform, Compute Engine, Kubernetes, Google data storage and data warehousing. This event will take place on Thursday morning and include breakfast.

 

Thursday’s events:

Friday, March 31

Saturday, April 1

Sunday, April 2

Categories
Uncategorized

My upcoming mobile dev presentations: Audio apps for iOS, and augmented reality apps for Android

In the coming weeks, I’ll be making a couple of presentations on developing two rather different types of mobile application development, for two rather different mobile platforms, for two rather different audiences programming in two rather different languages…

Tuesday, March 28: Building a guided meditation audio app for iOS

The “relaxation tape” came into being when the first personal music players — this was when cassette tapes were the most popular medium for playing music — became popular. These were recordings that featured soothing music and a narrator with a calming voice who would guide you through a relaxation or mindfulness exercise. As technology evolved, relaxation tapes became relaxation MP3s, and you can now find relaxation and mindfulness apps in the App Store, such as Take a Break (it’s free).

Tampa iOS Meetup is my Meetup group aimed at people new to software development or new to iOS development. Rather than study just a single aspect of iOS development, each Tampa iOS Meetup session is devoted to developing a complete app, and learning various things along the way.

This coming Tuesday, we’re going to build a relaxation/mindfulness app at Tampa iOS Meetup, and in the process, you’ll learn about:

  • Error handling in Swift: responding to errors gracefully rather than having the app come to a crashing halt and annoying the user.
  • Playing sounds: Playing both short sound cues and effects, as well as longer recordings.
  • Auto layout: Building user interfaces that adjust themselves to the screen size, from the (relatively) tiny iPhone 4S all the way to the large iPad Pro.

Join me, next Tuesday, March 28th at 6:30 p.m. at the Wolters Kluwer office (1410 N Westshore Blvd, Tampa) in Westshore for Tampa iOS Meetup’s session on building a guided meditation audio app! We’ll provide food and drink — bring your Mac laptop, and be ready to code!

To register for this event, visit the event page. Registration is free! Please register by Monday, March 27th at 12 noon so that we can determine how much food and drink we’ll need.

Wednesday, April 19: Android and Augmented Reality

Augmented reality — the overlaying of computer-generated images over a user’s view of the real world to provide an information-rich composite view — is a hot topic these days, what with enterprises getting excited about it, Gartner predicting that its mainstream adoption will happen in the next 5 to 10 years, and Apple’s apparent bet on it.

GDG Sun Coast is Tampa Bay’s Google developer group, run by Mike Traverso and Scott Thisse, and devoted to all matters related to software development for Google’s platforms. Mike’s invited me to speak at April’s GDG Sun Coast Meetup, where I’ll walk the group through building FaceSpotter, an Android app that adds cartoon-like features to people’s faces in real-time, in the style of Snapchat’s “Lenses”.

In the talk, you’ll learn about:

  • Incorporating the Face API into your own Android apps
  • Programmatically identifying and tracking human faces from a camera feed and getting their location and size
  • Identifying points of interest, such as eyes, ears, nose, and mouth on tracked faces
  • Drawing augmented reality text and graphics over images from a camera feed

Join me and the rest of the GDG Sun Coasters on Wednesday, April 19th at 7:00 p.m. at Tampa Bay WaVE (500 East Kennedy Boulevard, 3rd floor, Tampa) for GDG Sun Coast’s session on building an augmented reality app! Bring your laptop, and be ready to code!

To register for this event, visit the event page. Registration is free! Please register as soon as possible, so they can plan accordingly.

Categories
Uncategorized

What you’ll find in the emails of employees engaged in corporate wrongdoing

Scan of a sidebar article from Harper’s Magazine: “The Elements of Guile”.

From Harper’s Magazine’s Twitter account. Click to see the source.

According to Harper’s Magazine’s Twitter feed, the list pictured above contains the sort of words and phrases that typically appear in work emails between “employees engaged in corporate wrongdoing.”

They were gathered by Ernst and Young in the process of developing their Fraud Triangle Analytics software, which “flags personal correspondence in which expression of ‘incentive/pressure’ and ‘opportunity’ coincide with ‘rationalization’.” Harper’s wryly observe that “In cases of corporate malfeasance, employees’ emails tend to rely heavily on terms like “want no part of this” and “deep shit.”

The words and phrases are listed below. The list is rather enlightening:

  • cover up
  • gray area
  • special payment
  • off the books
  • facilitation fee
  • bullshit
  • cash incentive
  • special service
  • under the radar
  • cookie jar
  • offshore
  • quid pro quo
  • adjust invoices
  • shady deal
  • hush money
  • friend fee
  • massage earnings
  • I’m the boss
  • for crying out loud
  • corrupt bastard
  • deep shit
  • want no part of this
  • hit the fan
  • It’s gonna be my ass
  • Everyone does it
  • too stupid to figure it out
  • fresh start
  • I don’t get paid enough
  • told me to
  • gambling problem
  • not a good idea
  • ticking time bomb
  • tired of this
  • It’s immaterial
  • treat me this way
  • part of my job
  • phony
  • divorce
  • girlfriend
  • medical bills
  • vacation home
  • wife is demanding
  • broke
  • charade
  • ploy
  • play ball
  • red tape
  • sweetener
  • Don’t worry about it
  • No one will notice

Thanks to Frank McGillicuddy for the find!

Categories
Uncategorized

What if we applied the “People don’t quit their jobs, they quit their BOSSES” maxim to Uber’s president’s resignation?

Until his resignation yesterday, Jeff Jones was the second-highest ranking executive at Uber, where he held the title of President.

Here’s his full statement on his departure:

I joined Uber because of its Mission, and the challenge to build global capabilities that would help the company mature and thrive long-term.

It is now clear, however, that the beliefs and approach to leadership that have guided my career are inconsistent with what I saw and experienced at Uber, and I can no longer continue as president of the ride sharing business.

There are thousands of amazing people at the company, and I truly wish everyone well.

Jones had been with Uber a mere six months. His prior job was at Target, where Recode reports he was “its well-regarded CMO”, and in addition to being the president of its main ride-sharing business, his was the responsibility “to remake the company’s tainted image”. In order to get lured away from such a position at Target, Jones was probably offered a salary of considerable size and stock options of even greater potential value. Walking away from them — especially well before those options would’ve vested — wouldn’t have been a decision that he would take lightly. There’s also the fact that you can tolerate a lot when you’re one of the top dogs at a place that’s been valued as high as $70 billion.

Many of the stories that you’ll read about Jones’ departure will cite Uber’s problems as his reason for leaving, such as its “aggressive, unrestrained workplace culture” of “brilliant jerks”, bad driver relations, and its infamous discrimination issues as cited in engineer Susan Fowler’s blog entry about why she quit, as well as the firings of their SVP of engineering for not disclosing that he had to leave Google due to a sexual harassment allegation and their VP of product for sleazing at a company party. Accepting those reasons at face value requires assuming that he did no due diligence before taking the position, and read none of the stories about the problems at Uber that were circulating last year, and that he wasn’t explicitly hired to help improve Uber’s reputation.

If you’ve been on the internet over the past five or so years, you’ve likely heard the maxim that people don’t quit their jobs; they quit their bosses. This generally traces back to a 2008 article written by Jennifer Robison in Gallup’s Business Journal titled Turning Around Employee Turnover, whose conclusions are based on “Gallup research, which included a meta-analysis of 44 organizations and 10,609 business units, Gallup Polls of the U.S. working population, exit interviews conducted on behalf of several companies, and Gallup’s selection research database”.

“Most people quit for a few explainable reasons,” Robison wrote, and “at least 75% of the reasons for voluntary turnover can be influenced by managers.”

She also observes that after a certain point, no amount of money will make up for a bad manager. I understand this completely — I once took a 25% pay cut by changing jobs to get away from a management team that was slowly turning the workplace into something like Italy around the time of the Borgias.

As the number two person at Uber, Jones would’ve had only one boss with no one above him: Travis Kalanick, an almost cartoonishly-stereotypical Silicon Valley Ayn Rand fan. Given Recode’s reports that Jones is conflict-averse, that Kalanick is scrappy, tenacious, and amoral, and that the organization takes its cultural cues from Kalanick, it’s hard not to see Jones’ departure through the “people don’t quit their jobs, they quit their bosses” lens.

And once again, because it’s worth viewing if you haven’t seen this video yet:

Are you looking for your next great hire?

I’m looking for my next great job! If you’re looking for someone with desktop, web, mobile, and IoT development skills who can also communicate to technical and non-technical audiences, or a marketer or evangelist who also has a technology background and can code, you should talk to me.

If you’d like to learn more, you can: