Categories
Hardware Mobile

Sidetalking makes a (slight) comeback

“I CAN’T HEAR YOU! I’VE GOT A CONTROLLER IN MY EAR!!!”

While getting groceries, I saw this endcap for cotton candy-flavored energy drink. The “XBox controller as phone” pose is silly, but it also reminded me of a phone I’d wanted way back in the early 2000s: the Nokia N-Gage.

The Nokia N-Gage. Tap to view at full size.

Released in 2003 (in the pre-smartphone era, back when mobile phones sported a lot of dedicated buttons), the N-Gage was a phone-meets-handheld gaming device. IGN summed it up best as “a bad console filled with bad games,” and it didn’t help that the speaker and microphone were mounted on its side. In order to use it as a phone, you’d have to hold it like this — a position that would come to be known as sidetalking:

Sidetalking looked silly, so soon there were sidetalking photos featuring people using the N-Gage while making silly faces…

…followed by people ditching the N-Gage altogether and opting to take sidetalking photos with any old electronic thing, turning it into a full-blown meme:

I even got on the fun, using my device of choice:

In case you’re wondering, I’m not really pining for the N-Gage anymore. My iPhone 13 Pro is a decent gaming phone, and on the Android side, I’ve got a Nubia Redmagic 6R that plays Genshin Impact rather nicely.

Categories
Current Events

Elon Musk is to Twitter as Darth Vader is to Lando Calrissian

Right up to its cancellation, the Elon Musk / Twitter deal increasingly looked like Robot Chicken’s parody of the Darth Vader / Lando Calrissian deal:

Categories
Career Programming

How to solve coding interview questions: Looking deeper into finding the first NON-recurring character in a string

In the previous installment in the How to solve coding interview questions series, I showed you my Python solution for the challenge “Find the first NON-recurring character in a string,” which is a follow-up to the challenge “Find the first recurring character in a string.”

A couple of readers posted their solution in the comments, and I decided to take a closer look at them. I also decided to write my own JavaScript solution, which led me to refine my Python solution.

“CK”’s JavaScript solution

The first reader-submitted solution comes from “CK,” who submitted a JavaScript solution that uses sets:

// JavaScript

function findFirstNonRepeatingChar(chars) {
    let uniqs = new Set();
    let repeats = new Set();
    
    for (let ch of chars) {
        if (! uniqs.has(ch)) {
            uniqs.add(ch);
        } else {
            repeats.add(ch);
        }
    }
    
    for (let ch of uniqs) {
        if (! repeats.has(ch)) {
            return ch;
        }
    }
    
    return null;
}

The one thing that all programming languages that implement a set data structure is that every element in a set must be unique — you can’t put more than one of a specific element inside a set. If you try to add an element to a set that already contains that element, the set will simply ignore the addition.

In mathematics, the order of elements inside a set doesn’t matter. When it comes to programming languages, it varies — JavaScript preserves insertion order (that is, the order of items in a set is the same as the order in which they were added to the set) while Python doesn’t.

CK’s solution uses two sets: uniqs and repeats. It steps through the input string character by character and does the following:

  • If uniqs does not contain the current character, it means that we haven’t seen it before. Add the current character to uniqs, the set of characters that might be unique.
  • If uniqs contains the current character, it means that we’ve seen it before. Add the current character to repeats, the set of repeated characters.

Once the function has completed the above, it steps through uniqs character by character, looking for the first character in uniqs that isn’t in repeats.

For a string of length n, the function performs the first for loop n times, and the second for loop some fraction of n times. So its computational complexity is O(n).

Thanks for the submission, CK!

Dan Budiac’s TypeScript solution

Dan Budiac provided the second submission, which he implemented in TypeScript:

// TypeScript

function firstNonRecurringCharacter(val: string): string | null {

    // First, we split up the string into an
    // array of individual characters.
    const all = val.split('');

    // Next, we de-dup the array so we’re not
    // doing redundant work.
    const unique = [...new Set(all)];

    // Lastly, we return the first character in
    // the array which occurs only once.
    return unique.find((a) => {
        const occurrences = all.filter((b) => a === b);
        return occurrences.length === 1;
    }) ?? null;

}

I really need to take up TypeScript, by the way.

Anyhow, Dan’s approach is similar to CK’s, except that it uses one set instead of two:

  1. It creates an array, all, by splitting the input string into an array made up of its individual characters.
  2. It then creates a set, unique, using the contents of all. Remember that sets ignore the addition of elements that they already contain, meaning that unique will contain only individual instances of the characters from all.
  3. It then goes character by character through unique, checking the number of times each character appears in all.

For a string of length n:

  • Splitting the input string into the array all is O(n).
  • Creating the set unique from all is O(n).
  • The last part of the function features a find() method — O(n) — containing a filter() method — also O(n). That makes this operation O(n2). So the whole function is O(n2).

Thanks for writing in, Dan!

My JavaScript solution that doesn’t use sets

In the meantime, I’d been working on a JavaScript solution. I decided to play it safe and use JavaScript’s Map object, which holds key-value pairs and remembers the order in which they were inserted — in short, it’s like Python’s dictionaries, but with get() and set() syntax.

// JavaScript

function firstNonRecurringCharacter(text) {
    // Maps preserve insertion order.
    let characterRecord = new Map()

    // This is pretty much the same as the first
    // for loop in the Python version.
    for (const character of text) {
        if (characterRecord.has(character)) {
            newCount = characterRecord.get(character) + 1
            characterRecord.set(character, newCount)
        } else {
            characterRecord.set(character, 1)
        }
    }

    // Just go through characterRecord item by item
    // and return the first key-value pair
    // for which the value of count is 1.
    for (const [character, count] of characterRecord.entries()) {
        if (count == 1) {
            return character
        }
    }

    return null
}

