The Daily Review, Read, Review, and Question Answer Routine

UPDATE 7/22/2019: I’ve added a survey to attempt to collect more options. Please fill out this quick survey ~(30 seconds) so that I can build up a larger list of options derived from the community. Thanks!

Survey >> here <<!

I’ve started trying out a “punch list” to go through on a daily basis. It’s one of the first things I do in the day as a way to get into topics of discussion and also the workflow for the day. There’s also a “checklist” that I go through on a weekly basis, thanks to head honcho Jeff Carpenter @jscarp, that he has brought into our team’s weekly SITREP.

I use the term “punch list” because sometimes it gives me that “I wanna punch something” level of frustration. The “check list” on the contrary is more a list of intended accomplishments and ongoing accomplishments. First of the two, here’s the punch list.

Daily Punch List

Each of these sections I try to time box in 5 to 20 minutes at the most. If there’s more I can answer, or help out with I might go a little longer, but otherwise I try to keep it concise and to the point for each list item.

The first site I check out these days is the DataStax Community site. I go through, answer questions, or just give a good look at anything new or conversations that are going on.

Next up to bat is Stackoverflow. The first 4 topics I’m aiming to cover everyday include these, but I’ll admit so far I’ve trampled off into the weeds on the topics.

I routinely then click through on the “unanswered” too just to see if I can help out and provide some answers.

Dev.to I don’t always visit every single day, but try to every other day or so. I take a look at the main page and then look at any new comments, questions on my own blog entries, or whatever else that might have come up. Then I also give a look at any blog posts or other entries others have written that seem interesting and are a quick read. Finally, if I’ve got any ready, I post a blog entry or two myself. The other sites that I generally tend to do the same process for I’ve included below too.

Some of the other sites I dive into on an almost daily basis, or am trying to on an almost daily basis, include the following.

The last two sites I check into and read, comment, or otherwise on an almost daily basis include DZone and Medium. I try to make semi-frequent posts here too but that doesn’t happen to often these days. However the content tends to be pretty solid on the technical front.

These are the higher value daily punch list items, then there is the high value low value items of pure social media: LinkedIn and Twitter. These two sites can be vast and total wastes of time if not used right. They’re almost as bad as Facebook, which at this point I largely ignore.

  • LinkedIn – For LinkedIn the content needs specific call to actions, appropriate link and images, ideally a good URI to follow through, and of course good content. This way LinkedIn can actually be super useful for rallying coders to open source projects, finding out what others are working on, and any and all other curiosities that can – if used right – provide positive value.
  • Twitter – Twitter, number one priority these days is to avoid the political garbage fire and troll trash since it’s a complete and utter waste of time. However, Twitter can and does still provide an excellent way to follow key figures in the industry, keep up with trends and find out about events for example. Using it for such, and providing a valuable stream of such content makes Twitter a solid investment.

NOTE: When I say I ignore Facebook now because of low value, I’m talking about maybe 5-10 minutes of use PER MONTH! Facebook is an extremely low return site for software development and related technology industry efforts these days. Avoid it like one would avoid the plague!

You might have noticed I didn’t put Twitch on this list, that’s because it isn’t on the punch list but a fundamental element of my day to day coding efforts. For more on it check out my repo and corresponding blog entry from a few weeks back.

Weekly Checklist

The checklist for the week involves a few questions that when answered provide a solid basis for direction for the week and a short list of accomplishments to discuss:

  1. What am I learning?
  2. What development am I working on?
  3. What’s coming out next?
  4. What’s the next event?

What am I learning? – This should be answered with anything from high level “I’m learning physics” down to tactical things like “I’m figuring out how to run concurrent go routines to better handle messaging between node instances I’m running.”.

What development am I working on? – As a developer advocate I aim to make sure a significant bulk of my day to day activities is centered around doing actual software development work. That can be on actual internal repositories of code, open source project, or some other variant coding option. Whatever the case, whatever I’ve found to work on that can help add value in some way is what becomes the answer to this question.

What’s coming out next? – For this answer I tend to look at upcoming blog entries, conference talks, releases of software I’ve been working on, and almost anything else that is getting released by me, or that I’ve been involved in that will be released. This sometimes matches the next events too when I’m the one hosting and organizing the event.

What’s the next event? – This answer can be anything from “no event this week” to a “I’m attending/hosting/crashing a cool meetup on topic X” or “releasing X feature from Y project”. Something along these notions.

That’s that, so what’s your flow for getting started every day? What’s the routine for checking in with your world and network?

Until next time, happy thrashing code! \m/

Provoking the Parietal, Temporal, Occipital, and Frontal Lobes!

I love starting the week provoking my mind into some intertwined, interlaced, involved, composition, and a nice dose of craziness in my music. So for this Monday, here’s the weekly prescription. Gojira…

From the lands of Canadia, here’s some In Vertigo by The Agonist!

To wrap up today’s trio, here’s a classic The Underground in America covered by Leo and Ola Englund!

Learning Go Episode 5 – Functions (and Methods and lots of other things)

Episode Post & Video Links:  1, 2, 3, 4, 5 (this post), 6, 7, and 8. Non-linked are in the works! Videos available now on Youtube however, so check em’ out!

In this session we covered a host of topics around Go Functions. Along with some troubleshooting, debugging, and other features in Jetbrains Goland IDE.

If you’d like to go through this material too in book form, I highly suggest “The Go Programming Language” by Alan A.A. Donovan & Brian W. Kernighan as a starting point. I’m using it as a simple guideline, but also doing a lot more in each stream that includes ecosystem, dependency management with godep, IDE use of Goland from Jetbrains, and more. In this session I get specifically into: functions, signatures, declarations, recursion, return values, and more.

