teleren/devto huggingface dataset:
No ios Device to Run/Test App 
Tags: xamarin, ios, testing, android
Published: 2021-10-22 08:16:05

Hi all, I'm looking to develop an application in Visual Studio Xamarin for both android and ios. I'm an android user (nothing against ios as I've used it in the past) and have nothing that uses ios to be able to test the application or a Mac to simulate an ios device.

Is there a way around this? For example a VM running ios to act as a Mac? Or anything else?

I have looked at buying an ios device but can't afford to do that right now.

Thank you in advance.
Agen Deposit Pulsa 
Tags: gamedev, javascript, programming, tutorial
Published: 2021-10-22 08:03:52

Berbagai macam game slot online telah ada dan hadir untuk para penggemar game tersebut yang kerap disapa dengan sebutan sloter mania yang gemar memainkan game tersebut dimanapun dan kapanpun juga.

Banyak provider terkemuka di seluruh belahan dunia ini mengaplikasikan game slot mesin besutan mereka menjadi sebuah aplikasi yang dapat dimainkan dengan mudah dan gampang hanya dengan menggunakan ponsel pintar saja dengan akses internet yang memadai.

Bayangkan saja sobat sekalian sudah bisa berbagai jenis game slot online seperti provider Slot Pragmatic, Joker 123, Habanero, PG SOFT, Soft Play dan masih banyak lagi lainnya hanya dengan menggunakan satu id game saja.

Sobat sekalian tentu bertanya-tanya dimanakah tempat yang bisa memainkan game tersebut ? jawabannya tentu saja hanya di game SlotCR7 yang merupakan agen <a href="https://medium.com/@slotcr7/agen-deposit-slot-pulsa-tanpa-potongan-26df3d23a628" >Slot Deposit Pulsa</a> tanpa potongan minimal depo 10 ribu saja.

Hanya dengan melakukan minimal deposit 10 ribu saja sobat sekalian sudah dan bisa berkesempatan untuk memenangkan berbagai hadiah menarik dan bonus yang diberikan hingga hadiah jackpot kecil dan besar yang bisa mencapai hingga ratusan juta rupiah.

Buruan daftar dan bergabung segera di SlotCR7 yang sudah terbukti sebagai salah satu agen slot online aman dan terpercaya di seluruh negeri Indonesia.
Create an underline animation in CSS !
Tags: css, animation, tutorial
Published: 2021-10-22 07:22:06

Hey **fellow creators**,

Let's learn how to create an easy but impactful *underline animation* in CSS so that your links look cooler!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7ppg186dpmrvswfsrjm.gif)
If you prefer to watch the video **version**, it's right here :
{%youtube 8U6x-pDTguU%}

##1. The HTML Structure.
You only need to add a title to your body.

```html
<body>
	<h1>Animation</h1>
</body>
```


##2. Style the title.

Start by choosing whichever font you want for your body. I'll use Arial here.

```css
body {
	font-family: Arial, Helvetica, sans-serif;
}
```

Then, center the title in the middle of the page and style it a bit.

```css
h1 {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 80px;
	cursor: pointer;
}
```


![Inspecter on Chrome](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nil3z08o00k8vz1xibkg.png)

##3. Time to animate it!
The animation will run with the pseudo-element after.

```css
h1::after{
	content: "";
	display: block;
	position: absolute;
	width: 100%;
	height: 3px;
	background: #000;
	transition: transform 0.2s ease-in-out;
	transform: scale(0);
}
```

To trigger the animation, you need to hover over the title. So, once you do (with "h1:hover"), the animation will happen ("::after"), like so:

```css
h1:hover::after{
	transform: scale(1);
}
```

(You can also replace "scale" with "scaleX", but it will only provoke a minor difference.)

**You're done.** And yes, it's *that* easy!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7ppg186dpmrvswfsrjm.gif)

This is a nice animation to use on links for instance, because it will allow users to understand that it's a link.

Check out my **Youtube channel**: https://www.youtube.com/c/TheWebSchool


Enzo.
Add WebSockets to Express
Tags: javascript, typescript, websockets
Published: 2021-10-22 07:20:10


Most folks these days use the ws package.

