Random Bits of Wisdom

I am a software engineer building his own stuff. This is my home on the Internet.

[Quote]: The Case for Apple to Postpone macOS 10.16 into 2021
macOS

[Quote]: The Case for Apple to Postpone macOS 10.16 into 2021

With so many errors reported throughout the lifetime of macOS Catalina, it kind of makes sense for Apple to slow down a bit and work on polishing it. Moving towards new features without fixing the existing bugs might be disastrous for the macOS ecosystem. But again, that’s Apple we’re talkign about. Anything can be expected from Apple. Like, deprecating macOS altogether, and eventually, replacing it with some some sort of iOS hybrid.

[Quote]: The President Is Trapped
Quote

[Quote]: The President Is Trapped

Here is a quote from: The President Is Trapped Trump is utterly unsuited to deal with this crisis, either intellectually or temperamentally. https://www.theatlantic.com | Created with Linqable The president will try to blame someone else—but in this case the “someone else” is a virus, not a Mexican immigrant or a reporter with a disability, not a Muslim or a Clinton, not a dead war hero or a family of a fallen soldier, not a special counsel or an NFL player who kneels for the national anthem.

Stay the F*** Home, Germany!
2 Cents

Stay the F*** Home, Germany!

TL;DR: This is not a drill! Despite the seemingly low moratilty rate in Germany, nearly 3000 people might die by the end of April alone. We can help keep many of them alive. Judging by how much people in Munich seem to enjoy the sunny days of spring, I am going to conclude that either: they all live in complete denial of the situation they already gave up they fully trust that no matter what happens, the German healthcare system would fix them in no time.

Elixir-Style Actors in Go
Programming

Elixir-Style Actors in Go

My foray into Elixir brought forward many more similarities between it and Go, than I originally expected. One of them is how both handle concurrency. With respect to that, creating Elixir-style stateful actors in Go is surprisingly easy. Answering the question, whether one needs them, or can make use of them, I’d leave to the user. If you approach me back saying that the same thing can be achieved using a channel or a map with sync.

iEx Is Dope!
Programming

iEx Is Dope!

iEx (Elixir’s interactive shell) is pure dope! It helped bring my development efforts back to the “let’s play and see what happens” level. Since Elixir modules are stateless and made up of pure functions, reloading a module is as easy as calling r MyModule inside iEx. During development, I’d try to keep one module called Demo, or Scratch, etc, where I’d do the quick and dirty setting up of things. This scratch module would usually have one function only, called demo or run.

[Quote] You Can Think of Any Web Server as a Function
Quote

[Quote] You Can Think of Any Web Server as a Function

“You can think of any web server as a function. Each time you type a URL, think of it as a function call to some remote server. That function takes your request and generates some response. A web server is a natural problem for a functional language to solve.” Excerpt From Programming Phoenix by Chris McCord Buy on Amazon Programming Phoenix Don’t accept the compromise between fast and beautiful: you can have it all.

Programming

A Crystal in Go’s World

