RSSAmplifier

Blog

Sergey Stadnik's blog

Recent content on Sergey Stadnik's blog

ozmoroz.comRSS feed ↗83 posts

Latest posts

Getting to senior

You got your first job as a developer. Worked for a couple of years. As time goes by, you start asking yourself “What next?”. I’ve got an answer for you. If you are a junior or a mid-level developer, then your immediate career goal is to become a Senior Developer. Here is how you do that. Malcolm Gladwell famously popularised a ten-thousand-hours rule in his book…

What do async and await really mean?

async...await syntax only appeared in JavaScript recently - it was introduced in ECMAScript 2017. However, it still remains a bit of mystery. Most articles I read state that async…await is syntactic sugar over JavaScript promises. But what does that mean exactly? Are async and await two parts of the same syntax, or they are two separate things? Do we have to use them together with each…

How to make a copy of an array in JavaScript

Making copies of arrays in JavaScript is not as straightforward as it seems. It certainly not as easy as b = a . Let’s look at an example: let a = [ 1 , 2 , 3 ] const b = a console . log ( a === a ) --- a is array of [ 1 , 2 , 3 ] b is array of [ 1 , 2 , 3 ] Is a equal b ? true So far so good. Here’s what we did: a is an array. We assigned it to b . Now b is also an array. It contains…

A two-minute guide to deploying your React app to Netlify cloud

Up until a couple of years ago, I hosted this site, all of my React applications, code demos etc on virtual private servers (VPS). I tried AWS, Digital Ocean and others. Some of them were more convenient to deal with. But frankly, all of them were a huge pain in the butt. In the start, I had to spin up my own VPS, configure a web server, security, firewall, user logins, SSH keys, SSL certificates,…

You may not need Redux

If you were starting a new React project a few years ago, that almost always meant that you’d include Redux . React and Redux were thought to be one indivisible entity. When I was learning React myself I did that with the help of Stephen Grider’s excellent course Modern React with Redux . That course is a true bestseller. Nearly 200,000 students watched it since it was released.…

How I fixed kernel_task consuming 100% of my MacBook's CPU

Recently I started experiencing a weird issue with my 2016 MacBook Pro. I occasionally play Velocidrone FPV racing simulator on it. So far it worked fine. Although MacBook Pro doesn’t have enough power to run it in 4K resolution, it works reasonably well in 1280x1024. However, this time it was a different story. Once I started the game, the CPU went to 100% and the frame rate dropped from…

Aslam Khan: Scaling Down

Another tech talk that struck me deeply - “Scaling Down” by Aslam Khan at Beauty in Code 2020 conference. It is about architecture complexity and domain complexity. We have a tendency to over-complicate things when that complexity is not warranted. That is a trap that s very hard to find a way out of. One of the quotes he had in his presentation which struck me was: A complex system…

John Carmack on testing ideas

In my opinion, John Carmack is the greatest software engineer of our time. Unfortunately, he doesn’t talk much about what he does. His public appearances are limited to very occasional talks and his Twitter. @ID_AA_Carmack This talk provides an insight in the way he thinks. An interesting point he makes that resonated with me is that he “gets stuck” on ideas if he can’t…

Talking FPV drones on Jay Boston show

Jay Boston invited me on his live show to talk about my experience with FPV drones. It is a long conversation. We go deep into a range topics: What FPV drones are. What makes them different from consumer drones such as DJI. How to start with FPV. Different classes of FPV drones. Analogue vs digital FPV systems. What equipment you need to fly FPV drones. What to buy and where to buy it. Where to…

Introducing backstop-site-test - a visual regression checker for static sites

Photo by Linus Strandholm on Scopio This site is built with Hugo static site generator . Being a static site, it doesn’t have a fancy back-end engine. No database either. Nothing breaks if left alone. Still, Hugo team releases new versions from time to time. They add new features, fix some bugs and add new ones. I don’t upgrade to every new version. But occasionally I want to upgrade.…

