Categories
Florida Tampa Bay

Tonight at Tampa Bay Startup Week: The Star Wars / Iron Yard Hour of Code!

rey and bb-8
iron yard logo

Tonight, as part of Tampa Bay Startup Week, Anitra and I will be helping the people from the coding school The Iron Yard Tampa Bay with their Hour of Code event! It’s an hour-long training session where kids ages 8 – 12 and teens ages 13 – 17 can get a quick, fun introduction to coding with the help of Rey and BB-8 from The Force Awakens and Princess Leia and R2-D2 from the original trilogy.

Here’s a quick video intro to what the Star Wars Hour of Code’s all about, courtesy of Star Wars: The Force Awakens’ producer Kathleen Kennedy and Rachel Rose, lead engineer for Star Wars’ animation and creature development team…

The programming interface that Hour of Code participants use is delightfully simple and fun. They drag and drop “blocks”, which represent calls to functions, to move the droid characters like BB-8 and R2-D2 around, arrange them into sequences which function as programs, and then click the “Run” button to see if their code worked.

It starts off with the simple task of moving BB-8 towards a single piece of scrap metal:

star wars code 01

Click the screenshot to see it at full size.

…but about a dozen lessons later, you’re writing considerably more complex stuff that includes concepts like variables, branches, and loops, and changing droid characters:

star wars code 02

Click the screenshot to see it at full size.

tampa bay wave

If you can make it to tonight’s Hour of Code…

The event takes place tonight at Tampa Bay WaVE, 500 East Kennedy Boulevard, Suite 300 at 6:30 p.m.

If you’d like to have your kid or teen participate in tonight’s event, go to Tampa Bay Startup Week’s event schedule and sign up for the appropriate event. You’ll need to bring a fully-charged laptop (and it’ll be a good idea to bring its power cord) or tablet with working wifi and browser in order to work on the code. It can run Windows, Mac OS, Linux, iOS, or Android — as long as it’s got a relatively recent browser and can connect wireless to the internet, it’ll work for this class.

If you can’t make it to tonight’s Hour of Code…

…you can still code your way through the galaxy by visiting Code.org’s Star Wars site!

code.org star wars

Have fun, and may The Source be with you!

Categories
Uncategorized

It’s Tampa Bay Startup Week 2016!

tampa bay startup week

It’s that time of year again: Tampa Bay Startup Week! The tech/entrepreneurial event, which this year runs from today, Monday February 8th, through Friday, February 12th, is focused on bringing techies, creatives, and entrepreneurs together to bring them together, provide ideas and inspiration, and help grow the city’s self-starter business scene.

