teleren/devto huggingface dataset:
Translations updates in React js
Published: 2020-03-02 21:46:18

I am new to react js.  I have learned how to localize the code I am writing using intl and files like en.json and fr.json, de.json, cn.json etc.  However, I want to be able to update the localizations in production occasionally, maybe changing the translation for one particular text in one particular language etc.  My boss says because of the way react is deployed using azure, you would have to completely redeploy the application every time one of the translation files changes at all - I cannot believe that to be true, as I have never seen that with other languages - you can always just drop a new version of the file(s) onto the production build and it should just pick up the changes - right???
Linux by example - GCC, Ncurses, attr and bzip2
Tags: linux
Published: 2020-03-02 21:21:10

---
title: Linux by example - GCC, Ncurses, attr and bzip2
published: true
description: We are in our new linux environment and create gcc compiler that will be our final compiler. Then we look at some text manipulation libraries, compressors and file attribute tools.
tags: linux
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/u2yqekdfe9l1vm44plai.jpg
---

{% youtube mabrZNofeOg %}

We are in our new linux environment and create gcc compiler that will be our final compiler. Then we look at some text manipulation libraries, compressors and file attribute tools.
Programming first principles - 8. First principle - Proof that code works
Tags: programming, webdev, learning, development
Published: 2020-03-02 21:14:48


