<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blog Title</title>
    <link>https://blogtitle.github.io/</link>
    <description>Recent content on Blog Title</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 16 Dec 2024 22:19:23 +0100</lastBuildDate>
    
        <atom:link href="https://blogtitle.github.io/index.xml" rel="self" type="application/rss+xml" />
    
    
    
    <item>
      <title>Go advanced concurrency patterns: part 4 (unlimited buffer channels)</title>
      <link>https://blogtitle.github.io/go-advanced-concurrency-patterns-part-4-unlimited-buffer-channels/</link>
      <pubDate>Mon, 16 Dec 2024 22:19:23 +0100</pubDate>
      
      <guid>https://blogtitle.github.io/go-advanced-concurrency-patterns-part-4-unlimited-buffer-channels/</guid>
      <description>Preface It&amp;rsquo;s been almost 6 years since I added to this series, but I thought it was time to resume working on it.
Since &amp;ldquo;perfect is the opposite of done&amp;rdquo; I thought I would talk about a simple pattern that I haven&amp;rsquo;t covered yet.
A couple of years ago I worked on a toy library to see if the new-ish generics proposal would finally allow to express some of the most common channel patterns in Go.</description>
    </item>
    
    
    
    <item>
      <title>Let&#39;s Go to Go2</title>
      <link>https://blogtitle.github.io/lets-go-to-go2/</link>
      <pubDate>Fri, 07 May 2021 09:04:30 +0200</pubDate>
      
      <guid>https://blogtitle.github.io/lets-go-to-go2/</guid>
      <description>Preface In my previous post I summarized the latest generics proposal for Go.
In this post I&amp;rsquo;m gonna use it a bit, and misuse it a lot.
The problem Sometimes I find myself writing code to run the same function in parallel with itself with different inputs, for example to process a batch of data.
This is not super complicated code, but it&amp;rsquo;s not exactly straightforward and can sometimes be tricky to get right.</description>
    </item>
    
    
    
    <item>
      <title>Go Generics</title>
      <link>https://blogtitle.github.io/go-generics/</link>
      <pubDate>Fri, 07 May 2021 05:54:36 +0200</pubDate>
      
      <guid>https://blogtitle.github.io/go-generics/</guid>
      <description>Preface Go doesn&amp;rsquo;t have generics yet, but there is a proposal that looks promising, and this post refers to that.
Here is a version of the playground you can use to try this proposal out if you want to experiment without installing any tools.
Functions Converting a slice into a channel. This is not necessarily the most useful function but it&amp;rsquo;s a good and simple example:
func chanFromSlice[T any](in []T) chan T { c := make(chan T, len(in)) for _, v := range in { c &amp;lt;- v } return c } Here you can see that this looks and feels like Go, with the only difference of the [T any] bit.</description>
    </item>
    
    
    
    <item>
      <title>Go Safe HTML</title>
      <link>https://blogtitle.github.io/go-safe-html/</link>
      <pubDate>Tue, 30 Jun 2020 13:03:31 +0200</pubDate>
      
      <guid>https://blogtitle.github.io/go-safe-html/</guid>
      <description>Disclaimer: this is not an official Google post or communication, it is just me commenting on something that is now available.
 The Google infosec team just released the Go &amp;ldquo;safehtml&amp;rdquo; package. If you are interested in making your application resilient to server-side XSS you might want to adopt it instead of &amp;ldquo;html/template&amp;rdquo;. Migration to safehtml should be quite straightforward as it is just a hardened fork of the original html/template standard package.</description>
    </item>
    
    
    
    <item>
      <title>I Am Switching to JS</title>
      <link>https://blogtitle.github.io/i-am-switching-to-js/</link>
      <pubDate>Wed, 01 Apr 2020 00:00:00 +0300</pubDate>
      
      <guid>https://blogtitle.github.io/i-am-switching-to-js/</guid>
      <description>After 5 years of using Go I am finally moving on. Go has served me well and has been the best language I could have possibly used for the longest time, but it is now the moment for me to let it Go.
Over time Go has not failed to show me its limitations and its issues, to the point where I decided to switch to something more future proof and with a more thriving community.</description>
    </item>
    
    
    
    <item>
      <title>Sneaky race conditions and granular locks</title>
      <link>https://blogtitle.github.io/sneaky-race-conditions-and-granular-locks/</link>
      <pubDate>Wed, 11 Dec 2019 09:33:58 +0100</pubDate>
      
      <guid>https://blogtitle.github.io/sneaky-race-conditions-and-granular-locks/</guid>
      <description>Race conditions are the main problem you have to care about when writing concurrent code. Go provides high level primitives that make it easier to get concurrency and parallelism right, but those are often times not enough.
