A Short Spot on Coding up Go Types Sizing Limits

In an effort, finally, to get around to putting more content together I’ve created this video. It’s the first of many that I’ll put together. This one is a quick coding example of getting the maximum size of particular types in Go. At just about a minute, it’s a quick way to pick up a way to do something coding. If you like this video, do leave a comment, if you thought it wasn’t useful leave a comment. Either way I’d like to read the over under on material like this and if it is or isn’t useful (or entertaining) for you. It’ll mostly be just little tips n’ tricks on how to get things done.

The code gist.

package main

import (
	"fmt"
	"math"
)

const(
	MinUint uint = 0 // all zeroes
	// Perform a bitwise NOT to change every bit from 0 to 1.
	MaxUint = ^MinUint // all ones

	// Shift the binary number to the right to get the high bit to zero
	MaxInt = int(MaxUint >> 1) // all ones except high bit

	MinInt = ^MaxInt // all zeroes except high bit.
)

func main() {
	// integer max
	fmt.Printf("max for int64 = %+v\n", math.MaxInt64)
	fmt.Printf("max for int32 = %+v\n", math.MaxInt32)
	fmt.Printf("max for int16 = %+v\n", math.MaxInt16)
	fmt.Printf("max for int8 = %+v\n", math.MaxInt8)

	// integer min
	fmt.Printf("min for int64 = %+v\n", math.MinInt64)
	fmt.Printf("min for int32 = %+v\n", math.MinInt32)
	fmt.Printf("min for int16 = %+v\n", math.MinInt16)
	fmt.Printf("min for int8 = %+v\n", math.MinInt8)

	// Added parts that aren't in the video!
	fmt.Printf("max float64 = %+v\n", math.MaxFloat64)
	fmt.Printf("max float32 = %+v\n", math.MaxFloat32)
	fmt.Printf("smallest nonzero float64 = %+v\n", math.SmallestNonzeroFloat64)
	fmt.Printf("smallest nonzero float32 = %+v\n", math.SmallestNonzeroFloat32)

	fmt.Printf("max uint = %+v\n", MaxUint)
	fmt.Printf("min uint = %+v\n", MinUint)
	fmt.Printf("max int = %+v\n", MaxInt)
	fmt.Printf("min int = %+v\n", MinInt)
}

View the gist on GitHub

Machine Learning, Protocols, Classification, and Clustering

Today Suz Hinton @noopkat and Amanda Moran @AmandaDataStax are presenting, “Alternative Protocols – how offline machines can still talk to each other” and “Classification and Clustering Algorithms paired with Wine and Chocolate” respectively. The aim is to stream these talks tonight too on my Thrashing Code Twitch Channel. If you can attend in person, we’re almost at capacity so make sure you snag one of the remaining RSVP’s.

Here’s some more details on the speakers for tonight.

Suz Hinton AKA @Noopkat! Twitter: https://twitter.com/noopkat Twitch: https://twitch.tv/noopkat LinkinIn: https://www.linkedin.com/in/susanmhinton/

Alternative Protocols – how offline machines can still talk to each other

Abstract: IoT has Internet built into the abbreviation itself, and so these days we take for granted that internet is always available. However, when you lack the stable infrastructure for communicating over networks, there should be ways to overcome this challenge. Device management and deployment is seeing a change in architecture, and edge computing is growing in popularity. What would a semi-offline edge device network look like? Can we use sound to communicate reliably and securely without wires in the absence of an always on connection? This talk will cover this scenario by introducing the Chirp protocol with a demo thrown in for good measure.

Amanda Moran AKA @AmandaDataStax! Twitter: https://twitter.com/AmandaDataStax LinkedIn: https://www.linkedin.com/in/amanda-kay-moran/

Classification and Clustering Algorithms paired with Wine and Chocolate

Abstract: Hearts, wine, and chocolate .. it must be February! Can machine learning determine a wine’s region and quality? Can machine learning determine what makes chocolate delicious? Short answer, yes it can! This talk will focus on using classification and clustering algorithms to do analytics at scale using Apache Cassandra and Apache Spark. Publicly available datasets, Jupyter notebooks, Pyspark, and DataStax Analytics will power this talk and live demo.

After the talks we’ll reconvene at a nearby location for conversations and refreshments (from Sponsors, so not out of your pocket!).

Schedule:

6:30pm Conversations – We will reconvene for a drink and some food afterwards, but no pizza and beer for this meetup. Be sure to grab a quick bite before the talks! 7:00pm Introduction & Announcements 7:10pm Presentation 1 7:50pm We’ll wrap up talk 1 and take a short break. 8:00pm Presentation 2 8:40pm Trek to … ?? where should we go ?? Want to sponsor the meetup or drinks, check out https://compositecode.blog/meetup-sponsorship-prospectus/ 8:50pm After meetup drinks & conversation at McMennamins next door.

Logistics:

We’ll be meeting The Maxwell Hotel, in one of their fancy meeting rooms. It’s a “Staypineapple Hotel” which I’ve no idea.

Bus: – KC Metro 3 or 4 route and get off at/near the QFC at Mercer & 5th. It’s 1 block north to Roy and ~3-4 blocks west on Roy St. – D Line between Seattle & Ballard, get off at Mercer St & Queen Anne Ave N and travel 1 block north to Roy St and east ~3-4 blocks. – 2, 13, or 29 to 1st Ave N & Mercer St, then go 0.40 north to Roy St and ~3-4 blocks east.

Monorail: – Board downtown at Westlake, travel north and get off at Seattle Center Monorail station. Travel one block section west by the Seattle Children’s Museum, then turn north and pass the fancy International Fountain and Seattle Center Exhibition Hall coming to Mercer St, continue to Roy St and the location is 0.3 blocks on the right.

Bike: – Best route coming from the east is cut down under Aurora on Mercer where the cycle track is, it’s a beautiful ride, and then right on 5th and left to the PBL on Roy St ~3-4 blocks to the location. – Coming from the west or “the other side of the tracks” cross at the Thomas St Overpass. – From the south take 2nd Ave cycle track to Denny, cross and stay on 2nd through the beautiful Seattle Center. At Roy St turn right and travel ~2-3 blocks. – If you’re coming from the north from in Queen Anne I’m still collecting data. Any input is welcome.

More on ML4ALL, Learning About “Using Your Data to Give Your Customers Superpowers”

This year’s ML4ALL is coming up real soon, more details over on the site, but here I’m providing some retrospective talks from last year to get you ready for this year’s ML4ALL!

In this talk Kirsten Westeinde (@kmkwesteinde) provides us insights into how your customers can gain superpowers through effective data use. Last year, I introduced Kirsten.

This year’s event is coming up, if you want to get deeper into, pr present on machine learning, learn ways to improve your use of, and eliminate biases like this then ML4ALL is going to be a great conference for you. Check it out, we have an open CFP, tickets are available (early bird still!)

Eliminating Machine Bias

I introduced Mary Ann Brennan last year for ML4ALL and I really enjoyed the talk Mary gave and wanted to share it again with everyone.

The more I learn myself about machine bias, which really is just manifestation of people’s cognitive biases showing through in models because we’ve poorly identified we have a problem, the more frustrated I get with humanity’s inability to fix this problem. But to the rescue come those people who aim to find, identify, and fix these problems and eliminate the inherent cognitive biases by eliminating machine bias! Enter, Mary Ann Brennan and this talk she gave last year at ML4ALL. This year’s event is coming up, if you want to get deeper into, pr present on machine learning, learn ways to improve your use of, and eliminate biases like this then ML4ALL is going to be a great conference for you. Check it out, we have an open CFP, tickets are available (early bird still!)