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 raw

main.go

hosted with ❤ by 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.

Continue reading “Machine Learning, Protocols, Classification, and Clustering”

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

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

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

Continue reading “Eliminating Machine Bias”

Meetups Last Week: Serverless Identity and Security, Advanced XSS, RAFT Algorithms & Events, and Event Modeling.

Tuesday: Matthew Henderson, Serverless Identity and Security, then Naomi Bornemann, Advanced XSS Techniques.

Wednesday: James Nugent, RAFT Algorithm and Events, then Adam Dymitruk on Event Modeling.