CyberSpy

Rantings from a guy with way too much free time

OCaml Intro: You can have it all: Object-Oriented, Imperative, and Functional

2018-02-01 Programming Rob Baruch

YAPL

So why take the time to delve into yet another programming language? I find at worst, one can expands one’s knowledge of existing programming paradigms by studying the language design choices of other languages not used on a daily-basis. Best case, one discovers a new language that is rich in expression and productivity; thereby refining the productivity of the user.

OCaml

So, I tripped over this programming language in a rather random and circuitous path. I was watching a super-cool video visualizing how the Fourier Transform integral is constructed (by 3Blue1Brown). At the end of the video, the sponsor was a well-known, prestigious wall-street boutique, Jane Street, famous for hiring the best of the best in mathematics and computer science. So, naturally, I thought I’d take a closer peek at their website and discovered that they were big sponsors in OCaml as it underlies their trading and production environments. And down the rabbit hole I went.

Continue reading

GPOTD - Furry Lewis

2018-01-25 Music Rob Baruch

New Blog Series: GPOTD (Guitar Player of the Day):

Aside from writing about technical matters, I enjoy writing about music and musicians from time to time. To that end, I want to kick-off a new series GPOTD which features a guitar player that you likely aren’t familiar with. Today at the end of my acoustic guitar lesson, my teacher pulled up some music by this lesser-known player of the American Folk Music Revival. And it sounded amazing! So, I thought I’d take a closer look at the music and the man.

Continue reading

Pothos - A New Take on Data-Flow Frameworks

2018-01-17 Programming Rob Baruch

Data-Flows… like a river

In today’s post, I thought I’d take a look at and discuss the Pothos toolkit, a work-flow tool that improves upon the design principles of gnuradio and enables real-time data-flow processes for real-time applications.

Using a MacBook Pro, an ettus N210 SDR, and an FM-antenna, I’ll show how easy it is to build an FM Receiver to listen to your favorite radio stations on your laptop. While it’s an expensive way to tune in to your local DJ, it’s a great demonstration of how to use this great kit (written by Josh Blum).

Continue reading

Crypto 101: A Brief Tour of Practical Crypto in Golang

2017-12-14 Programming Rob Baruch

Crypto 101:

Golang offers a rich collection of packages supporting cryptographic operations. From a beginner’s perspective, maybe too many offerings! I offer up an overview of what’s available and an introduction to some practical uses of cryptography in Golang. Implementation details are always critical when discussing crypto. We’ll discuss some general implications of making poor choices and how such choices can completely undermine any uses of these tools.

What’ in the box?

The top-level crypto package is comprised of a little over a dozen sub-packages that offer:

Continue reading

Channel Your Inner Gopher

2017-12-13 Programming Rob Baruch

Channeling your Inner Gopher - (Literally) Reflecting upon Channels

Many gophers are likely familiar with the communication paradigm, channels. An elegant solution to communicate (uni or bidirectionally) typed information among go-routines. In it’s simplest form, we declare as type-valued channel variable, make it, and then send and receive data through it. Easy enough!

package main

import (
        "fmt"
)

func main() {
        var simpleChan chan int = make(chan int)

        go func(c chan int) {
                // send important data to the channel
                c <- 42
                close(c)
        }(simpleChan)

        // receive data
        num := <-simpleChan
        fmt.Printf("got %d\n", num)

}

In our trivial example above, we create an chan int typed-channel and initialize it using make.

Continue reading

Once Upon a Reflection: Looking Deeper into Golang reflection

I often reflect upon my code…

One of the coolest features of the Golang programming language is the reflect package. As the package documentation states at the onset of the package:

Package reflect implements run-time reflection, allowing a program to manipulate objects with arbitrary types. The typical use is to take a value with static type interface{} and extract its dynamic type information by calling TypeOf, which returns a Type.

On the surface, that all sounds pretty straight-forward. But when you start to think about the types of objects (literally) that you might reflect upon, things can get interesting pretty quickly. It’s one thing to dynamically get the type of an object like an Int, and then extract it’s value. But what about dynamically getting access to Methods inside a struct and then calling it with values created dynamically from an a-priori signature, returning values and extracting those values programatically? Rather quickly, the power of reflection can become overwhelming and even confusion. Moreover, appropriate use-cases of reflection should be well thought out so that we aren’t simply getting too clever for our own good.

Continue reading
Older posts Newer posts