Categories
Current Events Hardware Players Tampa Bay

Win a System76 Thelio Linux desktop in The Mad Botter’s Fourth of July contest!

Mike Dominick’s Tampa Bay-based consultancy The Mad Botter — which develops automation/integration software — has a Fourth of July contest for high school or university undergrad students where the prize is one of System76’s gorgeous Thelio desktop Linux systems!
Mad Botter Fourth of July content icon (Mad Botter “Bot” dressed as Uncle Sam in front of American flags, fireworks, and balloons)

This is an election year, and The Mad Botter’s contest is an election contest. Contestants are asked to develop an open source project that addresses ballot access or in some other way assists with voting. Perhaps something to help people find the closest polling station? Virtual “I voted” stickers? An aggregator for open information about candidates? A “Yelp” for polling places? (You can find more ideas here.)

Here are the contest details:

  • No purchase is required to enter.
  • Your solution must be posted to a publicly accessible Github repository with the appropriate license included.
  • You must be a US high-school or undergraduate college student.
  • If you are below the age of 18, you must provide written parental consent to have your submission considered; this can be done via email.
  • In the event that you win, The Mad Botter INC is granted the right to post a picture of you in the winning announcement and other applicable venues; if you are below the age of 18 your parent or guardian also provides permission for this by consenting to your entering the contest.
  • The winning entry will be the one that shows the most practical potential and creativity and will be selected by The Mad Botter team.
  • All submissions should be sent to sales@themadbotter.com and include a brief bio, explanation of the solution, and a link to the Github repository.
  • Submissions will be accepted until 9/1/2020.

You can find out more at The Mad Botter’s Fourth of July contest page.

Also worth checking out

Mike has a podcast, The Mike Dominick Show, which covers technology and open source.

I was a recent guest on the show (Episode 25), and we talked about how the Toronto tech scene changed from dismal to dynamic,  how I stumbled into developer evangelism, learning iOS programming via raywenderlich.com and then joining them, SwiftUI, Python and Burning Man, the hidden opportunities that come with having to stay inside during the pandemic, and more!

Categories
Programming

Converting a number into words, this time with Python and inflect.py

Teaching a person how to spell out numbers involves a lot of repetition. Tampa Bay’s own Jack Hartmann, whose children’s educational YouTube channel has over a million subscribers and 300 million views, knows this. He’s got a video that teaches kids the words for the numbers 0 through 10:

Don’t underestimate the power of videos for kids — Jack’s laughing all the way to the bank. This online estimator says that his YouTube channel should be earning about $70,000 every month, and keep in mind that his particular line of work has probably benefited from everyone being stuck at home. I may have to do something similar with the accordion when this software fad passes.

If you just wanted to be able to convert any number from 0 through 10 into word form in Python, you could use a list…

…and if you wanted the number 3 in word form, you’d use this:

You wouldn’t want to take this approach for a larger set of numbers, and you probably wouldn’t want to code it yourself. Luckily, you don’t have to do this in Python, thanks to the inflect.py module.

Using inflect.py

Pythoninflect.py is a module that does all sorts of processing to make your programs’ text output grammatically correct. If you hate seeing output like this…

You have 1 items in your cart.

…or this…

You have a egg in your inventory.

…you can use inflect.py to automatically use the correct singular or plural form, use “a” or “an” when appropriate, and so much more.

(I’ll cover inflect.py in greater detail in a future article.)

In addition to all these grammatical goodies, inflect.py can also be used to convert numbers to words.

To use inflect.py, you’ll need to install it first. The simplest way to do so is with pip:

Once installed, you can use it in your Python programs. Here’s an example:

It produces this output:

fifty-four thousand, three hundred and twenty-one

The number_to_words() method has a number of optional parameters that are useful in certain circumstances. For instance, there’s the boolean wantlist parameter, which causes the word output to be broken into “chunks”:

It produces this output:

[‘fifty-four thousand’, ‘three hundred and twenty-one’]

Suppose you want the number to be converted into its individual digits as words. You’d use the group parameter:

What if you’re using the group parameter set to 1, but want to get all UK English and have it use the word “naught” for zero? Or maybe you want your program to sound like a film noir gangster and say “zip” instead? Or you want it recite a phone number and say “oh”? That’s what the zero parameter is for:

The one parameter does the same thing, but for the digit 1:

Want to get all Star Trek? Use the decimal parameter to change the default decimal word to “mark”.

A lot of style guides tell you to spell out the numbers zero through ten, and use the number form for numbers 11 and greater. The threshold parameter makes this easy:

Go ahead — import inflect.py and play with it. There’s a lot of power in that module, and it goes way beyond just converting words to numbers!

Also worth checking out

If you’re an iOS/macOS programmer, you’ll want to look at the previous article, Converting a number from a numeric form into words in just four lines of Swift.

Categories
Programming