This is one of the reasons why Go has a race detector. You should always run your tests and, where possible, a portion of your production fleet with -race enabled. Beware that this might still not be enough: the detector only triggers when a race manifests and not all races are detected by it.</description>
    </item>
    
    
    
    <item>
      <title>Go advanced concurrency patterns: part 3 (channels)</title>
      <link>https://blogtitle.github.io/go-advanced-concurrency-patterns-part-3-channels/</link>
      <pubDate>Thu, 05 Dec 2019 20:07:04 +0100</pubDate>
      
      <guid>https://blogtitle.github.io/go-advanced-concurrency-patterns-part-3-channels/</guid>
      <description>Edit (16 Dec 2024) This post is still here for historical reasons, but it&amp;rsquo;s now quite old.
The sync package has evolved since then and some primitives have become available.
While all the channel and select semantics have stayed the same, please consider this as a post on how to better understand channels semantics rather than documentation or replacement for the sync package.
Previous Post Today I&amp;rsquo;m going to dive into the expressive power of Go channels and the select statement.</description>
    </item>
    
    
    
    <item>
      <title>Rob&#39;n Go security pearls: Cross Site Scripting (XSS)</title>
      <link>https://blogtitle.github.io/robn-go-security-pearls-cross-site-scripting-xss/</link>
      <pubDate>Wed, 11 Sep 2019 23:23:40 +0200</pubDate>
      
      <guid>https://blogtitle.github.io/robn-go-security-pearls-cross-site-scripting-xss/</guid>
      <description>This post is part of my developer-friendly security series. You can find all other posts here.
 XSS is a vulnerability that allows attackers to run arbitrary JavaScript code in applications they shouldn&amp;rsquo;t be able to control. This can lead to complete account compromises for every victim that follows a malicious link or visits a compromised page.
There are two major families of XSS: server side and client side.</description>
    </item>
    
    
    
    <item>
      <title>Rob&#39;n Go security pearls: fundamentals</title>
      <link>https://blogtitle.github.io/robn-go-security-pearls-fundamentals/</link>
      <pubDate>Thu, 05 Sep 2019 12:25:40 +0200</pubDate>
      
      <guid>https://blogtitle.github.io/robn-go-security-pearls-fundamentals/</guid>
      <description>Welcome to this introductory series on web security. I&amp;rsquo;ll use simple snippets and hands-on examples to introduce fundamentals on the topic. Most server-side code will be in Go but you&amp;rsquo;ll be able to understand it if you know any C-like language.
This first post is about the fundamentals: URI, HTTP, TLS, HTML, escaping and cookies. If you are already familiar with those concepts please feel free to skip to the next post.</description>
    </item>
    
    
    
    <item>
      <title>Using JavaScript SharedArrayBuffers and Atomics</title>
      <link>https://blogtitle.github.io/using-javascript-sharedarraybuffers-and-atomics/</link>
      <pubDate>Fri, 22 Mar 2019 12:42:05 +0100</pubDate>
      
      <guid>https://blogtitle.github.io/using-javascript-sharedarraybuffers-and-atomics/</guid>
      <description>I&amp;rsquo;m not a big fan of JavaScript but I like parallel programming and JS has some interesting concepts of it.
In addition to the event loop I&amp;rsquo;ve recently got to know the concept of Web Workers. They are real threads that execute in parallel with the main thread, and are allowed to wait and block as much as they want.
Modern devices are going in the direction of having a lot of FPS and web developers want to maintain the user experience smooth.</description>
    </item>
    
    
    
    <item>
      <title>Go advanced concurrency patterns: part 2 (timers)</title>
      <link>https://blogtitle.github.io/go-advanced-concurrency-patterns-part-2-timers/</link>
      <pubDate>Mon, 25 Feb 2019 22:56:23 +0100</pubDate>
      
      <guid>https://blogtitle.github.io/go-advanced-concurrency-patterns-part-2-timers/</guid>
      <description>As I stated in my previous article timers are hard to use the right way so here are some handful tips.
