teleren/devto huggingface dataset:
Start with correct coding stack!
Tags: html, css, beginners, javascript
Published: 2021-06-04 09:33:05

*Are you a code newbie looking for a roadmap to start your web development journey? This blog is just for you!*

##Web Development

Web Development is a broad term and one can never know everything, so you need to take baby steps and should chronologically focus on 3 basic web technologies respectively,

- HTML
- CSS
- JAVASCRIPT


###HTML

Hyper Text Markup Language (HTML) should be your first language to learn. It basically describes structure of web pages or you can say it tells the browser how to display the content.


### CSS

**C**ascading **S**tyle **S**heet **(CSS)** describes the presentation of an HTML document. In other words, it styles the web pages and make them attractive and responsive.

### JavaScript

**J**ava**S**cript **(JS)** is the world's most popular programming language. So obviously it wont lose the charm in the long run. JS provides functionality to a web page. JavaScript gives web pages interactive elements that engage a user.

*Observe the following image to understand the relation between HTML, CSS, and JS* 

![Screenshot_20210601-100725__01__01.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1622740817388/73pE6uHiC.jpeg)

##  Learning Sources

-  https://www.w3schools.com/
- https://www.freecodecamp.org/learn/responsive-web-design/
- https://www.youtube.com/

## Peace out!

