Some completely new tunes I’ve been enjoying.

Technological and coding misadventures!
Some completely new tunes I’ve been enjoying.

Obviously it isn’t Monday. But sometimes you go to a show on Sunday and you’re recovering on Monday and writing a blog entry just isn’t a priority. But in that vein, here’s the line up for the Bound by the Road Tour I dived into the pit with my brother this last Sunday! It was a truly brutal fight, loved it!
K’atun > https://www.facebook.com/pg/katunband
https://embed.spotify.com/follow/1/?uri=spotify%3Aartist%3A21XgrFZKhmE6A7U1Om95eU&size=detail&theme=dark https://embed.spotify.com/follow/1/?uri=spotify%3Aartist%3A1CToivUVH4hS9CXlYOSFgb&size=detail&theme=dark

Until next, happy thrashing code!
Recently I was dorking about with some Go code on OS-X. Just working with it via iTerm 2 and using some basic go run whateverthefile.go commands and displaying results out the the shell. All was well, and then I dived into some code that used so Go Routines. The code looked something like this.
package main
import (
"time"
"fmt"
)
func say(s string) {
for i := 0; i<5; i++ {
time.Sleep(2 * time.Second)
fmt.Println(s)
}
}
func main() {
go say("1. First thread is running.")
go say(" 2. Second thread is running.")
say(" 3. Thread is running in main.")
fmt.Println("Ended.")
}
That was fine. I ran the code and the results were as expected.
OSX$ 2. Second thread is running.
3. Thread is running in main.
1. First thread is running.
1. First thread is running.
2. Second thread is running.
3. Thread is running in main.
3. Thread is running in main.
1. First thread is running.
2. Second thread is running.
2. Second thread is running.
3. Thread is running in main.
1. First thread is running.
1. First thread is running.
2. Second thread is running.
3. Thread is running in main.
Ended.
Then I ran it again. Also these results were expected.
OSX$ 3. Thread is running in main.
2. Second thread is running.
1. First thread is running.
3. Thread is running in main.
1. First thread is running.
2. Second thread is running.
2. Second thread is running.
3. Thread is running in main.
1. First thread is running.
1. First thread is running.
3. Thread is running in main.
2. Second thread is running.
3. Thread is running in main.
Ended.
1. First thread is running.
You’ll notice the slightly out of order response as each thread completes. With the first set of results the last response is “Ended.” and with the second set of results “Ended.” is second to last. This of course is expected as the threads are likely to be executing while the last line of code is executed. But, there’s a catch to this depending where you run this code.
On the MacOS/OS-X platforms, when you run the shell it runs certain things with an assumed “&” after the command. Now, I’m not sure the specifics of what is happening (I’m looking it up and will happily post a super detailed reference link if you’ve got one, lemme know @Adron.) The “&” is however used on Linux/Unix systems to designate to the shell, run this command on the background so that the user remains in control of the shell. Specifically, from the man pages.
If a command is terminated by the control operator &, the shell executes the command in the background in a subshell. The shell does not wait for the command to finish, and the return status is 0.
The reason I bring this up, is if I run the same thing and those same results come back on Linux or Unix, you would not see anything after the “Ended.” runs, because the application terminates at that point and none of the background threads are actively connected to the shell. In other words the result where “Ended.” occurs second to last would look like this.
LINUX-SHELL$ 3. Thread is running in main.
2. Second thread is running.
1. First thread is running.
3. Thread is running in main.
1. First thread is running.
2. Second thread is running.
2. Second thread is running.
3. Thread is running in main.
1. First thread is running.
1. First thread is running.
3. Thread is running in main.
2. Second thread is running.
3. Thread is running in main.
Ended.
At first glance, it might seem like the application has run successfully, but look closely and count the number of responses from each thread. In this example, the shell has lost priority when the “Ended.” message appears and there is only four messages that read “1. First thread is running.”. However, after the “Ended.” message there should have been another one, like the second example above that I ran on OS-X. On Linux, the solution to executing this example is actually to add the ampersand at the end of the command.
go run whateverthefile.go & and then you’ll see the execution of the program with the correct results.
Well that’s it for this often overlooked and confusing behavior on Linux versus OS-X. Happy hacking, cheers!
Addition/Correction April 3rd, 2017: It was brought to my attention that this is very specifically the shell, not the operating system. This is an important thing to note, and sometimes is easily confused or mistaken outright. The effect can even be different behavior between shell use on the same operating system, regardless of OS-X, Linux, UNIX, or whatever.
Every few days I like to sit down like an old academic professor and just read and ponder what’s going on in the computer hardware and software industries. As of late it’s been interesting to dive into whatever Elon Musk is working on also; electric cars, solar energy, rockets, or even boring machines. Another thing I’ve had a curiosity in and continue to find interesting is machine learning, or as some call it in the mainstream movie media artificial intelligence.
I’ll tackle some of these technologies real quick so we all have a current situational report. Each of these topics seems to be a area of work that could use some extensive clarification. I’ll provide some of my own thoughts along with a few links of reference to dig in deeper, so that one doesn’t fall into the trap of uniformed oblivious media consumer.
My History: I haven’t always paid attention to this space because I never had intention of working in the area, however who isn’t interested in rockets in some way. Well, considering my desire for other work, I was extremely fortunate where I grew up to be involved in rocketry. I grew up in Picayune, Mississippi which is a mere ~15-20 miles away from John C. Stennis Space Center.
I had the joy of experiencing rocket tests at John C. Stennis and seeing research into rockets as a child, and on some of my first paid computer related gigs. As one might suspect, they use computers to do rocket research and help with launches. Shocker right!
My Thoughts: The space we’re in right now is impressive. The market is actually getting involved in launching it’s own rockets, which means we’re likely only years or maybe a decade or two of having an economically sustainable rocket program. Hopefully NASA can work on more focused deep space missions now while Musk’s Space-X and others refine and perfect orbital rockets for satellites and all that mess.
SITREP:
My History: I’ve toyed with machine learning on and off again, working on pathing algorithms for objects to decide travel patterns to supervised learning algorithms. In the end I’ve generally ended up working on other things in my day to day work but I know this will be changing in the near future (next year or three). It’s an extremely interesting space of work and research.
My Thoughts: First, getting AI & ML (That’s artificial integlligence and machine learning) conflated, especially in the media, is starting to reflect the popularity of said space in the software industry. However, for the most part these two things are effectively the same thing. It’s just different words describing the industry space where we’re trying to make machines make decisions we deem intelligent based on available data.
That actually leads to many other discussions. What do we as humans deem intelligent and what happens when available data isn’t enough? But more words on that for another day. I know the questions are burning in the mind of every chief executive of something that wants this mythical AI they keep hearing about and paying voluminous amounts of money to their big data bad ass data science ninja architects to implement but rarely have answers for all of it.
The SITREP:
Overall there’s a ton of material ending up on the web related to AI/ML, and my top suggestion is to start googling so you can pick and choose which aspects you want to read about in this space. One could dive in via the super technical aspect of how systems work that are being used for processing, how the algorithms work, or even working with data to model good decision results from data sets (i.e. diving into training). But it’s really a space that is awash in resources. Dive in!
That’s it for my industry introspections for now. If you’re interested in reading about this, programming material, and related topics subscribe, follow, or RSS feed read the ole’ blog here.
I’ve been getting a fair dose of New Orleans cajun grub lately so I went back to my roots and picked out a few bands from NOLA (That’s New Orleans, Louisiana FYI). Be prepared, NOLA Metal is a special level of sludgy heaviness and growl combined with some slightly psychedelic melodies thrown in.

With that, enjoy your coding heavy Monday metal!
Top 3 for Spotify
https://embed.spotify.com/follow/1/?uri=spotify%3Aartist%3A3xtIpqzIOfQUxKce8BU4Ka&size=detail&theme=dark https://embed.spotify.com/follow/1/?uri=spotify%3Aartist%3A1m0B9ak05G0jqDY4ACLhQu&size=detail&theme=darkhttps://embed.spotify.com/follow/1/?uri=spotify%3Aartist%3A5kuYamMO00pHPdRQcAXWTl&size=detail&theme=dark
Top 3 Videos for Youtube