Imagine a programming language with the ergonomic syntax of Ruby, the speed of execution of C, the concurrency model of Go, and last but not least, a compiler that performs null checks at compile time. Sounds like a dream? Well, this language exists, but chances are, you haven’t heard of it so far. Meet Crystal! Crystal is all of the above, plus it has types, outstanding documentation, and a strong community, delivering a steady stream of new libraries (a.

Programming

[Quote] Manual Work is a Bug

Here are a few lines from Manual Work is a Bug that I firmly stand by: The successful engineer has a quick way to create documents for new procedures and to find existing procedures. People with this mindset avoid the cognitive load of deciding whether or not a task is worth documenting, because they document everything. On finding a potential improvement, they are not slowed by the speed bump of switching from a document viewer to a document editor because they work from the editor at the start.

Programming

Reflecting on My Experience With Go, One Year After

In my little more than a year day-to-day developer experience with Go, I have so far learned three things: I can change my entire view of how programming works, even after 12+ years of doing it in one form or another. People are blaming Java for all the wrong reasons People are praising Go for all the wrong reasons Let me explain. This post is not about saying that “language A is better than language B”, or vice versa.

Using Gohack for Temporary Modifications to Go Module Dependencies
Programming

Using Gohack for Temporary Modifications to Go Module Dependencies

I started programming Go right at the time when the topic of modularization heated up. Of course, we all know how it all played out with Go modules. They are here and they are (IMO) great. I have spent a significant amount programming Python before virtual environments were really a thing, and believe me, things got really messed up at times. One big disadvantage of modules is that one can’t really edit them.

Apple

How to Request an App Refund on the Apple App Store

Buying the wrong product happens all the time, and apps make no exception to that. Although it does not apply to every country, if you live within the EU, you have the right to ask for a full refund of your purchases, no strings attached. You can do that with apps you have bought from the App Store too, without having to provide an explanation. It is actually very easy, though providers try to put a few stones on the way.

2 Cents

Why Is Bulgaria So Poor?

Note: What follows is my answer to question on Quora. I thought it might be worth sharing with my readers too. This is perhaps an unpopular opinion, but for whatever it is worth, I am going to let my mind speak. I would like to emphasize on the fact that I am, and will always be a Bulgarian, despite my conscious choice to live and have business somewhere else. The reason why Bulgaria is so poor has nothing to do with its nature and geographic location.

Programming

Panic Without Worry

In the Go community, there is some kind of paranoia around panicking, as if it’s the worst thing that can happen to your application. In fact, it often is the better option. Think about Go programs as CLI applications. Would you rather crash right away and let the user react, or hang, trying to recover? The same applies to applications running as services. Modern tooling makes it easy to automatically restart a crashing service within seconds.

Programming

If You Can’t Get Flutter to Work with Your Beta Version of Xcode

You need to explicitly set the beta version of Xcode as your default one via the command line: sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer/ Afterwards, getting your app to run via flutter run should work as it used to before. Related Resources select - Managing Multiple Versions Of Xcode It's not uncommon developers to have multiple versions of Xcode installed. For example, I typically have the latest beta as well as the most current http://iosdevelopertips.

Why I Still Find the Minimap Useful
Programming

Why I Still Find the Minimap Useful

This is an answer, I wrote in response to a recent blog post by Erica Sadun: My enemy the Minimap The minimap is one of Xcode 11’s starring features. I know many people were excited for it at its debut but after months of exposure, I now just disable it in the Adjust Editor Options menu (… https://ericasadun.com | Created with Linqable Many people ignore a particular use of the minimap - understanding the complexity of some portion of the code, without having to look at each line.

How I Stay Focused on Twitter Despite All the Buzz
Twitter

How I Stay Focused on Twitter Despite All the Buzz

With so much going on Twitter, we long have passed the point of being able to just look at our timelines and stay up-to-date. In fact, I have personally stopped following and would even go as far as to remove a significant portion of the people I’ve been following over the years. From people to topics Before anyone gets offended by my supposed rudeness, let me clear up. I do get to stay up-to-date with a large variety of stuff on Twitter.

Q&A

Q/A: Why Does an iPhone Need Less Memory Than an Android Phone?

Note: Unlike my usual posts, this is a very basic, non-technical explanation. A friend asked me this question, and I thought I might share the answer here. You can use it on your next cocktail party 🍻 It mainly boils down to how memory garbage gets collected on each platform. iOS applications rely on an approach called Automatic Reference Counting (ARC). Every piece of memory that gets assigned some value gets tracked and released, as soon as the number of its accessors reaches zero.

Go is Good Enough
Programming

Go is Good Enough

Have you heard about the Pareto Principle? Also known as the 80⁄20 Rule, it states that for many aspects of life, 80% of the effects come from 20% of the inputs. Flip it around and the opposite is also true: reaching out for the rest of the 20% requires 80% of the initial effort. It is amazing how many manifestations of both exist in real life. One of the big wisdoms in life - it is often not the smartest, fastest, or strongest individuals that leave a dent.

This Is How We Write History
Running

This Is How We Write History

This morning, a humble distance runner from Kenya once again proved that the impossible is only a state of mind. A performance, more resembling a concert symphony than an endurance race. Eliud Kipchoge broke the 2-hour marathon barrier today - something that for years was deemed unthinkable for any human being: This is the beginning of a new era of running. I am certain that Kipchoge’s achievement will inspire others, if not to try a and beat it, to at least get out and be active.

Programming

Simple Immutable Builders in Go, Using Value Receivers

Even in a simple language like Go, concurrently updating mutable state is like playing with fire. Take this piece of code, for example: l := content.NewLoader() l.PageCount = 5 c := l.Load(bytes) Can you be sure that what you are loading is actually going to contain five pages? What if another goroutine having access to l, interjects and sets PageCount to 1000? Or worse, updates the state of l such that a panic is inevitable?

Advice

Good Code is Boring

You have seen them many times. Small snippets of code and the question “What would the the following piece of code print” beneath. You might have tried taking a guess, and perhaps, even failed. #golang pop quiz: what will this print? https://t.co/99xR8wybpp pic.twitter.com/Q7YpJbYr8c — ✕✕✕✕✕ (@peterbourgon) May 18, 2017 I find those kinds of questions utterly pointless. They not only teach you nothing about real-world programming, but might also lead many newcomers to long-term frustration with programming.

Optimization

Reduce Struct Size by Laying out Attributes Accordingly

Many thanks to @themaour for sharing this tip on Twitter TIL that in Go, struct size depends on how underlying types were defined. struct { a bool b int32 c string d string } The size of the struct above is is different from the one down below struct { b int32 c string d string a bool } Why is that? Well, think of memory as consisting of segments of certain size, where, if the amount of data you fill the segment with is bigger than the current remainder of the segment, the data will get written onto the next segment.

X509: Certificate Signed by Unknown Authority (Running a Go App Inside a Docker Container)
Docker

X509: Certificate Signed by Unknown Authority (Running a Go App Inside a Docker Container)

If you ever get the following message: x509: certificate signed by unknown authority While running your Go app in a Docker container, there is a chance that you might not have the necessary trusted certificates installed in your Docker container. Assuming that you run your Go apps in lightweight containers, based on Scratch or Alpine, you will have to add the certificates yourselves. On Alpine, this can be done using the default package installer:

Podcasting

Mixtape Retrospective: Time to Split the Monolith?

I have recently made my project Mixtape open to the world. Mixtape is a search and discovery platform for podcasts, built exclusively using Go. I decided to use Go primarily because of its compiler’s ability to deliver small, self-contained executables with close-to-metal native performance and extremely low memory footprint. It was also a way to battle-test the stack and figure out where and how it will benefit future projects in my portfolio.

[Quote] Ten Years of Erlang
Quote

[Quote] Ten Years of Erlang

It’s probably not too important, in the grand scheme of things, whether you are using a language like Erlang or not. While I do feel it’s under-used and under-rated, the biggest benefit of it is not in running a system that uses it. The biggest benefit comes from learning about the fundamentals of solid system design, and internalizing its lessons in a practical context. Ten Years of Erlang For my ten years in the Erlang community, I decided to cover a few topics such as hype phases and how this related to Erlang, the ladder of ideas within the language and how that can impact adoption, what changed in my decade there, and what I think Erlang still has to bring to the programming community at large.

Functional Programming

Implementing a Functional-Style Builder in Go

Go is definitely not the first language on my mind, when I hear the term “Functional Programming”. Yet, functions are first-class citizens in Go, and one can achieve a lot using higher-order functions (those that can receive and/or return other functions) alone. In this post, I want to demonstrate the use of functional constructs for implementing the well-known Builder pattern. Please, note that there are many ways to implement a Builder, and I don’t claim that mine is certainly the best.

Introducing NoEmbed
Project

Introducing NoEmbed

Linqable: ⚡️ fast and engaging link previews Linqable turns URLs into beautiful and engaging previews. Using a combination of smart extraction techniques, it finds and extracts as much information about the provided URL as possible. https://noembed.preslav.me | Created with Linqable A picture is worth a thousand words. Everyone knows that. How about, a preview is worth a thousand links, however? If you have ever written a Medium article, more than certainly, you have tried adding links to videos or other Web pages.

Python

Busting the Myth Around Multithreading in Python

One of the things I often hear from other developers, along with the usual “Python is slow”, is that “multithreading in Python sucks”. The sad reality is that I hear those from Python developers too. While I will pretend I have not heard the former accusation (hoping you’ve already heard how well Python integrates with C), I will try to bring up some light on the latter. When I ask the same guys about why they think that multithreading in Python sucks, some of them mention the GIL (Global Interpreter Lock) as the root cause.

Running

Sixtus Half-Marathon (Schliersee) 2019

Today, I took part in the Sixtus Half-Marathon near lake Schliersee for the third time in a row. Unlike last year, this time I started with a completely different strategy - keep it cool and let everyone else pass by me during the first third of the race. Seeing everyone else’s backs can be demotivating and requires a lot of patience and training. After the first 5-6K, having realized that I was really the last of the HM group, I started slowly picking up the pace.

Programming

Using Ephemeral Docker Containers as CLI Applications

Docker containers have proven themselves extremely useful in allowing developers to sandbox environments and ease the deployment of services. Have a complicated service setup? No worries. Simply, describe the steps in a Dockerfile and you should be able to replicate the process on every host OS that has Docker support. When I said services, I bet that the first thing you thought about was HTTP servers, or some sort of persistent, always running processes that send or accept requests to such services.

Data Science

Kotlin ❤️ Data Science? (Part 1)

A few days ago, I was invited to give a talk at the Munich Kotlin Users Group meetup (check out my slides here) For quite some time, I have had an idea to promote Kotlin as the missing link between software engineering and Data Science. DuringKotlinConf 2018, I had the chance and the privilege to meet a couple of amazing people, whose talks only helped confirm my thoughts. Mathematical Modeling with Kotlin | Thomas Nield

Programming

Use Dotenv Files When Developing Your Python Apps

Hard-coding configuration is bad. This is one of the things that newbie programmers learn quickly after they realize that have committed sensitive information to a public GitHub repository. And it happens so easily. Often, you are in the spur of the moment, wanting to test something locally, when you figure out that you need some API key in order for your app to work. Adding the key to the code takes a second, and is just as easy to forget when committing.

Retrospection

What I learned in 2018

It’s that time of the year again. The time when you make yourself a cup of coffee, and go through the events of the past years, searching for a sign that it has been worth it. And judging by the numbers alone, it seems like a very eventful year: In 2018, I: Got engaged Changed my job Started new new side projects Attended 4 conferences and countless meetups Had my own chance to present in front of an audience (twice) Visited 5 countries and met many new people Read 15 books Wrote nearly 30 blog posts Ran 626 km, and finished 4 half-marathons Made between 5,500 and 6,000 push-ups Wow, quite a year, heh?

Kotlin

Connecting to a MongoDB Instance Using KMongo

Often, the seemingly simple things can make you spend hours chasing around your tail. Like trying to connect to a MongoDB instance using KMongo. Basically, if you have checked out the KMongo quick start, setting up a client and fetching some data should be extremely easy: val client = KMongo.createClient() //get com.mongodb.MongoClient new instance val database = client.getDatabase("test") //normal java driver usage val col = database.getCollection<Jedi>() //KMongo extension method The quick start tutorial assumes that your DB resides on mongodb://localhost:27017, but in reality, your MongoDB connection string looks more like this:

Kotlin

How Much of "The Kotlin Way" Is the Right Way?

NOTE: This post was originally intended to provoke a discussion, and despite its length, the original goal is still the same. Please, share your feedback on Twitter, Reddit, or Dev.to. My experience with the JVM dates back from around 2010. Java in those days was a bit different from todays’ standpoint. Java 6 was the current standard at the time, but most projects I got to work on, were stuck between Java 4 and 5.

Dependency Injection

Dependency Injection in Python: The Java Guy's Perspective

Dependency Injection (DI) in Python? Seriously? 🤔 At this point, I am expecting people to yell at me for thinking like a Java guy, but just bear with me for a moment, will you? Spoiler: I am going to mention Spring only once in this post, I promise. NOTE: If you are already familiar with Dependency Injection and want to see it in action, you might want to jump right to the example at the end.

Programming

Designing Well-Structured REST APIs with Flask-RestPlus: Part 1

This is the first part of a two-part series. In this post, I will introduce Flask-RestPlus and demonstrate how to start organising APIs around its simple REST-based conventions. Next time, I will address the topic of request/response marshalling (serialisation) and validation. A seasoned Spring developer, I felt a bit uneasy when designing and future-proofing a Flask-based API for the first time. I have recently started using Python way beyond my original intention to just play with data, and found Flask to be a super-easy micro-service alternative to Spring Boot or Ktor.

[Quote]: The Dying Art of Disagreement
Quote

[Quote]: The Dying Art of Disagreement

Here is a quote from: Opinion | The Dying Art of Disagreement Today’s clashes may hoarsen our voices, but they rarely sharpen our thinking, much less change our minds. https://www.nytimes.com | Created with Linqable Intelligent disagreement is the lifeblood of any thriving society. Yet we in the United States are raising a younger generation who have never been taught either the how or the why of disagreement, and who seem to think that free speech is a one-way right: Namely, their right to disinvite, shout down or abuse anyone they dislike, lest they run the risk of listening to that person — or even allowing someone else to listen.

Mastodon

I Made a Mastodon Account and so Far I like It

So, you might have heard about Mastodon. A micro-blogging alternative to Twitter, boasting itself for being 100% open-source, and for its decentralised nature. Unlike traditional social networks like Twitter and Facebook, Mastodon is not driven by a single company profiting by selling your identity to others, but by a network of instance maintainers and supporters who put their own money on the line. Ensuring that Mastodon is going to live in the long term sounds easy…on paper.

Data Science

Data Science on Your iPad

This article is a follow-up transcription to a talk I recently gave at a local Munich machine learning meetup. Unlike my previous talk, this time I wanted to convey the idea of using an iPad for actively running data science experiments, as opposed to passively consuming information. I illustrated my point with a few example iOS applications I personally use on a daily basis, which I hope would be good starting points to get the audience interested in the idea.

Programming

Live-reloading of Python Modules in the Python REPL / IPython / Jupyter Console

Often, I would work on a Python module and add changes to it live, which I would then want to test immediately. Piece of cake! Add the changes and execute the script again. Well, that’s certainly a way, but as modules get bigger, they tend to import other modules, or do some preliminary setup work. With time, I have developed this practice of opening up a Python REPL (though I recommend IPython or the Jupyter Console for that), importing my in-progress module and singling out separate functions I would like to test.

How to Use Twitter More Efficiently with These Hidden Search Features
Social Media

How to Use Twitter More Efficiently with These Hidden Search Features

Twitter can be a mess sometimes. If you follow tons of people, it’s easy to get lost in the torrent of constant updates. This was one of the reasons why Twitter decided to move away from the purely chronological timeline a couple of years ago. In a move that almost ditched the diehard Twitter fans in favor of the mainstream, predominantly passive content consumers, the company started pushing more and more in favour of algorithmically adjusted timelines, much like Facebook does it.

Python

Pandas: Finding a Row Where One of Its Values Is at a Minimum/Maximum

Often, we will want to get to get a specific row, which marks the minimum or maximum of one of its columns. Let’s suppose we have the SF Salaries dataset from Kaggle. We want to find the employee name, with the largest total pay benefits. The experience with writing NumPy/Pandas filter conditions will quickly let us produce the following version: sal[sal['TotalPayBenefits'] == sal['TotalPayBenefits'].max()]['EmployeeName'] which is absolutely valid, but is it the only option?

[QUOTE]: Plastic Synapses Offer Hardware Alternative to Neural Networks
Quote

[QUOTE]: Plastic Synapses Offer Hardware Alternative to Neural Networks

via Plastic synapses offer hardware alternative to neural networks | ArsTechnica A synapse—the connection between two neurons—consumes at most 100 femtoJoules per event. Once you realize that the entire human body is about the equivalent of an 120W light bulb, you can see that the efficiency of the brain is just astounding. […] This result has implications. If this research does turn out to be the way forward, neural networks will not operate faster than our own brains.

Programming

Debugging Network Calls in React Native Using the Chrome Debugger

TL;DR! Just give me the code In your index.js file (or your platform-specific index file for that matter), simply add the following line to the top, directly after the import statements: XMLHttpRequest = GLOBAL.originalXMLHttpRequest ? GLOBAL.originalXMLHttpRequest : GLOBAL.XMLHttpRequest; You will also need a Chrome plugin that overrides CORS. I use CORS Toggle. You may also decide to skip the plugin and start Chrome with CORS disabled: chrome --disable-web-security then, as usually, start remote debugging from your app, and open: http://localhost:8081/debugger-ui on your computer.

[Quote]: 3 Ways to Better Understand Your Emotions
Quote

[Quote]: 3 Ways to Better Understand Your Emotions

Here is a quote from: 3 Ways to Better Understand Your Emotions Naming them is an important first step. https://hbr.org | Created with Linqable Anger and stress are two of the emotions we see most in the workplace — or at least those are the terms we use for them most frequently. Yet they are often masks for deeper feelings that we could and should describe in more nuanced and precise ways, so that we develop greater levels of emotional agility, a critical capability that enables us to interact more successfully with ourselves and the world

DevOps

Securing your ElasticSearch instances

Securing your ElasticSearch instances and keeping all the fun Often, we choose convenience over security. Many modern tools such as MongoDB and ElasticSearch, have grown in popularity, partly because of their easy-to-set-up-and-tinker-with nature. Just spin off an instance, point your browser to the right URL and you’re ready to start sending queries. Unfortunately, one thing comes for another, and as we have recently seen, ElasticSearch left in the open can be a vulnerable target, same as MongoDB was in its heyday.