Video Time Points & Topics

2:50 – Introduction to the snowy wonderland of Seattle and episode 5 of the Learning Go series. Introduction to the various screen transitions and such.
6:40 – Getting started, opening up JetBrains Goland and creating a new project. The project exists on Github as https://github.com/adron/learning-go-….
12:18 – Starting with functions in Go. See the blog entry I wrote on the topic for more additional information around this first code session within the episode 5 session.

Code – This first example I setup a basic function in Go that is called by the main function. The sample function below I’ve named exampleExecutor, and the signature is made up of an int parameter called this, a string parameter called that, and a return parameter of type int and one of type string. In summary for the function signature we have two input parameters going in and two return parameters coming out.

The function does very little besides print the parameters passed in and then return the parameters back out as the return parameters.


package main
import "fmt"
func main() {
var this, result int
var that, message string
this = 2
that = "42"
result, message = exampleExecutor(this, that)
fmt.Printf("%s\n%d", message, result)
}
func exampleExecutor(this int, that string) (int, string) {
fmt.Printf("Numbers: %d, %s\n", this, that)
return this, "This is the result: " + that
}

Recursion with Go & HTML Parsing

28:10 – Here I get into recursion and the application example, largely taken from the book but with some very distinctive modifications, that parses HTML and the various nodes within an HTML document.

For the recursion section I use an example from the book with an expanded sample set of HTML. The HTML is included in the repo under the function-recursion branch. For this example I setup a set of types and variables up that are needed throughout the code.

First a type setup called NodeType of type int32. A constant array of ErrorNode, TextNode, DocumentNode, ElementNode, CommentNode, and DoctypeNode for determining the different nodes within an HTML document. Then a general struct called Node with Type, Data, Attr for attribute, and FirstChild with NextSibling setup as a pointer to *Node, which gives a type of memory recursion to the underlying type. Then finally the Attribute struct with a Key a Value.


type NodeType int32
const (
ErrorNode NodeType = iota
TextNode
DocumentNode
ElementNode
Commentnode
DoctypeNode
)
type Node struct {
Type NodeType
Data string
Attr []Attribute
FirstChild, NextSibling *Node
}
type Attribute struct {
Key, Val string
}

One of the first functions I then end up with is the visit function. It turns out as shown below. Here the function takes a links parameter that is of type string array, a parameter name n that is a pointer reference to an a node within html, and then the function returns a parameter of type string array.


func visit(links []string, n *html.Node) []string {
if n.Type == html.ElementNode && n.Data == "a" {
for _, a := range n.Attr {
if a.Key == "href" {
links = append(links, a.Val)
}
}
}
for c := n.FirstChild; c != nil; c = c.NextSibling {
links = visit(links, c)
}
return links
}

view raw

visit_func.go

hosted with ❤ by GitHub

After that function I worked through and created two additional functions, one for countsWordsAndImages and one called CountWordsAndImages. The casing being specific to scope and use of the functions, and they respectively look like this in completion.


func CountWordsAndImages(url string) (words, images int, err error) {
resp, err := http.Get(url)
if err != nil {
return
}
doc, err := html.Parse(resp.Body)
resp.Body.Close()
if err != nil {
err = fmt.Errorf("parsing HTML: %s", err)
}
words, images = countWordsAndImages(doc)
return
}
func countWordsAndImages(n *html.Node) (words, images int) {
if n.Type == html.TextNode {
words += len(strings.Split(n.Data, " "))
return
}
if n.Data == "img" {
images++
} else {
if n.FirstChild != nil {
w, i := countWordsAndImages(n.FirstChild)
words += w
images += i
}
if n.NextSibling != nil {
w, i := countWordsAndImages(n.NextSibling)
words += w
images += i
}
}
return
}

view raw

counting.go

hosted with ❤ by GitHub

Then all that is wrapped up, with recursive calls and more, in the main function for program execution.


func main() {
htmlContent, err := ioutil.ReadFile("compositecode.html")
if err != nil {
fmt.Println(err)
}
htmlData := string(htmlContent)
r := strings.NewReader(htmlData)
doc, err := html.Parse(r)
if err != nil {
fmt.Fprintf(os.Stderr, "find links: %v\n", err)
os.Exit(1)
}
for _, link := range visit(nil, doc) {
fmt.Println(link)
}
w, i, _ := CountWordsAndImages("https://compositecode.blog&quot;)
fmt.Printf("Words: %d\nImages: %d\n", w, i)
}

Starting Error Handling && Anonymous Functions

1:32:40 – At this point in the episode 5 session I get into a simple Error handling function, and further into function signatures and how to set them up.
1:52:24 – Setting up some anonymous functions and reviewing what they are.
1:59:00 – Introduction to panics in Go. After this short introduction I also discuss some of the pedantic specifics of methods vs functions and related verbiage around the Go language. Additionally I provide more examples around these specifics for declaring functions, various scope, and other types for function calls and related usage.

With that done the wrap up of the session is then a short introduction to anonymous functions.

A Little Monday Help for Monday the 1st of July, 2019!

Ever wake up on Monday and just feel like you aren’t gonna be able to handle anything? Well here, open your mind and prepare to get woken up with an unstoppable energy that’ll drive you through the day and breath life into those lungs of yours! For starters: Parasite Inc.

Then, make sure to give a listen to some Words of Wisdom.

To calmly then move on with the rest of the day now that you’re awake. At The Gates has The Mirror Black to pace yourself!

Enjoy the Monday another day to happily code, and may you thrash the code to your demands!