You may not think of Tampa as an entrepreneurial hotspot, but according to the 2015 report of the Kauffman Index of Startup Activity for Metropolitan Areas, the Tampa/St. Petersburg/Clearwater area’s in top 25 (ranked #20), and ranked ahead of places you’re more likely to associate with entrepreneurship, including:

  • the Chicago area (#21)
  • the Boston/Cambridge area (#22)
  • “Portlandia” (#26)
  • and even our neighbor, Orlando (#33), which people say has a more active startup scene

Chase doesn’t sponsor just any city’s Startup Week. To qualify, it’s got to meet the criteria of density, government regulations, culture, talent, and access to said talent. In Money’s 2015 roundup of the 5 best big cities, they named Tampa the best city in the southeast. It’s got great weather, an airport that punches above its weight class, low cost of living (moving here was like getting a big raise, there’s no state income tax, the median house price is $122K), and as I’ve posited before, the “Florida Man” factor is actually a blessing in disguise:

There will be all sorts of activities this week worth checking out, from presentations on technologies such as the Internet of Things, cryptocurrency, and mobile design, to business mentoring, networking, and even an opportunity to get a new headshot for your LinkedIn profile, to fun “intro to programming” events for kids, to mingling, networking, and enjoying the city’s excellent craft beer. Be sure to check out the Tampa Bay Startup Week page, follow the Tampa Bay Startup Week and organizer @thatgirlallie’s Twitter feeds, and come on down and take part!

This article also appears in The Adventures of Accordion Guy in the 21st Century.

Categories
Uncategorized

Meet the asshole computer scientist who’s trying to keep the Canadian Netflix experience awful

netflix ahole from carleton

The Canadian newspaper The Globe and Mail recently published an article on AbdelRahman Abdou, a postdoctorate student at the Carleton University’s Computer Security Lab, whose work in network measurement is focused around getting a more precise fix on a user’s precise geographic location based on physical properties of the internet rather than indirect methods like using IP addresses.

The practical use of such research, as this article’s headline suggests, is that it’s a way to counter workarounds like VPNs, that people use to access streaming video services that aren’t available in their regions or countries. What the article fails to mention is that this technology will also find willing customers in repressive regimes that like to monitor, control, and limit their citizens’ access to the internet and information.

As my friend Sean Galbraith put it, “He’s going to be very popular in some awful places.”

some people just want to watch the world burn

I’m surprised that Abdou consented to a non-anonymous interview, but it’s quite possible that he thinks he is, in the words of Silicon Valley, making the world a better place, and he may not have been in a social situation where he’s had to answer the question “So what is it that you do?”.

I’ve shown the article to my friends, and the response has been the same: it’s the line that works as a replacement caption for just about every New Yorker cartoon ever made:

christ what an asshole

Categories
Uncategorized

Twitter developer discovers what it’s like to use Twitter, experiences the developer-user gap

wow people on twitter are mean

In a series of unintentionally hilarious tweets that sound more like something from an Onion article than real life, Brandon Carpenter, an iOS developer at Twitter, is getting an object lesson in what Twitter is like for the people who actually use it on a regular basis.

A quick look at his Twitter stream shows that he’s neither dumb nor short on empathy, but that he doesn’t post anywhere near as often as the sort of users who aren’t all that keen on the announced changes to the way the timeline is going to work. He certainly doesn’t post as often as I do, and in my circles, I’m sure I’m merely a moderate user. Working on one of the most heavily-used mobile apps on the market is a big cognitive load to carry, and I suspect that along with being a husband, dad, and someone who has to pay rent in San Francisco, his Twitter experience is different from those of the people who make their day, their name, or their living using it. I call this difference in experience between the people who developer applications and its heavier users “the developer-user gap”, something captured quite well in the line from William Gibson’s Neuromancer: “The street finds its own uses for things.”

The fact that the developer-user gap exists highlights an oft-forgotten role that a technical evangelist can play. Companies try to make sure that their evangelists, community managers, social media people, and the like are sending out the right message to their customers and partners, but forget that communication can work in the opposite direction. A good evangelist will make sure that users get the message, but a great one will make sure that the users’ messages get back to the company as well.

Kudos to Brandon for taking this tweet sent to him…

…and responding with grace:

It’s often a thankless job, but as a regular user of Twitter’s iOS client, thanks for all your work, Brandon. I salute you with a filet mignon on a flaming sword!

But fire up your Twitter client and use it a little more, willya? It’ll help you make a better app.

Categories
Uncategorized

How to split Doubles and Floats into whole numbers and fractions in Swift

modf

Lately, I’ve been seeing a number of half-baked implementations of a function that splits a floating-point number (Floats, Doubles, and the like) into a whole number and fraction part. For example, given the value 3.141592, it should return:

  • The whole number part: 3, and
  • the fractional part: 0.141592.

There’s no need to come up with your own implementation: there’s a function in C’s math library, and many programming languages, Swift included, give you access to it. It’s called modf, and in Swift, it works like this:

// modf returns a 2-element tuple,
// with the whole number part in the first element,
// and the fraction part in the second element
let splitPi = modf(3.141592)
splitPi.0 // 3.0
splitPi.1 // 0.141592

Since C doesn’t have a tuple type, you call modf differently. Here’s the function’s signature:

double modf(double x, double *integer)

Its return value is the fractional part, and the whole number value is put into an extra variable whose address you provide. If you’re working in Swift and feeling homesick for the pointer-y stuff you have to do in C, you can call modf this way:

var wholeNumberPart: Double = 0.0
let fractionalPart = modf(3.141592, &wholeNumberPart)
fractionalPart  // 0.141592
wholeNumberPart // 3.0

But seriously: do it the first way. It’s more Swift-like (Swift-esque? Swifty?).

Categories
Uncategorized

Something for fans of Star Wars who aren’t fans of Uber’s new logos

star wars uber logo 1

Click the photo to see it at full size.

“Well, the Empire doesn’t consider a small one-man fighter to be any threat, or they’d have a tighter defense. An analysis of the plans provided by Princess Leia has demonstrated a weakness in the battle station. But the approach will not be easy. You are required to maneuver straight down this trench and skim the surface to this point. The target area is only two meters wide. It’s a small thermal exhaust port, right below the main port. The shaft leads directly to the reactor system. A precise hit will start a chain reaction which should destroy the station. Only a precise hit will set off a chain reaction. The shaft is ray-shielded, so you’ll have to use proton torpedoes.”

star wars uber logo 2

Click the photo to see it at full size.

For those of you who don’t remember the film, here’s the original still:

original scene

Click the photo to see it at full size.

For those of you who are insatiably curious (and hey, if you’re reading this blog, the odds are good that you are), here’s Larry Cuba explaining how he made the computer graphics for the Death Star briefing in Star Wars. Remember, this was the 1970s!

Categories
Uncategorized

Concatenating strings in Swift: Which way is faster?

which is faster

Creative Commons photo by Jaguar MENA. Click to see the source.

Stack Overflow user “James” asked:

Which is the quickest, and most efficient way to concatenate multiple strings in Swift 2?

// Solution 1...
let newString:String = string1 + " " + string2
// ... Or Solution 2?
let newString:String = "\(string1) \(string2)"

Or is the only differentiation the way it looks to the programmer?

It’s not worth worrying about the speed of string concatenations when you’re doing them, once, a dozen, a hundred, or even a thousand times. It may start to matter with larger quantities of larger strings. I decided to run a quick and dirty benchmarking test, which you should take with the appropriate number of grains of salt. Here’s the important part of my code:

let string1 = "This"
let string2 = "that"
var newString: String

let startTime = NSDate()
for _ in 1...100_000_000 {
  // Here's the concatenation:
  newString = string1 + " " + string2
}
print("Diff: \(startTime.timeIntervalSinceNow * -1)")

You may have noticed that I used _ (underscore) characters to make the size of the for loop, 100000000, easier to read, just as we in North America use commas and people elsewhere use spaces or periods. Swift, along with a number of programming languages, lets you do this — take advantage of this and make your code easier to read when dealing with large numbers!

Using the + operator to concatenate strings as shown in James’ example, here’s the average time as reported by the app running in Debug mode over a dozen runs:

  • 1.4 seconds on the simulator on my MacBook Pro (2014 15″ model, 2.5GHz i7, 16GB RAM), and
  • 1.3 seconds on my iPhone 6S

Then, after changing the line after the Here’s the concatenation comment to:

newString = "\(string1) \(string2)"

I ran it again and got these results over a dozen runs:

  • 50.9 seconds on the simulator
  • 88.9 seconds on the iPhone 6S

Running on the phone, the + method is almost 70 times faster, which is a significant difference when concatenating a large number — 100 million — strings. If you’re concatenating far fewer strings, your better bet is to go with the option that gives you the more readable, editable code. For example, this is easier to follow and edit:

"Hello, \(userName), and welcome to \(appSectionName)!"

than this:

"Hello, " + userName + ", and welcome to " + appSectionName + "!"