teleren/devto huggingface dataset:
Understanding Docker: part 8 – Docker Layers
Tags: docker, devops, beginners, cloud
Published: 2020-10-12 07:02:18

---
title: Understanding Docker: part 8 – Docker Layers
published: true
description: Serie of sketchnotes about Docker. Explaining in a visual way Docker principles.
tags: Docker, DevOps, beginners, Cloud
series: Understanding Docker in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/0u3i2a1h4cdqq2gd36e1.jpg
---

Understanding Docker can be difficult or time-consuming. In order to spread knowledges about Cloud technologies I started to create sketchnotes about Docker. I think it could be a good way, more visual, to explain Docker (and others technologies like Kubernetes and Istio).

We continue the serie of Docker Sketchnotes with a focus about Docker layers.

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

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

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

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

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

If you are interested, I published all the sketchnotes on Docker (and new ones!) to make a "book" of 93 pages: ["Understanding Docker in a visual way"](https://gumroad.com/aurelievache#YTLzM).

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).
Bullet-Issues: Tasks That Kill
Tags: webdev, tutorial, management, productivity
Published: 2020-10-12 07:01:11

Bullet issues… Each IT project has tasks of this type. They are small, simple, but once you forget about them, something gets killed suddenly.

Many teams underestimate bullet issues. From a developer’s perspective, such a task looks too simple to care about it. So the developer prefers to put it aside and focus on the bigger tasks that look more important.