The final part of this function takes an approach that’s slightly different from the one in my original Python solution. It simply goes through characterRecord one key-value pair at a time and returns the key for the first pair it encounters whose value is 1.

It remains an O(n) solution.

My revised Python solution

If I revise my original Python solution to use the algorithm from my JavaScript solution, it becomes this:

# Python

def first_non_recurring_character(text):
    character_record = {}
    
    # Go through the text one character at a time
    # keeping track of the number of times
    # each character appears.
    # In Python 3.7 and later, the order of items
    # in a dictionary is the order in which they were added.
    for character in text:
        if character in character_record:
            character_record[character] += 1
        else:
            character_record[character] = 1
    
    # The first non-recurring character, if there is one,
    # is the first item in the list of non-recurring characters.
    for character in character_record:
        if character_record[character] == 1:
            return character

    return None

This is also an O(n) solution.

Previously in this series

Categories
Career Current Events What I’m Up To

StartupBus looks good on a resume

Here’s an excerpt from the current version of my resume (yes, my resume’s under version control). Note the highlighted entry:

The entry is for Hyve, the startup and application that my StartupBus team built when I rode in 2019. Hyve was a service that let you create “burner” email addresses that relayed email to and from your real email address, allowing you to safely subscribe to services and avoid getting marketing spam or safely communicate with people whom you might not completely trust.

We did all right in the end, landing in the runner-up slot:

Team Hyve. From left to right:
Tracy Ingram, David Castañeda, me, Rina Bane, Justin Linn.

…but the real wins came a little bit afterward when I was interviewing for developer and developer relations jobs a couple of weeks afterward. StartupBus makes for a good story, and in a job interview, it’s the story that “sells” you.

After all, StartupBus is a hackathon where you’re challenged to come up with:

  • A startup business
  • and an application that supports that business
  • on a bus
  • in three days.

This intrigued the people who interviewed me, which led me to talk about the decisions that shaped the business, which in turn shaped the software. I detailed the challenges of writing business plans and software on a bus, a rumbling, rolling office space with spotty internet access, unreliable power, and the occasional engine breakdown. I also talked about dealing with the compressed timeframe and a few of the tricks we used to get around the limited time, which included getting help from our professional network, taking advantage of crowdsourcing services, and using our media contacts. My StartupBus story played a key part in convincing prospective employers that they wanted to hire me.

StartupBus Florida will depart Tampa, Florida on Wednesday, July 27 and make a 3-day trip with interesting stops and challenges along the way. It will arrive in Austin, Texas on the evening of Friday, July 29, where it will meet with teams from 6 other buses:

On Saturday, July 30, all the teams will assemble at a venue in Austin for the semifinals. Every team will pitch in front of a set of semifinals judges. By the end of the day, a handful of finalists will emerge (Hyve was one of six finalists in 2019).

Those finalists will then go on to the finals, which will take place on Sunday, July 31. They’ll pitch again (and if they’re smart, they’ll have spent the night before reworking their pitch and application) in front of the finals judges, who will select the winner and runners-up.

If you participate in StartupBus, you will come out of it a different person. You will pitch your startup at least a dozen times (and yes, everyone pitches — not just the marketing people, but the creatives and developers, too). You will work on product design. You will work on marketing. You will work on code. And you’ll do it all under far-from-ideal circumstances. StartupBus is a crash course in guerrilla entrepreneurship, and it’s an experience that will serve you well — especially during these economically upside-down times.

And you’d better believe that you’ll have stories to tell, and they’ll help you stand apart from the crowd.

Want to ride StartupBus later this month?

You’ll need to apply on the StartupBus site, and you’ll need an invite code. Use mine: JOEY22, which will tell them that I sent you.

Categories
Career Tampa Bay

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

Here’s the list of tech, entrepreneur, and nerd events for Tampa Bay and surrounding areas for the week of Monday, July 11 through Sunday, July 17, 2022.

Python powered logo

Every week, with the assistance of a couple of Jupyter Notebooks that I put together, I compile this list for the Tampa Bay tech community.

As far as event types go, this list casts a rather wide net. It includes events that would be of interest to techies, nerds, and entrepreneurs. It includes (but isn’t limited to) events that fall under the category of:

  • Programming, DevOps, systems administration, and testing
  • Tech project management / agile processes
  • Video, board, and role-playing games
  • Book, philosophy, and discussion clubs
  • Tech, business, and entrepreneur networking events
  • Toastmasters (because nerds really need to up their presentation game)
  • Sci-fi, fantasy, and other genre fandoms
  • Anything I deem geeky

By “Tampa Bay and surrounding areas”, this list covers events that originate or are aimed at the area within 100 miles of the Port of Tampa. At the very least, that includes the cities of Tampa, St. Petersburg, and Clearwater, but as far north as Ocala, as far south as Fort Myers, and includes Orlando and its surrounding cities.

StartupBus 2022 will depart from Tampa Bay!

If you’re looking for an adventure, a chance to test your startup skills, and an experience that will make your résumé stand out, join me on StartupBus Florida, which departs Tampa Bay on July 27, when it sets course for Austin, Texas!

On this three-day journey, “buspreneurs” will form teams, create a business idea, build a software demo for that idea, and develop pitches for that idea. When they arrive in Austin, they’ll spend two days pitching their startups to a panel of judges.

I was a “buspreneur” on StartupBus Florida in 2019, the last time the event took place, and our team made it to the finals and got the runner-up position. This time, I’m a “conductor” — one of the coaches on the bus — and our team is here to help you rise to the challenge.