Edit (16 Dec 2024) This post is still here for historical reasons, but it&amp;rsquo;s now quite old.
Many of the issues in this post have been corrected and some footguns don&amp;rsquo;t hold true anymore.
Please consider this as a window into a &amp;ldquo;previous Go experience&amp;rdquo; and nothing more.</description>
    </item>
    
    
    
    <item>
      <title>Go advanced concurrency patterns: part 1</title>
      <link>https://blogtitle.github.io/go-advanced-concurrency-patterns-part-1/</link>
      <pubDate>Sat, 23 Feb 2019 09:47:23 +0100</pubDate>
      
      <guid>https://blogtitle.github.io/go-advanced-concurrency-patterns-part-1/</guid>
      <description>Writing code is hard. Writing code that has to deal with parallelism and concurrency is harder. Doing all of that an keeping it efficient is challenging.
Today I decided to start sharing a couple of tricks to handle some peculiar cases.
Timed channels operations Sometimes you want to time your channels operations: keep trying to do something, and if you can&amp;rsquo;t do it in time just drop the ball.</description>
    </item>
    
    
    
    <item>
      <title>Go: slices gotchas</title>
      <link>https://blogtitle.github.io/go-slices-gotchas/</link>
      <pubDate>Fri, 22 Feb 2019 21:12:56 +0100</pubDate>
      
      <guid>https://blogtitle.github.io/go-slices-gotchas/</guid>
      <description>Preface One of the features that I love the most about Go is the fact that it is unsurprising. One could even say that it is boring in some sense. This is a good trait of a programming language. When you code you should focus on the problem at hand, and not on what your language is doing that you don&amp;rsquo;t want.
This article talks about one of the most &amp;ldquo;surprising&amp;rdquo; features of Go for newcomers: slices.</description>
    </item>
    
    
    
    <item>
      <title>A (un)biased story</title>
      <link>https://blogtitle.github.io/a-unbiased-story/</link>
      <pubDate>Tue, 19 Feb 2019 12:07:43 -0800</pubDate>
      
      <guid>https://blogtitle.github.io/a-unbiased-story/</guid>
      <description>I want to tell you a story somebody shared with me. Nobody knows where the story comes from, or who invented it, but now it&amp;rsquo;s widely used as an exercise to improve communication skills. I changed the names of the characters in order to be gender neutral, so, please, bear with me as some sentences are bulky.
Once upon a time, a long long time ago, there was a town. The town was cut in two halves by a large river.</description>
    </item>
    
    
    
    <item>
      <title>Some useful patterns</title>
      <link>https://blogtitle.github.io/some-useful-patterns/</link>
      <pubDate>Tue, 19 Feb 2019 08:37:12 +0100</pubDate>
      
      <guid>https://blogtitle.github.io/some-useful-patterns/</guid>
      <description>Coming from a VB.Net, Java, C# and Python background, when I first started using Go I was very annoyed by the lack of some patterns on a language level. It took me a while using the language to find out those patterns can be easily expressed.
Here is a collection of some common patterns and the best way I&amp;rsquo;ve found to express them.
Decorators This feature is extensively used in most object oriented languages, and consists in somehow taking a function or method and enrich it with other effects or properties.</description>
    </item>
    
    
    
    <item>
      <title>Go advanced benchmarking</title>
      <link>https://blogtitle.github.io/go-advanced-benchmarking/</link>
      <pubDate>Fri, 11 Jan 2019 22:15:43 +0100</pubDate>
      
      <guid>https://blogtitle.github.io/go-advanced-benchmarking/</guid>
      <description>The story Sometimes you have to solve a problem that comes in several flavours. Usually complicated problems do not offer a single solution, but there are several solutions that are optimal or terrible depending on which subset of that problem the program will have to solve at runtime.
One example I faced was to analyse some data flowing in some connections that I was proxying.
There are two main ways to extract some information from traffic: you can either record the entire traffic to analyse it as soon as it is done, or you can analyse it while it flows(with a buffer window) at the cost of slowing it down.</description>
    </item>
    
    
    
    <item>
      <title>The Hidden Pri(c|s)e of Research</title>
      <link>https://blogtitle.github.io/the-hidden-pricse-of-research/</link>
      <pubDate>Fri, 19 Oct 2018 15:42:57 +0200</pubDate>
      
      <guid>https://blogtitle.github.io/the-hidden-pricse-of-research/</guid>
      <description>You wake up one Sunday morning and think: &amp;ldquo;how the hell does that thing work?&amp;rdquo;. So you go and google for it and find several blog posts, talks and papers about the topic. During your research you find out some more detailed parts of the topic, so you search the web for it again and find out more. After several hours you find out something very interesting, many layers deeper than where you started, something that you can&amp;rsquo;t really grasp because it is too complex or requires some background knowledge that the speaker/researcher/blogger couldn&amp;rsquo;t possibly fit in the talk/paper/post.</description>
    </item>
    
    
    
    <item>
      <title>Regexp Fun</title>
      <link>https://blogtitle.github.io/regexp-fun/</link>
      <pubDate>Wed, 12 Sep 2018 19:57:02 +0200</pubDate>
      
      <guid>https://blogtitle.github.io/regexp-fun/</guid>
      <description>Preface I love using regular expressions. They are such a powerful tool, they are complex, concise, complex, expressive, complex, broadly supported, complex and easy to write.