Converting a number from a numeric form into words in just four lines of Swift

Until I started working on a video tutorial for Apple’s Combine framework (coming soon to raywenderlich.com!), I had no idea that this existed.

Open a Swift playground in Xcode and enter the following code:

Run the playground code, and you’ll see this:

87654 spelled out is eighty-seven thousand six hundred fifty-four.

Having come from the world of C, where you format strings using printf() and formatting strings, and later from other languages where you use whatever formatting method its string class provides, I’ve ignored most of Swift’s classes that derive from Formatter — with one notable exception: DateFormatter, which is indispensable when working with dates and times.

I’m now looking for an excuse to use this capability.

As I typed “DateFormatter” a couple of paragraphs above, I remembered that DateFormatter had a locale property. It’s for ensuring that any dates you present are in the correct form for the locale:

I wondered:

  • Does NumberFormatter have a locale property?
  • What happens if I changed it to something other than my system’s default of US English?

So I changed the code in my playground to the following:

I ran the code and saw this…

87654 spelled out in Filipino is walóng pû’t pitóng libó’t anim na daán at limáng pû’t ápat.

…and my response was “Ay nako!” (translation: OMG!)

How about Korean?

The output:

87654 spelled out in Korean is 팔만 칠천육백오십사.

My response: 세상에 (“Sesange!”, which is pretty much Korean for OMG!)

Try it out!  You might find this list of iOS locale string identifiers useful.

Categories
Current Events Tampa Bay

What’s happening in the Tampa Bay tech/entrepreneur/nerd scene (Week of Monday, July 6, 2020)

Hello, Tampa Bay techies, entrepreneurs, and nerds — here’s hoping you had a safe and happy 4th of July.

Here’s the list of the week’s online-only events for techies, entrepreneurs, and nerds based in an around the Tampa Bay area.

Keep an eye on this post; I update it when I hear about new events, it’s always changing. Stay safe, stay connected, and #MakeItTampaBay!

This week’s events

Monday, July 6

Tuesday, July 7

Wednesday, July 8

Thursday, July 9

Friday, July 10

Saturday, July 11

Sunday, July 12

No tech, entrepreneur, or nerd events have been posted for this day…yet!

Do you have an upcoming event that you’d like to see on this list?

If you know of an upcoming event that you think should appear on this list, please let me know!

Join the mailing list!

If you’d like to get this list in your email inbox every week, enter your email address below. You’ll only be emailed once a week, and the email will contain this list, plus links to any interesting news, upcoming events, and tech articles.

Join the Tampa Bay Tech Events list and always be informed of what’s coming up in Tampa Bay!


Categories
Current Events Players Programming Reading Material Tampa Bay

Local hero: Mike Dominick and his tech podcast, The Mike Dominick Show

Mike Dominick, who runs The Mad Botter — which develops automation/integration software — moved to the Tampa Bay area three years ago. It’s been my experience that Tampa Bay techies don’t do things halfway, so it shouldn’t be a surprise that in addition to the day job, he also has a technology- and open source-focused podcast named The Mike Dominick Show.

I had the privilege of being the guest for Episode 25 of the Mike Dominick Show, which we recorded yesterday afternoon (that’s its player above), and it was a fun conversation that covered:

  • The Toronto tech scene
  • Taking up the accordion
  • How I got into developer evangelism
  • Learning iOS programming via raywenderlich.com and then joining them
  • Remote work and the pandemic
  • WWDC 2020 and SwiftUI, Python and Burning Man
  • Windows Phone and my time as a Windows Phone Champ
  • What I’ve been doing while looking for work
  • The hidden opportunities that come with having to stay inside

Scrabble tiles in a tile holder spelling 'QUESTIONS'Mike ends each podcast with two questions — one tough and one easy. The tough question he asked me was “What question should I have asked you that I didn’t?” You’ll have to listen to hear how I answered that one.

Don’t just listen to my episode — be sure to check out previous ones, including these ones that I’ve enjoyed on my daily bike rides:

Categories
Current Events Programming What I’m Up To

RW Community Care: Free community support for mobile developers (and aspiring mobile developers, too!)

One of the reasons I write for raywenderlich.com — the premier mobile developer tutorial site — is that they’re wonderful people to work with, because they’re such good people. And as good people, they’ve put together something to help developers during this time of pandemic and quarantine: RW Community Care. It’s a series of office hours, livestreams, bootcamps, and more, running until August 22 — and all events are 100% free!

Here’s what RW Community care offers…

Read iOS Apprentice for free!

Cover of “iOS Apprentice, 8th edition”I learned iOS programming back in 2012 by reading and doing the exercises in an earlier edition of iOS Apprentice, which was written by Matthijs Hollemans. While I’d done some mobile development as a Windows Phone Champ during my time as a developer evangelist at Microsoft, it was this book that set me on my path as a mobile developer.

