teleren/devto huggingface dataset:
Request Per Second is probably not it
Tags: performance, services
Published: 2020-03-30 19:09:43

Let's start with a question: When you loaded this page did you experience the value the server's requests per second provided?

The web browser sent a request to the domain. Which, for a standard stack, will look something like:

1. domain name lookup to one or more addresses
2. one of these addresses is selected 
3. request is sent to the selected address
4. arrives at load balancer
5. dispatched to one or more nodes
6. that specific node(s) processes the request and replies
7. load balancer replies with a selected request

Where in that did the user experience "requests per second?". 

They didn't directly experience this for a (single) request. The user experience was of the latency. They did not directly experience maximum throughput or even per-node throughput. 

The service provider does receive value from per node throughput: Typically the higher throughput the more value per node in the system. Which, being dependent on value, depends on the customer. If the value per request warrants the cost then the throughput can be scaled.

The service provider also receives value from the max throughput of the system: A higher max throughput the more customers can be supported without queueing.

Imagine two scenarios:

1. A service that provides a security alarm system at 10k requests/sec. For one customer. With a latency of 20 days per request. 

That would probably not provide the experience the customer expects from a security system :) Even if each request is high value; with that latency the value is unlikely to be realized.

2. A service that provides bank transactions at a latency of 1 second. With a per-node throughput of 1 request per second; the entire node processes only a single request at a time. 

That might be entirely fine. Suppose each node cost 10$ for the duration of the request... but the request provided the company a value of 100$. I'd happily take that per-node throughput! The customer still experiences a fast transaction and the company can afford to horizontally scale and still profit.

Certainly don't forget throughput when decided the value of an implementation. Good performance engineering practice would be to record this performance data. Even if not explicitly optimizing for this. Designing systems to provide value to customers is always the priority. Which likely means a focus on latency first and throughput second.
[skip ci] for GitHub Actions
Tags: github, actions
Published: 2020-03-30 23:27:03

> This feature is already available on GitHub Actions. However, you could use this guide to make your own skip tags. 

GitHub Actions doesn't support skipping builds with [skip ci] like CircleCI, for example. But here's the magic trick:

```
jobs:
  build:
    runs-on: ubuntu-latest
    if: "! contains(github.event.head_commit.message, '[ci skip]')"

```

This snippet allows you to any custom filter you need. For example, I like to use:

```
jobs:
  build:
    runs-on: ubuntu-latest
    if: "contains(toJSON(github.event.head_commit.message), '[build]')"
```

Only triggers the action if `[build]` is found in some pushed commit comment, like a manual trigger.
What Non-Technical Interview Questions Have You Been Asked?
Tags: discuss, career, codenewbie, jobsearch
Published: 2020-03-30 23:25:05

