teleren/devto huggingface dataset:
Dapper: Eseguire BULK Insert
Tags: dapper, coding, andreacarratta
Published: 2021-10-14 10:03:19

🛢️ Dapper: Eseguire BULK Insert

🤔 Vorresti inserire in maniera massiva una List<T> su Dapper?

Nel mio post di domenica avevo anticipato un contenuto legato al mondo Dapper ed eccolo -finalmente- qua da leggere. Immagino già le scene dei miei lettori disperati per ingannare l'attesa. Vero?

🔥 Arriviamo dritti al punto cruciale: il caso pratico! In uno sviluppo nel mese di luglio mi sono trovato nelle condizioni di dovere effettuare -teoricamente- un numero di INSERT elevato (circa 15k) ed eseguirne una alla volta era da pazzi.

➡️ Sfruttando una caratteristica di Dapper ho aggirato il problema delegando tutto a lui!

[Come? Per scoprirlo ti invito a leggere il post sul mio blog!](https://links.devandreacarratta.it/60LV)

Nel mentre sappiate che ho già pronti nella mia mente gli articoli per la prossima settimana. Devo solamente scriverli.

Happy coding!

#dapper #coding #andreacarratta
A boilerplate for fiber versioning
Tags: go, fiber, api, showdev
Published: 2021-10-14 10:02:28

---
title: A boilerplate for fiber versioning
published: true
description: A boilerplate for fiber, clean architecture, api versioning, data versioning
tags: #go #fiber #api #showdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7lm6evib0jwyoqdvc1d8.png
---
👋 Hello! I just created a boilerplate, clean architecture, API versioning, data versioning. Any feedback is welcome!

<p align="center">
  <img alt="demo" src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pqw6aagpv154xvl0lhm0.gif" />
</p>

## Features ✨
- API Versioning
- Data Versioning
- Dynamic Struct Type
- Clean Architecture
- Postman Collections
- API Documentation with swagger


## Project structure 📁
```
api
  ├── adapters
  │  └── mongo.go
  ├── app.go
  ├── handlers
  │  ├── errors.go
  │  ├── parser_body.go
  │  └── response.go
  ├── utilities
  │  ├── configuration.go
  │  └── converter.go
  └── versions
    ├── v1
    │  ├── entities
    │  ├── factories
    │  ├── repositories
    │  ├── routes
    │  └── usecases
    └── v2
        ├── entities
        ├── factories
        ├── repositories
        ├── routes
        └── usecases

```

#### Here is my GitHub link for this project: 
https://github.com/aofdev/fiber-versioning-boilerplate

Thank you for reading my post 😊
Thanks! Don't forget to give a ♥️ and follow :)
Tìm hiểu về xe nâng điện
Tags: xenangdien, xenangdiengiare, xenangdienchatluong, xenangdienchinhhang
Published: 2021-10-14 09:49:38

Đặc điểm cấu tạo xe nâng điện
<a href="https://duyphatforklift.vn/xe-nang-da-qua-su-dung/">Xe nâng điện</a> là một phương tiện máy móc hiện đại, có chức năng nâng đỡ và di chuyển hàng hóa. Nhìn chung, các dòng xe nâng điện đều sở hữu những cấu tạo cơ bản sau đây:

Khung nâng
Là bộ phận nâng đỡ toàn bộ khung xe và càng nâng. Khung nâng được chế tạo vô cùng chắc chắn, có khả năng chịu lực tốt để đảm bảo hiệu suất vận hành và sự an toàn cho người sử dụng. Đây cũng là nơi trang bị bình ac-quy để nạp nhiên liệu cho xe vận hành.

Giá nâng
Được chế tạo từ thép dày và vòng bi để đảm bảo khả năng chịu tải trọng, và giúp quá trình nâng hạ hàng hóa chính xác, không bị sai lệch.
Càng nâng
Là nơi trực tiếp tác động lên các pallet hàng hóa khi có nhu cầu nâng đỡ, di chuyển. Càng nâng được trang bị bộ phận cố định phần thanh đỡ đầu xy-lanh, để khi piston di chuyển lên trên sẽ kéo theo sự di chuyển đi lên của xy-lanh.

Đối trọng
Là bộ phận quan trọng, có chức năng giữ cho xe thăng bằng trong quá trình nâng, hạ hay di chuyển hàng hoá. Bình ac-quy của xe nâng điện được gắn ở phần sau xe để đảm bảo sự cân bằng

Mui xe
Được chế tạo từ kim loại, có chức năng bảo vệ, đảm bảo an toàn cho người điều khiển dưới những tác động từ bên ngoài.

2.6. Động cơ điện
Là hệ thống động cơ giúp xe nâng điện vận hành. Động cơ điện là một hệ thống mô tơ khép kín, được bố trí ở bên trong xe. Tùy thuộc vào mỗi dòng xe mà xe được trang bị loại động cơ điện cho cả 2 mục đích nâng và hạ hàng hóa, hay sử dụng từng loại động cơ cho từng mục đích sử dụng.

Hệ thống điều khiển
Vận hành thông qua các cảm biến từ và hệ thống các board mạch điều khiển bên trong.

Board mạch điều khiển
Chưa các chíp điện tử, có tác dụng truyền dẫn tín hiệu từ người lái đến các bộ phận của xe nâng điện. Board mạch điều khiển được gắn ở phần trong của xe.

Hệ thống bánh xe
Thường được chế tạo từ nhựa PU cao cấp hoặc cao su, tùy thuộc vào từng dòng xe nâng điện. Hệ thống bánh xe có thể phân chia thành các bánh tải và bánh lái riêng biệt hoặc đều là bánh tải, phụ thuộc vào từng model xe.
Nguồn: https://duyphatforklift.vn/xe-nang-dien-la-gi/
SwiftUI 5.5 API Data to List View
Tags: ios, programming, swift, swiftui
Published: 2021-10-14 09:49:07

Many times we need to make API calls to fetch data to display in a list. Here, I show how to do that with SwiftUI. To illustrate the structure of the application, let’s look at the following diagram:

![Flow](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mmkn3p0lze98utx1p6v1.png)

### The Todo APIService
We need to create an API service to send the network requests. We will use URLSession. Here we have one method to fetch all todo item and deserialise them to [TodoItem]

```swift
struct TodoItem: Identifiable, Codable {
    let id: Int
    let title: String
    let completed: Bool
}

enum APIError: Error{
    case invalidUrl, requestError, decodingError, statusNotOk
}

let BASE_URL: String = "https://jsonplaceholder.typicode.com"

struct APIService {
    
    func getTodos() async throws -> [TodoItem] {
        
        guard let url = URL(string:  "\(BASE_URL)/todos") else{
            throw APIError.invalidUrl
        }
        
        guard let (data, response) = try? await URLSession.shared.data(from: url) else{
            throw APIError.requestError
        }
        
        guard let response = response as? HTTPURLResponse, response.statusCode == 200 else{
            throw APIError.statusNotOk
        }
        
        guard let result = try? JSONDecoder().decode([TodoItem].self, from: data) else {
            throw APIError.decodingError
        }
        
        return result
    }
    
}
```

### The Todo ViewModel
The view model in turn uses the API Service to fetch todos to then publish

```swift
@MainActor
class TodoViewModel: ObservableObject {
       
    @Published var todos: [TodoItem] = []
    @Published var errorMessage = ""
    @Published var hasError = false
    

    func getTodos() async {
        guard let data = try?  await  APIService().getTodos() else {
            self.todos = []
            self.hasError = true
            self.errorMessage  = "Server Error"
            return
        }
        
        self.todos = data
        
    }
}
```

### The Todo View
Finally we have the view which watches the ViewModel for any todo list state changes. The todo list is display in the view. On list appear the view makes the api call.


```swift
struct TodoList: View {
    @StateObject var vm = TodoViewModel()
    
    var body: some View {
        List{
            ForEach(vm.todos){todo in
                HStack{
                    Image(systemName: todo.completed ? "checkmark.circle": "circle")
                        .foregroundColor(todo.completed ? .green : .red)
                    Text("\(todo.title)")
                }
            }
        }
        .task {
            await vm.getTodos()
        }
        .listStyle(PlainListStyle())
        .navigationTitle("Todos")
        
    }
}
```

![List View Screen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/itxmynq9tolhjmy5kuas.png)
for_each: Apply a function to a range of elements in C++
Tags: cpp, computerscience, programming
Published: 2021-10-14 08:45:17

There are times when we need to apply a function to a range of elements in the container and C++ provides us with a native way to do it. 

Let's first see it in action before going into details: 

```
std::vector<int> nums{1, 34, 23, 3, 18};

auto print = [](const int& n) { std::cout << " " << n; };
 
std::for_each(nums.begin(), nums.end(), print);
```

As you can see, we have used lambda expressions in the above example but we can also use function in the same place. Let me show it to you.

```

void printFunc(int &n) {
    std::cout<<n<<" ";
}

int main()
{
    std::vector<int> nums{1, 34, 23, 3, 18};
    std::for_each(nums.begin(), nums.end(), printFunc);
}
```

Makes sense, right? :grin:

<br/>

## Use:

Include the required header file in order to be able to use for_each function. You can either include bits/stdc++.h or include algorithm on the top of your .cpp file.

## Syntax: 

for_each(startIterator, endInterator, functionExpression);


## Parameters:

:point_right: startIterator - Starting address of the container.

:point_right: endIterator - Ending address (range up to which the elements would be examined)

:point_right: functionExpression - A function that would be applied to the members of the container in given range.

The signature of the function should be equivalent to the following:

` void fun(const Type &a); `

## Another example: 

Suppose, we want to get initials of name from a list of names, we can write a function to do it for a string and pass it to the third parameter to for_each. Although this can also be done by iterating through the container and applying the function to each element of container but this is a syntactic sugar on top of it.

```

void retrieveNameInitials(string &str) {
    istringstream ss(str);
    str = "";
    string word;
    while (ss >> word) 
        str += word[0];
}
 
int main()
{
    std::vector<string> names{"Rahul Singh", "Rohan Kumar", "Ayush Ratre", "John Doe"};
    std::for_each(names.begin(), names.end(), retrieveNameInitials);
    
    for(auto i:names) cout<<i<<" ";
}

// outputs: RS RK AR JD
```

If we want to apply the function to not all elements but some in the range, we can pass the addresses accordingly.

` for_each(container.begin() + 1, container.begin() + 5, functionExpression); `

The above line will apply the function to elements from position 1 to 4 (end address is not inclusive) in the container, given that second parameter doesn't exceed end of container.


For full reference and more examples, visit [here](https://en.cppreference.com/w/cpp/algorithm/for_each)

If you find anything wrong or if you know some more exciting functions or other stuff related to C++, please drop a comment below so we learn together.

My Profile -

[Github](https://github.com/satyam1203)
[LinkedIn](https://linkedin.com/in/satyam1203)
Concat Class Names
Tags: javascript, react
Published: 2021-10-14 08:12:27

---
title: Concat Class Names
published: true
description: A simple helper function to concat class names
tags: javascript, react
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dspnrtipk194wt8v6p0b.png
---
When I began to work with React I used to install and import [classnames](https://www.npmjs.com/package/classnames) in any project. But I found that a smaller and simple helper function is sufficient for all of my projects:


```javascript
// Javascript
export function concatClassNames(...args) {
  return args.filter(item => !!item).join(' ');
}

// TypeScript
export function concatClassNames(...args: Array<string|boolean|null|undefined>)
: string {
  return args.filter(item => !!item).join(' ');
}
```


Usage is a little different than classnames though. What I like is that it looks similar to conditionally including components in React.

```javascript
import { concatClassNames as cn } from 'helpers';
import { important, myClass } from './styles.module.css';

export function SomeComponent({ className, isImportant }) {
  return <div
    className={cn(className, myClass, isImportant && important)}
  >
    Hello World{isImportant && ' !!!'}
  </div>;
}
```

Feel free to use it in you projects and let me know what you think!
🆕 feature in the Luos release 2.0.0: embedded packages to simplify portability
Tags: opensource, embedded, luos, release
Published: 2021-10-14 08:02:42

🆕 New feature in the Luos release 2.0.0: Packages to simplify portability

Packages allow you to store your embedded code features on sharable folders. So you can move those easily from one project to another and share them with the community.

We have big plans for this feature so keep in touch... [more information about packages](https://docs.luos.io/pages/luos-technology/package/package.html)
Why You Should Build Apps With Django
Tags: python, django, webdev, programming
Published: 2021-10-14 07:44:00

Hello fellow developers and aspiring developers. This is a post about the Python Django Web Framework. One of the most popular fully featured Web development frameworks existing Today. I am gonna share with you why you should learn the python django framework, especially if you are just getting started into the programming field(web).

One of the most obvious reasons why you should learn the python django framework is because it is a python based framework. Meaning you will need to know the Python programming language. Python as a programming language is encouraged for begginer programmers because of it being a user friendly langauge. Most statements are even english like. 'not' and 'is' could be used instead of using operators with special characters. 

The second reason you should learn to use django is because it is free and Open Source. You dont have to really pay for anything, just like most frameworks

Third is the rich community that backs the django framework as a whole. Django is continually being contributed to by developers all around the world. So, it is not very difficult to find a solution to a problem incase you get stuck.

The Fourth Reason, my favourite, is the rich universe of libraries. Some are django specific while others are not. There is a library to do almost anything with django. Want to add Bootstrap CSS and Javascript, there is a library for that. Want to add Asycn functionality? there is one for that. Want to make a Geolocation App? You guessed right. Another cool thing is that you can use even non-django specific libraries to fulfill whatever you want to build.

The other thing, which will be the last thing for today is the fact that django is scalable and can handle heavy traffic. Well known sites and apps like instagram and spotify(The most popular music streaming platform in the world as of the time of writing this post) once used or is still using(atleast in their early stages) Django as part of their tech stack. You can choose one of the supported backend engines and databases such as MySQL, PostgreSQL(recommended for high traffic sites), Sqlite and more coming up in the near future. With this switchable configuration of backend engines, you don't really need to write complicated queries to work with the database of choice. Django takes care of that with its built in ORM(Object Relational Mapper), which is essentially composed of Python classes as database tables, and their attributes as their columns.
Have a nice one and checkout Django. Ohh and I almost forgot, django greatly reduces development time. You can build highly complex web apps within the shortest possible time and the fewest lines of code. So, head over to https://www.djangoproject.com/ and check out their documentation to get started.
If a software engineer marries with an ethical hacker, what would you expect from their children and family?
Tags: discuss, watercooler
Published: 2021-10-14 07:35:19

+ Would they speak programming languages everyday?
+ Built an end-to-end encrypted chat app for themselves?
+ Will their children be able to code since the age of 5?
+ Or even become feared by neighborhood because **"if you mess up with, we'll pwn your house!"**
Use jQuery in 2021
Published: 2021-10-14 07:26:49

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s4of4nnocl8q1vus0h88.png)
*jQuery* is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well as event handling, CSS animation, and Ajax. It is free, open-source software using the permissive MIT License. As of May 2019, jQuery is used by 73% of 10 million most popular websites. Web analysis indicates that it is the most widely deployed JavaScript library by a large margin, having at least 3 to 4 times more usage than any other JavaScript library.

The 5 free resources to learn jQuery are as follows:‍

#### **1\. Learn jQuery**

Official jQuery tutorial that covers everything related to the topic. It's free and constantly updated to match the latest version. The tutorial is for both entry-level and advanced-level developers. It covers everything jQuery-related and is a great reference to clear any doubts.

[More info](https://learn.jquery.com/about-jquery/)

#### **2\. jQuery Fundamentals**

jQuery Fundamentals is designed to get you comfortable working through common problems you'll be called upon to solve using jQuery. To get the most out of this site, you'll want to read the content and try the various interactive examples. Each chapter will cover a concept and give you a chance to try example code related to the concept.

[More info](http://jqfundamentals.com/)

#### **3\. jQuery tutorial Playlist**

YouTube playlist consisting of 200 videos that cover everything jQuery-related. Each video is 5--10 minutes long and very much engaging. Everything from basics to advanced is covered in this playlist.

[More info](https://www.youtube.com/playlist?list=PL6B08BAA57B5C7810)

#### **4\. jQuery Tutorial**

A well-organized tutorial that covers everything jQuery-related. Both beginners and advanced programmers can find this tutorial very well appealing. The tutorial provides code snippets, diagrams, and practice problems to understand the subject better.

[More info](https://www.tutorialrepublic.com/jquery-tutorial/)

#### **5\. AJAX made easy, with jQuery**

Coursework that lets users learn Asynchronous JavaScript and HTML(AJAX) with jQuery effectively. The coursework provides the users with videos, notes, and practice problems. Many people have found this coursework very helpful in learning jQuery and AJAX.

[More info](https://www.devsprout.io/jquery-ajax)

‍

*Originally posted at* [*raftlabs.co*](https://raftlabs.co/development/top-5-free-resources-to-learn-jquery?utm_source=devto&utm_campaign=crosspost)
An boilerplate for parcel v2.0.0
Tags: typescript, parcel, react, node
Published: 2021-10-14 07:12:23

Parcel just publish v2.0.0 version, I can't wait update my project from webpack to parcel. 

if you use typescript, react, and node.js to development backend service, this is a great boilerplate for you. try it:

https://github.com/suhaotian/parcel-starter
Bookmark Preview 🔖👁️ - Preview all the Bookmarked websites...
Tags: productivity, opensource, showdev, programming
Published: 2021-10-14 06:56:29


**To preview all the Bookmarked websites. 🔖👁️**

**Chrome Extension Link** - [Bookmark Preview](https://chrome.google.com/webstore/detail/cljdikggplippofppjfgdklikfoccije)

{% youtube lgOWfRisv_E %}

Mainly purpose of Bookmark Preview is to recall bookmarked websites.

👁️ Folder View (📁) and ListView (📄) option is present to easily preview websites.

👁️ Search the Bookmark, to filter the bookmark using the keyword.

👁️ Use the Prev and Next Option easy to preview previous and next bookmarked websites.

👁️ You can open the bookmarked website New tab.

👁️ Edit, Delete bookmarked.

👁️ Also, having added a new Folder and a new Bookmark.

### Screenshot
#### General
![Bookmark Preview 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vbosz02t89ys61zodsz4.png)

![Bookmark Preview 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dvfrt7mx27dekwdw20x2.png)

#### Search

Search the bookmark Name or Url

![Search](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3n78ucyleaootddz3fcw.png)

#### Edit/ Delete

Edit Bookmark Name or Url, Delete the Bookmark

![Edit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/68p42sncs5qv3hmg90te.png)

![Delete](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/67st56erf06b290242xs.png)

#### Add New Folder / Bookmark

![Add New Folder](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iuqab1tz0utewg8sp28f.png)
CSS Positioning
Tags: css, webdev, frontend, programming
Published: 2021-10-14 06:47:38

In CSS Positioning of elements is very important topic. CSS having five type of Positioning method

*1. static*
*2. relative*
*3. fixid*
*4. absolute*
*5. sticky*

**Static**
1. default form of HTML
2. Do not have any specific styling
3. We can not use *top, bottom, left, right* with static positioning

![Link](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/skpxwx2f58cf0li2ggqs.png)

**relative**
1. Give affect relative to its normal position.
2. Normally No element can occupy its position.
![CSS relative property Demonstration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1fr62dtet46o0929d7eg.png)

**Fixed**
1. give affect relative to view port.
2. It always occupy the same place unless page is scroll.
3. top, bottom, left, right can be used with it
4. Normally other element occupy blank space which it left

![CSS Fixed property Demonstration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xs6xnzpbsvyr9d0drtkb.png)

**Absolute**
1. relative to the nearest positioned ancestor(instead of positioned relative to the viewport, like fixed).
2. It move along the scroll
3. if there are no ancestor exits it used document body
3. space left by element is fulfilled by another element.

![CSS Absolute Property Demonstration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dp465aeh18bvjt280daf.png)

**Sticky**
1. position based on the scroll
2. element toggle between relative and fixed
3. Element perform like relative property until viewport does not match then perform as fixed

![CSS Absolute Property Demonstration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x42jv6cfsp9ulskdb7w7.png)

All the positioning property is applied as:

.className or #Id or tag {
   positon: ProperyName; fixed);
}
PropertyName: static OR relative OR absolute OR sticky

Thanks for Reading...                                
By Tech 9-on
Payment Applications 101: What are Payment Applications?
Tags: javascript, docker, python, discuss
Published: 2021-10-14 06:38:02

 ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sp1lmuo34n5fu5bouy7u.png)
 
What are payment applications? Given 5 minutes to explain payment applications in your own words, what would you say?
Embracing Infinite Loops with Ruby and Polyphony
Tags: ruby, concurrency, polyphony
Published: 2021-10-14 06:24:22

---
title: Embracing Infinite Loops with Ruby and Polyphony
published: true
description: 
tags: ruby, concurrency, polyphony
//cover_image: https://direct_url_to_image.jpg
---
Infinite loops are great for expressing long-running concurrent operations. In [this article](https://noteflakes.com/articles/2021-10-14-embracing-infinite-loops) I’ll discuss the use of infinite loops as a major construct when writing concurrent apps in Ruby using [Polyphony](https://github.com/digital-fabric/polyphony). I’ll show how infinite loops differ from normal, finite ones; how they can be used to express long-running tasks in a concurrent environment; and how they can be stopped. [Read it now!](https://noteflakes.com/articles/2021-10-14-embracing-infinite-loops)