teleren/devto huggingface dataset:
What's your stack to write Cloud services?
Tags: cloud, programming, development
Published: 2020-06-01 17:30:29

---
title: What's your stack to write Cloud services?
published: true
description: Question to the community about cloud service development
tags: cloud, programming, development
//cover_image: https://direct_url_to_image.jpg
---

Hey all,

I was wondering what kinds of tools the community here uses for developing applications in the Cloud. We've gone through a variety of iterations over the years from the LAMP stack to the JAM stack for "web apps" but we're now approaching a place where "Cloud services" are a thing and with that requiring a different architecture, a different kind of scale. A lot of this is underpinned by Cloud computing, AWS, managed services, Kubernetes, cloud-native technologies, etc, etc. 

What is your stack to write Cloud services? And a more general question. Will we ever see a standard development model for the Cloud? The way mobile has iOS and Android.

Cheers
Asim
การแปะ Github gist บน medium
Tags: devops, github, microsoft, programming
Published: 2020-12-03 17:39:15

---
title: การแปะ Github gist บน medium
published: true
date: 2020-06-01 17:24:26 UTC
tags: devops,github,microsoft,programming
canonical_url: https://cdn-images-1.medium.com/max/1024/1*ADJHyiUrN0dpPsAI_6k3UA.png
cover_image: https://cdn-images-1.medium.com/max/1024/1*ADJHyiUrN0dpPsAI_6k3UA.png
---

วิธีการนำ Github gist มาแปะบนหน้าเว็บ medium หรือ เว็บอื่นๆ

ขั้นตอนที่ 1 ให้มาที่เว็บ