Want to find out more?

Want to join the bus? Drop me a line!

This week’s events

Monday, July 11

GroupEvent NameTime
Young Professionals Networking JOIN in and Connect!In person at Fords Garage St Pete11:00 AM
Option Trading Strategies (Tampa Bay area) Meetup GroupJuly 11th: Option Trading Strategies Meetup (Online)11:00 AM
JobFairXTampa Job Fair – Tampa Career Fair11:00 AM – 2:00 PM EDT
Christian Professionals Network Tampa BayLive Online Connection Meeting- Monday11:30 AM
Professional Business Networking with RGAnetwork.netVirtual Networking Lunch11:30 AM
Entrepreneurs & Business Owners of Sarasota & BradentonVirtual Networking Lunch Monday11:30 AM
Thinkful TampaThinkful Webinar || Intro to Data Analytics: SQL Fundamentals12:00 PM – 1:30 PM EDT
Tampa Financial Freedom Meetup GroupHow You Can Get Your Business In The Media For FREE!2:30 PM
SCIPS, a 50+ Tampa Bay Singles ClubEUCHRE, Rummy Q and other Board Games for ENTHUSIASTIC GAME PLAYERS4:00 PM
Entrepreneurs & Startups – Bradenton Networking & EducationDavid Wilkinson: Creating Momentum for Business Growth5:30 PM
Critical Hit GamesMTG: Commander Night6:00 PM
Tampa Bay TabletoppersMonday Feast & Game Night6:00 PM
BerLagmark – Sarasota AmtgardMonday Night Fighter Practice!6:00 PM
Beginning Web DevelopmentWeekly Learning Session6:00 PM
Toastmasters, Division DACE Advanced Toastmasters 32744806:00 PM
Board Game Meetup: Board Game BoxcarWeekly Game Night! (Lazy Moon Location)6:00 PM
Thinkful TampaThinkful Webinar || What Tech Career Is Right For Me?6:00 PM – 7:30 PM EDT
Toastmasters District 48Wesley Chapel Speaks Toastmasters6:30 PM
Toastmasters District 48North Port Toastmasters Meets Online!!6:30 PM
PWOs Unite!Tampa PWOs Meetup7:00 PM
Tampa Bay Gaming: RPG’s, Board Games & more!Flesh and Blood at Hammerfall Games and Collectibles7:00 PM
Tampa Bay Real Estate Investors Club (TampaBayREIC)TampaBayREIC – Brandon Subgroup7:00 PM
Brandon WordPress MeetupTBA: Regular WordPress Meeting7:00 PM
St. Petersburg Crypto Investors and Miners ClubClub DAO7:00 PM
Tampa – Sarasota – Venice Trivia & Quiz MeetupTrivia Night – Motorworks Brewing Smartphone Trivia Game Show7:00 PM
Orlando StoicsONLINE: “Epicureanism” (Part 2)7:00 PM
Central Florida AD&D (1st ed.) Grognards GuildWorld of Greyhawk: 1E One-Shots7:30 PM
North Florida Stock Investing EducationNorth Florida Chapter Model Investment Club7:30 PM
Thinkful TampaThinkful Webinar || Intro to HTML & CSS: Build Your Own Website9:00 PM – 10:30 PM EDT
Tampa / St Pete Business ConnectionsMonday Virtual Business Introductions11:30 PM

Tuesday, July 12