Introduction to asynchronous operations in Javascript

If you are learning JavaScript, you no doubt came across things like callbacks , promises , generators , and async / await . Those are asynchronous programming paradigms. In Javascript they are everywhere. If you want to understand JavaScript, you need to understand them. However, there is a problem. Although there is no shortage of tutorials explaining callbacks , promises and async / await ,…

Why are most React tutorials outdated?

If you are learning React using a book or an online tutorial, you may be in for an unpleasant surprise. One minute you are following along, and then you get pissed off once you realise that the instructions you are following are hopelessly outdated. Even 5-star tutorials are best-selling books won’t protect you from that.

Do I still need to bind React functions in 2019?

One of Reddit members asked me a question in follow-up to my answer to a question about this keyword: Why do I need to bind a function if it’s in a class? Short answer You don’t need to use bind . If you use the following syntax to declare class methods , then this in them will be automatically bound to the current class instance . It’s magic. class MyComponent extends React .…

When should I use "this" keyword?

When you browse through Javascript code, you often see function calls prepended with this. keyword, like this.functionName() . However, sometimes this is missing and it’s just functionName() . What is the difference and when you should use one over the other? That depends on whether you React component is functional or class-based.

Why do I need props?

If you are new to React, you may be wondering what that props business is all about. Components make sense. But why do they need props? Why should you use them, or then, or how? After all, you can build a perfectly functioning React application without those pesky props . Well, you don’t have you use props inside your React components. It is fair that not all the components require props.…

Painless React Animations via CSS Transitions

CSS art by Dennis Harry Animating things on the web is a pretty common task. You often need to animate a menu bar sliding from the top, or an input field expanding and collapsing when you click a button. But how do you do that? Maybe there is a library for that? Yes, lots. But which one you should choose? When you are pressed with a deadline, you don’t have time to plough through lots of…

Why my setState doesn't work?

Photo by Bruce Mars setState is one of the most essential operations in React. Yet, it is one of the most confusing. If you are new to React, then you may feel that it does not always do what you want it to do. It is almost as it doesn’t work. The problem may go like this: You set a state with a setState this . setState ({ count : 1 }) Then you follow it with another setState which…

What is React.PureComponent and when to use it

React 15.3 introduced PureComponent - a new way of implementing class-based components. It is now available to us alongside function-based components and components derived from React.Component . This new technique caused much confusion in React rounds. Is PureComponent a new improved version of React.Compoment ? Does it automatically make everything better? Should you just slap PureComponent…

What is the difference between functional and class-based React components?

React offers two ways to define components: they can be functional or class-based. If you are new to React, you may be wondering what the difference is between them. The React documentation doesn’t clearly explain when and why you would use one or the other, and what the pros and cons of each type are. In this article I will help you understand the difference between functional and…

How to pass a value to onClick event handler in React.js

The problem If you ever tried to pass a parameter to onClick event handler, you know that it is not straightforward. If you didn’t, here is why may want to. Imagine a scenario where you have a group of three buttons. When you click on one of them, you want to know which one was clicked and perform an appropriate action. You have a choice of creating three onClick event handlers, one for each…

About me

I am a software developer living in Melbourne, Australia. I always liked pushing buttons as a kid. I was excited by a look of complex machines with lots of buttons and blinking lights I saw on TV. When I saw a real computer the first time, I was blown away. It was an ATARI 2600 arcade machine, and I ended up blowing all my pocket money playing it regularly. When I got my own computer for a…

Choosing a flight controller for a GPS drone

A flight controller is the brain of any multirotor; it is the most crucial component. When my Alien 560 quadcopter fell from the sky , I figured it happened because its flight controller malfunctioned mid-flight. Therefore, when I decided to build a new drone and started choosing the components, a flight controller was the most difficult choice to make.

Why I want an autopilot in my racing drone