[Discover gists](https://gist.github.com/)

และให้ไปที่ หน้าโปรไฟล์ของตัวเองก่อน จะได้หน้าตา github gist ของตัวเอง

![](https://cdn-images-1.medium.com/max/1024/1*ADJHyiUrN0dpPsAI_6k3UA.png)

วิธีการเพิ่ม gist ก็คือให้กดปุ่มบวกใกล้ๆกับ รูปโปรไฟล์

![](https://cdn-images-1.medium.com/max/169/1*MARX0cF93MGFsYSo1K6iUQ.png)<figcaption>Add new gist</figcaption>

พอหลังจากที่เรา กดเครื่องหมาย “+” แล้วจะพาเรามาที่หน้านี้ให้เราใส่ description ใส่ชื่อไฟล์ และก็ใส่ Code ของเราลงไปตามช่อง หลังจากเสร็จให้เรากด Create public gist นะ เพราะถ้า private จะแปะไม่ได้

![](https://cdn-images-1.medium.com/max/1024/1*avggvX7whtCVhjp7V-mKsA.png)

พอหลังจากที่เรา Create เรียบร้อยจะได้หน้าตาประมาณนี้

![](https://cdn-images-1.medium.com/max/1024/1*YnQBy0FNhofTS3cL5Apqow.png)

ให้กดปุ่ม Embed แล้วเลือกเป็น Share สำหรับที่จะไปแปะบน medium แต่ถ้าจะไปแปะบนเว็บให้ใช้ embed แบบเดิม

แล้วก็เอา link ที่ได้ไปแปะบน medium แล้วกด enter ได้เลย แล้วมันก็จะขึ้นแบบนี้เลยยย

{% gist https://gist.github.com/thanawatgulati/ae658ebfc13cd83b7708fd9eff873cb7 %}

แค่นี้เราก็ได้ github gist มาแปะลงบนเว็บเราให้ Code ดูง่ายๆแล้วววววววววววววววว

![](https://cdn-images-1.medium.com/max/498/0*WsG6sya5f1zSrdvE)

* * *
Optimistic Rendering...what is it and why is it important?
Tags: javascript, ruby
Published: 2020-06-01 17:17:02

Optimistic Rendering. I had heard it a few times early on in my quest to becoming a full-stack developer, but did not recognize the importance and influence it has throughout frontend and full-stack development. Why is it so important? As soon as I discovered what exactly Optimistic rendering was, the relevance became clear. To better understand Optimistic rendering, I want to also explain its counterpart, Pessimistic rendering. Pessimistic rendering is the opposite of Optimistic rendering and is considered to be "expensive". 

Well, what is "expensive"? And what does that even mean?

Essentially, what Optimistic vs. Pessimistic rendering boil down to is whether or not events on a page happen before or after they fetch information to and from the database. 

Optimistic is before, Pessimistic is after. The reason that Pessimistic is so "expensive" is because rendering content that first must be stored in the backend and then retrieved back to the frontend can take a long time, in an end-user's eyes. Most websites use Optimistic rendering because it enables the user to see their results fast. Fetching pessimistically to the backend first can leave the website open to potential vulnerabilities. Especially in the event that something on the backend happens to misfire or take longer than expected. 

In our current world, especially in the context of the internet, people consume things quickly and expect instantaneous feedback. According to Kissmetrics, 47 percent of visitors expect a website to load in less than 2 seconds, and 40 percent of visitors will leave the website if the loading process takes more than 3 seconds. This is the instance where something can become "expensive", you want end users to be engaged and stay on your site for as long as possible. Losing users at a fast rate can be damaging to your companies long-term success, which is why Optimistic Rendering is now the status quo for front-end web development. 

Now, for the "how". Because Optimistic rendering sends the fetch after the event, the code in javaScript looks something like this: 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/m6mp6z4doktiocdzxo2j.png)

This is in vanilla JS. I created an update eventListener that uses FormData to get the information input by the user once the form has been submitted. By adding the fetch call to the end and adding the event.preventDefault(), which enables the update to be made without reloading the page, this optimizes the user's experience and facilitates longer engagement.

source for statistics on user engagement:websitemagazine.com/blog/5-reasons-visitors-leave-your-website
What is HTTP/3?
Tags: opensource, webdev, tutorial, codenewbie
Published: 2020-06-01 17:15:13

Hey, How are you guys? I hope you all are safe and never stop learning. So let's learn together. You all may have the idea of HyperText Transfer Protocol(HTTP) and the evolution of that. If you don't, then it is the right time to learn HTTP and an upcoming versions of the HTTP. Yes, you read the right, upcoming version of HTTP is HTTP3, though some of CDNs and browsers are already implemented but not announced to the public.

HTTP3 is the upcoming 3rd major version of the HTTP used to exchange data between client and server. But Why HTTP3? We are more acquainted now with HTTP/2 and we were also very well satisfied with HTTP/1.1 even.

I would say all the versions of HTTP came to reduce the latency or RTT(Round Trip Time) between the client and server communication. HTTP/3 will come for the same reason. The interesting part of this protocol is, it is coming with the new Transport Layer Protocol QUIC which is previously known as QUICK UDP Internet Connections but now this is a name and not an acronym anymore.

But QUIC is used over UDP(User Datagram Protocol), QUIC=Transport + Encryption. So now the question is what is the problem with TCP?

Let’s watch the video to understand in detail. Please do like, Share, Comment, and Subscribe to learn all time.

{% youtube JKwt18mBAlU %}
Upload existing project to github repository through command line
Tags: github, commandline
Published: 2020-06-01 17:06:51

At first [create a repo](https://github.com/new) from your github account

![alt text](https://i.imgur.com/WaonqEd.png "Create github repo from web")

Now head back to the folder you want to push to github. It'll look something like this in terminal `~/foldername$`. Now Type and run

```
git init
```

This command will create a hidden folder `.git`

Head back to terminal and type
```
git add .
```
Remember to put the (dot). This will make all your file in that folder to be committed.

At this point you have to configure your name and email to run commit command.
```
git config --global user.email "you@example.com"

git config --global user.name "Your Name"
```

Replace Your Name and email and run the commands separately.

Now you are ready to be committed 
```
git commit -m "Your Commit Message"
```

Head back to browser and go inside your newly created repo again. You'll find a link like this pattern `https://github.com/username/repository-name.git`
If you don't find tap on `Clone or download` and copy *the link*. Make sure 'https' is selected not 'ssl'

In terminal type
```
git remote add origin https://github.com/username/repository-name.git
```

Then run
```
git push -u origin master
```

Now Put your github username and password
📚 Top 3 Books on Automation Testing that you Should Read.
Tags: testing, tutorial, beginners, webdev
Published: 2020-06-01 17:00:26

✅ Join us - https://sendfox.com/thetestingacademy

In this video, We are discussing Top 3 Books on Automation Testing that you Should Read as QA.

✅ If you are new consider subscribing and follow day by day to become an Automation Testing expert in 30 days.

[![Automation Testing Tutorial for Beginners ](https://i.imgur.com/Etefa2J.png)](https://youtu.be/nvARtAzrlwA "Automation Testing Tutorial for Beginners ")


🚀 Day 2 Task :  Begin reading an automation related book and share something youʼve learnt by day 30

🚀 Thread :  https://scrolltest.com/automation/day2

🚀 All Task List : https://scrolltest.com/automation/task

🚀 Watch Full Playlist : https://scrolltest.com/automation/playlist


📚Experiences of Test Automation
https://amzn.to/2XToBKM

📚The Way of the Web Tester
https://amzn.to/3doNzbA

📚Software Test Automation Paperback
https://amzn.to/3eBbftx

📚Software Testing: Interview Questions
https://amzn.to/3cpzTLY

📚Lessons Learned in Software Testing: A Context–Driven Approach
https://amzn.to/3gPcffF

📚Core JAVA Interview Questions
https://amzn.to/2ArGkRx

📚Selenium Framework Design in Data-Driven Testing
https://amzn.to/2TXlkJg

📚Selenium WebDriver 3 Practical Guide
https://amzn.to/3dnjysN

--
Be sure to subscribe for more videos like this!

[![ TheTestingAcademy](https://dev-to-uploads.s3.amazonaws.com/i/r7vcy6wbvyjbk1y1uu0o.png
)](https://www.youtube.com/TheTestingAcademy?sub_confirmation=1 "TheTestingAcademy")
Notes from Permanent Record - Autobiography by Edward Snowden
Tags: books, notes, security
Published: 2020-06-01 16:59:50

"There is no turning back, only going forward - for Mario and Luigi, for me, and for you. Life only scrolls in one direction, which is the direction of time, and no matter how far we might manage to go, that invisible wall will always be just behind us, cutting us off from the past, compelling us on into the unknown."
Hacking system requires to know its (or part of its) rules better than the person who created.
When applying a job, the perfect philosophy is to think: say what you want, say who you are, never be ashamed. If they reject you, it's their problem.
System administrator manages a whole system and over time try to make it more efficient and reduce the number of bugs. System engineer analyze a problem like how to store data better and solve it with combination of existing components and new ones.
System is just a bunch of parts that function together. Almost always the part that breaks is the reason for the breaking. Solving problem happens by finding where it break and then continuing from there until reaching the point where it happened.
"Something that is devastating for the public can be, and often is, beneficial to the elites."
When NSA names something they don't want it to tell about the project so they use naming generator that picks two random words and combines them.
When a country tries to track everyone, they can't just record the phone calls and screens of everyone because it would require way too much space. They instead focus collecting metadata like how long a phone call lasted and who was the other person. They will collect more if the person is interesting.
Meta data allows analyze data at scale and also look very closely what happened but it can't tell what was going inside your head.
Extreme justice might be bad because there are a lot of laws that people aren't necessary following because they are outdated and then there are a lot of things that are in grey area like trashing. If it could be possible to follow everyone, all the time, everyone would be a criminal.
Even if you think that you could share everything publicly doesn't mean everyone can. There are things like financial records or previous jobs that some people want to hide. "Saying that you don't care about privacy because you have nothing to hide is no different from saying you don't care about freedom of speech because you have nothing to say."
"Nowhere is this more clear to me than in the case of the Rubik's Cube, which satisfies a universal fantasy: that if you just work hard enough and twist yourself through all of the possibilities, everything in the world that appears scrabbled and incoherent will finally click into position and become perfectly aligned; that human ingenuity is enough to transform the most broken and chaotic system into something logical and orderly where every face of three-dimensional space shines with perfect uniformity."
How to explain Machine Learning to your Granny
Tags: machinelearning, beginners, motivation, interview
Published: 2020-06-01 16:52:56

**Getting started with machine learning can sometimes be overwhelming for some. However, it's more fun if you put yourself into practice. Well, in this article I've tried to explain machine learning in the simplest way possible.**

When a child is born, they are born with zero experience & knowledge. To them, even the easiest task in the world will sound disastrous or extremely difficult, the exact same way which happens to us, when we try something new. 

For example, consider walking, initially, a child may fall several times but eventually, he will learn from his mistakes & will finally be able to stand on his own feet. But this is not the case with transitional computers.

Computers require step by step instructions in order to perform a task. If the task is modified, computers won't be able to perform with without suitable modification in the instructions as well. Unlike a child, computers are not capable of learning from their mistakes.

To tackle this disability in computers, machine learning comes to our rescue. It helps the computer to understand/analyze the problem or task to figure out various possible solutions for it. Once done, it will start with the process of applying the new solutions to the problem & this time it will learn from the mistakes which are happening. Soon with this constant trial & error method, the perfect solution will be found.

After this no matter how many times or in how many ways you modify the problem, the computer will eventually come up with a solution.

**This is called Machine Learning.**



*Hey, if you came this far reading it, I'm so thankful of you. This is my first post, here on Dev.to & It was so exciting to share it with all of you...*
Manage program flow in .NET #1 – Understand how threads and context switching work

Published: 2020-06-01 16:38:08

Here is the first post in the series: Manage program flow in .NET! In this series, I will step by step to share my knowledge on managing program flow in the .NET applications.

**Threads – What and Why?**
Imagine that every computer has only one CPU which is capable of executing the only operating at a time.

Your machines will be unresponsive or get freeze if many tasks are in the queue – For example, you have to stop youtube before switching to MS PowerPoint to prepare for your presentation slide tomorrow (just so boring for me).

Also, imagine what would happen if the CPU has to work overload to execute a long-task, the happy case is it will be completed successfully. But in case there a bug during executing, your system would get stuck. Then please, restart your machine, that is the only way to deal with it 🙂

Luckily, the concept: Threading was born to solve the problem!

a thread is something like a virtualized CPU for each process.

Each application runs in its own process under a thread, each process is isolated from the others. This is to make sure that the failure of a single one will not impact the others.

**CPU’s Context switching**
Most of the computer comes with one or multiple CPUs (the case of server machines), each CPU come with multiple cores. To make use of all the cores of a CPU, it should be run into a multithreading scheme.

each thread is allowed by Windows to run for a certain time period. after this period ends, the current thread is paused and Windows switch to another thread. This is called: Context switching.


Context switching ensures that threads can do their own jobs without having to wait for others to complete.

Obviously, there is also some work that must take by Windows for switching between threads. Especially, it needs to make sure the whole context of the current thread is saved and restored without any issue on each switch.

Overall, it is extremely great to improve the responsiveness of the systems, end-users will feel like their computers can do so many works at the same time.

**And more…**
That is enough of knowledge for developers having a glance on the multithreading from OS’s aspect. On the next posts, we will step by step deep dive into how we can deal with multithreading in .NET and C#. Be a follower! 😉

Happy coding again !
What is Hierarchy in Programming
Tags: hierarchy, programming
Published: 2020-06-01 16:28:23

A hierarchy in programming is an organizational structure in which items are ranked according to levels of importance. Most governments, corporations and organized religions are hierarchical.

In a computing context, there are various types of hierarchical systems. Most file systems, for example, are based on a hierarchical model in which files are placed somewhere in a hierarchical tree model. A file is placed in a directory (folder in Windows) or subdirectory at the desired place in the tree structure. The computer memory hierarchy ranks components in terms of response times, with processor registers at the top of the pyramid structure and tape backup at the bottom.

The word hierarchy comes from the Greek hieros, meaning sacred, and archein, meaning to rule. The word first entered English in the fourteenth century. According to the Oxford English Dictionary, it originally referred to “each of the three divisions of angels, every one comprising three orders, in the system of Dionysius the Areopagite.”
Layouts 
Tags: swift, beginners
Published: 2020-06-01 16:20:54

Why should developers use adaptive layout tools in their applications?

     A- Adaptive layouts would be used if the developer oriented a certain way.  

What is the difference between Auto Layout, constraints, and stack views?

     A- Auto Layout gives the app a generic way of staying together in screen, Constraints tell the view and buttons what lines not to cross, and Stack Views let you leverage the power of Auto Layout, creating user interfaces that can dynamically adapt to the device’s orientation, screen size, and any changes in the available space.
JSByte: Type conversion in JavaScript
Tags: javascript, programming, webdev, beginners
Published: 2020-06-01 15:55:21

## Type Conversion in JavaScript. 

*I will be sharing bite sized learnings about JavaScript regularly in this series. Follow along with me as I re-learn JavaScript. This series will cover JS fundamentals, browsers, DOM, system design, domain architecture and frameworks.* 


Think about what will output when you log the following - 


```
1. console.log( 2 * null) 
// 0 . null gets converted to 0. 

2. console.log( "4" - 1)
// 3. "4" gets converted to 4. 

3. console.log( "4" + 1)
// 41. + operator with a string, so concat

4. console.log( "5" * 2)
// 10. "5" gets converted to 5. 

5. console.log( "five" * 2)
// NaN. 

6. console.log( false == 0)
// true

```
JS will perform type coercion - convert types to match each other, for these operations. It will try to make sense of the operands, try to convert them to string or number, and when something doesn't seem intuitive to convert to number, such as `"five"`, it gives back `NaN`.
Node.js 101: Requiring modules
Tags: node, beginners
Published: 2020-06-01 15:54:49

Sooner or later in your journey through Node.js, you will want to make use of the code other people wrote instead of writing everything yourself, so you will look for what we call **modules**. Think of them as toolboxes that contain tools for building one category of programs.

You might also wish to separate your program and code into separate files so as to not jumble them up in a single file. This raises the question: How do we import variables in other files to another file?

The answer is by using `require`.

## About `require`

`require` is a function that takes a string that resembles a file path or a module name, and returns the variables that were exported in them. It is called like `require('foo')` for a module called foo.js, or `require('/home/Documents/myNodeProject/foo.js')` for a file called foo.js in the directory in the example.

The way require works is by inspecting the file you are trying to import, or the `index.js` file of the module you want to import, and it looks for a line that has:

```js
module.exports = ...
```

The value that is assigned to `module.exports` is the value that `require` will set its variable to. Usually `module.exports` is a single function, or a dictionary of variables and functions such as this one:

```js
// contents of example.js
module.exports = {
  foo: function () {
    // whatever
  },
  bar: function () {
    // whatever
  }
};
```

If you save example.js in the current folder, then when you import it from another file, you will be able to access `foo` and `bar`:

```js
const example = require('./example.js');
example.foo();
example.bar();
```

## Troubleshooting

#### I imported a module with `require` but it returns `undefined`
This is by design. `require` does not return any value, but it sets the variable that you're assigning to be the contents of the exported module. So if you use the variable then it will contain a real value.

```js
> const express = require('express');
undefined
// Using the variable returned in 'express'
> var app = express()
...
```

#### I get the error `ReferenceError: <name> is not defined`
(where `<name>` is whatever you're trying to import) If you are trying to import a module, then it is neither in the local node_modules folder, or the global system-wide node_modules folder. You might need to install the module with `npm`. If you're trying to import a file, then check the path to make sure it exists.
Be careful with big increments with Laravel 6 and 7.
Tags: laravel
Published: 2020-06-01 15:52:34

---
title: Be careful with big increments with Laravel 6 and 7.
published: true
description: Take care of big increments on migrations with Laravel 6 or higher.
tags: Laravel
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/vhdsn5wz79aym51d07ni.png
---


From Laravel 5.x to Laravel 6 by the default the migrations has a little change now all id columns has a type of big increments unsigned:

```php
Schema::create('users', function (Blueprint $table) {
    $table->bigIncrements();
    ...
});
```

Then the foreign key requires to be an "UnsignedBigInteger":

```php
Schema::create('posts', function (Blueprint $table) {
    $table->unsignedBigInteger('user_id');
    ...
});
```

### A little note on Laravel 7.

It adds a helper method to be an "alias" of "UnsignedBigInteger", now in your migrations by default you will have the id column:

```php
Schema::create('users', function (Blueprint $table) {
    $table->id();
    ...
});
```

The id method in is just an alias of the same "UnsignedIncrements", so nothing has change is just a method to make more readable the migrations code.

### Define a foreign keys with Laravel 7:

```php
Schema::create('posts', function (Blueprint $table) {
    $table->foreign_id('user_id')->references('id')->on('users');
    ...
});
```

But you have an even better way o add this foreign key, if you follow the convention, (id is the name of column id and use {tablename}_id as the foreign key):

```php
Schema::create('posts', function (Blueprint $table) {
    $table->foreign_id('user_id')->constrained();
    ...
});
```

That's all, thanks for reading.