GroupEvent NameTime
UiPath RPA TampaAutomation Hub best practices: Getting started9:00 AM
JOBLINK USA CAREER EVENTS – Job Fairs That Work!ORLANDO JOB FAIR – TAMPA / BRANDON JOBLINK 2022 – JUNE 2310:00 AM – 1:00 PM EDT
JOBLINK USA CAREER EVENTS – Job Fairs That Work!TAMPA BAY JOB FAIR – TAMPA / BRANDON JOBLINK 2022 – JULY 1210:00 AM – 1:00 PM EDT
Tampa Cybersecurity TrainingNetworking for Techies10:00 AM
Orlando Melrose MakersIn-Person: Makerspace Open Lab10:30 AM
Young Professionals Networking JOIN in and Connect!In Person Networking at the Great Catch ~~ Oldsmar All Welcome to connect!11:00 AM
Tampa Bay Business Networking Meetings & MixersUpper Pinellas, Oldsmar,Safety Harbor, Westchase Business networking lunch11:00 AM
Tampa / St Pete Business ConnectionsOldsmar Professional Business Networking lunch11:00 AM
Pasco County Entrepreneurs & Business Owners All WelcomeProfessional Business Networking Lunch Glory Day’s New Tampa11:30 AM
Wesley Chapel, Trinity, New Tampa, Business ProfessionalsNew Tampa Networking Lunch at Glory Day’s Grill New Tampa11:30 AM
Thinkful TampaThinkful Webinar || What is UX/UI Design?12:00 PM – 1:30 PM EDT
Global Networking SummitNetworking Brunch12:00 PM
Pasco County Entrepreneurs & Business Owners All WelcomeWednesday Business Networking Lunch New Port Richey at Widow Fleatchers12:30 PM
Block Co-op – Bitcoin Crypto Blockchain OrlandoBitcoin/Crypto. Buying, Selling and sharing ideas. Small group atmosphere.1:00 PM
Work From Home -Online Business Opportunities and NetworkingCreate Your Own Brand with A Print on Demand Business2:00 PM
Free Video Production Classes – TV/InternetSocial Video Marketing Tips(ONLINE CLASS)-FREE for Hillsborough County Residents4:15 PM
Bradenton Photo GroupPhotoshop – Editing and Creative Sessions5:00 PM
Professional Business Networking with RGAnetwork.netVirtual Networking Evening Meeting5:30 PM
Entrepreneurs & Business Owners of Sarasota & BradentonVirtual Networking Evening meeting Every TUESDAY5:30 PM
Tampa HackerspaceWeekly Open Make Night6:00 PM
AWS User Groups of Florida – TampaBest practices and resources to effectively manage and optimize your AWS costs6:00 PM
AWS User Groups of Florida – OrlandoBest practices and resources to effectively manage and optimize your AWS costs6:00 PM
Critical Hit GamesMarvel Crisis Protocol Night6:00 PM
St. Petersburg Business Networking Pick-up BasketballWeekly pickup networking basketball6:00 PM
Florida Center for Creative PhotographyMeet & Greet at O’Keefe’s Family Restaurant6:00 PM
Tampa Bay Photographic Arts CommunityFinding Your Success in Portrait Photography6:00 PM
Toastmasters District 48Seminole SPC Toastmasters6:15 PM
Pinellas WritersWeekly Group Meetings – All Writers Welcome!6:30 PM
The Sarasota Creative Writers Meetup GroupThe Sarasota Creative Writers6:30 PM
Tampa eMarketing GroupsLearn About Podcasting and How to Monetize Your Interest!6:30 PM
Tampa – Sarasota – Venice Trivia & Quiz MeetupTrivia Night – Moose Lodge 2117 Smartphone Trivia Game Show6:30 PM
Their Eyes Were Watching Books – Classic Book MeetupJuly Book Club6:30 PM
West Pasco Toastmasters Club Weekly Meeting6:30 PM
Orlando Adventurer’s Guild[IN PERSON] DDAL05 Storm King’s Thunder (Tier 2, FR, historic)6:30 PM
St. Pete Beers ‘n Board Games for Young AdultsSt. Pete Beers ‘n Board Games Meetup for Young Adults7:00 PM
Lakeland Note Investing GroupLakeland Note Investing Meetup Group7:00 PM
Big Data and Analytics TampaMeet Society’s Newest Debit Card That Will Relieve Paycheck to Paycheck Living!7:00 PM
Crypto/Trading/Online Business/Entrepreneurship nightsCrypto/Trading/Online Business/Entrepreneurship Nights7:00 PM
Tampa HackerspaceWoodshop Safety (Members Only)7:00 PM
Tampa Bay Gaming: RPG’s, Board Games & more!D&D Adventurers League at Armada Games7:00 PM
Tampa Entrepreneurs NetworkStop Telling Just ANY Stories. Start telling HIGH-IMPACT stories | Michael Davis7:00 PM
PWOs Unite!Tampa PWOs Meetup7:00 PM
IIBA Tampa BayBABOK IIBA Tampa Bay Study Group7:00 PM
Girl Develop It OrlandoJavaScript: Intro to the DOM (3-Class Series)7:00 PM
TB Chess – Tampa Bay – St. Petersburg Chess Meetup GroupLet’s play chess at 54th Ave Kava House!7:30 PM
Shut Up & Write!® TampaOnline Event: Shut Up & Write on Zoom7:45 PM
Wordier Than Thou Meetup for Writers and Book LoversBlah Blah Blah! Open Mic presented by Wordier Than Thou – Guest Joshua Ginsberg8:00 PM
Communication Skills for Interviews and LifeCommunication Practice and Improvement8:00 PM
Want to Make More Connections by Improving CommunicationHow to Communicate and Make More Connections8:00 PM
Thinkful TampaThinkful Webinar || UX/UI Design: Wireframes and Prototypes9:00 PM – 10:30 PM EDT

Wednesday, July 13