About a year ago Hobbyking was having one of their “Flash Sale” events. During a few days, they dropped prices on a few hundred items. An online shopaholic in me couldn’t miss it. I meticulously studied the offerings until I found something worthy of my attention and money. That was a Jumper 218 Pro racing quadcopter, almost ready to run. A bargain at a just a bit over $100! I…

Mocking same module ES6 dependencies

There is a subtle issue for which, unfortunately, neither ES6 nor proxyquire provide a solution. It is well described in this stackoverflow.com answer . So far in the previous articles of the series, the dependencies we were mocking were in a separate module from the code we were unit testing. But what if they were in the same module?

Mocking ES6 module dependencies with proxyquire

In part one , I wrote about mocking ES6 module dependencies using the ES6 native import * from construct. It works mostly fine. However, you need to be aware of a potential issue: You need to import modules to mock them, which means that those modules will be evaluated. That may be a problem if you don’t want the code in this modules to be executed. Another method I found to work well is…

Mocking ES6 module dependencies with import * from

Not so long ago I faced a problem: I needed to mock ES6 module’s dependencies for unit testing. The reason for mocking dependencies in unit tests is the following: when I write a unit test, I want to test the functionality of a single unit of code, hence a unit test. However, if a module has any dependencies, those dependencies need be satisfied. That may mean importing and executing code in other…

My midlife crisis

They say every man goes through a midlife crisis. They used to be associated with flashy purchases like fast cars or motorbikes. But recently a new trend started to emerge. Generation X men coming into a mid-age increasingly choose carbon fibre bicycles over Porsches. This is in part because of the financial pressure - there has been no real wage growth over the last few decades , and at the same…

Ghostbusters: Legacy

Sometimes I see dreams which are like movies: they are vivid, bright and clear. It doesn’t happen often, but whenever it does, I rush to write them down first thing in the morning before I forget them. Here is another one. I am not a writer. If anyone wants to take this and turn it into a work of art, be my guest. Just let me know. Here we go…

Alien 560 Quadcopter Build - Part 3 - Transmitter setup

I wish I could tell you that setting up the transmitter was straightforward, but unfortunately, it wasn’t. I’ll do my best to describe what I did, although I’m not sure my process is 100% repeatable. I have a Turnigy 9XR Pro transmitter with a FrSky JR module. It is a digital radio with lots of features: updateable firmware, model memory, custom sound files and so on. The first…

Alien 560 Quadcopter Build - Part 2 - Assembly

Unlike a conventional helicopter, a multirotor aircraft contains very few moving parts: no gears, no swash plates, no contrarotating propellers. It only has motors directly driving propellers, and that’s it. So there was no complex mechanics to assemble. The frame was probably the most complicated bit. The Alien 560 frame consists of a couple of dozen carbon fibre plates which need to be…

Alien 560 Quadcopter Build - Part 1 - Parts

When I was at school, I was an electronics geek. I was spending days in a library looking for schematics of AM radios and circuits of blinking lights and beeping sounds, and then long evenings in an electronics club trying to solder them together. Unfortunately, none of the stuff I built ever worked properly: radios received only static, lights blinked out of order, and beepers screaked. But most…

Introduction to iOS Music Production Brown Bag