They are the perfect tool if you want to write a simple script and you need to elaborate text. Some downsides are that they are complex, surprising, and very inefficient compared with simpler string manipulations primitives (e.g contains, hasPrefix, trim, replace,&amp;hellip;)
Regular The &amp;ldquo;reg&amp;rdquo; in &amp;ldquo;regexp&amp;rdquo; stands for regular.</description>
    </item>
    
    
    
    <item>
      <title>Let&#39;s talk about JavaScript</title>
      <link>https://blogtitle.github.io/lets-talk-about-javascript/</link>
      <pubDate>Sat, 11 Aug 2018 19:20:13 +0200</pubDate>
      
      <guid>https://blogtitle.github.io/lets-talk-about-javascript/</guid>
      <description>Short preface: The first version of JavaScript was completed in ten days in order to accommodate the Netscape Navigator 2.0 Beta release schedule.
Keep in mind that well structured languages usually take a little bit more than that.
What follows is a small piece of the aftermath of the rushed job.
NOTE: There is more madness in destroy all software&amp;rsquo;s wat video, which I suggest watching before reading this post.</description>
    </item>
    
    
    
    <item>
      <title>Considerations on error handling</title>
      <link>https://blogtitle.github.io/considerations-on-error-handling/</link>
      <pubDate>Fri, 10 Aug 2018 12:34:41 +0200</pubDate>
      
      <guid>https://blogtitle.github.io/considerations-on-error-handling/</guid>
      <description>The impact The first language I used to build something more than just school exercises was VisualBasic.Net. There are some good things and bad things in it, but I don&amp;rsquo;t want to discuss that today. I switched to C# after that and Java and Python after it.
This is to say that basically up until three years ago I knew one and only one way to handle errors which is expressed in the following pseudocode:</description>
    </item>
    
    
    
    <item>
      <title>Splitting Pipelines</title>
      <link>https://blogtitle.github.io/splitting-pipelines/</link>
      <pubDate>Fri, 13 Jul 2018 21:08:41 +0200</pubDate>
      
      <guid>https://blogtitle.github.io/splitting-pipelines/</guid>
      <description>The problem Some days ago I was looking at some configuration files that were presented in this form:
# # This is a section # VALUE_ENABLED=y # VALUE_DISABLED  The problem in reading this stuff is that both comments and non-comments are relevant and none should be ignored since a disabled feature could cause as much trouble as an enabled one.
I would have liked to see comments in a different file than the rest, so I thought: &amp;ldquo;Well, this is an easy job for grep&amp;rdquo;.</description>
    </item>
    
    
    
    <item>
      <title>Unmarshaling JSON in Golang</title>
      <link>https://blogtitle.github.io/unmarshaling-json-in-golang/</link>
      <pubDate>Wed, 30 May 2018 16:35:28 -0700</pubDate>
      
      <guid>https://blogtitle.github.io/unmarshaling-json-in-golang/</guid>
      <description>Unmarshaling JSON files in Golang can be tricky. Golang is a statically typed language and does not allow dynamic JSON deserialization. In order to unmarshal a JSON blob into Golang it usually requires to know its structure beforehand. But, as the internal documentation states, it is possible to unmarshal JSON into an empty interface.
An empty interface represents the empty set of methods and is satisfied by any value, since any value has zero or more methods.</description>
    </item>
    
    
    
    <item>
      <title>Kauai</title>
      <link>https://blogtitle.github.io/kauai/</link>
      <pubDate>Fri, 25 May 2018 21:35:39 -0700</pubDate>
      
      <guid>https://blogtitle.github.io/kauai/</guid>
      <description>This last weekend I flew to Hawaii for the first time in my life. What. An. Experience. Before leaving I read a couple of travel guides online, but nothing prepared me for the beauty of this island.
The flight I chose was on a Friday night. By 0330 I was done with my work for the week; quickly grabbed enough clothes for 4 days, my travel backpack and I was on a Lyft to the airport.</description>
    </item>
    
    
    
    
  </channel>
</rss>