GroupEvent NameTime
Entrepreneur Collaborative Center1 Million Cups TampaSee event page
Rafael StuchinerBlockchain, Bitcoin, Crypto! What’s all the Fuss?~~~Tampa, FLSee event page
United Inventors AssociationUnited Inventors Association – Roadmap to SuccessSee event page
Institute for Human & Machine CognitionIHMC Robotics Camp – Rising 9th and 10th Graders – OcalaThu, Jul 14, 2022, 3:00 PM EDT
Network Professionals Inc. of South Pinellas (NPI)NPI Profit Partners Chapter – Exchange Qualified Business Referrals7:30 AM
1 Million Cups – Orlando1 Million Cups – Orlando Weekly Meetup8:30 AM
North Tampa Networking GroupBusiness networking9:00 AM
Tampa Bay WaVEOpen/FREE Coworking for Women Tech Entrepreneurs9:00 AM
ManageEngine’s Cybersecurity MeetupsThreat detection by leveraging rules, signature, and machine learning.11:00 AM
ManageEngine’s Cybersecurity Meetups4 self-service best practices to supercharge your IT security11:00 AM
Wesley Chapel, Trinity, New Tampa, Business ProfessionalsLutz, Wesley Chapel, New Port Richey Networking Lunch11:30 AM
North Sarasota Happy Hour NetworkingBusiness Networking Lunch11:30 AM
Tampa Bay Business Networking Meetings & MixersBrandon Networking Professionals Networking Lunch11:30 AM
Entrepreneurs & Business Owners of Sarasota & BradentonSarasota Business Networking Lunch All Welcome, Just purchase Lunch!11:30 AM
Young Professionals Networking JOIN in and Connect!Brandon Business Professionals Just Love Coffee11:30 AM
Professional Business Networking with RGAnetwork.netCarrollwood Professional Networking Lunch Wednesday All Welcome JOIN us11:30 AM
Women Who Code TampaFind Your Next Dream Job: An Intro to Cloud and AI12:00 PM
Thinkful TampaThinkful Webinar || Data Analytics: Tools of the Trade12:00 PM – 1:30 PM EDT
Pasco County Entrepreneurs & Business Owners All WelcomeWednesday Business Networking Lunch New Port Richey at Widow Fleatchers12:30 PM
Tampa Startup Founder 101Startup Pricing 101: How To Price Your Early Stage Startup Product (Online)1:00 PM
Board Game Players ClubBoard game playing1:00 PM
Free Video Production Classes – TV/InternetDigital Video Editing Class (ONLINE CLASS) -FREE for Hillsborough residents only1:00 PM
Orlando Cybersecurity MeetupHow to spot attackers in your Active Directory2:00 PM
TampaBayNetworkers15+30 Virtual Networking2:45 PM
Network After Work Tampa – Networking EventsBuilding a Multi-Six Figure Business through Social Media Marketing3:00 PM
Orlando Adventurer’s Guild[HISTORIC] Storm King’s Thunder Tier 2 – DM Robert5:00 PM
Central Florida CitySecSwanCitySec Meetup5:00 PM
Tampa Small Business RoundtableSmall Business Startup Workshop5:00 PM
The Tampa Chapter of the Society for the Exploration of PlayPlaying Games in the Alley5:00 PM
Brandon BoardgamersBoard Gaming – In Person5:00 PM
Sarasota Business Exchange ClubWe ARE meeting again at Rusty Bucket Restaurant5:30 PM
Young Professionals Networking JOIN in and Connect!Evening Networking Pasco County Entrepreneurs & Business Owners All Welcome6:00 PM
Tampa Cybersecurity TrainingGetting Started with Jira – Online Course6:00 PM
St. Petersburg Crypto Investors and Miners ClubCryptoProCafe : The Investors Club6:00 PM
St. Petersburg Crypto Investors and Miners ClubCryptoProCafe: Free Meetups, Staking Report Release, Market-Makers6:00 PM
Data Analytics – Tampa BayData Analytics – Tampa Bay – JULY MEETUP6:00 PM
Tampa DevsTDevs – Home Automation and IoT (Internet of Things) @ PwC6:00 PM
Tampa Bay Gaming: RPG’s, Board Games & more!Hobby Night – Minis Painting Tips & Tricks at Armada Games6:00 PM
Brews N Board GamesBoard Game Night at Gatlin Hall Brewing6:00 PM
Tampa Bay Tech Career Advice ForumGetting Started with Jira – Online Course6:00 PM
Thinkful TampaThinkful Webinar || UX/UI Design: Creating A Design System6:00 PM – 7:30 PM EDT
Tampa Writers AllianceTampa Writers Alliance Critique Group6:30 PM
Tampa Bay Business Networking Happy Hour/Meetings/Meet UpLutz /Land O Lakes /Odessa /Trinity Evening Networking Dinner All Welcome6:30 PM
Tampa Bay Inventors Council – www.TampaBayInventors.orgTampa Bay Inventors Council – www.tbic.us bi-monthly Meetup6:30 PM
PWOs Unite!Tampa PWOs Meetup7:00 PM
Central Florida AD&D (1st ed.) Grognards GuildNew Beginnings & Old Rivalries7:00 PM
Communication Skills for Quiet PeopleHow to Open Yourself Up and Connect with People7:00 PM
Broward Drupal Users GroupCall for presenters7:00 PM
Nerdbrew EventsGames & Grog – Party Games Social Night7:00 PM
Writers of Central Florida or ThereaboutsThe Short Attention Span Storytelling Hour7:00 PM
Tampa Bay Beach and Sunset Photography and Modeling ClassesOff-camera Lighting Demo and Small Group Shoot7:00 PM
Tampa HackerspaceIntroduction to Fusion 3607:00 PM
Florida Writer’s Association / OrlandoFlorida Writer’s Association / Orlando7:00 PM
Toastmasters District 48Carrollwood Toastmasters Meetings meet In-Person and Online7:00 PM
Florida Center for Creative PhotographyNighttime PhotoWalk in Ybor City7:00 PM
Central Florida Books and BrewsLet’s Meetup and Discuss “Before the Fall” by Noah Hawley7:00 PM
Suncoast Developers GuildOpen Code7:00 PM
MakerFX MakerspaceThe Art Of Electronics Guild7:00 PM
Tampa Bay Bitcoin[Virtual] Tampa Bay Bitcoin Meetup: News, Markets, & Community7:00 PM
Castaways Euchre ClubCastaways Euchre Club7:00 PM
Tampa / St Pete Business ConnectionsCarollwood Professionals Networking Lunch!11:30 PM
Tampa / St Pete Business ConnectionsBrandon Business Professionals IN Person!!!!11:30 PM

Thursday, July 14

