I’ve recently changed my workflow for preparing talks. I prepared 3 with this approach so far and I’m quite happy with the process so I decided to document it. Inspired by Gary I love Gary Bernhard’s How to prepare a talk . But it’s a lot! tl;dr: improvise a bunch of times and the structure will crystallize. As a bonus you’ve now practiced a lot and are well prepared…
If you’ve done anything nontrivial with GraphQL you’re probably familiar with how “N+1 select problem” sneaks up on you. If not, this is how gqlgen docs explain it: Imagine your graph has query that lists todos… 1 query { todos { user { name } } } and the todo.user resolver reads the User from a database… 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 func ( r * todoResolver )…
awk is the Swiss army knife of the command line. If you have a text-shaped problem then awk can probably be a solution. Here’s a fabulous talk by Brian Kernighan (the k in awk) on why this may be the case. But it’s also a tool that I use just rarely enough that I keep forgetting details. So everytime I reach for awk it’s a painful experience of not remembering and having to cobble together 3…
Micro frontends? Huh? extending the microservice idea to frontend development – https://micro-frontends.org/ or: how to scale frontend development once you have too many engineers and they start stepping on each other’s toes. Assuming of course your frontend is an SPA ( grug might have something to say about both points). But of course splitting an SPA into multiple smaller…
About 5 years ago I was working on a project written in style still common for today: python backend serving a REST API (public btw) SPA using framework-of-the day And it was horrible. Not to mention that the framework-of-the-day did not actually take off and we ended up using something very fringe - there were real performance and complexity problems. And to this day I believe all our problems…
tl;dr it’s a tradeoff so it depends. With that out of the ways let’s start with the fact that this is not an article about technical merits and which is best. It about my experience and my beliefs about which kinds of projects are a good fit for which tool. So what did I do? I have a (useless) pet project I keep fiddling with to try out new things. At one point I decided my eyes hurt…
I’m pretty sure that as computers got faster they got slower. As chips got faster the software slowed down. I’m acutely aware that we do much more now but just the user interfaces really have no reason for slowing down. Why do I care? Because a fast web is a delight to browse. A fast app is a delight to use. The tool feels like an extension of your body. Where as a sluggish tool…
I came across Supporting Remix with full stack Cloudflare Pages on Cloudflare blog (yes I’m a CF fan) and Remix piqued my interest. Mostly because it addresses my concerns with “modern” web development: the wiring boilerplate is mostly gone, there is no 100 file setup to get a workable dev environment. And of course because it’s outside my comfort zone - so maybe I’ll…
tl;dr it works, scroll though and look for the code snippets You might have heard about Docker (the company) changing the terms of use which effectively requires enterprise users to pay up. While I personally think that paying for critical infrastructure that supports your business is a good idea there was a considerable backlash among engineers and “alternative to docker” was the…
This time I’m trying out a monitoring solution: Prometheus . All I know about it so far: pull based, server scrapes /metrics on workloads, human readable format scales well because of this popular in kuberetes space Let’s try running the docker iamge based on the README. 1 docker run --rm -it -p9090:9090 prom/prometheus:main We’ve got lift off! And it’s monitoring itself…
In another “running kuberets” flavoured post I’ll be trying out microk8s High availability K8s. Low-ops, minimal production Kubernetes, for devs, cloud, clusters, workstations, Edge and IoT. In the past I’ve been using k3s for small (mostly single node) “clusters”. The pitch is very similar. The few differences I can point out now are: microk8s is a bit heavier…
This time it’s a bit different: this post has very little code and a lot of screenshots as I was primarily working with a GUI. Reading about (and working with) K3s is almost impossible to not hear about Rancher - the company behind K3s. But what had me slightly confused is their primary product: Rancher (the software) . The web page says Managed Kubernetes Cluster Operations but that…
This is a part two of Trying out Okteto . I’ll be trying out okteto.com - “The Kubernetes development platform”. At a first glance it looks like a hosted kubernetes solution + the CLI tool I already tested + some bells and whistles. Let’s find out what those are. First impressions Login with github. Boom I’m in, no extra sign up required. Big thumbs up. Looks like I…
Today I’ll be giving Okteto a spin. From the docs Okteto: Tool to Develop Applications on Kubernetes Or my personal pitch: Okteto delivers on the “my other computer is the cloud” trope What does this mean? First of all: there is a distinction between Okteto Cloud & Okteto Enterprise: this is a server side solution that provides managed k8s namespaces, CD and other bells and…
I’m trying out a new concept: my “I should check this out” list of tools and technologies has grown quite a bit so I got the idea that I could do short write ups of my experimentation and first impressions to give myself motivation to try these things out. Will see how this turns out, hopefully this will turn out a series :) Today I’ll be trying out Buffalo - a Go web…
Why on earth would you want to do that?! You may have a legitimate reason like pooling spare compute capacity. Oooooor you’re just goofing around in order to understand things. Like me. Specifically I was playing with telepresence (a “VPN into the cluster”) and a had an idea: why not just run a part of the cluster locally. Then you can interact with the containers and containers…
During the quarantine my hobbies (and I imagine many others’) shifted to more indoors ones - possibly sedentary. Among other things I also started gaming after a hiatus of many years. But as you can probably imagine gaming on a 13" laptop with integrated graphics is not the most gratifying of experiences. So I got myself a desktop with a proper graphics card. And now comes the interesting…
Want to perform a git rebase in which you rename a file without pesky conflicts? tl;dr 1 2 git filter-branch -f --tree-filter 'git mv ORIGINAL_FILE_NAME NEW_FILE_NAME || true' -- $( git merge-base origin/master HEAD ) ..HEAD git rebase origin/master Ever wanted to rename a file you created/modified in a pull request but also wanted to keep the pristine history you worked hard for? Well tough luck…
If you’ve been here before you might notice the site looks different. Indeed I moved my content to yet another platform (first it was blogspot -> hakyll). I wanted to publish something but I ran into issues: my toolchain did not work. See, I’ve been doing less Haskell on my machine lately and negligence led into my setup rotting (as I did upgrade my machine quite a bit). Truth be told…
Did you know that you can sort data in time linear with respect to the lenght of said data? Some people dismiss linear time sorts because they’ve learned that n log n is the bottom bound for sorting an arbitrary input. But n log n is optimal!? Let’s even sketch out a proof. Any function that sorts an array of elements will in fact figure out a permutation of elements into a sorted…
So I got a (recurring) task to compile some stats from Jira. You now, some filtering and agregation. Possibly a pivot table and a chart. Sounds like a perfect task for spreadsheets. But Jira doesn’t have spreadsheets - at least without addons, but that is not an options for me. So I decided to use Google Sheets. And figure out a way to automatically fetch data from Jira because there’s…
The Back Story My first foray into world of Linux happened with Red Hat Linux 6 (original, not the enterprise one). It was magical but it didn’t stick. See, I was a kid who liked video games. So it was back to Windows until I finally got serious about programming and discovered I the development environment on Linux. So I formatted my hard drive and installed Ubuntu. I quickly learned…
One of the first things you learn as a newcomer to Scala is the difference between a list and a tuple: a list must be homogeneous but a tuple can be heterogeneous. That is all elements of a list must have the same types but a tuple can contain things of different types. A direct consequence of this is that a list can define a by-index accessor and a tuple cannot. You can use list(3) but you…
So you want an “isolated” MySQL “service” but don’t want to (or are not able to) run Docker/rkt/LXC/whatever? Here are the tl;dr steps: 1 2 3 4 5 6 7 8 9 cd /tmp mkdir mysql-1 cd mysql-1 nix-shell -p mysql mysql_install_db --datadir = $( pwd ) mysqld --datadir = $( pwd ) --socket = $( pwd ) /socket & mysqladmin -uroot -h127.0.0.1 password <REDACTED> mysql -uroot…
Just recently I was porting a toy sized parser combinator library (a proof of concept) from Haskell to Python. You know, for educational purposes. It turns out I’m not smart enough to keep the complicated types (and explicit laziness) in my head even for such a small project. So my solution was to do TDD. To clarify: I wanted to test happy paths through my functions to make sure at least…
Quite recently I managed to make myself a corrupt git repository due to a file system failure. See, git stores everything in content addressable blobs - the file name of something is it’s hash. Which lends itself nicely to checking repository integrity - it keeps out malicious attackers as well as my file system problems. I already hear you saying: Why not just make a new clone, git is…
We are used to encoding numbers on computers in binary. Binary is the “simplest” base that yields logarithmic length though it may not be optimal . But can we do simpler? How about unary? Unary is often used with Turing machines where we don’t care for efficiency and I will assume this same stance. Let’s forget about efficiency and explore what can unary numbers do that…
Sometimes you want to distinguish between different types that have the same underlying representation. For example both UserId and ProductId could be represented by Long . The usual solution is to introduce wrappers in order to make the distinction safe. 1 2 case class UserId ( id : Long ) case class ProductId ( id : Long ) But this introduces runtime overhead of boxing and unboxing over and over…
Recently I’ve been thinking about the design of programming interfaces, especially in Haskell. But don’t let the title misguide you; this is not supposed to be a tutorial or a guide but simply an showcase of different styles. Feel free to tell me I’m wrong or missed something. The problem Let’s say we are writing an interface to RESTful web service. Our goal is to create…
There are many reasons why to prefer dynamic linking to static but I’ll not go through them. Sometimes you just want static linking, period. In my case it was to show that Go ’s static executables without dependencies are not something special and other languages can do it as good as well - Haskell included. My compiler of choice is GHC and I’m running ArchLinux. More on why this…
Motivation My first run-in with coroutines was with Python’s generators. 1 2 3 4 5 def ints (): i = 0 while True : yield i i += 1 This is a function that never returns. Instead it runs in an infinite loop over all natural numbers. But it yield s every number. This means it actually stops and “returns” the number to the caller but is available for more execution. Kind-of like…
Motivation In real world concurrent code you often come across the Future[Option[A]] type(where A is usually some concrete type). And then you need to compose these things. This is not straightforward in Scala. If you’ve done some Haskell just import scalaz._ and you can skip the rest of this article. Scalaz library defines a monad typeclass(and many others) that formally specifies what it…
Intro Lately I got sucked into Haskell. When I first saw it it looked like it might be a bit impractical for real-life projects but this prejudice faded away slowly. Now I’m at the point where I have an idea for a web application and I’d like to do it in Haskell. After a quick search I found many frameworks and libraries that I might use. So I decided to do some exploration and…
Let’s take a look at Go-language functions. They let you return more than one result. Like in 1 2 3 func foo ( n int ) ( int , int ) { return n + 1 , n + 2 } This function foo returns two numbers. But does it really? Pairs(and tuples in general) aren’t a first class citizen in Go. Yes you can return them from function and you can even return a result of a function that returns the same…
Hello there. I think I’m gonna resurrect this blog as I feel like writing again. I kinda have a general dislike for PHP and don’t like Wordpress. I tried mucking about with Github Pages, but I’m not a fan of Jekyll either. And then I forgot about this. Haskell A few weeks ago I rediscovered Haskell. I tried learning it once before but gave up. And insisted in Scala. This time I…
This is not a tutorial. This post is a flashback I had today. It might be a bit fiction as my memory about events tends to be fuzzy at times. But I promise it at least resembles the real story. I was in elementary school and just found out about programming and was learning about c++. After reading “ C++ na kolenih” by Goran Bervar I was empowered by knowledge and tried to do all sorts…
I did a tutorial how to set up everything using IntelliJ a while ago. I still think IntelliJ IDEA is awesome and you should use it(it has a free and open version) but I’ve found a better way. No more clicking around in wizards…it’s config file time. Relax - it’s quite simple. I recommend installing the Typesafe-stack. It gives you the two tools listed below in nice…
This week I felt the impulse to express myself multiple times. I felt like writing . Being a bit sentimental I opened up a notepad I got from my girlfriend as a birthday present and began a brain dump. A stream of consciousness . But my handwriting is painfully slow. This means I had time to do reformatting and rewording in my mind. Sot this was definitely not a brain dump. I wasn’t…
Today I was hanging in the # scala IRC channel and somebody came along(forgot the nick, sorry) and asked about some compilation error . I deduced he was trying to chain implicit conversions. And this doesn’t work. Else compilation would take forever and would also compile some wrong code by inserting long strings of implicits. But then somebody else responded(I think nick started with d) and…
Ever tried to write a generic singleton? It’s an oxymoron of a sort. But sometimes my brain dreams up funny concepts to solve the problem at hand. Sadly I cannot remember what I wanted to use them for. Anyway I think I just made all the methods generic and solved it this way. But this doesn’t really express the notion of one entity that’s agnostic to type of the parameters. With…
I just recently scratched the surface with scalaz . Think of it as an additional standard library for scala that’s FP oriented. It provides a bunch of type classes , instances for pretty much everything, some fancy data types, pimps(Pimp My Library) for standard library collections, actor implementation and probably some stuff I’m not aware of. I could really use a “map of…
I was doing my homework today(yes I am aware I should be enjoying myself on 30th December) and had some problems with concatenating possibly null strings in LINQ . Quick trip to StackOverflow and I find out C# has some funky operators that solve this in a (sort-of) clean way. 1 var outputString = input1 ?? '' + input2 ?? '' ; I like type inference so I use var’s extensively - please…
I’ve done some research a while ago on union types and found a nice implementation by Miles Sabin but it only works for declaring types of function parameters. And you can also do this with with type classes . What do I mean with “only function parameters”? In “everything is a function” kind of view there are three places to put types function parameters value(val or…
I use scala on Android and I don’t like the integrated database API . It’s very verbose and very stateful. I had written my own ORM ( DAO would be a more appropriate tag) a while back, before I used scala but it’s not enough anymore. So now I’m on a quest for a better database API. My dream is something small that handles schema for me and is type-safe . A nice DSL that is…
I’m attending Algorithms and data structures class this semester. Material it self is quite interesting and one TA is pretty cool too. But I don’t like professor(makes whole experience very much worse) and I believe homeworks could be much better. Oh, and we didn’t even mention functional approach…you know Haskell , Scala and the like. All we do is imperative, C-style code…
I’ve seen this great talk by Daniel Spiewak on Functional Compilers . He talks about lexical and semantic analysis in particular. First, problems with traditional lexing with scanner. You can only have regular tokens or you have do do some dirty hacking and backtrace the scanner therefore losing linearity. And you can solve this with scannerless parsing putting regular expressions into your…
DISCLAIMER: This is about my opinion. And may or may not contain some boasting. And is also a bit of a brain dump. Yep, this is not a typo. Not monadic but nomadic . Although monads are cool too. A few days ago the CTO of a company I work for said it’s time to specialize. He was talking about my career. Offering me a few things to try and then pick one. But this got me thinking. Today…
This week’s post is a bit different. Well very different. My team qualified for CERC ICPC (european programming contest) and that means a trip to Krakow, Poland . I plan on writing this in a journal style. A bit every day. Friday, 11. am I got up at 6. to check news and read a bit before departing. And of course to charge my laptop and phone to 100% batter for the long trip. Then a 10 minute…
Don’t get me wrong, I’m a huge linux fan. I use it on all my machines(even my phone, Android is basically linux) and even converted my sister and a few friends. But if you don’t convert somebody, chance they’ll try a new operating system is slim to none. Only geeks like me install funky stuff as their primary software just to try it. But the major problem lies somewhere…
For me the highlight of this week was discovering Bootstrap. I heard of it before but never looked into it. Probably because I wasn’t doing web stuff. The thing is bloody awesome. Back on topic. Scala 2.10 RC2 was released this Friday. Considering 2.9 had 3 RC releases, 2.10 final is probably quite near. And it brings some awesome features. One2 of them are macros