The steps are simple. Hook into your express app, do not allow `ws` to create its own server, pick a path. Handle the "upgrade" event that is the protocol negotiating to go beyond simple HTTP.


```typescript
import express from "express"
import cookieParser from "cookie-parser"
import * as WebSocket from 'ws';

const app = express()
app.use(express.json())
app.use(cookieParser())

// all your normal routes
app.post("/refresh-token", issueRefreshToken)
app.post("/delete-token", deleteRefreshToken)

// and now the magic
const websocketServer = new WebSocket.Server({
  noServer: true,
  path: "/echo"
})
server.on("upgrade", (request, socket, head) => {
  websocketServer.handleUpgrade(request, socket, head, (websocket) => {
    websocketServer.emit("connection", websocket, request)
  })
})

websocketServer.on('connection', (ws: WebSocket) => {

  //connection is up, let's add a simple simple event
  ws.on('message', (message: string) => {
    websocketServer.clients.forEach((client) => {
      client.send(`${message}`)
    })

    //log the received message and send it back to the client
    console.log('received: %s', message);
    ws.send(`Hello, you sent -> ${message}`);
  });

  ws.send('Hi there, I am a WebSocket server');
});

```

This creates an echo server that broadcasts whatever it receives to each connected client.

To test this, wscat works well.

```
yarn global add wscat
```

Then do this in two separate terminals:
```
wscat -c 'ws://localhost/echo'
```

Type in one, and you should immediately see it in the other.
Stepping into the real open source by first contribution
Tags: firstcontribution, opensource, github
Published: 2021-10-22 07:19:19

Through Github, I contributed to correcting typos in the open-source world for the first time!

