Categories
Humor Process Programming

The third kind of “free”

Photo: Old mattress on the side of the road, waiting for pickup
Tap to see at full size.

If you’re into open source, you’re probably aware of the different kinds of free, thanks to the expressions “Free as in beer” and “Free as in speech”. 

If you’ve dealt with some particular open source codebases, you’ve probably also internalized a third kind of free: Free as in mattress.

Categories
Programming What I’m Up To

Computer Coach’s “Intro to Python Coding” course (taught by Yours Truly) starts tonight!

The online Intro to Python Coding course that I’m teaching on behalf of Tampa Bay’s own Computer Coach Training Center starts tonight at 6:00 p.m.. For the next five weeks, on Monday and Wednesday evenings from 6:00 to 10:00, I’ll be leading a class of Python learners through “code along with me” exercises in the Python programming language.

Photo: Joey deVilla points at a projected screen of code with co-presented Angela Don.
Dropping code science at BarCamp.

The format of the course will be pretty much the same as the one I use at Tampa iOS Meetup, where I lead the group through a “code along with me” exercise. I project what’s on my computer on the big screen, and everyone follows along, entering the code as I explain what’s happening.

Since Python has a REPL (Read-Evaluate-Print Loop), I can also have the class go through some exercises and try little coding challenges. It will be a “learn by doing” kind of class.

The main textbooks for the course (which will be provided to students) are Python Crash Course, 2nd Edition…

Book cover: “Python Crash Course, 2nd edition: A Hands-On, Project-Based Introduction to Programming”

…and Automate the Boring Stuff with Python, 2nd edition (which is free to read online):

Book cover: “Automate the Boring Stuff with Python, 2nd edition: Practical Programming for Total Beginners”In order to minimize confusion, we’ll all use the same tools in the course, namely the Anaconda Individual Edition distribution of Python 3.7 and associated tools…Logo: Anaconda…and Visual Studio Code:

Logo: Visual Studio CodeBoth are available free of charge, and run on macOS, Windows, and Linux.

It’ll be fun! Watch this space; I’ll post some snippets from the course as it progresses.

Interested in signing up? Visit Computer Coach’s site and speak to them. Don’t dawdle — it starts tonight!

Categories
Current Events Programming What I’m Up To

I’m teaching an online Python programming course!

Photo: Man’s hand on Mac laptop, with Python book on the side. Caption: “Intro to Python course / Starts this Monday!”

Graohic: Computer Coach Training Center logoI’ll be teaching a live online course on Python programming on behalf of Computer Coach Training Center starting Monday. Here are the details:

  • What: Intro to Python Coding course
  • When: Monday and Wednesday evenings, 6:00 – 10:00 p.m., starting Monday, July 13 and ending Wednesday, August 12 (6 weeks, twice a week)
  • Where: Online.
  • How much: $900 — and Computer Coach has grants that can cover the cost if you’re unemployed and based in the Tampa Bay area (contact them to see if you qualify)
  • What you’ll need:
    • A computer that was made sometime in the last ten years. My main computer is a 2014-era MacBook Pro, but I’ll be doing demonstrations on a 2012-era Lenovo ThinkPad running Linux Mint, a 2009-era Compaq laptop running Peppermint Linux, and a $35 Raspberry Pi.
    • An internet connection. This is an online course, after all.

To register for this course, visit this page and tap the Attend Online button. Someone from Computer Coach will contact you.

Screenshot: The Meetup page for the Python course, with the “Attend online” button highlighted.

The course description

Photo: Woman’s hands typing on Mac laptop.

This is an introduction to the Python programming language. Now in the top 10 programming languages according to the TIOBE Programming Language Index, it is versatile enough to have a wide array of uses, from simple scripting to powering Instagram, Spotify, Netflix, Dropbox, and more. Its combination of simplicity and vast scientific and math libraries have made it the preferred programming language for data science and machine learning. If you’re looking for a first programming language, Python is an excellent choice.

 

This is not a passive course! This isn’t the kind of course where the instructor lectures over slides while you take notes (or pretend to take notes while surfing the web or checking your social media feeds). In this course, you’ll be actively taking part in the learning process, entering code, experimenting, making mistakes, correcting those mistakes, and producing working applications. You will learn by doing. At the end of each session, you’ll have a collection of little Python programs that you wrote, and which you can use as the basis for your own work.

The course will start at the most basic level by walking you through the process of downloading and installing the necessary tools to start Python programming. From there, you’ll learn the building blocks of the Python programming language:

  • Control structures that determine what your programs do,
  • Data structures to store the information that your programs act on,
  • Functions and objects to organize your code, and
  • Using libraries as building blocks for your applications.

You’ll write all sorts of programs…

  • You’ll use Python in “immediate mode” to perform quick calculations (and you’ll sharpen your command-line skills in the process).
  • You’ll write scripts to simplify or automate tedious tasks.
  • You’ll build web applications.
  • And since it’s a networked, data-driven world where no application is an island, you’ll learn how to use Python to interact with web services and databases.

Better still, you’ll learn how to think like a programmer. You’ll learn how to look at a goal and learn how you could write a program to meet it, and how that program could be improved or enhanced. You’ll learn skills that will serve you well as you take up other programming languages, and even learn a little bit about the inner workings of computers, operating systems, and the internet.

 

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:

let formatter = NumberFormatter()
formatter.numberStyle = .spellOut
let number = 87654
let spelledOutNumber = formatter.string(for: NSNumber(integerLiteral: number))!
print("\(number) spelled out is \(spelledOutNumber).")

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:

let formatter = NumberFormatter()
formatter.numberStyle = .spellOut
formatter.locale = Locale(identifier: "fil_PH")
let number = 87654
let spelledOutNumber = formatter.string(for: NSNumber(integerLiteral: number))!
print("\(number) spelled out in Filipino is \(spelledOutNumber).")

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?

let formatter = NumberFormatter()
formatter.numberStyle = .spellOut
formatter.locale = Locale(identifier: "ko_KR")
let number = 87654
let spelledOutNumber = formatter.string(for: NSNumber(integerLiteral: number))!
print("\(number) spelled out in Korean is \(spelledOutNumber).")

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 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!