I work at Odecee. It is a technology consultancy company with a difference. They understand that people are their main and only asset, so they tend to hire smart IT professionals, pay them well, and give them cool toys. Every week they run brown bags in their office. A “brown bag” means a lunchtime presentation where attendants are supposed to bring their lunches (in brown paper bags,…

Road Ahead

It’s been nearly a year since I wrote that post: A new chapter. During that time I did a bit of traveling, spent a fair amount of time slacking off at the beach (you can’t resist that during summer time in Australia), but most of all I was studying. I was keen to deliver on my resolution to pick up lasting fundamental skills. As I already had an experience with online education and found it as…

My new track - Neon Spark

I wrote another track - “Neon Spark”. Here it is: Your user agent does not support the HTML5 Audio element. Download the track Artwork: Triumph by ba8y6irl

How to separate a stuck windsurfing mast

I’ve been windsurfing a few years but I didn’t have my own board. Whenever I wanted to go for a ride, I rented a board from SHQ at Sandringham beach. That was Ok, and I had a lot of fun, but I was confined to a single location. Besides, SHQ only has beginners’ large boards and small sails available for rent, and after some time riding on them started to feel dull.

How to set up Git on Windows

I finally found a way to set up Git on Windows in a way that it isn’t painful to use. Here’s how to do that: Uninstall all installations of git, TortoiseGit, etc. Install Git Extensions. The easiest way to do that is via Chocolatey package manager: Install Chocolatey Install Git Extension package package. Install Git Credentials Manager for Windows That’s it. Git Extensions come…

Focus

I listen to a few podcasts every week. These are weekly shows I’m subscribed to and listen to every episode. My most favourite one is Freakonomics Radio. I love that show because every week Stephen Dubner and Steve Levitt take ordinary ideas we are so used to that we don’t even pay attention to them, and turn them on their heads. Just like Mythbusters blow things up “for science”, the…

A new chapter

Today I was informed that my position was made redundant. I have been here for 3 years and I enjoyed it, but it will soon be over, and I will be on the market again looking for new job. I am a bit disappointed but other than that I’m fine – I’ve been through that before. When something ends, it also manifests a beginning of a new chapter. There is no use to obsess over what has already happened.

How to install CyanogenMod on Oneplus One

I really like my OnePlus One phone. It is an exemplary engineering achievement proving that it is possible to design a mobile phone as powerful as leading brand’s flagship models but costing half of their price. Oneplus One is powered by Cyanogen OS, an open source OS based on Android Open Source Project (AOSP). Cyanogen OS has its own update cycles, which OnePlus One receives via over-the-air…

James Sinegal: Costco’s Winning Formula

Jim Sinegal, co-founder and former CEO of Costco, is one of the most influential business leaders of our time. Motley Fool recently recorded an interview with him, “Costco’s Winning Formula”. The whole conversation is packed with wisdom. But one quote caught my particular attention: If you find yourself involved in something that you don’t truly love and feel passionate about, run,…

Dreamer

This isn’t a new song. I wrote it 3 years ago as an assignment for Berklee’s Online Composing and Producing Electronic Music course.

How to identify Oracle sessions consuming CPU time

Identifying sessions consuming CPU time is a common task in Oracle performance tuning. However, as simple as it sounds, it is not that straightforward. Oracle recommends using Enterprise Manager or Automatic Workload Repository for that. The problem is that in real-life situations Enterprise Manager is often not installed, or you may not have access to it. You may not also have necessary…

Show information about Oracle sessions

An SQL script which shows information about Oracle sessions.

OzBsidian colour scheme for Oracle SQL Developer

This is a spinoff of Obsidian colour scheme for Oracle SQL Developer. It is based on Obsidian Eclipse colour scheme by Morinar. Unfortunately Oracle doesn’t make it easy to import a new colour scheme into SQL Developer, thus a little bit of hacking is required. Close SQL Developer. This is important. If you modify the scheme file while SQL Developer is open, your changes won’t be…

MIDI routing in FL Studio via a MIDI loopback device

How to record the output of one MIDI track (for example, arpeggiator’s output) into another MIDI track in FL Studio.

How to get size of all tables in an Oracle database schema

An SQL script to get size of all tables in an Oracle database schema.

Music production for masses - iOS to the recscue!

Some time ago I wrote my thoughts on the modern state of PC music-making applications. In the nutshell, I reckon that niche became too overpriced and overcomplicated. All the existing digital audio workstations are targeted towards professional users, with the price tags to match. At the same time, the area of casual music production remains a no-man’s land. Since then I got an iPad and discovered…

Troubleshooting eth0 in Oracle Linux

How to make eth0 autostart on Oracle Linux.

What is a data warehouse?

What data warehouses are, how they are different from OLTP databases, and why we may want to use them.

Cost and complexity of making electronic music

Does making electronic music has to be as complex and expensive as it is?