This post ([Programming first principles - 8. First principle - Proof that code works](https://www.sargalias.com/blog/programming-first-principles-first-principle-proof-that-code-works/)) was originally published on [Sargalias](https://www.sargalias.com).

We require proof that code works.

## Why we need proof that code works

It follows from our basic requirement that what we produce must work:

1. Without proof that the system works, we do not know whether it works or not.
2. If we do not know whether it works, it means it may not work.
3. If it does not work, we have failed the requirement that the system must work.
4. On the other hand, if we have proof that the system works then we know that it works and we have fulfilled our requirement.

Therefore we require proof that the system works.

## Requirements for our proof

Our proof must:

- Be reproducible on demand, because we need it for every single change we make, because we must know the system works at all times.
- Must be as effective as possible.

## Suggested proof

Currently the only thing I know of is a good test suite.
Casting an Eloquent integer value to boolean
Tags: laravel, eloquent
Published: 2020-03-02 20:54:03

I want to start to frequently post small things I'm learning through code reviews or simply googling for a solution. 

Here's a nice solution that once again surprised me about Laravel's feature richness.

I wanted to return a value that gets saved as an integer in the 'active' column in a database table as a boolean.

My initial ugly solution was to change the attribute like this (that is to force the return type to boolean):  

```
public function getActiveAttribute($value): bool
{
       return $value;
}
```

My code reviewer found a much better solution:

https://laravel.com/docs/6.x/eloquent-mutators#attribute-casting

So I replaced above code in the Eloquent model with this:

```
 protected $casts = [
        'active' => 'boolean',
    ];
```
The Rise of No-Code (dude, where's my code)
Tags: nocode, podcast, webdev
Published: 2020-03-02 20:49:12

On the latest episode of Salted Bytes, James and I tore into a veritable buffet of no-code web development platforms. 

From Wix and Squarespace to Zapier via Google Sheets (did we just invent a new startup?), we talk about how no-code platforms provide much-needed glue between the myriad SaaS behemoths slugging it out for your time, attention and subscription dollars. But not everything is as rosy as some no-code proponents would say - we discuss some of the pitfalls of going all-in on no-code: anyone for some of that sweet vendor lock-in? 

No-code is a polarising topic and super popular here on dev.to (check out https://dev.to/search?q=no-code), but contrary to some of the views we've seen James & I think no-code has it's place in a thriving digital marketplace and actually empowers business / product owners to either raise their game or push for that little bit of extra innovation (as a treat).

In researching this episode we found a whole bunch of super-salty takes on no-code from devs across the Twitterverse, from the thoughtful and considered to the downright savage - and we include them here for your pleasure. Enjoy.

### Holy Salt! 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ih39r5f0bkud0og697hu.png)

### How could you say something so brave and so true
![How could you say something so brave and so true](https://dev-to-uploads.s3.amazonaws.com/i/yeamjxlw51jz1h0q3e7h.png)

### Dadjoke.gif
![Dadjoke.gif](https://dev-to-uploads.s3.amazonaws.com/i/s8sdbm5rd3l495qowh3v.png)

### It is like cloud 
![It is like cloud](https://dev-to-uploads.s3.amazonaws.com/i/6xn2s75g5syemsitxo64.png)


Low-effort Twitter screencaps aside, we're really interested to see what the NextBigThing<sup>TM</sup> in no-code is, and even more interested to see if no-code continues to be such a polarising topic... or whether one day it'll sink into the doldrums of every day office life, like Clippy and and that guy who writes Excel macros.

James & I think no-code is a valuable part of the web dev ecosystem, and here to stay - what do you think? Why not check out our latest episode at the links below and let us know in the comments!

https://dev.to/salted-bytes-podcast
https://saltedbytes.rocks

Till next time

Chris
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2020-03-02 20:37:50

---
title: The 7 Most Popular DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---
Every Monday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week. ❤️

#1. Debugging

Leira enhances their debugging experience by using console properties beyond `log`. They share their most used console properties in this post.

{% link https://dev.to/leirasanchez/like-console-log-but-better-nhm %}

#2. Latest & Greatest

Jeremy implements an SPA with the latest JavaScript features. The app supports routing, databinding, reusable web components, and more - all using pure JS.

{% link https://dev.to/jeremylikness/build-a-single-page-application-spa-site-with-vanilla-js-4g2l %}

#3. You have the skills!

Janessa acknowledges how contributing to open source may feel daunting, and so they've shared several suggestions on how to get started.

{% link https://dev.to/janessatran/a-beginner-s-guide-to-contributing-to-open-source-4fen %}

#4. Animated Explanations

Lydia created an interactive game that focuses on realistic JavaScript questions. See if you know the answers to these questions!

{% link https://dev.to/lydiahallie/interactive-javascript-quiz-1-1flc %}

#5. Stale While Revalidate

In an effort to understand how SWR works, Julian walks us through how to build our own version!

{% link https://dev.to/juliang/how-swr-works-4lkb %}

#6. Two Languages, One Shell

Maciej introduces us to the TypeScript type system, explaining why they believe it should be considered a fully flavored language. 

{% link https://dev.to/macsikora/typescript-is-more-than-you-think-2nbf %}

#7. Productivity Boost

Zoe recently switched over to VS Code. In this post, they share their list of shortcuts, configurations, and extensions. 

{% link https://dev.to/whizzzoe/how-i-set-up-vscode-for-productivity-checklist-omc %}

_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Monday!_
Memoization in JavaScript
Tags: javascript, webperf, webdev
Published: 2020-03-02 20:26:39

<h2>What is memoization?</h2>

<b>Memoization</b> is a technique that makes your function calls faster in exchange of memory space. Although it is generic for all programing languages, I'm going to use JavaScript to implement a simple memoization function.

<h2>Why to use it?</h2>

As our application grows, there may be some cases where hard computational algorithms might happen to be slowing down your application. You may want to store those computations' results and use them over and over again to improve your application's performance and that's where memoization comes in...

<b>Memoization</b> technique gives you the ability of caching results in function scope and lets you use it from inner functions. This caching mechanism provides you better performance especially in terms of expensive function calls.

Let's say you have a simple factorial function and you don't want to calculate factorial of any given number after it has already been calculated.

![Factorial function image](https://dev-to-uploads.s3.amazonaws.com/i/x1j3dplgw3u34hu9ujxm.png)

By returning a function and storing factorial result in its closure, we can create a memory cache. 

![Memoize](https://dev-to-uploads.s3.amazonaws.com/i/dbdz0sw8gk21n5211jsd.png)

As shown above, we created a memoizedFactorial function and store every calculated factorial in the cache object. This way we create closure for returning function and it has access to this cache object therefore second function call with same parameter will not call factorial function.

<h3>Conclusion</h3>

We prevent our application from calling function over and over again in the exchange of memory space because closured data is stored on heap memory.


Also you can read;

<a href="https://dev.to/mertsafak/how-to-handle-dynamic-import-errors-in-vuejs-2d51">How to Handle Dynamic Import Errors in Vuejs</a>
Transfer data from a SQL-server to a noSQL structure
Tags: mongodb, sql, database, JSON
Published: 2020-03-02 20:16:57

{% stackoverflow 60490433 %}


I have a problem.
my boss say: i can design relational data base, in sql server , Use it to avoid problems if we migrate a part of DB to MONGODB later. What do you recommend to me? And what about migrating to Mongodb?
iPad Pro + Raspberry Pi 4 ❤️ 🥰
Tags: ipad, raspberrypi, eppr, bash
Published: 2020-03-02 20:14:57

Do you have a RPI4 running Raspbian on 32 or 64 bits?

You can use this bash to setup a fresh raspbian image and enable SSH connection through your iPad Pro USB C connector in a breeezz

Run this code on a Raspberry Pi connected to the Internet.

>__`sudo curl -sSL ipad.eppr.link | sh`__

Shutdown your Pi after finish.

Take out your SD card and:

Create an empty file named “ssh” on your boot folder

And edit 2 other files on your boot folder

Add dtoverlay=dwc2 to the /boot/config.txt

Add modules-load=dwc2 to the end of /boot/cmdline.txt

Get the sd back inside again and...

Connect your pi to your iPad Pro using a USB C 2.0 Cable (!important;)
Wait 30 seconds and look inside Settings App on your iPad.

A new Ethernet USB adapter should pop in sight.

SSH into your Pi using a local ip 10.55.0.1 and your favorite password

>__`ssh pi@10.55.0.1`__

If you want to know more cool stuff HMU, and if you want show appreciation follow our socials:
(Cmd+C Cmd+V this on your browser)

-EPPR
https://eppr.link

(Disclaimer: Remember to ALWAYS wash you hands and read the bash inside your sudos)
Nevertheless, Kayla Coded
Tags: wecoded
Published: 2020-03-02 20:12:47

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title & narrative! ✨ -->

I make sure to participate in #shecoded every year to share this gif:

<figure>
![Every woman has the right to make a profit](https://thepracticaldev.s3.amazonaws.com/i/5i2mboh4u9810r0iqrl3.gif)

<figcaption>
<a href="https://www.reddit.com/r/startrekgifs/comments/ayos69/happy_international_womens_day_moogie">Gif source</a>
</figcaption>
</figure>

## Equality in tech looks like… 

Anything that would be provided is provided to all peoples equally.    
Care products in one bathroom are also in the other. 1:1s offsite are available to all people. Time off is distributed equally. There are multiple ways of boosting morale.

These things sound like no brainers, but the actual act of doing them gets far greyer to the people in charge of an organization. Sanitary products in women's restrooms but not in men's and neutral/family restrooms. 1:1s between the same gender but not with the opposite because of the _perception_, which then disadvantages those who can't get facetime with management. Minimal maternity/paternity leave or offering it skewed because one gender is more nurturing or physically recovering (but that other partner needs to be around to help, too). Rewards are only after-hours happy hours, which means caregivers can't go or it ends up being very "tech bro", but you can't complain about a reward without being labeled as entitled. 

There's always a reason against doing what would be equal, but it's never a good one.

## I’m an expert at…

Hmmm... probably Protractor and Jasmine. Wrangling those frameworks into working because I have enough hours of practice to know their quirks. Knowing them well enough to know what to Google, at least. I don't know -- I don't really think about it.


## My advice for allies to support self-identifying women and non-binary folks who code is...

People are people. There's no mythical solution to making sure you're behaving right for The Women or whatever group. 

Yes, sanitary products are a great way to provide support for transfolk, but does Joe feel safe to take them?     
Adding generous maternity leave can make HR feel good about supporting women in tech, but what about Jenny, who has no interest in having children, or Christine, who is so swamped at work that she takes only what's needed to physically recover and is on her phone the whole time?

Make sure you're including all your peers in everything. Ask if there's anything they'd like to see be changed about the place that you can help with. Be mindful you might have perceptions that are off; the fix for that is to get to know people you may have perceived wrong. Speak up if you see or hear someone being offbase. Be an ally.

<!-- Once your post is published, it will not appear on the /t/shecoded page until an admin approves it. This is an extra step to ensure there is no abuse on this important tag. -->
Make Git ignore changes to a tracked file
Tags: git
Published: 2020-03-02 18:06:08

Sometimes you want to change a tracked file so that you can run your project locally on your machine. This is typical of configuration files and templates. But you don't want to commit these files. 

One way is to discard these changes every time you are about to commit and redo them every time you pull from master. Another way is to stash them before you commit and reapply them after you pull. 

But there is a better way! You can tell Git to ignore changes to this file:

``` bash
$ git update-index --assume-unchanged <file-to-ignore>
```

Now you can go ahead and do whatever you want in that file and it will not show up as a changed file in Git.

This will work unless that file is changed on the remote branch. In that case if you do a pull, you will get an error. 

When that happens you need to tell Git to start caring about the file again, stash it, pull, apply your stashed changes, and tell Git to start ignoring the file again:

``` bash
# tell Git to stop ignoring this file
$ git update-index --no-assume-unchanged <file-to-ignore>

# stash your local changes to the file
$ git stash <file-to-ignore>

# Pull from remote
$ git pull

# Apply your stashed changes and resolve any possible conflicts
$ git stash apply

# Now tell Git to ignore this file again
$ git update-index --assume-unchanged <file-to-ignore>
``` 

You can automate this by either creating a bash script or a Git alias that does all these steps at once.

<a href="https://chipper-musician-9131.ck.page/562695812e">![signup](https://dev-to-uploads.s3.amazonaws.com/i/cufm58ypdt0dilhlgh5j.png)</a>
Top 9 iOS Design Practices
Published: 2020-03-02 19:01:40

Respect platform conventions and design guidelines. Go through the Apple Human Interface Guideline before you start designing and try using components available instead of trying to create your own. All apps released by Apple on Android always follow the Android Material Guidelines and not the Apple Human Interface Guidelines and vice versa.[ Read more...](https://www.peppersquare.com/top-9-ios-design-practices/)
Access VM disk image from the host
Tags: virtualization, qemu, linux
Published: 2020-03-02 18:46:58

Many times there are multiple solutions to a problem. This statement is driven to an extreme by the number of tools provided in a standard Linux distribution.

Most of the time, I'd like to find the fastest solution.
In Linux, the fastest solution usually includes installing a tool that does the job.

But sometimes I prefer an elegant solution - one that uses the tools at hand, one that will teach me more about the versatility of the environment I'm already using.

The task at hand was to install an upstream kernel on a fedora VM.
The catch - the VM has no network connectivity.
Why? no reason really. I just wanted a simple test VM that didn't need any network adapters in the first place.

How do I copy the kernel sources and all related build tools to the VM?

Possible solutions could have been - adding a network adapter, sharing the host FS using some modern solution like virtio-fs, or using a specific tool for the job - something like [libguestfs](http://libguestfs.org/).

But if I want a more elegant solution?

Assuming I'm already using Qemu/KVM as the hypervisor, it's likely I already have a tool for the job. It's called qemu-nbd.
NBD stands for "Network Block Device" - it's a protocol for accessing block devices over the network.
qemu-nbd provides a way to access the VM disk image as if it was a block device on a remote host.
The Linux kernel has a built-in driver for NBD, so accessing a disk image is fairly simple.

Load the nbd driver module:
```sudo modprobe nbd```
nbd provides some module parameters: nbds_max and max_part, see `modinfo nbd` for their description.

Then use qemu-nbd to map the disk image to an nbd device:
```sudo qemu-nbd -c /dev/nbd0 image.qcow2```

The disk image most likely contained a partitioned disk, so the result will be multiple partitions - /dev/nbd0p1, /dev/nbd0p2, etc.
Now we can mount and access the filesystem on the image by mounting the nbd partion:
```sudo mount /dev/nbd0p1 /mnt```

That's it.

Don't forget to clean up after you're done:
```
sudo umount /mnt
sudo qemu-nbd -d /dev/nbd0
sudo rmmod nbd
```

In future posts, I'll discuss how to install an upstream kernel on a mounted image and also how to create an image from scratch.
🏁 Immer: React made speedy
Published: 2020-03-02 18:46:03

Immer is a **truly great tool for increased React performance**, creating a Immutable-like flow without the need of any specialized library on the subject and letting you add tons of components with no fear, but it lacks a bit of docs online. Here is a small schema to understand the **trick behind the scene**.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/eguq7jfuk1b4wynignma.png)
Lenguajes de programación de nueva generación
Tags: scala, crystal, go, rust
Published: 2020-03-02 18:43:27

[Escuchar podcast](https://anchor.fm/tecnotrucos/episodes/Lenguajes-de-programacin-de-nueva-generacin-eb5lfl)
{% spotify spotify:episode:5S3CFqqzwU59K9WO4qs3Yp %}

En los últimos años nuevos lenguajes de programación están dando mucho que hablar.

Qué buscan mejorar y que puntos tienen en común. Haremos un repaso a los nuevos lenguajes soportados por JVM y aquellos que se compilan usando LLVM o GCC.

Podemos encontrar de nuevos lenguajes compilados como Golang, Crystal, Nim, Julia, lenguajes sobre JVM como Scala y Kotlin y los que funcionan sobre JavaScript como TypeScript o ELM

Mi recomendación, busca el que mejor se adapte a tí, a tu equipo o a tu proyecto.
Der Error Fürst
Tags: go, podcast, errors
Published: 2020-03-02 18:41:30

🎧 👉🏻 Hier anhören und abonnieren: [codeandship.rocks/podcast/18](https://codeandship.rocks/podcast/18/)


Diesel Folge ist voll mit Fehlern, denn es geht um Errors in Go und was man dagegen machen kann.

# Links für diese Folge

- [Errors are values](https://blog.golang.org/errors-are-values) - The Go Blog
- [pkg/errors: Simple error handling primitives](https://github.com/pkg/errors)
- [hashicorp/go-multierror: A Go (golang) package for representing a list of errors as a single error.](https://github.com/hashicorp/go-multierror)
- [friendsofgo/errors: Simple error handling primitives](https://github.com/friendsofgo/errors)
- [Working with Errors in Go 1.13](https://blog.golang.org/go1.13-errors) - The Go Blog
- [Error](https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Error) - JavaScript | MDN

## Mate Test

[Mio Mate Banane](https://limoliste.de/mio-mio/mate-banana) - 0,5 l Glasflasche

| Key        | Value |
|------------|-------|
|Geschmack   | ★★★★★ |
|Erfrischung | ★★★☆☆ |
|Effekt      | ★★★★☆ |
|Preis       | ★★★★★ |
Data Annotation Tools and Frameworks
Tags: machinelearning
Published: 2020-03-02 18:34:38

I started creating my own [list of data annotation tools](https://data-annotation.com/tools-and-frameworks/) and frameworks for my machine learning projects. I work a lot with computer vision data and used to build my own little annotation tools. However, there are plenty of open-source tools available!

I thought it would be helpful for some of you!

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8ks1l1ef5ux1qgj1y2z7.jpg)

I will start blogging more about my deep learning related projects here. So stay tuned for more interesting content!
Colourful CSS: Z-Index
Tags: css, frontend, beginners, codenewbie
Published: 2020-03-02 18:17:47

🎨

Z-index helps in tricky situations where an element looks like it is layered over another. 

Content of the body of the page may show through the navigation bar you create. By placing a <code>z-index:1</code> in your header section (where your navigation bar is) you can layer the navigation bar on top of the body in such a way that when scrolling through the page, elements you do not get unwanted element positioning. 

🎨