If you have any question feel free to DM me on [Twitter](https://twitter.com/tanyacoder) 

###### This post was originally written on [Hashnode] (https://tanyacoder.hashnode.dev/)
Load More after Button Click Pagination Example in Laravel
Tags: laravel, ajax
Published: 2021-06-04 09:32:17

Hello Aritsans,

How are you doing? In this tutorial, I’ll show you how to implement load more data in Laravel using Ajax/Axios with a button click. I will show you everything step by step from scratch so that you can understand the main concept and implement other projects. So here we go.

In this article, we will share with you how to create infinite scroll pagination using vue js with laravel 8(Laravel 8 Vue JS Infinite Scroll Load More Example).

sometimes we need to create a mouse scroll or infinite scroll pagination, like Facebook messenger. we give you a simple example of vuejs infinite loading data using laravel.

In this example, we are creating a simple example of Vue JS and laravel. so you can see the following steps.

[Load More after Button Click Pagination Example in Laravel](https://www.codecheef.org/article/load-more-after-button-click-pagination-example-in-laravel)
Images in "files" property with gatsby-source-notion-api
Tags: gatsby, javascript, notion, jamstack
Published: 2021-06-04 09:28:58

---
title: Images in "files" property with gatsby-source-notion-api
published: true
tags: gatsby, javascript, notion, jamstack
canonical_url: https://orlow.dev/images-in-files-property-with-gatsby-source-notion-api
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kojdyfk7xfatn6cyns2x.jpg
---

There are many ways you can find the Notion **files** property useful. One of the experiments I did was using it to provide a hero image for my blog. Currently, hero images from all blog posts come for a `Hero Image` files property I have on my DB. In general, the process is quite straightforward. Here's an example with **MarkdownRemark** that pulls in images for all notion pages, assuming that the **files** property we need is called `Hero Image`:

```graphql
query {
  allMarkdownRemark {
    edges {
      node {
        remoteImage {
          childImageSharp {
            gatsbyImageData(layout: FIXED)
          }
        }
      }
    }
  }
}

```

But there are things you need to consider.

# ✅ Embedding files via links

If you embed files via links, it should work out just fine with **MarkdownRemark** or **MDX**. `gatsby-source-notion-api` will create remote file nodes for those images. You can then use Sharp to transform them and do any other stuff you would do with images in Gatsby. All you need to do is to query for the image and put it where you need it.

# 💥 Uploading files

If you upload files, things get a bit trickier. The thing is that Notion API returns only the name of the asset if you upload it, not the URL where it resides. There are two ways you can bypass this

## Storing attached images in the project repository

You could potentially attach images to a Notion page and then also copy them to your project folder, and then find the Notion attachment in the list of files you have in the repo, but this approach is quite funny and I didn't try it out. Maybe it could help in some cases. But, again, maintain it here and there if you do this.

## Uploaded files are in fact links

After you attach a file, you can use the kebab menu (three dots) near the image and click "View original". It will open your image in a new tab. All you need to do is to copy the link and attach it to the same property. It is observed that you can remove the initial file afterward and the embedded link will still lead you to the file correctly. I don't know for how long they cache assets and if they remove them when you remove the attachment or not, but for now and for me it works.

**UPD:** Don't remove the file, simply move it down in the attachments, so that attachments as links are always on top.

After you have a file attached as a link, you can be sure that everything will work. 🎉
My Own Portfolio Website (My first blog)
Tags: neogcamp, levelzero, portfolio, htmlcss
Published: 2021-06-04 09:20:51

Hey everyone, I'm very excited because this is my first ever blog...Yaahhhhhhh I'm so excited... Coming to the blog in this blog I'm going to say about my portfolio website which I have created and hosted as a part of neoGcamp LevelZero assignment, which is organized by Tanay Pratap sir.
                
To know more about neoGcamp and Tanay Pratap sir [click here](https://tanaypratap.com/)

##Technologies used

* HTML5
* CSS
* Netlify (For hosting the website)
* Google forms(To create contact form in about section)

##Overview of the website

The website totally consists of 4 sections
1. Navigation and Footer
1. Home
1. projects
1. Blogs
1. About

###1. Navigation and Footer

####Navigation

![Navigation Bar Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uo4xfmx4wiid7jmm3bts.PNG)

I have used a basic navigation bar in the website which contains a brand-name on top left and links to navigate through the sections at right side.

####Footer

![Footer Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rs28z8cm2k5xdezz9umu.PNG)

In footer I have just written a heading and also links to my social media profiles.


###2. Home

![Home Page Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vswq7kspsngc8eud1yba.PNG)

In Home page I have used a basic header image which depicts my study and passion and below to that a heading describing my name and my designation.
                  After Header I have used some sections which describes what technolgies I'm good at, My projects and my blogs.

###3. Projects

![Project Sections Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9aiinuq0qpn52rlzahce.PNG)

In the Projects section I have showcased my projects also provided links to view the source code and to view the live project.

###4. Blogs

![Blogs Section Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a1crjahcc57bemhhhnhg.PNG)

In the Blogs section I have showcased my projects also provided links to read more about my blogs.

###5. About

![About Section Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ho484ayyzr5wfu7txozy.PNG)

In the about section I placed my photo and a small description about me. Also I created a google form and embedded here. so, if anyone want to say something they can fill the form and send to me.

![Contact Form Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ky1v4stw5jjz00d6nwm0.PNG)

##Links
* To view my portfolio website [click here](http://saicharangouru.netlify.app)
* For source code [click here](https://github.com/saicharan-gouru/Saicharan-Gouru)
Máy nén khí 
Published: 2021-06-04 09:10:46

Hiện nay, trên thị trường có rất nhiều địa điểm bán máy nén khí cũng như cung cấp nhiều dòng máy nén khí đa dạng về xuất xứ, dung tích bình chứa,.... cũng như giá thành sản phẩm
Máy nén khí có nhiều loại
- Máy nén khí có dầu
- Máy nén khí không dầu

Hoặc phân loại thành
- Máy nén khí mini
- Máy nén khí piston
- Máy nén khí trục vít
- Máy nén khí đầu nổ
Nếu bạn có nhu cầu mua máy nén khí hoặc có bất kỳ thắc mắc nào thì đừng ngần ngại liên hệ ngay với chúng tôi nhé! 
>>> Tham khảo các dòng máy nén khí https://spro.vn/may-nen-khi
Azure news roundup!
Tags: azure, news
Published: 2021-06-04 09:10:13

Since July 2019 I've been doing a weekly roundup of the latest news on my [YouTube channel](https://www.youtube.com/techielass) and this week is no different. 

{% youtube evMYWB2MgNs %}

This week in the news we've had the following items: 

- [Azure Site Recovery update rollup 55 is now generally available](https://support.microsoft.com/topic/update-rollup-55-for-azure-site-recovery-kb5003408-b19c8190-5f88-43ea-85b1-d9e0cc5ca7e8?WT.mc_id=modinfra-30499-salean)
- [New recommendations are in preview for hardening Kubernetes clusters in Azure Security Centre](https://docs.microsoft.com/azure/security-center/release-notes?WT.mc_id=modinfra-30499-salean#new-recommendations-for-hardening-kubernetes-clusters-in-preview)
- [Azure Digital Twins Explorer available in public preview, visual tool to help it easier to explore the Azure Digital Twins APIs](https://azure.microsoft.com/updates/azure-digita-twins-explorer-preview/?WT.mc_id=modinfra-30499-salean)
- [Azure Databricks Spot Virtual Machines are now generally available](https://azure.microsoft.com/updates/spot-virtual-machines-are-now-generally-available-on-azure-databricks/?WT.mc_id=modinfra-30499-salean)
- Azure Cosmos DB free tier has been expanded, you can now get even more free provisioned throughput (Request Units per second) and storage each month
How to Install Dotnet Core on Ubuntu
Tags: dotnet, linux, ubuntu, hostnextra
Published: 2021-06-04 09:02:40

In this article, we'll explain how to install Dotnet Core on Ubuntu.

.NET Core is a free, cross-platform, open-source developer platform for building many different types of applications. Software developers often need to use the Dotnet core framework on the Linux system to test, run, and build the packages.

The notion of using Dotnet on Linux comes true through the new Dotnet core, which is an API based modular system of Microsoft’s Dotnet framework. But the Dotnet core doesn’t act as a single API; it functions as a shared or public library of API and codes.
<h4>Prerequisites</h4>
<ul>
 	<li>An <a href="https://www.hostnextra.com/dedicated-server.html">Ubuntu installed system</a>.</li>
 	<li>A root user access of normal user with administrative privileges.</li>
</ul>
<a href="https://www.hostnextra.com/kb/how-to-install-dotnet-core-on-ubuntu/">Install Dotnet Core on Ubuntu</a>
<h4>Step 1: Download and Install MS Prob on Ubuntu</h4>
Now, we will download and install the Microsoft prob package on our Ubuntu system. Use the following wget command to download the Microsoft prob package on your Ubuntu. Following link is for Ubuntu 20.04. You can check your <a href="https://packages.microsoft.com/config/ubuntu/" target="_blank" rel="noopener">Ubuntu version's package link</a>.
<blockquote># wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb</blockquote>
Now, run the following Debian package installer command to install the MS prob package on your Ubuntu machine.
<blockquote># sudo dpkg -i packages-microsoft-prod.deb</blockquote>
<h4>Step 2: Install the Dotnet SDK</h4>
Following commands will install the Dotnet core library and functions on our Ubuntu system. You can check the source codes of the <a href="https://github.com/dotnet/sdk" target="_blank" rel="noopener">Dotnet core here in GitHub</a>.

First, update and install the transport-HTTP tools to install the Dotnet SDK package.
<blockquote># apt update

# apt install apt-transport-https -y</blockquote>
Now, install the Dotnet SDK packages
<blockquote># apt install dotnet-sdk-3.1</blockquote>
Once the installation gets completed, follow output will show:
<blockquote>Welcome to .NET Core 3.1!
---------------------
SDK Version: 3.1.409</blockquote>
<h4>Step 3: Create a New Project</h4>
We have completed with the installation. Now, lets create a simple 'Hello World!' project to test Dotnet core in Linux

Run following command to create a project:
<blockquote># dotnet new console -o HostnExtra</blockquote>
The project will be stored in the <em>~/HostnExtra/</em> directory.

Run the following <em>cd</em> command to open the project’s directory. Then run the Dotnet run command to run your project.
<blockquote># cd Reconshell
# dotnet run</blockquote>
Output:
<blockquote>Hello World!</blockquote>
That's it. We have completed with the installation.

In this article, we have seen how to install Dotnet Core on Ubuntu.
cons car cdr
Tags: cons, lisp, car, cdr
Published: 2021-06-04 08:57:25

---
title: cons car cdr
published: true
description: 
tags: cons,lisp,car,cdr
//cover_image: https://direct_url_to_image.jpg
---

## (cons "dog" "cat")

```
+------------------+-----------------+
|                  |                 |
|                  |                 |
|                  |                 |
|        X         |        X        |
|        |         |        |        |
|        |         |        |        |
|        |         |        |        |
+--------|---------+--------|--------+
         |                  |
         |                  |
         V                  V
       "dog"              "cat"
```

## (car (cons "dog" "cat"))

```
"dog"
```

## (cdr (cons "dog" "cat"))

```
"cat"
```
Laravel 8 Ajax Form Validation Tutorial

Tags: laravel, programming, php, tutorial
Published: 2021-06-04 08:30:24

<p>Hi Artisan,</p>

<p>In this post,i will apportion you how you can utilize and submit the form utilizing ajax with jquery validation in laravel 8. we can ajax submit form after validation in laravel 8. you can facilely laravel ajax form submit.</p>

more..

https://codingtracker.blogspot.com/2021/06/laravel-8-ajax-form-validation-tutorial.html
I'm moving to wordpress, here's why
Tags: wordpress
Published: 2021-06-04 08:20:37

For a while, I've write posts here. I share my work and programming stuff with you. But sometimes I feel wanna share other topics that not suitable to share here in dev.to. So I decided to move my blog to wordpress. Read more abot this movement on my post : http://blog.suryawiguna.com/2021/05/26/why-i-move-my-blog-from-dev-to-to-wordpress/
Get Network Security Strategies ($27.99 Value) for free
Tags: network, security, ebook, free
Published: 2021-06-04 08:05:06

With advanced cyber attacks severely impacting industry giants and the constantly evolving threat landscape, organizations are adopting complex systems to maintain robust and secure environments.
Network Security Strategies will help you get well-versed with the tools and techniques required to protect any network environment against modern cyber threats.

You’ll understand how to identify security vulnerabilities across the network and how to effectively use a variety of network security techniques and platforms. Next, the book will show you how to design a robust network that provides top-notch Read more.

https://go.kd.ms/r2GPRd
Kubernetes Pod DNS with Jobs not sharing a Pod
Tags: kubernetes, containers, docker
Published: 2021-06-04 07:52:18

---
title: Kubernetes Pod DNS with Jobs not sharing a Pod
published: true
description:
tags: kubernetes, containers, docker
//cover_image: https://direct_url_to_image.jpg
---

I use a feature on StackOverflow to send me a daily digest of questions asked about Kubernetes so I can remain aware of the sorts of things people are asking about, but also are running into organically in using it in production. 

Because I don't do this often where I intervene unless a question goes unanswered, I recently fielded a [question about DNS between Pods without using a `Service`](https://devops.stackexchange.com/questions/14050/how-to-connect-two-kubernetes-jobs-without-using-a-service/14069#14069).

Normally, when you create a `Service` in Kubernetes, you are, then, able to access the `Pod` resources that make up that service via DNS, i.e. `${your_service_name}.${namespace}.svc.cluster.local`.

However, `Service` resources can't be applied to all resources that use the `Pod` spec for definition (because `Pod` resources are the primitive that Kubernetes relies on for anything that requires--a set of- containers) like `Job` resources, as this user asked on StackOverflow.

You can read [my response](https://devops.stackexchange.com/questions/14050/how-to-connect-two-kubernetes-jobs-without-using-a-service/14069#14069), but to break it down a little bit:

Basically, when you define a `Job`, you're mostly asking the Kubernetes scheduler to manage the container lifecycle in a certain way-- a `Job` (or `CronJob`) is expected to exit upon completion, when this happens in a `Pod` (or something like a `Deployment` or `StatefulSet`) it is probably a little troubling (because this means something you expected to remain online is definitely down).

Normally, when two containers need to communicate, if the resource cannot be used as a backend to a `Service` (like a Load Balancer) and exposed with a DNS record, the solution is to create them in the same `Pod`, which a `Job` uses, and then the component containers are scheduled to the same `node` and thus all ports exposed are available via `localhost`. 

However, this user specifically could not (for unspecified reasons) do this, so the question becomes, how do I use `Service`-style DNS with `Pod` resources that are part of a `Job`:

In Kubernetes 1.20, a new feature in the `Pod` spec was revealed: `setHostnameAsFQDN` that, when set to `true`, would create a `Service`-style DNS entry like `pod-instance-1.default-subdomain.my-namespace.svc.cluster-domain.example`.

Because `Job` resources use the `Pod` spec, it's as simple as defining your `Job` to include this:

```yaml
apiVersion: batch/v1
kind: Job
metadata:
  name: pi
spec:
  template:
    spec:
      containers:
      - name: pi
...
      setHostnameAsFQDN: true
  backoffLimit: 4
```

which, as I reported in my answer, I tested to be working up through Kubernetes 1.21 (this is a beta feature in 1.20).
My first program in Elixir
Tags: elixir
Published: 2021-06-04 07:50:27

---
title: My first program in Elixir
published: true
description: 
tags: elixir
//cover_image: https://direct_url_to_image.jpg
---

10 มีนาคม 2562



I ported my program for showing concurrency from Erlang to Elixir. I guess this is still not Idiomatic Elixir. 😅

```elixir
defmodule Con1 do
  def log(p, i) when rem(i, 3000) == 0 do
    IO.puts "#{p} #{i}"
  end
  def log(_, _) do
    :ok
  end

  def cnt(_, 0) do
    :ok
  end
  def cnt(p, i) do
    log(p, i)
    cnt(p, i - 1)
  end

  def par_cnt(0) do
    :ok
  end
  def par_cnt(n) do
    spawn fn() -> cnt(n, 3000000) end
    par_cnt(n - 1)
  end
end
```
Concurrency in Crystal (lang)
Tags: concurrency, crystal, crystallang
Published: 2021-06-04 07:49:50

---
title: Concurrency in Crystal (lang)
published: true
description: 
tags: concurrency,crystal,crystallang
//cover_image: https://direct_url_to_image.jpg
---

7 มีนาคม 2562

[Crystal](http://crystal-lang.org/) intentionally looks similar to Ruby. However, Crystal is a static typing programming language. A Thai word segmentation program written in Crystal, which is a CPU bound program, was found almost as fast as one written in Go.

I wondered whether its concurrency support was like what I expected. So I did this experiment. By spawning, Crystal did not create any new thread because it doesn't support multithreading parallelism yet. To support concurrency, Crystal has to be able to switch fibers when a fiber performs non-blocking IO operation. 

```ruby
require "socket"

def load(id, chan)
  puts "ID=#{id}; START"
  (id..11).each do 
    socket = TCPSocket.new("www.ku.ac.th", 80)
    socket.close
  end
  puts "ID=#{id}; FINISH"
  chan.send nil
end

def main
  chan = Channel(Nil).new
  (1..10).each{|i| spawn(load(i,chan))}
  # Wait
  (1..10).each{chan.receive}
end

main 
```

In this program, a task with the id with a smaller number creates a TCP socket repeatedly more times than a task with a larger number id. For example task#1 establishes a TCP socket for 11 times and task#10 create a TCP socket for one time only. So even task#1 started long before task#10, task#10 should finish before task#1.

```
ID=1; START
ID=2; START
ID=3; START
ID=4; START
ID=5; START
ID=6; START
ID=7; START
ID=8; START
ID=9; START
ID=10; START
ID=10; FINISH
ID=9; FINISH
ID=8; FINISH
ID=7; FINISH
ID=6; FINISH
ID=5; FINISH
ID=4; FINISH
ID=3; FINISH
ID=2; FINISH
ID=1; FINISH
```


The result was that task#1 finished after task#10 although task#1 started before task#10, show that Crystal can switch tasks. And the important thing is the code looks like regular Ruby code, without async-await nor promise nor callback.
ลุงที่ใช้เป็นแต่ shell script พื้น ๆ และขี้เกียจเขียน Python เยอะ แต่ต้องมาเรียกโปรแกรมตัดคำ
Tags: nlp, thai, tokenization, management
Published: 2021-06-04 07:48:49

---
title: ลุงที่ใช้เป็นแต่ shell script พื้น ๆ และขี้เกียจเขียน Python เยอะ แต่ต้องมาเรียกโปรแกรมตัดคำ
published: true
description: 
tags: nlp,thai,tokenization,management
//cover_image: https://direct_url_to_image.jpg
---

18 มีนาคม 2562

ผมมักจะไปสร้าง script ด้วย Python สั้น ๆ ไว้ใน $HOME/bin หรือ /usr/local/bin ก็ได้ แล้วก็ chmod 755 <ชื่อไฟล์> แล้วก็จะได้เรียกจาก shell ได้เลย

ผมเขียนไว้ 3 ตัวตามนี้

## /usr/local/bin/deepcut

```python
#!/usr/bin/env python
# * mode: python-mode *

import deepcut
import json
import sys

for line in sys.stdin:
    line = line.strip()
    print(json.dumps(deepcut.tokenize(line)))
```

## /usr/local/bin/newmm

```python
#!/usr/bin/env python
# * mode: python-mode *

from pythainlp.tokenize import word_tokenize

import json
import sys

for line in sys.stdin:
    line = line.strip()
    print(json.dumps(word_tokenize(line ,engine='newmm')))
```

## /usr/local/bin/wordcutpy

```python
#!/usr/bin/env python
# * mode: python-mode *

from wordcut import Wordcut
import json
import sys

wordcut = Wordcut.bigthai()

for line in sys.stdin:
    line = line.strip()
    print(json.dumps(wordcut.tokenize(line)))
```

## เรียกใช้งาน 

ใน shell จะเรียกเดี่ยว ๆ ก็ได้แบบ

```
$ newmm < file1.txt > file1.ndjson
```

แต่ส่วนมากก็จะเรียกผ่าน for-loop เถื่อน ๆ แบบนี้

```
$ for x in *.txt; do newmm < $x > $x.ndjson; done
```

พอได้ไฟล์มาก็เอาไปใช้กับภาษาอื่นต่อได้

## /usr/local/bin/wcnt

```ruby
#!/usr/bin/env ruby
# * mode: ruby-mode *

require "json"
require "csv"

h = Hash.new(0)
while gets
  JSON.parse($_.chomp)
    .each{|w| h[w.chomp] += 1}
end
h.to_a.each{|row| puts CSV::generate_line(row)}
```

เวลาเรียกก็ไป pipe แบบนี้เลย

```
cat file1.txt | newmm | wcnt
```

เดี๋ยวนี้คนดี ๆ เขาคงใช้ Jupyter กันหมดแล้ว ผมก็พยายามฝึกอยู่เหมือนกัน แต่ยังไม่คล่อง บางทีก็เลยเอาแบบนี้ไปก่อน