GroupEvent NameTime
Young Professionals Networking JOIN in and Connect!Tampa Young Professionals Virtual Networking Thursday Morning All WElCOME7:30 AM
Pasco County Entrepreneurs & Business Owners All WelcomeHappy Hangar Early Bird Professionals Networking7:30 AM
Professional Business Networking with RGAnetwork.netWesley Chapel/Lutz networking breakfast7:30 AM
Wesley Chapel, Trinity, New Tampa, Business ProfessionalsBusiness Over Breakfast ~ Happy Hangar IN PERSON JOIN US!7:30 AM
Professional Business Networking with RGAnetwork.netVirtual Networking Breakfast Thursday’s7:30 AM
Toastmasters District 48Toast of the Bay Weekly Toastmasters Meeting – Join Us!7:30 AM
Network Professionals Inc. of South Pinellas (NPI)NPI Bayview Chapter – Exchange Qualified Business Referrals7:30 AM
BNI Professional Alliance – Business Referral GroupBNI Professional Alliance – A Business Referral Group8:00 AM
Business Networking Weekly Meeting for Local ProfessionalsBusiness Networking for Local Professionals8:00 AM
Masterminds of Orlando Leads GroupMasterminds of Orlando Leads Group8:30 AM
TampaBayNetworkersSuncoast Networkers8:30 AM
Orlando Melrose MakersIn-Person: Makerspace Open Lab10:30 AM
Hyperledger TampaHow to Operate and Extend the Hyperledger Besu Ethereum Client11:00 AM
The 360 Exchange – WaterfordThe 360 Exchange – Waterford Networking11:30 AM
Thinkful TampaThinkful Webinar || Learn Data Analytics With Thinkful12:00 PM – 1:30 PM EDT
Tampa Bay Tech Career Advice ForumLunch & Learn: Salary Negotiations12:00 PM
Tampa Cybersecurity TrainingLunch & Learn: Salary Negotiations12:00 PM
Tampa Bay Professionals (IT, Sales, HR & more)Handling Objections1:00 PM
Bradenton Photo GroupLightroom Sessions – Edits and Catalogs5:00 PM
Lean Startup OrlandoLSO&TrueFit Summer Social5:30 PM
Thinkful TampaThinkful Webinar || Data Science vs. Data Analytics6:00 PM – 7:30 PM EDT
Brandon and Seffner area AD&D Group1st ed AD&D Campaign.6:00 PM
Remote Collective ST. PETE | Social Club For Remote WorkersDrinks @ Grand Central Brewhouse6:00 PM
Brown Girls’ Book Club and Hangout GroupHomegoing6:00 PM
Sunshine Social Deduction GamingSocial Game Night @ Hourglass Brewery7:00 PM
Meet Me In The MetaverseMeet Me In The Metaverse – Florida’s First Web3 Metaverse Meetup7:00 PM
Real Life Trading – Tampa FLRLT Tampa Stock Trading Meetup7:00 PM
Tampa HackerspaceWoodshop Tool Sign Off-Jointer, Planer, & Bandsaw (Members Only)7:00 PM
Financial Secrets for Wealth Accumulation Personal/BusinessFinancial Wealth Secrets to turn your Debts into Wealth8:00 PM
Thinkful TampaThinkful Webinar || Intro To Data Analytics: Tableau Basics9:00 PM – 10:30 PM EDT

Friday, July 15

GroupEvent NameTime
RGAnetwork.netInternational Professional Networking JOIN us to grow your businessSee event page
Winter Park Toastmasters – Learn while having FUN!Improve your communication, listening, and leadership skills7:15 AM
Laid Back Leads GroupLaid Back Leads Group8:00 AM
Homebrew HillsboroughJuly 2022 VIRTUAL Homebrew Hillsborough: Suncoast Credit Union8:30 AM
Dr. Phillips Chamber of CommerceBusiness Speed Networking – of Dr. Phillips8:30 AM
Brandon Biz ProsBuild your Business with Brandon Biz Pros8:30 AM
NTi Port Richey, FLNTi New Port Richey – Business Referral Network9:00 AM
Toastmasters District 48Real Talkers #73069:15 AM
Christian Professionals Network Tampa BayImprove Speaking Skills & Build Confidence9:25 AM
Tampa Cybersecurity TrainingA Day in the Life of a Project Manager with Jose Gutierrez, PMP10:00 AM
Tampa OtakuMetroCon 202210:00 AM
Tampa Bay Tech Career Advice ForumA Day in the Life of a Project Manager with Jose Gutierrez, PMP10:00 AM
Tampa Bay Business Networking Meetings & MixersFriday Business Introductions!11:30 AM
Professional Business Networking with RGAnetwork.netFriday International Business Introductions at McAllisters Westshore11:30 AM
Tampa / St Pete Business ConnectionsInternational Professionals Networking Meeting11:30 AM
Young Professionals Networking JOIN in and Connect!Friday Business Introductions JOIN us at Cafe Delanie All Welcome11:30 AM
Tampa / St Pete Business ConnectionsInternational Professionals Networking Meeting11:30 AM
Tampa Bay Business Networking Happy Hour/Meetings/Meet UpInternational Networking Westshore McAlisters Deli11:30 AM
Women’s Prosperity Network | Orlando ChapterThe Business of Speaking Online Training: Take Your Message to the Masses12:00 PM
Clermont Nerd GamesBoard Game Night!5:00 PM
Toastmasters District 48MESSAGE CRAFTERS5:30 PM
Tampa Gaming GuildFriday Board Game Night5:30 PM
Meeple Movers Gaming GroupLet’s Play Games ONLINE on Fridays!5:30 PM
Thoughtful WritingPhilosophy in Writing6:00 PM
Critical Hit GamesMTG: Commander FNM6:00 PM
Thinkful TampaThinkful Webinar || Enhancing Your Career With Mindfulness6:00 PM – 7:30 PM EDT
Tampa Bay Gaming: RPG’s, Board Games & more!Board Game night at The Strange Realms in Carrollwood Friday, 6 PM6:00 PM
MakerFX MakerspaceMakerFX Woodshop Guild IRL Hangout6:00 PM
Toastmasters District 48Positively Speaking Toastmasters6:15 PM
Orlando Web 3.0 Meetup GroupWeb3 CFL EXPO6:30 PM
Tampa StoicsIN-PERSON: Epictetus Discourses (Part 12)7:00 PM
Gen GeekGame Night @ Southern Brewing and Winery7:00 PM
Learn-To-Trade Crypto – Online (As Seen on Orlando Sentinel)Learn-To-Trade Advanced Strategies (ONLINE & OFFICE)7:00 PM
Kat Usop, MSHIMINDSHOP™ REPLAY| How To Design a Mobile Health App7:00 PM – 9:00 PM EDT
Breweries & Board GamesBBG Social Night: Pinellas Ale Works!7:00 PM
Dunedin Professional MeetupGame time! Come get spanked in 🎳 Bowling7:00 PM
Central Florida Social ClubGet Social and Play Board Games7:00 PM
Orlando StoicsThe Practicing Stoic – Special Event with Ward Farnsworth7:00 PM
Orlando Adventurer’s Guild[Online] DDHC Tomb of Annihilation – DM Matt (Lvl. 1 Only)7:30 PM
Read Between The Wines // Sarasota, FLVIRTUAL 💫 July MeetUp // The Nightingale by Kristin Hannah8:00 PM
Thinkful TampaThinkful Webinar || UX/UI Design: Designing A UX Case Study9:00 PM – 10:30 PM EDT
Florida Center for Creative PhotographyMonthly Cell Phone Photo Showcase11:59 PM