[![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4ppgluugx5kk6rlqo7v3.png)](https://maddevs.io/blog/pm-mistakes?utm_source=devto)

Let’s have a look at a real-world example:

##A dialogue between developers

> *Tom, have you seen that ticket saying that you need to remove the photo of one of our founders from the website? It has been on the backlog for three days already. Could you fix it?*
>
> *My tests have fallen, I will fail the sprint if I get distracted. Do it yourself.*
>
> *Well, I also have a ton of sprint-related tasks. Okay, we’ll get to it later.*

![Bullets.](https://dev-to-uploads.s3.amazonaws.com/i/061vw3hmwovzk5n1474o.jpeg)

##A dialogue between stakeholders

> — *Well, I have already told you that you need to officially rename your team of developers into a gang of sleepy sloths. That is why I decided to quit. They cannot even remove my picture from the website. I even failed my interview in the CoolFinTechStartUp.ai because of that darned picture. They didn’t believe me that I am no longer with the company!*



That is how a bullet task killed a team consisting of two developers and one project manager. We grieve. We remember them.

##Conclusion
Every team needs to have a couple of interns or junior staff members taking care of such small but critical “bullet” issues. That will not end in losses or anyone’s departure.

[![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/v12u53heox8r6b0gf5f4.jpeg)](https://maddevs.io/services/?utm_source=blog&utm_medium=bullet-issues)

Previously published at [maddevs.io.](https://maddevs.io/blog/bullet-issues-tasks-that-kill?utm_source=devto&utm_medium=bullet-issues)
GitLab CI pipeline failed when using API commit with project access token #246784
Tags: gitlab
Published: 2020-10-12 06:59:56

```
--- auth-origin.rb	2020-10-11 06:00:00.000000000 +0800
+++ auth-patch.rb	2020-10-11 06:00:00.000000000 +0800
@@ -47,7 +47,7 @@
         # is enabled.
         result =
           service_request_check(login, password, project) ||
-          build_access_token_check(login, password) ||
+          build_access_token_check(login, password, project) ||
           lfs_token_check(login, password, project) ||
           oauth_access_token_check(login, password) ||
           personal_access_token_check(password, project) ||
@@ -276,16 +276,17 @@
         end
       end

-      def build_access_token_check(login, password)
+      def build_access_token_check(login, password, project)
         return unless login == CI_JOB_USER
         return unless password

         build = find_build_by_token(password)
         return unless build
         return unless build.project.builds_enabled?
+        return if project && build.user.project_bot? && !project.bots.include?(build.user)

         if build.user
-          return unless build.user.can?(:log_in)
+          return unless build.user.project_bot? || build.user.can?(:log_in)

           # If user is assigned to build, use restricted credentials of user
           Gitlab::Auth::Result.new(build.user, build.project, :build, build_authentication_abilities)

```
Design Patterns & Principles in Kotlin
Tags: android, kotlin, beginners, computerscience
Published: 2020-10-12 06:52:31

Here are my notes I made while reading the book **Head First Design Patterns**. It has full and quality implementation of every design pattern in the book with notes on different patterns and principles. The examples are written in Kotlin.

The Head First Design Pattern is a great read if you are just starting to learn design patterns.

Check out the Github repo below and do star it if you find it useful:

{% github Devansh-Maurya/Design-Patterns-And-Principles %}
How To Use/Create Middleware Laravel 8 Example

Tags: laravel, css, html
Published: 2020-10-12 06:48:35

Simply laravel middleware filter all the HTTP requests in laravel based on projects. For example when the user is doing any request that time middleware check user is logged in or not and redirect accordingly. Any user is not logged in but he wants to access the dashboard or other things in projects that time middleware filter requests redirect to the user.

This example of active or inactive users access laravel 8 app or not. So, add this middleware with routes to restrict logged user to access routes, if he/she is inactive by admin.

**[Middleware- Laravel 8- Use/Create the make: middleware Artisan command](https://www.phpcodingstuff.com/blog/how-to-use-create-middleware-laravel-8-example.html)**
Google Signin release error.
Published: 2020-10-12 06:32:22

Hello. My app works fine on a simulator but crashes when I release it in testflight.
Libraries that I use:
-react-native-config@1.3.3
-@react-native-community/google-signin@3.0.3
Those are relevant and you will understand why.
I followed advice from the internet and changed the scheme to 'release'. And I get this error at this line after adding a breakpoint:
line: [[GIDSignIn sharedInstance] restorePreviousSignIn]; in RNGoogleSignin.m
error: Thread 1: "You must specify |clientID| for |GIDSignIn|"

Extra, I submitted the crash from testflight and I opened it with Xcode. I get the error at the same line but different texting: Last Exception Backtrace (0)

I need to mention that I pass the clientId using react-native-config library.

Can you help me? :)

Regards.

Late edit: I use Xcode12 and react-native v0.63.3
How to Use Mobile Apps for Boosting Sales in the Holiday Season 2020?

Published: 2020-10-12 06:16:42

The holiday season 2020 amid the COVID-19 pandemic is not going to be a usual one. The expectations of customers will be new due to ‘new normal’ norms of physical distancing. As a business owner, we need to provide the most compatible solutions to our customers with the mobile app. 

The influx of users for eCommerce and travel is certain. The real challenge is to attract them to your mobile app and make them your long term customers. There are various ways of doing this. But remember, everyone is at an equal level. 

The competition is fierce but all the businesses are sailing the same boat. The one who will match the needs and expectations of customers during this new normal is going to rule in the post-COVID period. 

Keeping this in mind, you must revamp your existing app by availing result-oriented <a href="https://www.sparxitsolutions.com/app-development-company.shtml">mobile app development services</a>. With appropriate techniques and tactics, you can achieve your goals to boost sales during this Holiday Season. 

<strong>3 Tips to Boost Holiday Season Sales with a Mobile App</strong>

<strong>Test your app</strong>

If you already have an app or you are going to launch a new app, make sure to test it for scalability. During the holiday season, you will witness an influx of users. Make sure your app is robust enough to handle the surprise rise in your mobile app’s traffic. 

<strong>Get a redesign with festive themes</strong>

This is the perfect time to revamp your UI/UX design of mobile apps. You can do it as an attempt to make your app a welcoming one for the excitement and joy of the people during these festive times. Think about adding the micro-interactions, bright color schemes, offer announcements, and many more. 

<strong>Integrate push notification</strong>

There are various reasons that your app might get unnoticed by the users after they install it. Most of the apps are left abandoned by the users after a few times of use. In such cases, you need to call them back with push notifications. You can update them about all the latest information regarding your app and holiday season offers. 

<strong>In a nutshell, </strong>

These techniques and tactics can help you in improving your sales with my folds. Make sure to be an early bird in working on these strategies. During these uncertain times, we need to be the first in attracting the customer with ‘new normal’ needs.

The idea is to offer new solutions to new problems. No matter in which industry you are working in, consult with an experienced mobile app development company. Get an idea of what features your app should have to succeed in boosting sales during the 2020 Holiday Season. Happy holidays!
Sentiment Analyzer using SSVM
Tags: rust, webassembly, node
Published: 2020-09-19 04:40:03

Recently I came across SSVM and WebAssembly on the server-side. It is a new way of development with ease of javascript and performance of rust. This approach combines Rust's performance, WebAssembly's security and portability, and JavaScript's ease-of-use. A typical application works like this.

* The host application is a Node.js web application written in JavaScript. It makes WebAssembly function calls.

* The WebAssembly bytecode program is written in Rust. It runs inside the SSVM and is called from the Node.js web application.


## Description:
My project uses an express API to receive 'phrase' as a parameter and then uses a rust function to do the sentiment analysis using the AFINN-111 wordlist.

{% github https://github.com/Bearbobs/ssvm-nodejs-starter %}

The current implementation is very simple, as it is my first project with rust as well. I am working on adding file support to it so that it can parse text directly.

The underlying architecture is like:

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

Special thanks to second-state for an amazing [getting-started guide](https://www.secondstate.io/articles/getting-started-with-rust-function/), I was able to set it up on my local within 10 minutes.
Overall it was an amazing learning experience and I can think of many use cases where this type of infrastructure will work.
Need a career guidance
Tags: javascript, career, webdev
Published: 2020-10-12 06:04:07

Hi, I'm an Engineering graduate (ECE) trying to make a career in web development. so far, I've learned HTML, CSS, bootstrap, javascript, jQuery and looking forward to learning some javascript frameworks. Am I going on the right path?! I feel confused between self-study or coding Bootcamp. Please help me here!! Any guidance to improve me.
Why did I decide to study Software Engineering?
Published: 2020-10-12 05:49:02

I've always seen myself as someone who's creative. As a child my creativity was expressed through drawing, making sculpture out of clay, doing beadwork, and just basically seeing the world as my canvas.However when I got older my art forms took a more practical role, I learned to paint my face(make up), or create accessories, and skin care. Once it was time for me to decide what career path I was ready to take I opted for "Make-up Artist" or "Business Owner." I quickly found out that wasn't for me, and when I accepted that and started looking into more "traditional" jobs none really appealed. I wanted to be able to create things that benefit people, and during a talk with my best friend she suggested engineering. That led me down a google search rabbit hole, there are so many paths pursuing an engineering job can take you. I finally landed on software, my ideal of software engineers was like something straight out an action movie. I imagined monitors surrounding a person dressed in all black as they type 100 miles a minute hacking into top secret information. Upon further studying of Youtube videos that wasn't the case (sadly), but still I was super interested. So I started by buying courses from Udemy and i really liked coding although it hasn't always been easy for me to understand. Fast forward through this pandemic and here I am, starting coding bootcamp. I excited to see my progress through this program, and hope that this will lead to a wonderful career in this field.
Kamera DSLR; Ketahui Jenis Lensa dan Fungsinya
Tags: teknologi, dslr, kamera, tips
Published: 2020-10-12 04:59:34



Setelah banyak mengupas prihal brand yang merilis kamera DSLR, cara merawat, dan juga keunggulan serta kekurangannya, maka di artikel kali ini, kami akan membawa pembaca untuk mengetahui berbagai ragam lensa kamera DSLR.

Selain jenis, pembaca juga akan mengetahui fungsi dari masing-masing kamera, sehingga dapat tepat sasaran ketika mengambil suatu objek.

Oke, dari pada semakin penasaran, berikut daftar 9 lensa kamera DSLR yang wajib kamu tahu.

1. Lensa Standar

Lensa standar merupakan lensa sederhana yang paling banyak dipergunakan oleh fotografer populer sejak masa lalu hingga sekarang. Lensa tipe ini akan menghasilkan gambar yang sepenuhnya sama dengan apa yang dilihat secara normal.

Lensa ini memiliki jarak fokus sekitar 40-60 mm (ekuivalen dalam format 35mm). Namun yang paling umum digunakan adalah 50 mm.

Lensa ini memiliki aperture yang maksimal sehingga dapat dipakai ketika menangkap gambar dalam pencahayaan minim. Lensa ini juga cocok untuk menangkap objek dengan model Landscape dan potret.

2. Lensa Zoom

Yang kedua adalah lensa Zoom atau lensa sudut lebar. Lensa ini memungkinkan pengguna untuk menyesuaikan framing subyek secara tepat terhadap focal lenght lensa.

Lensa ini juga memiliki jangkauan 3 sampai 4 lensa fokus dan memiliki aperture variabel.

3. Lensa Long-Focus

Lensa ini memiliki ciri fisik yang panjang dan besar. Fungsinya tentu saja untuk menangkap gambar objek yang jauh, atau posisi pengambil gambar tidak dapat menjangkau objek apabila menggunakan lensa lain yang lebih pendek.

4. Lensa Cermin

Lensa keempat adalah Lensa cermin. Disebut demikian karena lensa ini mengkombinasikan elemen kaca dan cermin untuk membelokkan sinar yang masuk ke lensa agar berjalan searah laras lensa.

Cerimin-cermin di dalamnya akan memantulkan cahaya ke atas dan bawah lensa serta memanipulasi sinar sehingga focal lenght yang panjang menjadi terkandung dalam ruang yang pendek secara fisik.

5. Lensa Wide-Angle Zoom

Jika anda membutuhkan lensa untuk tangkapan yang lebih detail, maka lensa jenis ini adalah pilihan yang tepat. Lensa ini membentang antara 75-300mm dan terdiri dari enam lensa dengan panjang fokus yang tetap.

Para fotografer di bidang olahraga dan satwa juga menggunakan kamera ini untuk mendapatkan hasil yang detail dan jelas.

Info lebih lanjut silahkan kunjungi http://www.berita-teknologi.com/
Combining SQLite and Android
Tags: database
Published: 2020-10-12 04:58:03

SQLite is a relational database management system and the most used database engine in the world.

Its a very small library, depending on which platform you use it can be only 600kb big. It is embedded into your application and runs there locally, meaning there is no server needed.

All you need to do is to create an SQLite database in your application and then you are able to use SQL to access and change the data. The database file is stored in your project. The SQLite library is already part of Android Studio so you can have a head start.

I found an example project for Android Studio online, which shows how you can use SQLite inside your Android app, this is the link:
https://github.com/ravi8x/AndroidSQLite

You find the database file of this project like this: run your virtual device or connect the phone and run your app. Click on view→tool windows→ device file explorer. Then go to the folder data/data/info.androidhive.sqlite/databases.

Which databases are your favorites?
Laravel not running accessors with numbers in attribute name when serializing to JSON
Tags: laravel, php
Published: 2020-10-12 04:52:25

---
title: Laravel not running accessors with numbers in attribute name when serializing to JSON
published: true
description: 
tags: Laravel, PHP
---

I recently ran into an issue where Laravel wasn't running an accessor when serializing my Eloquent model to JSON. I had one property called `is_drop_off_location` and another called `is_24_hour_drop_off_location`. These values were stored in an SQLite database that doesn't support booleans, and when serializing the model to JSON it would return `"0"` or `"1"` as a string. 

I added the following accessors to my model to convert these strings to proper booleans:

```php
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Location extends Model
{
    public function getIsDropOffLocationAttribute($value)
    {
        return $value == "1" ? true : false;
    }

    public function getIs24HourDropOffLocationAttribute($value)
    {
        return $value == "1" ? true : false;
    }
}
```

However, when I serialized to JSON, I'd get the following:

```json
{
  "is_drop_off_location": true,
  "is_24_hour_drop_off_location": "0"
}
```

As I looked around, I wasn't the only person having [problems](https://stackoverflow.com/questions/52953810/laravel-cant-create-accessor-for-field-named-edge-50mm) with [numbers](https://stackoverflow.com/questions/52382964/how-to-define-an-accessor-in-model-where-the-field-name-contains-a-number) and [serialization](https://github.com/laravel/framework/issues/27035).

As far as I can tell, this bug occurs because Laravel is trying to convert the `StudlyCase` attribute name to `snake_case`, and the conversion function has no way of knowing that there's an underscore before the number.

The good news is this is a solvable problem. [Laravel allows you to explicitly append values to JSON](https://laravel.com/docs/8.x/eloquent-serialization#appending-values-to-json) with the `protected $appends` property on the Eloquent model. This feature exists for adding dynamic attributes that don't correspond to database columns, but we can use it to ensure that Laravel serializes our accessor for an attribute with a number in it.

Here is what our model looks like afterwards:

```php
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Location extends Model
{
    // This will make Laravel serialize our accessor.
    protected $appends = ['is_24_hour_drop_off_location'];

    public function getIsDropOffLocationAttribute($value)
    {
        return $value == "1" ? true : false;
    }

    public function getIs24HourDropOffLocationAttribute($value)
    {
        return $value == "1" ? true : false;
    }
}
```

Now when I serialize this to JSON, Laravel knows to look at the accessor.

Here is the JSON serialized output from the code above:

```json
{
  "is_drop_off_location": true,
  "is_24_hour_drop_off_location": false
}
```

Happy coding.
flask like asynchronous web framework written in Nim
Tags: nim, flask, webdev
Published: 2020-10-12 04:17:50

Nim language has great macros supports. Metaprogramming is interesting to play with. Let's look at this asynchronous web framework based on macros route.

https://github.com/planety/starlight

## Hello world

```nim
import starlight
var app = newApp(newSettings())

proc hello(ctx: Context) {.async, get(app, "/hello").} =
  resp "Hello world!"

app.run()
```

Vs flask

```python
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'
```

## Complex example

```nim
import starlight except loginPage
import logging
import htmlgen


func loginPage*(): string =
  return html(form(action = "/login",
      `method` = "post",
      "Username: ", input(name = "username", `type` = "text"),
      "Password: ", input(name = "password", `type` = "password"),
      input(value = "login", `type` = "submit")),
      xmlns = "http://www.w3.org/1999/xhtml")


var app = newApp(newSettings())

proc hello*(ctx: Context) {.async,
  get(app, "/"),
  post(app, "/"),
  get(app, "/hello")
  .} =
  resp "<h1>Hello, Prologue!</h1>"

proc home*(ctx: Context) {.async, route(app, "/home", HttpGet).} =
  resp "<h1>Home</h1>"

proc helloName*(ctx: Context) {.async, get(app, "/hello/{name}").} =
  resp "<h1>Hello, " & ctx.getPathParams("name", "Prologue!") & "</h1>"

proc redirectHome*(ctx: Context) {.async, route(app, "/redirect").} =
  resp redirect("/home")

proc loginGet*(ctx: Context) {.async, route(app, "/loginget").} =
  resp loginGetPage()

proc doLoginGet*(ctx: Context) {.async, route(app, "/loginpage", [HttpGet, HttpPost]).} =
  resp redirect("/hello/Nim")

proc login*(ctx: Context) {.async, get(app, "/login").} =
  resp loginPage()

proc doLogin*(ctx: Context) {.async, post(app, "/login").} =
  resp redirect("/hello/Nim")

app.run()
```
Scenario Based Docker Interview Questions | Part-4 
Tags: docker, kubernetes, devops, linux
Published: 2020-10-12 03:09:28

Hey There,

Here is the 4th video on “Scenario based Docker Interview Questions”

Following questions are addressed in this video:-
- I have a requirement to copy token/config file inside a container but can’t use docker cmd for that. Is there any alternate way to achieve it ?

- “I can run any linux flavour container on my host as docker engine makes use of linux kernel features for containerization”
Do you support this statement ? If yes then prove.

- Is it possible to
pull/push Image, run/stop other docker containers from inside a container ?
or
talk to host docker daemon from inside a container ?

- Stopping a running container using docker stop is slow as compared to docker kill but still its advised for a good user experience why ?

- I have an app and a db container running on a host. How can these 2 containers talk to each other ?

{% youtube __5bNusS7_Y %}