I owe a lot to this book, which is why it was a big honor to co-author the eighth edition with Eli Ganim. For the summer, you can read it online for free at RW Community Care. Whether you’re completely new to programming or — like me, back in 2012, experienced at programming but new to iOS development — you should check out iOS Apprentice on RW Community Care!

RW Talks

RW Talks happen weekly, cover all sorts of topics that mobile developers will find interesting, ranging from the deeply technical to the inspiring. Upcoming talks include:

You can also see past talks:

RW Chat

Can’t attend some of the other live events, or prefer to collaborate on discussions as a community? Or maybe you’re more the type to hash out challenges or problems with a group of like-minded developers? There’s a Discord server that you can join!

Office Hours

Not everyone has easy access to a senior mobile developer, especially when everyone seems so busy these days and our teams are more physically separate then ever before.

Good news: Office Hours are the next best thing to having a senior developer right next to you!

Review My Stuff

Want a senior member of the development community to look over your current project, run a critical eye over your professional résumé, or review some code you’ve been struggling with? This program is designed to do just that.

If you need someone to help you with deeper questions on your particular project, or to lend a critical eye to your resume or job search, you need Review My Stuff!

 

Categories
Hardware Programming What I’m Up To

New life for old computers

The current coronavirus pandemic has given me a chance to do some spring cleaning at home, which in turn led me to revive some old computers that have been sitting idly in a closet. I figure I could put them to work doing interesting things.

Compaq 610 (2009-era 4GB Core 2 Duo)

Installing Peppermint on the Compaq 610.

I’ve given an old Compaq 610 a new lease on life with Peppermint OS, a lightweight Linux distro that runs really well on old machines (the Compaq is a 2009-era machine with a Core 2 Duo processor). I also installed VS Code, Node, Anaconda, and React on it, making it a lean, mean machine for that upcoming Python course I’m teaching.

My very erudite makeshift monitor stand.

In the process, I also gave some old Smalltalk-80 books a new purpose as well: propping up the monitor that goes with the Compaq.

ThinkPad T430 (2012-era 16GB Core i5)

Preparing class notes (using Jupyter notebooks) for my upcoming Python course on the ThinkPad.

I replaced the CMOS battery on my trusty ThinkPad T430 and its older version of Ubuntu with Linux Mint. Its own internal wifi card finally died, and I simply decided to simply replace it with a faster USB wifi adapter that would arrive the next day instead of getting the slower internal card that could take as long as 6 weeks to arrive.

As with the Compaq, I set up the ThinkPad with VS Code, Node, Anaconda, and React. Since it’s got the processor power and 16 GB RAM, I also put Android Studio 4 and Flutter on it. Between some mobile projects in my near future, and the need to have a machine for running servers and other automated tasks, it’s going to prove to be quite useful.

That leaves me with one last machine to update.

Raspberry Pi 3 B (2016-era 1GB ARM A53)

My Raspberry Pi, as it was back in 2016.

I got the Raspberry Pi 3 4 years ago as my one impulse purchase on Amazon Prime Day 2016 (in mid-July of that year), and made regular use of it until around early 2018, when I used it for a Sonic Pi programming demo. It was high time to bring it back to active duty.

The Raspberry Pi’s “hard drive” is actually a microSD card that fits into an easily-accessed slot near one of the edges of the board. The process of updating the Pi’s OS is pretty simple: You use the Raspberry Pi imager on another computer with an SD card slot (and a microSD-to-standard SD card adapter) to rewrite its contents.

The Raspberry Pi is a pretty good Python machine, and I may end up using it while teaching that Python course, if only to show what’s possible on a computer that’s smaller than a deck of cards (when it’s not in a case) that you can get for about $50.

Since it’s powered by an ARM chip, it offers an opportunity for a kind of programming that most other machines don’t offer: ARM assembly programming!

The actual code from the first assembly program I wrote on my newly-reformatted Raspberry Pi: A “Tiger King”-themed version of “Hello World”.

It looks like it’s going to become an ARM-based world:

  • ARM-based chips power IoT devices,
  • Smartphones are generally powered by ARM-based chips, and
  • Apple’s upcoming switch from Intel x86-based chips to their own ARM-based silicon is likely have wide-ranging impact across the PC industry.

With this upcoming sea change, it doesn’t hurt to have some familiarity with ARM assembly language. Even though smartphones have ARM chips, the Raspberry Pi is a much better platform on which to learn ARM assembly, as it allows you to do development and execution in the same place.

It may have been a while since I’ve done assembly language programming — first on the 6502 in high school on Apple ][s and Commodore PETs, and later in university on NS32000 boards connected to Digital Unix machines — but I found my return pretty simple. It didn’t take long for me to cobble together a “Hello World!”-style app on the Pi.

Watch this blog for ARM assembly tutorials!