After my recent article, [Looking for Your First Dev Role: Advice for Young Devs by a Young Dev Part 2](https://dev.to/torianne02/looking-for-your-first-dev-role-advice-for-young-devs-by-a-young-dev-part-2-57ga), I have had a few new devs who are ramping up to apply for their first roles reach out to me and there was one common thread amongst them. They were asking about some of the most common soft skills or non-technical interview questions that I have been asked. Before this happening, I hadn’t really thought about writing a blog post about this topic, but here I am writing it! 

With this brief article, I am going to list a few of the most common soft skills and non-technical interview questions that I have been asked over the last year. I would love for any of you reading this that have gone through the interview process in the past to contribute any of the common questions you were asked as well. **Let us try to create a great resource for those new devs out there trying to land their first roles or any experienced dev entering the job search again wanting to brush up their interviewing skills!**

## The Questions

1. Can you tell me about a time when you overcame a challenge?

2. Can you give an example of a time you’ve had a conflict with a coworker? How was this conflict resolved?

3. Give an example of a time you’ve stood up for something you believed was right. 

4. What made you switch careers? What ultimately led you to pursue software engineering?

5. What project are you most proud of and why?

6. How would you go about explaining a technical topic/issue with someone non-technical?

7. Tell me about a time that you built a good relationship with someone you didn’t particularly like.

8. What was the most difficult aspect of going through bootcamp? What was the most rewarding?

## A Quick Note

These are all of the questions that I can think of right now. Check back at any point to see if I’ve added any new questions or to check the discussion section to see questions that the amazing DEV community has added. 

I personally know how stressful the job search can be, so I hope that this article can help any of those new devs out there trying to prep for interviews. 

Good luck to anyone out there interviewing!

![Patrick star waving a foam finger with the quote "I'm rooting for you"](https://media.giphy.com/media/12XDYvMJNcmLgQ/giphy.gif)

*This post's cover image is brought to you from my recent trip to Hawaiʻi Volcanoes National Park in Volcano, Hawaii.*
Day 1: Erlang Hello World
Tags: erlang, ruby
Published: 2020-03-30 23:05:21

Ok so after being a Java and Ruby guy for 13 years it is time for me to learn some Erlang for my new job. 

Hello World in Ruby is extremely easy. You just open up the terminal and run the code below:
```ruby
puts 'Hello World'
```

My initial attempt to do something similar in Erlang found no simple one liner to do so. Below is Hello World in Erlang:

```erlang
% hello.erl
-module(hello).
-export([hello_world/0]).

hello_world() -> io:fwrite("hello, world\n").
```

My inner nerd found a few things to get excited about:
* You finish each line with a full stop. This is just so logical and makes sense. When I started with java 13 years ago I always wondered why they used a semi colon instead of a full stop.
* You declare the function to export with the arity. This is cool because you can see at glance how many arguments the function will take
* Function declaration on a single line could mean we have nice, concise code 

How do you run this code? You open the Erlang shell, compile the code in the shell (never seen that before) and then you call the function:

```bash
1> c(hello).
{ok,hello}

2> hello:hello_world().
hello, world
```

`c(hello).` literally compiles the hello.erl file. Another neat thing is how each time you evaluate a line it updates the number in the shell.
PHP Composer package version cheatsheet
Tags: php, composer
Published: 2020-03-30 22:45:37

```"require": {
    "vendor/package": "1.5.4", // Exact version to 1.5.4
    "vendor/package": ">=1.5.0", // Anything above 1.5.0
    "vendor/package": "<1.5.0", // Anything below 1.5.0
    "vendor/package": "1.5.*", // Wildcard i.e. >=1.5 <1.6
    "vendor/package": "~1.5", // Next significant release i.e. >=1.5 <2.0.0 // 
    "vendor/package": "~1.5.2", // Next significant release i.e. >=1.5.2 <1.6.0
    "vendor/package": "^1.5.2", // Next release, major version fixed i.e. >=1.5.2 <2.0.0 
    "vendor/package": "^0.5.2", // Next release, major version fixed i.e. >=0.5.2 <0.6.0
}```
Linux kernel 5.6 has been released. Here's what's new.
Tags: linux
Published: 2020-03-30 22:26:55

Linux kernel 5.6 was released this morning by Linus Torvalds, the [social distancing champ](https://fossbytes.com/linus-torvalds-is-a-social-distancing-champ/) himself. 
In short, this is a fairly substantial kernel update (even putting aside the headline inclusion of Wireguard) with a wealth of networking, file system, and hardware driver improvements bundled up inside.
Here are some of the biggest changes.

## 1. Wireguard

Linux 5.6 boasts WireGuard support out-of-the-box — a big deal for those who know what this is, making it arguably the headline change of this kernel update.

It runs as a kernel module, and replaced OpenVPN.

## 2. Early USB4 support

The Linux 5.6 kernel series is the first to include support for USB4.

USB4 [is based on Thunderbolt 3](https://www.cnet.com/news/usb4-marries-thunderbolt-3-for-faster-speeds-and-smarter-transfers/) and (among other benefits) provides high data throughput and backwards compatibility with USB 3.2 and USB 2.0.

## 3. CPU idle cooling driver

A rival approach to Intel’s home-grown versions, this new generic thermal driver isn’t limited to specific CPU architectures or vendors.

As [summarised by Phoronix](https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.6-Generic-CPU-Cool-Idle), “…this driver will inject idle cycles at run-time when necessary to cool down the CPU and also reduce any static power leakage.” 

## 4. Better hardware support

Each kernel update offers improved support for hardware, ranging from ARM-based SoCs, developer boards, input devices, sound cards, mice, keyboards, and so on.

Linux 5.6 adds support a bunch of new SoCs and developer boards, including the Pine HardRock64, SolidRun’s HoneyComb LX2K workstation, and the Qualcomm sc7180.

There are also thermal sensor updates for a range of Rockchip and Allwinner platforms, as well as the Broadcom BCM2711 used in the Raspberry Pi 4 (among others).

Logitech devices that use the HID++ protocol can now report battery voltage on Linux, and the Logitech MX Master 3 Mouse will now “just work” out of the box.

## 5. Virtual box folder sharing

You may recall [the plan to add support for the Virtualbox Shared Folder Driver](https://www.omgubuntu.co.uk/2018/01/virtualbox-guest-additions-linux-kernel) (allowing users to instantly share folders between guests and hosts without using the Guest Additions package) in the Linux kernel.

It kinda debuted in Linux 5.4, but the feature didn’t quite work as planned and was postponed.

Well, this time the feature is back, working, and more importantly, staying put to enable seamless file access.

## 6. Fix for the 2038 bug

Linux 5.6 is the first kernel for 32-bit systems ready to run past Year 2038 given the [Unix timestamp issue.](https://en.m.wikipedia.org/wiki/Year_2038_problem) Granted, plenty of user-space software still needs to be updated to handle the Y2038 issue.


That’s an overview of the biggest changes in Linux 5.6, which soon will be available for UKUU and rolling release distros such as Arch.
Install New Relic on Mac OS using homebrew php
Tags: newrelic, architecture, php
Published: 2020-03-30 22:23:44

1.Grab archive from https://download.newrelic.com/php_agent/release/ and decompressed
gzip -dc newrelic-php*.tar.gz | tar xf -
cd newrelic-php*/

2.Check homebrew's PHP extension path exists
```ls -al /usr/local/Cellar/php@7.2/7.2.25/lib/php/20170718/```
(My PHP version is `7.2` and lib version is `20170718`. Yours might be different based on PHP version. But in any case, `/usr/local/Cellar/php` is a good direction.)

3.Run install script with custom paths (since /usr/bin is not writeable because of macOS "system integrity protection")
```NR_INSTALL_INITFILE=/usr/local/bin/newrelic-daemon-service NR_INSTALL_DAEMONPATH=/usr/local/bin/newrelic-daemon ./newrelic-install```

4.Now New Relic agent has been installed and the daemon can be started using `sudo newrelic-daemon-service start`

5.If you don't want to use `sudo`, you need to change owner and group of `/var/log/newrelic/newrelic-daemon.log` to your own user and group.
```chown staff /var/log/newrelic/newrelic-daemon.log```

Then simply run `newrelic-daemon`

6.Ensure New Relic daemon is up and running by running
```ps aux | grep newrelic```

That's it, have fun with APM data!
Wordpress Themes or Vala for Java Programmers?
Tags: linux, java, wordpress, discuss
Published: 2020-03-30 22:15:03

Oh, how tech gods tease me so... 
I am stuck between either learning how to create Wordpress Themes or learning Vala for Java Programmers to create ElementaryOS applications. 

Which do I choose? Oh, the technology! 

There are probably more jobs for people who can create and work with Wordpress themes and templates, but, with Vala, you have ElementaryOS apps! I do want to become a Linux App Developer one day but maybe it's probably better to learn how to work with Wordpress themes because it has more opportunities.

Do you or anyone you know work as a Linux App Developer or Wordpress Theme Developer? What has your or their experience been?
Quick Python: Decorators
Tags: python
Published: 2023-01-06 01:35:11

---
title: Quick Python: Decorators
published: true
date: 2020-03-30 22:07:14 UTC
tags: Python
canonical_url: https://brandonrozek.com/blog/pydecorators/
---

[Geir Arne Hjelle](https://realpython.com/team/gahjelle/) at Real Python wrote a great post called [Primer on Python Decorators](https://realpython.com/primer-on-python-decorators/). I recommend reading that as this post serves mostly as a reminder to myself on how to write a decorator.

I find decorators useful for several reasons

- Check a pre-existing condition (Is the user logged in?)
- Perform post processing on function output (Convert to SI units)
- Expose extra variables for use in the function

Here is a template for how a decorator is written

```
import functools

def decorator(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        # Do something before
        value = func(*args, **kwargs)
        # Do something after
        return value
    return wrapper

```

If your decorator takes arguments then there’s another layer…

```
def decorator_with_argument(argument):
    def decorator(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            # Do something before
            value = func(*args, **kwargs)
            # Do something after
            return value
        return wrapper
    return decorator

```

## Example: Logging

Let’s write a decorator that logs the string returned by the function to a file.

```
def filelog(filename):
    def decorator(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            with open(filename, 'w') as f:
                f.write(func(*args, **kwargs))
        return wrapper
    return decorator

@filelog('log.txt')
def greet(name):
    return f"Hello {name}!"

```
Job Search Week 6
Tags: makers
Published: 2020-03-30 21:48:03

This week I managed to get a lot done. I managed to complete my react glucometer app although I'll defiantly go back to it and add more. I also got started on my group project which I'm very excited about and lastly, I got shortlisted for one of the companies at the careers fair.

Day 1

So I spent Monday working on my glucometer trying to figure out how to working on the Keypad and Key component. I did eventually go back and change it but it never hurts to practice testing.

Day 2

I also spent Tuesday working on the glucometer trying to figure out how the form would work using state. I also got the Key component displaying the Key values. I also added some snapshot tests.
 
Day 3

Day 3 was when I started on my group project. It was good to be back to pair programming hearing different ideas. We managed to get the first bit done as well we managed to get the form up and running but after doing looking into it I think it can be done better but I'll have to discuss it with my group next week.

Day 4

I started adding the actual functionality to my glucometer. It wasn't too much trouble I managed to get it working and displaying your bolus displayed and I added a feature to capture errors. I also got the form working which was nice to see.

Day 5

This was when I started rebuilding the form. It wasn't too much trouble I just had to save the states of each of the inputs when they were changed. It did make a big difference because it was now easier to test using enzyme so I was happy.

Summary

Overall a productive week I'm very happy with getting shortlisted and I feel a lot more comfortable with react forms and testing. Also to get the glucometer done was defiantly a win.
Installing video_transcoding on Linux
Tags: video, transcoding, mp4, mkv
Published: 2020-03-30 21:41:52

---
title: Installing video_transcoding on Linux
published: true
description: 
tags: video, transcoding, mp4, mkv
---

`video_transcoding` is a set of tools to transcode, inspect and convert videos from command line: https://github.com/donmelton/video_transcoding

Installation on Linux Mint 19:

    sudo apt install ruby ffmpeg handbrake-cli mkvtoolnix mp4v2-utils
    sudo gem install video_transcoding

Installation on Ubuntu 20.04:
    Download:
        https://packages.ubuntu.com/bionic/libmp4v2-2
        https://packages.ubuntu.com/bionic/mp4v2-utils

    sudo dpkg -i libmp4v2-2_2.0.0~dfsg0-6_amd64.deb
    sudo dpkg -i mp4v2-utils_2.0.0~dfsg0-6_amd64.deb

    sudo apt install ruby ffmpeg handbrake-cli mkvtoolnix
    sudo gem install video_transcoding

Usage example:

    transcode-video --mp4 --quick --target small --ac3-bitrate 384 -o output.mp4 input.mp4
What’s your alternative solution? Challenge #5
Tags: challenges, discuss, javascript, codenewbie
Published: 2020-03-30 21:40:59

# About this series

This is series of daily JavaScript coding challenges... for both beginners and advanced users.

Each day I’m gone present you a very simple coding challenge, together with the solution. The solution is intentionally written in a didactic way using classic JavaScript syntax in order to be accessible to coders of all levels.

Solutions are designed with increase level of complexity.

## Today’s coding challenge

```
Calculate the sum of numbers from 1 to 10.

```

(scroll down for solution)

## Code newbies

If you are a code newbie, try to work on the solution on your own. After you finish it, or if you need help, please consult the provided solution.

## Advanced developers

Please provide alternative solutions in the comments below. 

You can solve it using functional concepts or solve it using a different algorithm... or just solve it using the latest ES innovations.

By providing a new solution you can show code newbies different ways to solve the same problem.

## Solution

```javascript
// Solution for challenge05

var sum = 0;

for(var i = 1; i <= 10; i++)
{
    sum += i;
}

println(sum);

```


To quickly verify this solution, copy the code above in this coding [editor](https://codeguppy.com/code.html) and press "Run".

> Note: The solution was originally designed for [codeguppy.com](https://codeguppy.com) environment, and therefore is making use of `println`. This is the almost equivalent of `console.log` in other environments. Please feel free to use your preferred coding playground / environment when implementing your solution.
Quick Python: Memoization
Tags: python
Published: 2023-01-06 01:35:23

---
title: Quick Python: Memoization
published: true
date: 2020-03-30 21:31:55 UTC
tags: Python
canonical_url: https://brandonrozek.com/blog/pymemoization/
---

There is often a trade-off when it comes to efficiency of CPU vs memory usage. In this post, I will show how the [`lru_cache`](https://docs.python.org/3/library/functools.html#functools.lru_cache) decorator can cache results of a function call for quicker future lookup.

```
from functools import lru_cache

@lru_cache(maxsize=2**7)
def fib(n):
    if n == 1:
        return 0
    if n == 2:
        return 1
    return f(n - 1) + f(n - 2)

```

In the code above, `maxsize` indicates the number of calls to store. Setting it to `None` will make it so that there is no upper bound. The documentation recommends setting it equal to a power of two.

Do note though that `lru_cache` does not make the execution of the lines in the function faster. It only stores the results of the function in a dictionary.
How to Reverse Ordered List Counters in HTML
Tags: html
Published: 2020-03-30 20:56:35

---
title: "How to Reverse Ordered List Counters in HTML"
published: true
description: "An explanation of the reversed attribute for ordered lists in HTML."
tags: html
canonical_url: https://www.clairecodes.com/blog/2020-03-29-how-to-reverse-ordered-list-counters-in-html/
---

An [ordered list in HTML](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol) uses ascending numbers to display list items, beginning at number 1. The code:

```html
<ol>
  <li>Don't Stop Me Now</li>
  <li>Under Pressure</li>
  <li>We Are the Champions</li>
  <li>Bohemian Rhapsody</li>
</ol>
```

produces the following list:

<ol>
  <li>Don't Stop Me Now</li>
  <li>Under Pressure</li>
  <li>We Are the Champions</li>
  <li>Bohemian Rhapsody</li>
</ol>

It's possible to reverse the order of the counters with only HTML - no CSS or JavaScript required!

Add a HTML attribute called `reversed` to the `<ol>` tag.

The same code as above, only now with the `reversed` attribute:

```html
<ol reversed>
  <li>Don't Stop Me Now</li>
  <li>Under Pressure</li>
  <li>We Are the Champions</li>
  <li>Bohemian Rhapsody</li>
</ol>
```

produces a list with descending counters:

<ol reversed>
  <li>Don't Stop Me Now</li>
  <li>Under Pressure</li>
  <li>We Are the Champions</li>
  <li>Bohemian Rhapsody</li>
</ol>

Note that this only reverses the sequence of the numbers, and not the position of the list items contained with the `<li>` tags.

Where could you use this technique? The only situation I can think of is in a countdown, and perhaps this is why I'd never encountered this attribute before!

The reverse attribute is supported in all modern browsers but has no support in IE. See the [caniuse table for the reverse attribute](https://caniuse.com/#search=ordered%20list%20reverse) for more details.

I've created a [Codepen demo](https://codepen.io/clairecodes/pen/OJVaNGO) of the reverse attribute which you can play with below:

{% codepen https://codepen.io/clairecodes/pen/OJVaNGO %}
Meu ambiente de trabalho
Tags: linux, code, development, environment
Published: 2020-03-30 20:52:24

**Editado em:** 10/05/2020

Direto ao assunto: 

- **Sistema Operacional:** [Linux Ubuntu 20.04.1](https://ubuntu.com/)
- **Tema:** Modo Dark do Ubuntu 20.04
- **Terminal:** [tilix](https://gnunn1.github.io/tilix-web/) 
- **Shell:** [zsh](http://www.zsh.org/) com [ohmyzsh](https://ohmyz.sh/).
- **Gerenciador de versão:** [asdf](https://asdf-vm.com). Com os plugins para: [Python 3](https://github.com/danhper/asdf-python), [Golang](https://github.com/kennyp/asdf-golang) e [Lua](https://github.com/Stratus3D/asdf-lua) 
- **Editor de Código:** [Sublime Text 3](https://www.sublimetext.com/) com packages: [Terminus](https://packagecontrol.io/packages/Terminus), [ColorPicker](https://packagecontrol.io/packages/ColorPicker) e [Markdown Preview](https://packagecontrol.io/packages/MarkdownPreview); Editor no modo **terminal**: [Micro](micro-editor.github.io/)
- **Navegador:** [Brave](https://brave.com/) **extensões:** Lastpass.
- **Aplicativos do dia a dia**: Audacity, Discord, PDFSam, Calibre, Pinta, Gimp, Inkscape, Scribus, QBitorrent, VLC, Nvlc, Virtual Box e Wine para o uso do *Winbox*.
- E obviamente: [Git](https://git-scm.com/) para uso do [github.](https://github.com/jhoonb)