## what was the project about?
The name of the project is [TDEngine](https://github.com/taosdata/TDengine). [TDEngine](https://github.com/taosdata/TDengine) is mostly written with C and python and it is an open-source big data platform that helps devices that need big data such as IoT, Connected Cars, Application Monitoring, etc.

## what are the steps for solving [the issue](https://github.com/taosdata/TDengine/issues/8297 "the issue")?
**First of all**, I commented on the issue page,
asking if I can be assigned this issue.

**Next**, Once I got the answer from the contributor, I forked it and git-cloned it. And then, I looked for the exact file I needed to fix for this issue.

**Finally**, I found the file and it was about a message typo as it was mentioned at the issue. It should be "press," but it was "presss" with an extra "s".  
```c
printf("presss any key to exit\n");
```
So, I fixed that part very quickly and fast.

## what did I learn from this?
I haven't learned much about this issue in terms of programming. But obviously, this contribution informed me about the world of open source. It has helped ease fear by revealing that all issues are not as tricky as I expected but as easy as I did not expect. Also, communicating with a contributor or maintainer was a new experience for me. Although solving this issue was not a difficult task, I was amazed by the contributor's thank-you, and souvenirs offer. I was satisfied and fulfilled to think that I had helped someone and some project. Although not all issues are this easy, I believe that my contribution through this issue will serve as a good stepping stone for future open source contributions for.

**My pull request:** [*PR8300*](https://github.com/taosdata/TDengine/pull/8300)
neural networks
Tags: machinelearning, computerscience, ai, career
Published: 2021-10-22 06:57:14

Neural networks, also known as artificial neural networks (ANNs) or simulated neural networks (SNNs), are a subset of machine learning and are at the heart of deep learning algorithms. Their name and structure are inspired by the human brain, mimicking the way that biological neurons signal to one another.

Artificial neural networks (ANNs) are comprised of a node layers, containing an input layer, one or more hidden layers, and an output layer. Each node, or artificial neuron, connects to another and has an associated weight and threshold. If the output of any individual node is above the specified threshold value, that node is activated, sending data to the next layer of the network. Otherwise, no data is passed along to the next layer of the network.

Neural networks rely on training data to learn and improve their accuracy over time. However, once these learning algorithms are fine-tuned for accuracy, they are powerful tools in computer science and artificial intelligence, allowing us to classify and cluster data at a high velocity. Tasks in speech recognition or image recognition can take minutes versus hours when compared to the manual identification by human experts. One of the most well-known neural networks is Google’s search algorithm.
How to: implement selected/highlighted buttons/boxes
Published: 2021-10-22 06:51:54

This is one of those features that seems simple in hindsight but it's actually not easy to come up with a clean solution. Here's a clean solution. 

Define the problem:
Basically you have a bunch of elements, only one of them can be selected/highlighted at any given time.

The key insights are 

1. You must have a state OUTSIDE of all of these elements 
2. And all these elements have READ access to that state
3. All elements have WRITE access to that state

This example uses functional component.

We initialize a state like this:
const [ clickedBox, setClickBox ] = "";


Then we assign each component 2 things:

<
Box 
active={clickedBox == "box1"} 
onClick={ (event) => setClickBox("box1")
}
/>

<
Box 
active={clickedBox == "box2"} 
onClick={ (event) => setClickBox("box2")}
/>

<
Box 
active={clickedBox == "box3"} 
onClick={ (event) => setClickBox("box3")
}
/>

We give each component an attribute named "active", its value will be true or false. 
We also give each component a callback function that gets called if the box is clicked. 

Inside the Box component, you can use the active attribute's true/false status to conditionally display each box as selected/highlighted.
Laravel sanctum and nuxt configuration
Tags: laravel, vue
Published: 2021-10-22 06:48:56

Laravel:
```php
    1) .env => SESSION_DRIVER=cookie
               SANCTUM_STATEFUL_DOMAINS=nuxt.product.test
               SESSION_DOMAIN=.product.test:3000
```

product.test is your laravel url.
nuxt.product.test is your subdomail for nuxt.

Nuxt:
```javascript
    1)nuxt.config.js => 
        ssr: false,
        server: {
           host: 'http://nuxt.product.test',
           port: 3000,
        },
       modules: [
          '@nuxtjs/axios',
          '@nuxtjs/auth-next'
      ],
      axios: {
         credentials: true,
      },

```
API Testing - Setting up API Tests for different environments like Dev, Prod,...
Tags: testing, tutorial, apitesting, vrest
Published: 2021-10-22 06:29:10

This video #tutorial explains how you may set up multiple test environments for the same set of API tests in the vREST NG Application.

vREST NG is a script less API test automation tool. It helps you to write maintainable test cases quickly for functional and regression testing of APIs. You can download and install the vREST NG application directly on Windows, OSX, and Linux via our website.

**Video Link:** https://youtu.be/1bhpENPenJY

**API Testing Tutorials Playlist:** https://youtube.com/playlist?list=PLmua155_WrDzt1AbB6iV5Lsw_Z7QrzZZ0

*Important Links:*
1. [vREST NG Website](https://vrest.io/?utm_source=devto&utm_medium=devto-desc&utm_campaign=video)
2. [Community Chat](https://discord.gg/NtRa7kw)
3. [Book a Live Demo](https://meetings.hubspot.com/dheeraj-aggarwal)

Please do like and share if you found this video helpful and let the voice heard by the testing community. Also, let us know your feedback by commenting on this post.
HTML tags | style
Tags: html, tags, style
Published: 2021-10-22 06:12:16

It is used to **assign styles to the document or to a part of it**. Inside it will contain CSS that will define how HTML elements are rendered in a browser.

It must go inside `<head>`. It is generally better to put styles in external style sheets and link them using the `<link>` element.

Like the `<link>` element, the `<style>` element can include media attributes that contain [media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries) to allow you to selectively apply styles based on certain characteristics such as the width of the viewport.

It can have several attributes:
* `type`: defines the style language as a MIME type (the charset must not be specified). This attribute is optional and its default value is `text/css` (it cannot have any other value than that or empty string). In modern web documents there is no reason to use it.
* `media`: defines to which media the style should be applied. Its value is a [media query](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) whose default value is `all`.
* `nonce`: a cryptographic nonce (number used once) used to whitelist inline styles in a [style-src Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src). The server must generate a unique nonce value each time it broadcasts a policy. It is essential to provide a nonce that cannot be guessed, otherwise bypassing the policy of a resource is very easy.
* `title`: specifies a name so that you can use [alternate style sheets](https://developer.mozilla.org/en-US/docs/Web/CSS/Alternative_style_sheets).

If multiple `<style>` and `<link>` elements are included to external style sheets in the same document, they will be applied to the HTML document in the order in which they have been included, so it is important to take this into account to avoid unwanted effects.

- Type: *none*
- Self-closing: *No*
- Semantic value: *No*

[Definition and example](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style) | [Support](https://caniuse.com/mdn-html_elements_style)
5 proverbs for rapid development
Published: 2021-10-22 06:06:40

Let us see five proverbs which fit perfectly to the rapid development scenario.
---
____

### An ounce of protection is worth a pound of cure.
A little precaution before a crisis hits is better than lot of firefighting afterwards.
Many times, developers neglect risk management. Risk management, identification and prevention are more critical than we think. Unidentified risks cause a lot of trouble in the later stages of software development. This is why, preventing such risks is wiser than to fix them after they get worsened. Identifying risks and taking precautions against them, that is protecting the project against the risk is a key to rapid development.

### A stich in time saves nine
Correction at early stages saves work later.
In a software development lifecycle, doing right things at the right time is very important. If work is delayed in the earlier stages, it can causes much trouble afterward. Example a flaw in the design time is not fixed is bound to cause a disaster. And one flaw in the implementation time if not fixed will take almost triple the time to fix at the debugging phase. 

### Cross the stream where it is shallowest.
Don't complicate things unnecessarily.
Many developers believe that the more complicated things will be made, the better the project will execute. But that's not the case. In reality complicated practices, stringent methodologies actually lengthen the process rather than  making it faster. This is why many times the simple is the best. Complex design patters, complex code leads only to increasing the clutter of the program. Yes, this doesnt mean that one must nor use complex patterns or code. This means that one must always strive for a simpler solution to the problem.

###  Watch the doughnut, and not the hole.
Focus on what you have rather than at what you don't.
In a software development lifecycle, one cannot get all the aspects perfect. In that case, you need to maximize what you have over what you don't. For example you might not have trained personnel, or say might not have enough time. But in such cases, you must focus on what you have and try to give the best possible. Focus on your strengths and try to win the match.

### Too many cooks spoil the broth.
If too many people are involved in a task or activity, it will not be done well.
This is often the case with software development scenarios. Too many people who are experienced and have their own different viewpoints. While difference in perspectives always leads to better ideas, there must be only one decision maker whome everyone  must follow. Disagree but commit must be the case with those who are the subordinates. If too many people are decision makers, then it will lead to chaos.
A way initialization in streams and collections.
Tags: java, beginners, programming, tutorial
Published: 2021-10-22 05:49:31

Let's consider, we have to validate fields in the object according to some logic. I provide an example of this class.

```java
@Data
public class Example {
    private String a;
    private String b;
    private String c;
    private String d;
}
```
All fields are nullable. If field "a" is present then field "b" has to be present too. If field "c" is blank then field "d" has to be blank too.
My first variant is

```java
public class Validator {

    public void validate(Example example) {
        List.of(example.getA(), example.getB(), example.getC(), example.getD())
                .forEach(this::validateSomeLogic);
    }

    private void validateSomeLogic(String example) {
        ...
    }
}
```

Assume, once we receive `null` for a field, in this case we get NPE. The straightforward solution to prevent the error will be the null check definition before adding a value to the list.
Let's see what happens.

```java
public class Validator {

    public void validate(Example example) {
        List<String> list = new ArrayList<>();
        if (exapmle.getA() != null) list.add(example.getA());
        if (exapmle.getB() != null) list.add(example.getB());
        if (exapmle.getC() != null) list.add(example.getC());
        if (exapmle.getD() != null) list.add(example.getD());
        list.forEach(this::validateSomeLogic);
    }

    private void validateSomeLogic(String example) {
        ...
    }
}
```

It works but it looks a little bit clumsy. Do we have a way to do lazy initialization?
One of the differences between collections and streams is that streams support lazy initialization.

```java
public class Validator {

    public void validate(Example example) {
        Stream.of(example.getA(), example.getB(), example.getC(), example.getD())
                .filter(Objects::nonNull)
                .forEach(this::validateSomeLogic);
    }

    private void validateSomeLogic(String example) {
        ...
    }
}
```

It looks much better! I think this example is good to demonstrate the differences between types of initializations in collections and streams.
設定 MariaDB / MySQL 真・UTF-8 編碼
Tags: maridb, mysql
Published: 2021-10-22 05:47:30

MariaDB 遺傳了 MySQL 的老問題，utf8 是假的 UTF-8，utf8mb4 才是真的 UTF-8。

參照：

- [Mariadb UTF8 utf8mb4](https://simplekj52.blogspot.com/2017/09/mariadb-utf8-utf8mb4.html)
- [Force MariaDB clients to use utf8mb4](https://stackoverflow.com/questions/47566730/force-mariadb-clients-to-use-utf8mb4)

依照我的 CentOS 做出對應修改。

改 /etc/opt/rh/rh-mariadb102/my.cnf.d/mariadb-server.cnf：

```
[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
character-set-server = utf8mb4
character-set-client-handshake = FALSE

[mariadb]
character_set_server = utf8mb4
character_set_client = utf8mb4
```

加上這些設定敘述。

重啟 MariaDB 服務：

```sh
> sudo systemctl restart rh-mariadb102-mariadb
```

確認一下狀態：

```sh
> sudo systemctl status rh-mariadb102-mariadb
```

進去 MariaDB 看一下現在的編碼：

```sql
show variables like 'char%';
show variables like 'collation%';
```

會看到像這樣滿滿的 `utf8mb4`：

```
+--------------------------+---------+
| Variable_name            | Value   |
+--------------------------+---------+
| character_set_client     | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database   | utf8mb4 |
| character_set_filesystem | binary  |
| character_set_results    | utf8mb4 |
| character_set_server     | utf8mb4 |
| character_set_system     | utf8    |
| character_sets_dir       |         |
+--------------------------+---------+

+----------------------+--------------------+
| Variable_name        | Value              |
+----------------------+--------------------+
| collation_connection | utf8mb4_general_ci |
| collation_database   | utf8mb4_general_ci |
| collation_server     | utf8mb4_general_ci |
+----------------------+--------------------+
```

## 檢視 database、table、column 的編碼

檢視 database 編碼：

```sql
SELECT default_character_set_name
FROM information_schema.SCHEMATA 
WHERE schema_name = "schemaname";
```

檢視 table 編碼：

```sql
SELECT CCSA.character_set_name
FROM information_schema.`TABLES` T, information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA
WHERE CCSA.collation_name = T.table_collation
    AND T.table_schema = "schemaname"
    AND T.table_name = "tablename";
```

檢視 column 編碼：

```sql
SELECT character_set_name
FROM information_schema.`COLUMNS` 
WHERE table_schema = "schemaname"
    AND table_name = "tablename"
    AND column_name = "columnname";
```

以上來自 〈[How do I see what character set a MySQL database / table / column is?](https://stackoverflow.com/questions/1049728/how-do-i-see-what-character-set-a-mysql-database-table-column-is)〉
Code that replicates itself(not recursion)
Tags: programming, javascript, python, tutorial
Published: 2021-10-22 04:57:58

This thing called virus is crazy as hell, right? Like some dude out of nowhere got infected by COVID-19 virus. Now the world is going through this huge pandemic. That is due to their ability to replicate.
![Computer virus](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bs8f73t3692hejst4sug.png)
 
The situation is similar with digital virus aka computer virus. If somehow just one virus can enter your computer, in right condition it will create millions of copies of itself.
So what is a computer virus? A computer is just some code that has the ability to replicate itself. **Code that can output itself is called Quine**.
However a code that simply just reads itself is not a Quine.
```py
#not a quine
print(open(__file__).read())
```
Code for a quine is made out of two parts:
1. code used to do the printing
2. data representing textual form of the code

Here's an example of quine in Python
```py
q='q=%r;print (q%%q)';print (q%q)

#output: q='q=%r;print (q%%q)';print (q%q)
```
And in JS:
```js
($=_=>`($=${$})()`)()

//output in console: ($=_=>`($=${$})()`)()
```

You can find more examples of quine by following these links: [JavaScript Quines](geeksforgeeks.org/quines-in-javascript/), [Python Quines](https://www.geeksforgeeks.org/quine-in-python/)

That's all for now. Make sure you check out my other articles and YT tutorials.
{% user 0shuvo0 %}
{% youtube cyUsAFblyhc %}