teleren/devto huggingface dataset:
Apiary API 規格文件 假接口一次到位
Tags: apiary, api
Published: 2021-12-14 16:27:14

[Apiary](https://apiary.io/) 是個讓我們撰寫 API 規格的服務，但不僅如此，依照 Apiary 特有的 Markdown 語法寫下的 API 規格文件，Apiary 會根據規格文件幫我們產出文件與假資料的接口，本文介紹一下它的一些特色。

## 費用方案

在入坑前一定要先了解他的費用，避免愛上後難以自拔。

Apiary 目前有免費與收費的方案，在它的網站上可以查到[每個方案的差異](https://apiary.io/plans)，不過必須特別提醒的是，Apiary 已經被甲骨文收購，並併入台灣沒什麼人用的 Oracle Cloud 產品線內，未來會不會依舊保持獨立的服務是有疑問的，另外就是甲骨文一貫的…作風，如果對甲骨文特別有疑慮的請自行斟酌使用。

## Apiary

回歸正題，Apiary 解決了我們以往在開發 API 時的痛點：

* 規格文件先寫出來，但 API 還沒有完工，導致無法測試，只能先略過或是假裝 API 是好的來做測試，簡稱瞎測。
* API 已經寫了，但沒空寫文件，導致串接參數像秘方一樣只能靠口耳相傳，比較邊緣的同事就難以實做串接，最後因為文件一直與實做脫節，導致產品難以維護。
* 有 API 也有文件，但不知道為何就是串不起來，不確定 API 寫錯還是文件寫錯，總之難免有錯。

{% youtube iq1pm_g7RWs %}

## API Blueprint

前面提到過在 Apiary 撰寫文件必須使用它特規的 Markdown 語法，這種 Markdown 的變體有自己的名字 [API Blueprint](https://apiblueprint.org/)。

API Blueprint 的語法以 Markdown 為基礎，只是加了一些為 API 文件需求而生的語法格式。

API Blueprint 有兩種型式，一種用於定義資料結構，例：

```Markdown
# Data Structures
## Blog Post (object)
+ id: 42 (number, required)
+ text: Hello World (string)
+ author (Author) - Author of the blog post.

## Author (object)
+ name: Boba Fett
+ email: fett@intergalactic.com
```

應該可以望文生義。

有了資料結構後，就可以把前面定義的資料結構用於 API 定義文件內，例：

```Markdown
# Blog Posts [/posts]
## Retrieve All Posts [GET]
+ Response 200 (application/json)
    + Attributes (array[Blog Post])
```

API Blueprint 的語法相較於另一派的 XML 或 JSON 都更簡單。

## 規格文件與假接口

用 API Blueprint 寫好定義文件後，Apiary 會依照文件內的定義，產生出 API 文件與假接口，具體範例可以參考這份官方範例 [Sample API Documentation](https://pandurangpatil.docs.apiary.io/)，裡面所有的 API 接口都是可以被使用的。

## 其它值得一提的功能

除了文件與接口外，另外值得一提的是 Apiary 支援 GitHub Sync，我們可以把 API 定義文件也放到程式專案資料夾內，享受版控的好處，同時透過 GitHub Sync 的機制，每次提交都會觸發 Apiary 也把發布的規格文件更新，好棒棒。

## 參考資料

- [[apiary][01] 設計 API 時好用的工具 - 讓前後端溝通格式不再卡卡 - 概念介紹篇](https://blog.alantsai.net/posts/2019/03/apiary-why-user-apiary-different-document-api-format-makes-back-and-front-communicate-easier)
Chinh Chu Net Worth
Published: 2021-12-14 16:13:25

[Chinh Chu's net worth](https://expresstech.info/chinh-chu-net-worth/) is estimated at $ 1.1 billion. Senior CEO and Co-Chairman of the Blackstone Group, which he joined in 1990. Chu has led the following largest private equity transactions: the purchase of the water treatment and chemicals company Nalco from the conglomerate French Suez for more than $ 4 billion; the takeover of Celanese, a German chemicals company, for 3.8 billion dollars; and the ongoing acquisition of SunGard, a $ 11.7 billion transaction. distinction from the School of Management in 1988.He first worked at Salomon Brothers for two years, his first step towards Chinh Chu's net worth.

 He is originally from Vietnam but was forced to leave his country with his four brothers, mother and grandmother in 1975. They moved to Hawaii, where Chu's father had studied medicine but eventually moved to Queens. , NY. From an early age, Chu read books on economics and entrepreneurship in his spare time that fascinated him in the world of finance.

The monolithic Trump World Tower on First Avenue, the 34-room, 14,864-square-foot, 12-bedroom, 16.5-bath, duplex penthouse apartment. Blackstone chairman Chu Chinh, a master of corporate capital, bought the tower several years ago, where the 89th and mid-90s were occupied by Chu and his family. 

The couple used their private jet for vacation and charity work. In the photos, the couple spent several days in Milan, Italy, then flew to Monaco, France. 

The main objective of the Ha Phuong Foundation and Vietnam Relief Effort is to do humanitarian works, in general it is to help the poor and the miserable, the miserable, the handicapped and those who live in a bad situation. The difference between these two foundations is that the Ha Phuong Foundation is mainly aimed at providing extreme support and care for those who wish to become artists or any unhappy and disabled artist who needs help. In addition, the Ha Phuong Foundation provides and supports those who are self-sufficient and lacking in resources but who wish to improve their lives.
Detecting counterfactual text with Hugging Face
Tags: transformers, datascience, deeplearning, nlp
Published: 2021-12-16 16:07:05

---
title: Detecting counterfactual text with Hugging Face
published: true
date: 2021-12-14 16:13:16 UTC
tags: transformers,datascience,deeplearning,nlp
canonical_url: https://julsimon.medium.com/detecting-counterfactual-text-with-hugging-face-e9a293c7d99d
---

In this video, I start from an Amazon research paper and its companion dataset for detection of counterfactual text. Using the [Hugging Face](https://huggingface.co) open source libraries, I use the reproduce the training job described in the paper, and I compare my metrics to the ones reported in the paper.

Did I do better? Watch this video to find out :)

{% youtube g3QXiZ7BtOY %}

⭐️⭐️⭐️ Don’t forget to subscribe to be notified of future videos ⭐️⭐️⭐️

Article: [https://www.amazon.science/publications/i-wish-i-would-have-loved-this-one-but-i-didnt-a-multilingual-dataset-for-counterfactual-detection-in-product-reviews](https://www.amazon.science/publications/i-wish-i-would-have-loved-this-one-but-i-didnt-a-multilingual-dataset-for-counterfactual-detection-in-product-reviews)

Dataset: [https://github.com/amazon-research/amazon-multilingual-counterfactual-dataset](https://github.com/amazon-research/amazon-multilingual-counterfactual-dataset)

Notebook: [https://gitlab.com/juliensimon/huggingface-demos/-/tree/main/counterfactual-detection](https://gitlab.com/juliensimon/huggingface-demos/-/tree/main/counterfactual-detection)

New to Transformers? Check out the Hugging Face course at [https://huggingface.co/course](https://huggingface.co/course)
Evaluation Of KineMaster, and How Does It Work?
Tags: kinemaster, kinemasterprimeapk
Published: 2021-12-14 16:11:48

[KineMaster Prime APK](https://kinemaster.tools/) allows you to watch movies without having to pay anything.

KineMaster, an Android video editor/animator that supports a wide range of functions, is KineMaster.

The KineMaster Free Apk has a limited number of functions. There are also some drawbacks like a watermark or limited video editing.

Download KineMaster's Pro Version to avoid all of these flaws. However, it is not completely free. Users must upgrade to the pro version in order to unlock the locked features.

Most users cannot afford to purchase the paid apps. They must have access to the editing tasks to be able to complete them. This is where KineMaster Prime Mod APK comes in.

Mod versions don't cost anything, but you get all the premium features free of charge. These versions are sometimes referred to as "cracked" versions.

[KineMaster Prime APK Download](https://apkmodroid.com/kinemaster-prime-apk-download/) includes a host of features for free, including no watermark in the final video and access to many video editing tools. We have more information about KineMaster Pro.

KineMaster can be used completely free of charge, but a KineMaster premium subscription unlocks more features. KineMaster subscriptions remove the watermark and provide an ad-free experience. To learn more, tap the crown button at the top of the screen.

Find out why KineMaster is loved by artists for YouTube, TikTok and Instagram. It's also loved by journalists, educators and marketers who use it professionally. Make beautiful [videos](https://apkpure.com/kinemaster-video-editor/com.nexstreaming.app.kinemasterfree) with KineMaster and share them all over the internet!
New Version of The Bauhaus Art Geometric Patterns Kit V002
Tags: figma, geometricpatterns, design, ux
Published: 2021-12-14 16:09:39

We are very excited to disclose the new version of the Bauhaus Art Geometric Patterns Kit V002!

Designers have a broad spectrum of options for creating geometric patterns. Bauhaus Art is one system that lets you easily create colourful geometric patterns in web or graphic design projects with Figma, which allows you to select the tiles and add your own colours. The kit contains more than 100 unique patterns and is extremely easy to use. There's no need to install software or export individual PNG files in different sizes because they are all pre-rendered.

This release adds many new features, including rethought components and new tiles. As usual, we've simplified the export process so that you can instantly use your designs in your favourite design application.

To find out more about Bauhaus Art Geometric Patterns Kit V002, visit the [product page](https://hotsnow.fi/geometricpatternconstructor).

What's new: we changed the structure, so the elements now are listed as components, so it's handier to select using thumbnails when you drag them into your design. The components are also sorted by categories. Also, we added a new type of element called "Ornaments" - the features that can be used for accent or as a small detail in the design.

We added more elements to the kit, so it now contains over 100 components. Enjoy! The most important thing for us is your feedback, so if you like it, please leave a review.

We will be thankful for any comments or recommendations!
1 line of code: How to create an URL Slug from a string
Tags: javascript, webdev, productivity, codequality
Published: 2021-12-14 15:58:11

```javascript
 const toURLSlug = str => str.trim().toLowerCase().replace(/[\[\]?.,\/#!$%\^&\*;:{}=\"\-_~()…–—·'’\s]/g, "-").replace(/[\-]{2,}/g, "-").replace(/^[\-]/g, "").replace(/[\-]$/g, "");
```
Returns the a new string as an URL slug.

Uses space, dot, underscore, dash as delimiters as well as punctation marks. Leading and trailing "-" will be removes .

--

Please note that it's optimised for the standard latin alphabet. While unicode characters are allowed and valid in URL-slugs, they are resolved to their unicode equivalent and thus the URL is not nicely formatted anymore.

---

## The repository & npm package

You can find the all the utility functions from this series at [github.com/martinkr/onelinecode](https://github.com/martinkr/onelinecode)
The library is also published to [npm as @onelinecode](https://www.npmjs.com/package/@onelinecode/onelinecode) for your convenience.

The code and the npm package will be updated every time I publish a new article.

---

Follow me on [Twitter: @martinkr](http://twitter.com/_martinkr) and consider to [buy me a coffee](https://www.buymeacoffee.com/martinkr)

Photo by [zoo_monkey](https://unsplash.com/@zoo_monkey) on [Unsplash](https://unsplash.com/s/photos/fuji)

---

[![Subscribe to the weekly modern frontend development newsletter](https://modernfrontend.dev/banner/banner_583-111.png)](https://modernfrontend.dev/)

---
How to Represent and Query Hierarchical Data in SQL
Tags: database, datascience, sql, webdev
Published: 2021-12-14 15:54:47

A tutorial on how to build and query a hierarchical table using a relational database.

Given its flat nature, a relational database is not suitable to represent hierarchical data. However, thanks to some tricks, you can transform a relational database into good storage for hierarchical data.

In this article, I cover the following topics:

* definition of hierarchical data
* how to convert hierarchical data into a relational table
* how to query a hierarchical table

## 1 Definition of Hierarchical Data
Hierarchical Data is a data structure where items are related to each other in a parent/child relationship. The following figure shows an example of hierarchical data:

At the first level, there is a parent class, called Animal, which is the father (or root) of all the other classes. Then, at the second level, there are three children, Mammal, Bird, and Fish, all at the same level. Finally, there is a third level, with all the single species (e.g. Cat, Dog, and Lion for Mammal).

Looking at the previous figure, we can say that Mammal, Bird, and Fish are brothers, while Cat, Pheasant, and Shark are cousins.

Hierarchical Data is well represented by a tree, thus a graph database could be the best solution to represent it. Alternative solutions, such as NoSQL databases also could fit, as described in this Stackoverflow thread.

Anyway, a relational database also could be exploited to store hierarchical data. In the remainder of the article, I describe how to do it.

## 2 Converting Hierarchical Data into a Relational Table
To convert a hierarchical data structure into a relational table, different strategies could be adopted. In this article, I describe two methodologies:

* Adjacency List Model
* Nested Set Model

### 2.1 Adjacency List Model
In the Adjacency List Model each item stores a pointer to its parent. Practically, a new attribute, describing the level in the hierarchy, should be added to the classical data properties. Let us see an example, to understand what I mean.

I suppose to have the previous Animal structure, with three levels of hierarchy. I also suppose that for each animal, the following attributes are available:
* name
* description

Thus, I can build the following schema for the table Animals:
`Animals(animal_id,name,description,parent_id)`

where parent represents the previous level in the hierarchy. As a result, I could produce the following table:

Continue Reading on [Medium](https://alod83.medium.com/how-to-represent-and-query-hierarchical-data-in-sql-69b6b77577e8)
How to Measure JavaScript Execution Time
Tags: javascript, webdev, beginners, tutorial
Published: 2021-12-14 15:53:51

When it comes to the performance of applications, measuring performance becomes important. For anything to be optimized, it must be measured first, optimized, and measured again to capture gains. Measuring JavaScript execution time thus becomes one of these steps.

Modern browsers and the Node.js platform provide various APIs to measure code execution time.

We will be discussing a few ways of measuring JavaScript execution time in this post.

## 1. Date object

The easiest way to track execution time is to use a date object. Using Date.now() that returns the total number of milliseconds elapsed since the Unix epoch, we can store the value before and after the execution of the function to be measured and then get the difference of the two.

    const start = Date.now();
     
    await functionToBeMeasured();

    const end = Date.now();
    console.log(`Execution time: ${end - start} ms`);

## 2. Console time

Another easy solution is to use a console timer. The console.time() method starts a timer with a label. And a subsequent call to the console.timeEnd() method with the same label will output the time elapsed since the method was started.

    console.time('Execution Time');
     
    await functionToBeMeasured();

    console.timeEnd('Execution Time');

## 3. Performance timers

Console timers do not provide high accuracy. If we want accuracy in 1-millisecond increments, we can use high-resolution timers like performance.now(). It also avoids some synchronization issues with the system clock.

    const start = performance.now();
     
    await functionToBeMeasured();

    const end = performance.now();
    console.log(`Execution time: ${end - start} ms`);

**Note:** If measuring in Node, process.hrtime.bigint() returns accuracy in nanoseconds.

This covers the ways of measuring JavaScript execution time. If we run into a scenario wherein we want to start measuring JavaScript execution time for multiple functions, we can make use of the Performance API and [Performance Observer](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver). They provide markers to track multiple entries and measure them independently.

## Measuring JavaScript execution time in Unit tests

For ensuring the execution of functions is fast enough, it can be made a part of our unit tests. Many frameworks (Jest, Jasmine, etc.) allow setting of a timeout for the execution of a test. The timeout feature can then be used to fail a test if the method takes longer to execute.

With Jasmine:

    describe('testing time duration', () => {
      it('does not take longer than 5 seconds', async () => {
        await functionToBeMeasured();
      }, 5000);
    });

*Originally published at [https://www.wisdomgeek.com](https://www.wisdomgeek.com/development/web-development/javascript/measuring-javascript-execution-time/) on July 1, 2021.*
My first post for developers
Published: 2021-12-14 15:38:13

I thought this can be a best place to reach-out developers to share my initiative :) 

I have created few [resume HTML templates](https://designstub.com) for developers to showcase their portfolio. I agree Developers should be focused more on development rather designing beautiful graphics. therefore I took some effort and create something beautiful to showcase those works.

Let me know if my effort make sense :)

Thanks
Andy
What is AWS RDS (Relational Database Services)
Tags: aws, rds, awsrds, cloudcomputing
Published: 2021-12-14 14:58:00

## What is AWS?
Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform, offering over 200 fully-featured services from data centers globally. Millions of customers—including the fastest-growing startups, largest enterprises, and leading government agencies—are using AWS to lower costs, become more agile, and innovate faster.


## What is Amazon RDS?
Amazon Relational Database Service (RDS) is a managed SQL database service provided by Amazon Web Services (AWS). Amazon RDS supports an array of database engines to store and organize data. It also helps with relational database management tasks, such as data migration, backup, recovery, and patching.

`Here is a full dedicated video on AWS RDS (Relational Database Services)👇👇`
[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/47jmhuqtil02sc2rv82d.png)](https://www.youtube.com/watch?v=EO8BZ2Vjw90)

Amazon RDS facilitates the deployment and maintenance of relational databases in the cloud. A cloud administrator uses Amazon RDS to set up, operate, manage and scale a relational instance of a cloud database. Amazon RDS is not itself a database; it is a service used to manage relational databases.

## What are the benefits of AWS RDS?
The main benefit of Amazon RDS is that it helps organizations deal with the complexity of managing large relational databases. Other benefits include the following:

- Ease of use. Admins don't need to learn specific database management tools. They also can manage multiple database instances using the management console. RDS is compatible with database engines that users may already be familiar with, such as MySQL and Oracle And it automates manual backup and recovery processes.
- Cost-effectiveness. According to AWS, customers only pay for what they use. Also, the time spent maintaining instances is reduced, because maintenance tasks, such as backups and patching, are automated.
- The use of read replicas routes read-heavy traffic away from the main database instance, reducing the workload on that one instance.
- RDS splits up compute and storage so admins can scale them independently.

---
▬▬▬▬▬▬ WANT TO LEARN MORE? ▬▬▬▬▬▬
Full Terraform tutorial ► [https://bit.ly/2GwK8V2](https://bit.ly/2GwK8V2)
DevOps Tools, like Ansible ► [https://bit.ly/3iASHuP](https://bit.ly/3iASHuP)
Docker Tutorial ► [https://bit.ly/3iAT9Jx](https://bit.ly/3iAT9Jx)
AWS Tutorial ► [https://bit.ly/3iAT9Jx](https://bit.ly/3iAT9Jx)
GCP Tutorial ► [https://bit.ly/3mwh412](https://bit.ly/3mwh412)
Jenkins Tutorials ► [https://bit.ly/3iHnfv4](https://bit.ly/3iHnfv4)
My Three Darlings
Published: 2021-12-14 15:20:55

Eliza's life was destroyed by them: her boyfriend and her best friend.
Five years ago, her boyfriend's career was at its lowest point and Eliza sacrificed everything to support him. However, her best friend fooled Eliza to be a surrogate mother. When her boyfriend led a successful career, he dumped Eliza because she had lost her virginity and had babies. It was just an excuse for the affair between the shameless couple.
Losing all interest in life, she agreed to marry Mr. Valentine, a disfigured billionaire who likes to torture women in bed. It was said that his two exes died horribly in bed.
Eliza didn't know that Mr. Valentine was the man she used to carry babies for. In this way, she got a handsome husband and a pair of adorable twins.
[Billionaire/Millionaire](https://www.novel-cat.com/bookDetail/17069606820/about/MyThreeDarlings),One-night Stand,
Make Voxel Chicky Bounce Call To Action
Tags: codepen, javascript, showdev, webdev
Published: 2021-12-14 15:16:13

<h1>Make Voxel Chicky Bounce Call To Action</h1>

<h2>Description</h2>

<p>A call-to-action microinteraction, and animation of bouncing  voxel model using GSAP and ThreeJS.</p>

<p>This layout is designed for full-page view of mobile devices. Though it will also look good on computer devices I believe.</p>

<p>I tried to make the squishing animation by playing on the GSAP timeline.</p>

<p>I created the Voxel model months ago using MagicaVoxel. The reference I used for this is also a 3D model (Using HTML and CSS) I created years ago.</p>

<p>See <a href="https://codepen.io/takaneichinose/pen/zgrovE">Chick in 3D Pixel World (No Javascript)</a></p>

<h2>Resources</h2>

<h3>JavaScript Library</h3>

<p><a href="https://greensock.com">GreenSock</a></p>

<p><a href="https://threejs.org">ThreeJS</a></p>

<h3>Modelling Tool</h3>

<p><a href="https://ephtracy.github.io">MagicaVoxel</a></p>

<h3>Fonts</h3>

<p><a href="https://fonts.google.com/specimen/Luckiest+Guy">Luckiest Guy</a></p>

<p><a href="https://fonts.google.com/specimen/Rubik">Rubik</a></p>

{% codepen https://codepen.io/takaneichinose/pen/JjrEOON %}
First Post
Tags: hello, welcome, hi
Published: 2021-12-14 15:03:49

Hi around, here is my first post, have a fly to my [website](https://www.cgifl300.com/).

![A dog in the snow, faceview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0k5u9j3iq8afo38obst3.jpg)
What is AWS S3 Intelligent-Tiering?
Tags: aws, s3, awss3, cloudcomputing
Published: 2021-12-14 15:03:18

## What is AWS S3 Intelligent-Tiering
S3 Intelligent-Tiering is an Amazon S3 storage class that analyzes an AWS user's stored data and automatically moves it between storage tiers based on usage frequency. It is designed to optimize storage costs for data with irregular or unknown access patterns.

`Here is a full Demonstration video on AWS S3 Intelligent-Tiering👇`
[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4m0c8q5lfc5z3mlc806j.png)](https://www.youtube.com/watch?v=KYqgBIIuilo)

## S3 Intelligent-Tiering features
A user can access S3 Intelligent-Tiering through the AWS Management Console, command-line interface, or S3 API. He or she can select this storage class when data is uploaded to S3, or move existing data into this class from another class. Lifecycle rules can also be established to transition data to another storage class, such as Amazon S3 Glacier, after a designated period.
The service monitors and predicts user behavior to determine the tier in which it will store data. Those predictions are the output of machine learning algorithms AWS built to analyze data traffic patterns across the trillions of objects stored in S3.
S3 Intelligent-Tiering is one of several S3 storage options designed around accessibility demands. S3 Intelligent-Tiering is not recommended for a user who knows data access patterns well.

---

▬▬▬▬▬▬ WANT TO LEARN MORE? ▬▬▬▬▬▬
Full Terraform tutorial ► [https://bit.ly/2GwK8V2](https://bit.ly/2GwK8V2)
DevOps Tools, like Ansible ► [https://bit.ly/3iASHuP](https://bit.ly/3iASHuP)
Docker Tutorial ► [https://bit.ly/3iAT9Jx](https://bit.ly/3iAT9Jx)
AWS Tutorial ► [https://bit.ly/3iAT9Jx](https://bit.ly/3iAT9Jx)
GCP Tutorial ► [https://bit.ly/3mwh412](https://bit.ly/3mwh412)
Jenkins Tutorials ► [https://bit.ly/3iHnfv4](https://bit.ly/3iHnfv4)