Saturday, July 16

GroupEvent NameTime
Doris Muller for NPI Westchase ChapterBusiness Networking Event for Local ProfessionalsSee event page
Central Florida Philosophy MeetupWake Up and Think Clearly Saturday morning share and discuss.7:00 AM
Toastmasters Division GEarly Bird Ocala8:00 AM
Tampa HackerspaceMachine Shop Milling 101 (Members Only)9:00 AM
Florida Center for Creative PhotographyFREE – Learn Your Camera Series, part 1 – Aperture9:00 AM
Toastmasters Division EHunters Creek Toastmasters9:30 AM
Chess RepublicCoffee & Chess: Tampa Midtown9:30 AM
North Florida Stock Investing EducationSouth Florida Model Investment Club Meeting10:00 AM
Tampa Alchemist Nation – Real Estate and Wealth BuildingDouble Your Income in 52 Weeks: Millionaire Wealth Principles10:00 AM
Gen GeekBayshore morning walk10:00 AM
Orlando Lady Developers MeetupCode with me – learning sessions weekly on Saturdays10:00 AM
Orlando Melrose MakersIn-Person: Makerspace Open Lab10:30 AM
Oviedo Middle Aged Gamers (OMAG)Bravo Group Campaign Continues11:00 AM
Thinkful TampaThinkful Webinar || Intro To Data Analytics: Excel Basics12:00 PM – 1:30 PM EDT
WordSmitten Writing WorkshopWordSmitten Writing Workshop :: Saturday 1 PM – Online Session1:00 PM
Critical Hit GamesWarhammer 40K – RTT1:00 PM
Suncoast MakersFREE Fab Lab Orientation1:00 PM
Central Florida Florida Foam Fighting (Fumetsu)Fighter Practice! (Newbies welcome)2:00 PM
Casual Scrabble PlayAnyone up for Scrabble?2:00 PM
Nerd Night OutMovie Day!2:45 PM
Tampa Bay Gaming: RPG’s, Board Games & more!Saturday MTG Draft at Hammerfall Games and Collectibles3:00 PM
Socrates Cafe – “The unexamined life is not worth living”ONLINE: “Adam Smith & The Wealth of Nations” Part 23:00 PM
Tampa Book Club – Award-Winning BooksIn the Garden of the North American Martyrs: Stories (Art of the Story Series)3:00 PM
Tampa Games Developer GuildGame Project Therapy (Virtual)4:00 PM
Geekocracy!Congo River mini golf5:30 PM
Thinkful TampaThinkful Webinar || Intro to Data Analytics: SQL Fundamentals6:00 PM – 7:30 PM EDT
Kitchen Table Book Club: Year of Short StoriesDrifting House by Krys Lee6:00 PM
Nerdbrew EventsCommunity Hang-out Night7:00 PM
Central Florida AD&D (1st ed.) Grognards GuildTHE ONE-SHOT GUILD8:00 PM
Gen GeekMad Hatter’s (Gin &) Tea Party8:00 PM
Thinkful TampaThinkful Webinar || What Tech Career Is Right For Me?9:00 PM – 10:30 PM EDT

Sunday, July 17

GroupEvent NameTime
Florida Center for Creative PhotographyFree – Adobe Lightroom Classic CC Class9:00 AM
Toastmasters District 48Clearwater Sunday Speakers Toastmasters Club9:30 AM
Soberish Hang Outs and Book ClubDiscussing The Untethered Soul by Michael A. Singer10:00 AM
Board Games and Card Games in Sarasota & BradentonGames at Table Talk Board Game Bistro12:00 PM
Thinkful TampaThinkful Webinar || Intro to HTML & CSS: Build Your Own Website12:00 PM – 1:30 PM EDT
Tampa Amazon Seller Meetup GroupHow to Profitably and Easily Launch 100 Products on Amazon1:00 PM
Sarasota Strategy Board Game LeagueNemesis Sunday1:00 PM
Tampa Bay Gaming: RPG’s, Board Games & more!D&D Adventurers League at Critical Hit Games2:00 PM
Drunk’n Meeples West PascoWeekend Game Day2:00 PM
Critical Hit GamesD&D Adventurers League2:00 PM
Thinking While Drinking TampaSpin-Off Event: Movie (& more!)2:30 PM
Toastmasters, Division DWeekend Toastmasters3:00 PM
Geekocracy!Game Night at Southern Brewing3:30 PM
Thinkful TampaThinkful Webinar || What is UX/UI Design?6:00 PM – 7:30 PM EDT
Tampa StoicsIN-PERSON: A Walking Meditation – Causeway Trail7:00 PM
Nerdbrew EventsHidden Gems Night, Presented by A Duck!7:00 PM
Nerd Night OutNerdBrew Karaoke @ MacDinton’s!8:00 PM
Solana – TampaOffice Hours8:00 PM

