teleren/devto huggingface dataset:
AzureFunBytes Reminder - Intro to @AzureCosmosDB with @markjbrown
Tags: nosql, azure, beginners, tutorial
Published: 2021-02-24 14:31:21

Every week on AzureFunBytes, we try to introduce you to the technology, tools, processes, and practices that make up the fundamentals of Azure.  This week we'll discuss how to get your data fast, with nearly any programming language, and distributed across the globe with [Cosmos DB](https://cda.ms/1Z9).

Join us at 11 AM PST / 2 PM EST on Thursday, February 25, 2021!

[Cosmos DB](https://cda.ms/1Z9) is Azure's fully managed, multi-model [NoSQL database](https://cda.ms/1Zb) for your apps. data science, and nearly whatever purpose you may need for querying unstructured data sets.  You can work at PLANET scale by replicating your data across multiple regions with single-digit millisecond response times.  You'll be able to work with key-value, column family, document, and graph data all from Cosmos DB.  Access using popular APIs such as [SQL](https://cda.ms/1Zh), [LEAF for MongoDB](https://cda.ms/1Zk), [Gremlin](https://cda.ms/1Zn), [Cassandra](https://cda.ms/1Zj), and [Table](https://cda.ms/1Zp). Make use of SDKs for your favorite programming language.

This week I am joined by [Mark Brown, Principal Product Manager](https://cda.ms/1Zq) for the Cosmos DB team. He'll provide me with some great insight into how, when, where, and why to use Cosmos DB.  We take questions, listen to comments, and hopefully get you all the new information you can use on Cosmos DB including their upcoming [Cosmos DB Conf](https://gotcosmos.com/conf?WT.mc_id=devops-15965-jagord) April 20-21st, 2021.

{% youtube 6kZVIZSAboY %}

Join us at 11 AM PST / 2 PM EST for the latest episode!  We'll get you the information you need to start building your global scale apps.

Learn about Azure fundamentals with me!

Live stream is available on Twitch at 2 pm EST Thursday. You can also find the recordings here as well:

https://twitch.tv/azurefunbytes
https://twitter.com/azurefunbytes
https://aka.ms/jaygordononyoutube
[Azure DevOps YouTube Channel](https://www.youtube.com/channel/UC-ikyViYMM69joIAv7dlMsA)

Useful Docs:

[Microsoft Learn: Azure Fundamentals](https://cda.ms/1WL)
[Microsoft Azure: $200 Free Credit](https://azure.microsoft.com/free/?WT.mc_id=devops-15621-jagord) 
[Welcome to Azure Cosmos DB](https://cda.ms/1Zf)
[Getting started with SQL queries](https://cda.ms/1Zh)
[Introduction to the Azure Cosmos DB Cassandra API](https://cda.ms/1Zj)
[Azure Cosmos DB's API for MongoDB](https://cda.ms/1Zk)
[Introduction to Gremlin API in Azure Cosmos DB](https://cda.ms/1Zn)
[Introduction to Azure Cosmos DB: Table API](https://cda.ms/1Zs)
Crossplane: GKE Installation
Tags: kubernetes, multicloud, provider, cloud
Published: 2021-02-24 14:27:50

>*..Crossplane is an open source Kubernetes add-on that supercharges your Kubernetes clusters enabling you to provision and manage infrastructure, services, and applications from kubectl.* (crossplane.io)

Crossplane is a CNCF sandbox project, open source, community driven solution and add-on for your kubernetes API to manage and compose infrastructure.

It uses a team centric approach with Open Application Model.

The idea is to use a kubernetes cluster as a single control panel. where there is freedom to provision resources in any cloud and link these services with the cluster itself. The cluster does not need to be in the same cloud as the services.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nz3dp5pfbhx0rgl2ejst.png)
<figcaption>Crossplane Application Architecture Example</figcaption>

Basically a provider is configured in the cluster linked to a service account of a specific cloud.
 
Crossplane CRDs use this provider to deploy and link services across the cluster.

Each cloud service has its particularity and is defined through structures of compositions, definitions and namespaced k8s specifications.

The CRDs that define the crossplane providers services are called XRDs.

Crossplane has an external CLI and its own CRDs that are deployed in the cluster. 

Since CRDs and XRDs are deployed, the provisioning operation no longer requires the local CLI. Just having kubectl configured needed to re-deploy the types of resources that are already configured.

##Installation

Follows ansible to automate the installation of a crossplane + GCP Provider in a GKE cluster

## Requirements
 - *GKE*
 - *Google Cloud SDK (316.+)*
 - *bq (2.0.62+)*
 - *core (2020.10.23.+)*
 - *gsutil (4.54.+)*
 - *Kubernetes(1.16.+)*
 - *kubectl(1.16.+)*
 - *Helm(3.+)*
 - *ansible (2.10.+)*
 - *openshift python client (0.11.+)*
 - *PyYAML (5.3.+)*

## Deploy

  1 - Git clone the repo to bastion
```
  - $ git clone https://gitlab.com/cedon/crossplane-gcp.git
```

  2 - Check if roles/crossplane/defaults/main.yml is right for the environment you want to deploy

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9tov5u0nlm441s3iuvmj.png)

  3 - Deploy with ansible command:
```
  - $ ansible-playbook -i ./hosts -e \ 
'ansible_python_interpreter=/usr/bin/python3' crossplane.yml 
\ --tags "install, gcp" -vvv
```
  *After the Deploy you must take care about the file creds.json. It will be located at the repo root, and has the service account credentials.*

  4 - Check Crossplane Installation
```
  - $ kubectl get all -n crossplane-system
  - $ kubectl crossplane --help
```
###References
 - Crossplane - https://crossplane.io
 - Crossplane Install and Configure V1.0 - https://crossplane.io/docs/v1.0/getting-started/install-configure.html
 - Crossplane Provision Infrastructure - https://crossplane.io/docs/v1.0/getting-started/provision-infrastructure.html
React Native Apple Silicon Common Errors and solutions
Published: 2021-02-24 14:24:17

Check version

first step: you need your react-native version and information:

npx react-native info


1.Common Error,no bundle url present.
solution
 Remove Main.jsbundle, again create main.jsbundle
and then solution following code

npx react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios


2.Common Error, YogaKit Modulemap Error
xcode 11.x,12.x version build fatal error: module map file xxx/Build/Products/Debug-iphoneos/YogaKit/YogaKit.modulemap' not found

Url: https://github.com/facebook/react-native/issues/28503
Solution
Please check React native Podfile, iPhone model and Xcode iPhone Model


info Launching iPhone 11 (iOS 14.4)
info Building (using "xcodebuild -workspace yourapp.xcworkspace -configuration Debug -scheme your app -destination id=xxx-xx-xx-xxx-xxxx")
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening yourapa.xcworkspace. Run CLI with --verbose flag for more details.
Command line invocation:
Free e-book: The importance of high-quality Ansible Collections
Tags: ansible, ebook, ansiblecollections
Published: 2021-02-24 14:21:12

This e-book introduces the **importance of high-quality Ansible Collections**, explains the importance of documentation and testing, and illustrates the value with a help of a case study. The book is written for **Ansible content producers** who already have a basic understanding of Ansible.

[![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/67qjd1fho0oahnfjacny.png)] (https://steampunk.si/ebooks/importance-of-high-quality-ansible-collections/)


**Here’s what you will learn:**

⚙ Why Ansible Collections add value to your existing solution
⚙ Why it’s important to invest into a high-quality Collection and not develop it as a side project
⚙ What “high-quality” actually means and how to ensure it
⚙ How ISV managed to attract new customers with their Ansible integration


**Get your e-book [here] (https://steampunk.si/ebooks/importance-of-high-quality-ansible-collections/)!**
JS Console  Tricks(How to use Css in the console)
Tags: console, css, javascript, style
Published: 2021-02-24 14:09:57

Hello there guys.

Today we will provide a nice trick,about how you can style your console messages with css.
It's common nowdays developers using the browser console for their
tests.

What about if you can preview your result with more semantic way?
Let's dive to the point

I will use Chrome Developer Tools for this project you  can seek with me or you can use the browser of your choice.

First we  open the developer tools,you can pres F12 for the shortcut.

You should see something like this :
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xxzhzg7ohl9hy74kxxah.png)

After that you going to the head menu and you hit the console tab.
 ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mn9wg4u7ywalltdzi5hc.png)
 
If you have bunch of errors or warnings you can press **CTRL + L**
to clear the console.

So,for our example we will console just the Hello World with styling and without.

The normal `console.log` should be  something like  this and we print just a **'Hello there dev Community'**

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

If we would like to add some styling we should use the percentage sign and the letter **c** in the beggining of the text and as second parameter with comma you import your css style and the example shoul look something like this

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

And our result  seems different,ouacha!

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

Have a nice workday guys, in case for further explanation do not hesitate to contact me or find me in github or linkedin.
GitHub : https://github.com/feco2019
Linkedin : https://www.linkedin.com/in/dimitris-chitas-930285191/
3 Steps to Frictionless TDD with Jest and VS Code
Tags: webdev, javascript, vscode, testing
Published: 2021-02-24 13:59:21

If you're looking to make writing your Jest tests easier in VS Code, look no further. In my quest to optimize my testing, I've tried several approaches, but I always come back to this workflow.

## 1. Configure VS Code

No more tiny terminal squeezed at the bottom of the editor. View your terminal and test file side by side by dragging the terminal to the action bar.

![Moving the VS Code terminal to the action bar](https://derekndavis.com/images/vsCodeTdd.gif)

## 2. Target a Single File in Watch Mode

Jest watch mode will automatically re-run your tests when anything changes. Provide it a file name or pattern to limit what files are ran. Here we're running just the "string" file. 

```
jest --watch string
```

![Running tests in watch mode targeting the string file](https://derekndavis.com/images/vsCodeTdd2.png)

Something to note here is that "string" will match on folders and file names. There are various ways to target different test files to run. Check out the [Jest Docs](https://jestjs.io/docs/en/cli) to learn more.

## 3. Focus on One Test

You may have used `it.skip` to skip certain tests, but we can also make it run a certain test with `it.only`. In this case, we're focusing on the "should trim" test.

```javascript
it.only('should trim', () => {
  schema.trim().cast(' 3  ').should.equal('3');
});
```

Make your test pass, and go back to step 2!

P.S. Don't forget to remove `.only` before you run `jest --coverage`, or you'll have a heart attack when your percentage drops to nothing.

## Summary
- Setup VS Code to show your terminal side by side with your test
- Focus on a single test at a time to reduce noise in the terminal and boost your productivity

Happy testing
What is Get Data in Power BI? Tell us about the data connections
Tags: datascience, bigdata, analyst, database
Published: 2021-02-24 13:53:03

Get Data highlight offers data network to various distinctive data sources. The Get Data choice is on the Menu bar of Power BI Desktop primary page. We can tap on this alternative to associate our Power BI Desktop application with a favored data source. 

You can interface with data documents on your neighborhood framework, Excel records, Azure SQL Database, Facebook, Google Analytics, Power BI datasets, and so forth You can associate with cloud-based sources, on-premises information sources utilizing passages, online administrations, direct interfaces, and so forth Become a Power BI Expert by joining our [Power BI Course](https://intellipaat.com/power-bi-training/)

Some generally utilized data sources are recorded beneath

File: Excel, Text/CSV, XML, PDF, JSON, Folder, SharePoint.

Database: SQL Server database, Access database, Oracle database, SAP HANA database, IBM, MySQL, Teradata, Impala, Amazon Redshift, Google BigQuery, etc.

Power BI: Power BI datasets, Power BI dataflows.

Azure: Azure SQL, Azure SQL Data Warehouse, Azure Analysis Services, Azure Data Lake, Azure Cosmos DB, etc.

Online Services: Salesforce, Azure DevOps, Google Analytics, Adobe Analytics, Dynamics 365, Facebook, GitHub, etc.

Others: Python script, R script, Web, Spark, Hadoop File (HDFS), ODBC, OLE DB, Active Directory, etc
Here goes nothing
Tags: devjournal, beginners, productivity, programming
Published: 2021-02-24 13:52:36

Learning new things is great and definitely one of the top tools of a (good) developer. Keeping up with the fast moving world of software, never stop learning, and most of all keep getting surprised by the creativity of others (and yourself) just feels great! So I decided I want to share more of my knowledge so I can also inspire others and thus add to the awesomeness that is development.

In my job as a developer I do a lot of research, I like being the expert on stuff and start to glow when someone comes to me with questions on those subjects. We all know how great it feels to fully understand how a framework or technique is supposed to work (probably defining the same code as amateurish months/years later). And yes I really hope that one day I'll look back at this article and think, what was I doing! Because that will mean I have learned something new.

The topics I'm currently interested in are Typescript, Angular, NGRX and RXJS and in my next post I’ll be sharing my creative insights on any one of those. Hopefully inspiring others but mostly for learning from it myself.

Maybe someone will read this, maybe not, and that’s ok. At least I tried and learned from it. Please feel free to share your latest surprise in the awesome world of development so I can enjoy it with you.
การใช้งาน Keycloak เบื้องต้น
Tags: keycloak, authentication, jwt
Published: 2021-02-24 13:50:01

การใช้งาน Keycloak เบื้องต้นเพื่อทำระบบ Login กับ JWT

## Base URL ของ Realm และ Client ที่เราสร้าง
```shell
https://{{BASE_URL}}/auth/realms/{{REALM}}
```

## Endpoints ของ Keycloak ที่เราจะใช้งาน
- `/protocol/openid-connect/auth`
- `/protocol/openid-connect/token`
- `/protocol/openid-connect/userinfo`

## ขั้นตอน (ในกรณี Login ผ่านเว็บ Keycloak เอง)
- ไปตั้งค่า Keycloak ให้เรียบร้อยก่อน
   - สร้าง Realm ใหม่
   - สร้าง Client ใหม่ใน Realm ตัวใหม่นั้น
   - ใน Client ให้ไปตั้งค่า
     - Root URL ถ้าใช้หน้า Login ใน Keycloak 
     - Valid Redirect URIs รายชื่อเว็บที่อนุญาติให้ redirect ไปหลัง login เสร็จ
     - Base URL 
     - Web Origins รายชื่อเว็บที่อนุญาติให้ CORs
   - สร้าง user ใหม่ใน Realm นั้น

### เข้าไป Login ผ่านเว็บ เข้าที่
```shell
curl -XGET -H 'Content-Type: application/x-www-form-urlencoded' 'https://{{BASE_URL}}/auth/realms/{{REALM}}/protocol/openid-connect/auth?response_type=code&client_id={{CLIENT_ID}}&redirect_uri={{VALID_REDIRECT_URI}}'
```

สิ่งที่จะได้มาจะเป็น
```shell
curl -XGET -H 'Content-Type: application/x-www-form-urlencoded' 'https://{{BASE_URL}}/auth/{{VALID_REDIRECT_URI}}?session_state={{SESSION_STATE}}&code={{CODE}}'
```
Parameters ที่เราได้กลับมา
 - session_state
 - code ชุดรหัสนี้จะเอาไปขอ access token


### นำ code ไปขอ access token ที่ URL
```shell
curl -XPOST -H 'Content-Type: application/x-www-form-urlencoded' -d 'client_id:{{CLIENT_ID}}
client_secret:
grant_type:authorization_code
code:{{code}}
redirect_uri:{{VALID_REDIRECT_URI}}' 'https://{{BASE_URL}}/auth/realms/{{REALM}}/protocol/openid-connect/token'
```
Response ที่ได้จะเป็น
```json
{
    "access_token": "eyJhbGciOiJSUzI1NiI...",
    "expires_in": 300,
    "refresh_expires_in": 1800,
    "refresh_token": "eyJhbGciOiJIUzI1Ni...",
    "token_type": "Bearer",
    "not-before-policy": 0,
    "session_state": "3dd8b...",
    "scope": "profile email"
}
```


### เมื่อต้องการ Refresh Token
```shell
curl -XPOST -H 'Content-Type: application/x-www-form-urlencoded' -d 'client_id:{{CLIENT_ID}}
client_secret:
grant_type:refresh_token
refresh_token:{{REFRESH_TOKEN}}
redirect_uri:{{VALID_REDIRECT_URI}}' 'https://{{BASE_URL}}/auth/realms/{{REALM}}/protocol/openid-connect/token'
```
Response ที่ได้จะเหมือนกับตอนขอ access token
#1 Build in public - Growex.App
Tags: sideprojects, saas
Published: 2021-02-24 13:49:21

## Working on a side product called  [Growex](https://growex.app) 
*It is a social media automation tool*
Follow growex on twitter [@growexApp](https://twitter.com/growexapp)

I have decided to build this product in public, this means everyday I will share the update for my product
I am going this on twitter and decided to do the same here also

# Worked on Admin Dashboard with 3 Important tasks

### 1/3 Tried typescript with vercel nextjs

Nextjs did all the work to setup typescript

use tsx for better formatting

![Eu_g3hJUYAcEXVI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jhk42xj4r9kofgxhggu6.jpeg)
 

### 2/3 Added .env file

When you work locally you need localhost

But on the server, you need a real API call

.env.local file for local and .env for env

Nextjs use .env.local when you run "npm run dev" and .env when you run "npm run build"

Amazing work vercel

![Eu_g37UUcAwRTMs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/21sal313vfj43sqaudcb.jpeg)
 

### 3/3 Using tailwind ui design for user table

This is easy but fun stuff I did

Just recreated the tailwindui table, I don't have premium but if you know tailwindcss
 then you can easily create them

Just a simple thing


If you have any question then twitter is open for you @[Sarthak Shrivastava](@sarthaksavvy)
Evaluate and find the cost of adding a npm package with Bundlephobia and Moiva
Tags: webdev, javascript, npm, node
Published: 2021-02-24 13:46:17

## Bundlephobia

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4dcrkohfi750pvc5mshw.png)

Bundlephobia helps you find the performance impact of adding a npm package to your front-end bundle.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mqd13inh446tyt5qw5il.png)

Link : [https://bundlephobia.com/](https://bundlephobia.com/)

## Moiva

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jltaoc3y67qc9kyspcny.png)

The goal was to provide developers with a good tool to evaluate and compare npm packages in different dimensions - Popularity, Maintenance, Security, etc.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ez8dxjg8oh4ce8sppodm.png)

Link : [https://moiva.io/](https://moiva.io/)
How to ML - Deploying
Tags: machinelearning, ai
Published: 2021-02-24 13:43:11



So the ML engineer presented the model to the business stakeholders and they agreed that it performed well enough on the key metrics in testing that it's time to deploy it to production.

So now we have to make sure the models run reliably in production. We have to answer some more questions, in order to make some trade offs.

How important is latency? Is the model making an inference in response to a user action, so it's crucial to have the answer in tens of milliseconds? Then it's time to optimize the model: quantize weights, distill knowledge to a smaller model, weight pruning and so on. Hopefully, your metrics won't go down due to the optimization.

Can the results be precomputed? For example, if you want to make movie recommendations, maybe there can be a batch job that runs every night that does the inference for every user and stores them in a database. Then when the user makes a request, they are simply quickly loaded from the database. This is possible only if you have finite range of predictions to make.

Where are you running the model? On big beefy servers with a GPU? On mobile devices, which are much less powerful? Or on some edge devices that don't even have an OS? Depending on the answer, you might have to convert the model to a different format or optimize it to be able to fit in memory.

Even in the easy case where you are running the model on servers and latency can be several seconds, you still have to do the whole dance of making it work there. "Works on my machine" is all to often a problem. Maybe production runs a different version of Linux, which has a different BLAS library and the security team won't let you update things. Simple, just use Docker, right? Right, better hope you are good friends with the DevOps team to help you out with setting up the CI/CD pipelines.

But you've killed all the dragons, now it's time to keep watch... aka monitoring the models performance in production.
[BLOG] - 
DEV Community – Rede social para desenvolvedores
Published: 2021-02-24 13:32:21

Quem é dev e curte uma comunidade toca aqui 🤜.

Eu amo comunidades, trocar ideia, compartilhar conhecimentos, responder e ter dúvidas respondidas… Falar de programação “é muito prazeroso” (referência a José Almiro – ele não é programador).

[Continuar...](https://blog.erikfigueiredo.com.br/dev-community-rede-social-para-desenvolvedores/)
Examples for reversing a string in JavaScript, Python and Dart
Tags: javascript, webdev, beginners, python
Published: 2021-02-24 13:22:45

One of the most common interview questions is how do you reverse a string in the programming language that you know. Here are a few examples of how easily it can be done. As these programming languages are C based the syntax is quite similar so it is easy to translate across languages.

## Example 1

**JavaScript**

```javascript
function reverse(str) {
		console.log(str.split('').reverse().join(''));
}

reverse('Hello World');
```

**Python**

```python
def reverse(str):
  print(''.join(reversed(str)));


reverse('Hello World');
```

**Dart**

```dart
void main() {
  reverse(str) {
    print(str.split('').reversed.join(''));
  }

  reverse('Hello World');
}
```

## Example 2

**JavaScript**

```javascript
function reverse(str) {
	reversed = '';

	for (let char of str) {
		reversed = char + reversed;
	}
	 console.log(reversed);

}

reverse('Hello World');
```

**Python**

```python
def reverse(str):
  reversed = '';
  for char in str:
    reversed = char + reversed;

  print(reversed);


reverse('Hello World');
```

**Dart**

```dart
void main() {
  reverse(str) {
    List newStrings = [];
    dynamic index = (str.length);

    while (index > 0) {
      index -= 1;
      newStrings.add(str[index]);
    }
       print(newStrings.join(""));
  }

  reverse('Hello World');
}
```

## Example 3

**JavaScript**

```JavaScript
function reverse(str) {
		
	const arr = [];
	for (let i = str.length - 1; i > -1; i--) {
		arr.push(str[i]);
	}
	console.log(arr.join(''));
}

reverse('Hello World');
```

**Python**

```python
def reverse(str):
    new_strings = []
    index = len(str)
    while index:
        index -= 1                       
        new_strings.append(str[index])
    print(''.join(new_strings))

reverse('Hello World');
```

**Dart**

```dart
void main() {
  reverse(str) {
    List arr = [];
    for (var i = str.length - 1; i > -1; i--) {
      arr.add((str[i]));
    }
    print(arr.join(''));
  }

  reverse('Hello World');
}
```

## Example 4

**JavaScript**

```javascript
function reverse(str) {
		
	const arr = [];
	for (let i = str.length - 1; i > -1; i--) {
		arr.push(str[i]);
	}

  // Using regex
	console.log(arr.toString().replace(/,/g, ''));

  // Using reduce
	console.log(arr.reduce((acc, cur) => acc + cur));

}

reverse('Hello World');
```

**Python**

```python
def reverse(str):
  print(str[::-1]);


reverse('Hello World');
```

**Dart**

```dart
void main() {
  reverse(str) {
    List arr = [];
    for (var i = str.length - 1; i > -1; i--) {
      arr.add((str[i]));
    }

    // Using Reduce
    print(arr.reduce((acc, curr) => acc + curr));
  }

  reverse('Hello World');
}
```