Do you have any events or announcements that you’d like to see on this list?

Let me know at joey@joeydevilla.com!

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
Humor

How computer networking works

Funny and true:

Categories
Career Programming

How to solve coding interview questions: The first NON-recurring character in a string

Welcome back to How to solve coding interview questions! In this series of articles, I’ll walk you through the sort of questions that you might be asked in a coding interview and provide solutions in a couple of programming languages.

In the previous article in this series, I presented you with a challenge to write a function that took a string as an argument and returned either:

  • The first recurring character in the given string, if one exists, or
  • A null value like JavaScript’s or Kotlin’s null, Python’s None, or Swift’s nil.

I also provided solutions in Python, JavaScript, and Swift.

The follow-up challenge

Usually in a coding interview, if you succeed at the initial challenge, there’s usually a follow-up that is a more challenging variation on the theme. The “find the first recurring character” challenge is often followed up by looking for its opposite:

Write a Python function named first_nonrecurring_character() or a JavaScript function named firstNonRecurringCharacter() that takes a string and returns either:

  • The first NON-recurring character in the given string, if one exists, or
  • A null value like JavaScript’s or Kotlin’s null, Python’s None, or Swift’s nil.

Here are some example inputs for the function, along with what their corresponding outputs should be:

If you give the function this input……it should produce this output:
'aabbbXccdd''X'
'a🤣abbbXcc3dd''🤣'
‘aabbccdd'null / None / nil

One solution

See if you can code it yourself, then scroll down for my solution.

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

👇🏽

Let’s consider the following example string:

"a🤣abbbXcc3dd"

The string is short, and I purposely made the first non-recurring character an emoji so that it would be easy to spot, so a glance is all you need to spot it.

One programmatic approach is to go through the string one character at a time and keep track of the number of times you’d encountered each character. For this example string, you’d end up with this:

CharacterNumber of times it appeared in the string
a2
🤣1
b3
X1
c2
31
d2

If you maintain the order in which the characters were encountered, the solution becomes either:

  • The first character that appears 1 time in the string, if one exists, or
  • A null value like JavaScript’s or Kotlin’s null, Python’s None, or Swift’s nil.

This was my first pass at a solution in Python:

# Python

def first_non_recurring_character(text):
    character_record = {}
    
    # Go through the text one character at a time
    # keeping track of the number of times
    # each character appears.
    # In Python 3.7 and later, the order of items
    # in a dictionary is the order in which they were added.
    for character in text:
        if character in character_record:
            character_record[character] += 1
        else:
            character_record[character] = 1
            
    # Now that we have a record of the number of times each character appears,
    # create a list containing only those characters that have appeared once.
    non_recurring_character_record = {k:v for (k, v) in character_record.items() if v == 1}
    non_recurring_characters = list(non_recurring_character_record.keys())
    
    # The first non-recurring character, if there is one,
    # is the first item in the list of non-recurring characters.
    if len(non_recurring_characters) == 0:
        return None
    else:
        return non_recurring_characters[0]

What’s the Big O?

In the code above, there are 2 O(n) operations:

  • The for loop that builds a record of the number of times each character appears in the text, and
  • This list comprehension:
# Python

{k:v for (k, v) in character_record.items() if v == 1}

These operations take place one at a time, so the complexity of the code is O(2n). As far as computational complexity is concerned, constants don’t really matter; O(2n) is effectively the same as O(n). So its computational complexity is O(n).

An (unsuccessful) attempt to make the solution a little more time- and space-efficient

In its current form, the code builds a record of the number of times each character appears in the text — even those that appear more than once. Then, in the next step, it goes through that record to create a new record of the characters that appear only once.

I thought: “What if we eliminated that second step by building a record of only characters that appeared once?”

Here’s pseudocode that explains what I mean:

For each character in the text:
    If the current character is already in the record:
        Remove that character from the record
    Otherwise:
        Add that character to the record

At the end of the for loop, the character record contains only the characters that have appeared once.

Here’s my revised implementation:

# Python

def first_non_recurring_character(text):
    character_record = {}
    
    # Go through the text one character at a time
    # but record ONLY those characters that appear once.
    # In Python 3.7 and later, the order of items
    # in a dictionary is the order in which they were added.
    for character in text:
        if character in character_record:
            # We've seen this character before,
            # so remove it from the record.
            del character_record[character]
        else:
            # # We've never seen this character before,
            # so add it to the record.
            character_record[character] = 1        
    
    # character_record contains only those characters
    # that appear ONCE in the string
    non_recurring_characters = list(character_record.keys())
    
    if len(non_recurring_characters) == 0:
        return None
    else:
        return non_recurring_characters[0]

This solution seems like a good idea, but it has a big flaw! As one reader, Hans, astutely pointed out in a comment:

basically it tests if characters appear an odd number of times in a string. For example if a character appears a third time, it was removed the second time and consequently added again to character_record that third time.

This is true — by removing a character from character_record, it’s as if the character was never encountered. I’m going to treat this as a reminder to:

  • Not prematurely discard information, and
  • Write better tests!

So in the end, I should stick with my first solution. Good catch, Hans, and thanks for pointing out my mistake!

Previously in this series