teleren/devto huggingface dataset:
Install MongoDB with Docker (in Ubuntu 18.04)
Tags: mongodb, docker, database, devops
Published: 2020-11-25 23:28:31

######Info: This post is one of the articles in context of this post: [Huawei Cloud ECS server notes](https://dev.to/jemaloq/huawei-cloud-ecs-server-notes-1gnj)


Firstly, create the mapping repository for mongodb:
```bash
  mkdir ~/docker/mongo_8301
  mkdir ~/docker/mongo_8301/db
  mkdir ~/docker/mongo_8301/config
  mkdir ~/docker/mongo_8301/log
``` 
Then create the launch file for starting the docker container:

```bash
  touch ~/launchers/docker_mongo_8301.sh
  vi ~/launchers/docker_mongo_8301.sh
``` 
Fill the following code into the launch file:

```bash
docker rm -f mongo_docker_8301
docker run -d -p 8301:27017 \
--name mongo_docker_8301 \
-v /home/jemaloQ/docker/mongo_8301/config:/data/configdb \
-v /home/jemaloQ/docker/mongo_8301/db:/data/db \
-v /home/jemaloQ/docker/mongo_8301/log:/data/log \
mongo --auth
``` 

Now launch docker using cmd line: `sh ~/launchers/docker_mongo_8301.sh`. Wait till the end of image pull. Then check if `mongo_docker_8301` is running correctly by executing `docker ps -a | grep mongo`. 

Enter the inside of the container and execute `mongo admin` to login the default 'admin' database
```bash
   docker exec -it mongo_docker_8301 mongo admin
```

Create an user of role `administrator`: 

```bash
  > db.createUser({user:'admin',pwd:'JemaloAdmin', roles:[ { role:'userAdminAnyDatabase', db: 'admin'} ] })
  > exit
```
Later on, I can login 'admin' as user `admin`:

```bash
  docker exec -it mongo_docker_8301 mongo admin
  > db.auth('admin','JemaloAdmin')
```


I can create other users by specifying their info and roles. Now I create user *"jemaloQ"* as "dbOwner" of database *"knowledge"*: 

```bash
  > db.createUser({user:'jemaloQ',pwd:'123456', roles:[ { role:'dbOwner', db: 'knowledge'} ] })
```

Snapshot of my Putty console:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/575ogub1204wo599d7d5.png)


Now try to connect the newly launched MongoDB by Python:

```python
from pymongo import MongoClient

client = MongoClient("mongodb://jemaloQ:123456@111.22.123.117:8301")

# print all the Databases names in Mongodb, returns empty list if no database has been created 
client.list_database_names()

# connect to the 'knowledge' database, if it does not exist, this line shall create it and then connect to it
db = client['knowledge']

# get the 'test' collection of the 'knowledge' database, if it does not exist, this line shall create it
col = db.get_collection('test')

# this item shall be uploaded to my database
item_dic = {'uid': 123, 'name': 'jemaloQ'}

# a query filter for checking whether an item with same id exists or not
query_filter = {"uid": item_dic["uid"]}

# now insert the item to 'test' collection of knowledge' database
col.update( query_filter,  {'$setOnInsert': item_dic},  upsert=True)

# now, we can see the 'knowledge' database since it is no longer empty
client.list_database_names() # => ['knowledge']

```

Thus, I have now implemented my MongoDB service using docker on my server.
I'm making a desktop app using Web Technologies. Any Advise?
Tags: webdev, electron, react, help
Published: 2020-11-25 23:09:52

Hey folks,

I've decided to build my next project using web technologies for the frontend. I've picked [Electron](https://www.electronjs.org/) and [React](https://reactjs.org/) to be the main tech to accomplish it.

This is going to be an audio application, so the backend is going to be a c++ library that I'm writing. [Node addon's](https://nodejs.org/api/addons.html) are how I'm going to call my library in js.

Any advise? Should I build a [BFF](https://nordicapis.com/building-a-backend-for-frontend-shim-for-your-microservices/) to handle the addon? Any pitfalls to be aware of?
Is there vararg-like generics in Java?
Tags: java, help, watercooler
Published: 2020-11-25 23:08:20

Are there generics that can act like varargs in Java?

E.g.
```java
class Test<...T> {
    private final T[0] val = testarg;
    public Test(T[0] testarg) {
        val = testarg;
    }
}
```
An Introduction to Machine Learning with R & Python
Tags: datascience, machinelearning, statistics
Published: 2020-11-25 22:51:47

I've been working on building a complete introduction to machine learning including step-by-step tutorials in both R and Python.

The complete introduction can be found here: https://www.statology.org/machine-learning-tutorials/

The end goal with this project is to provide a nice starting spot for anyone interested in machine learning with tutorials that are written in simple terms and plain English.
Day 264: Thanksgiving
Tags: hiphop, code, coding, lifelongdev
Published: 2020-11-25 22:45:29

_liner notes_:
- Professional : Pretty chill day. Went through the code for an SDK so I can update the documentation. Been pretty cool experience. Really helping me understand what goes on behind the scenes of our products. I've been coding up small projects and adding to them so I can see what is happening so I can document it properly. A whole lot of learning happening.

- Personal : Last night, went through a bunch of tracks for this week's radio show. I also created a bunch of icons for the PWA I'm working for my next side project. Ended up with like 13 different files. haha Took a little longer than I thought, but got it done.

![View into a valley in Campagna, Italy with some housed and fields](https://dev-to-uploads.s3.amazonaws.com/i/izf0uxfod8ugu5rjv0dm.jpg)

Thanksgiving is tomorrow so I'll have the day off. I'm at my folks place. I'll probably spend the day putting together the radio show and working on making my next side project a PWA and get the push messaging working. I'll try to relax somewhere in there. Maybe after I'm stuffed with food. Hope if you are reading this, you are in a safe place and doing well.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube HDs40vtplgU %}
What's your favorite way for learning to code?
Tags: discuss, beginners, codenewbie, learning
Published: 2020-11-25 22:36:28


It's been nearly one year since I decided to become a professional developer. Spoiler alert: I recently got my first job as a junior web developer, so _mission accomplished and ready for takeoff!_ :rocket:

Now, I am taking some time to think back how my coding journey started. I made my decision with barely no previous experience in any programming language :scream:

I'd like to share milestones of my coding journey with you before listening to _your favorite ways_ for learning to code, maybe how you started your journey and  what you'd recommend to a beginner!

## How I started my journey

Although I was completely convinced and self-confident, I had to decide _which ways to choose while learning to code._ Of course I found plenty of websites, but then again I had to choose what suited me best. But how would I know :interrobang:

### Platforms that I personally used for learning to code

These are the websites I started learning with:

- Khan Academy: I remember watching some videos about the basics of HTML, CSS and JavaScript.
- Codecademy: Trying out their free courses on Python really got me going! I really liked their approach how to teach syntax & basics.
  - The screen was divided into three parts: _Introduction_ left, _text editor_ middle, _browser/console_ right. It was perfect to get live feedback of what I was doing.
  - Thirsty for more and more, I got into the Web Development skill path, enjoyed quizzes and projects.
  - Eventually I got a pro membership.
- Udacity: I took some great video courses about mobile development and responsive design.
- edX: In order to learn about AWS, I took a nice course preparing for the AWS Developer. I was hands-on experience with the AWS free tier.

### Other resources I use

- MDN: Mozilla Developer Network is one of my favorite resources for web development. It is a quick reference of anything inside HTML, CSS and JavaScript with rich and illustrative examples.
- Blog posts are super helpful resource I frequently use to learn new concepts or expand my horizons. What I like best about blog posts is the personal touch of their blog and getting to know the person behind.
- RTFM: Documentation is most often the starting point for my new projects.

## What's _your_ favorite way?

Enough about me! Let me hear how you started your journey learning to code. Did you use a website/platform/approach that was particulary useful for you?

> P.S. I am planning to write an extended post about my journey and different paths for learning to code on my [blog](https://chrisko.io). So I'd love to include what resources you might recommend here. Thank you! :pray:
Login responsive con CSS Grid
Tags: css, html, grid, webdev
Published: 2020-11-25 22:30:11

Login básico programado usando HTML5, CSS3 y CSS Grid (responsive) 

![img](https://raw.githubusercontent.com/crisdux/login-css-grid-2020/main/img2.png)

![img](https://raw.githubusercontent.com/crisdux/login-css-grid-2020/main/img1.png)

[Repo del proyecto](https://github.com/crisdux/login-css-grid-2020)

[deploy](https://crisdux.github.io/login-css-grid-2020/)
Using Python To Visualize Internet Affordability Worldwide
Tags: python, showdev
Published: 2020-11-25 22:29:24

{% github vnbrs/internet-affordability %}

Using some data from Numbeo, a bit of Python and research I've made [this project](https://github.com/vnbrs/internet-affordability) that shows that there are countries that Internet access costs more than 20% of the average monthly income of a household.

![](https://dev-to-uploads.s3.amazonaws.com/i/pwvev73eo6rz9akdp12t.png)

Access to Internet is a basic human right, the United Nations declared in 2016, however there are many countries that Internet is still not affordable. In Europe, 87% of families enjoy Internet access, while that figure is only 18% in Africa.

The global coronavirus pandemic has revealed how dependent we have become on Internet access. Voting, telemedicine, studying, shopping, among other things that we do without even realizing there are people that don't have Internet access.

Check out the project on [GitHub](https://github.com/vnbrs/internet-affordability) and please star and/or contribute!

https://github.com/vnbrs/internet-affordability
PHP 8 performance 🐘🐘🐘🐘🐘🐘🐘🐘🚀
Tags: php, discuss, performance, webdev
Published: 2020-11-25 22:21:46

Is anyone else seeing a big performance boost on PHP 8?

A couple of tests in my small library dealing with reflection and a bit of regexps are running 30-50% faster 💪!
It is great, but the isolated unit tests are by no means representative.

**Has anyone successfully benchmarked a more complex solution already?**

As the third party library support for the new PHP version is far from sufficient, I was not yet able to run more complex tests.

This is the hobby lib that's seeing the boost.
{% github dakujem/wire-genie %}

And since the attributes can now be used instead of doc-comment annotation parsing (which requires regexp parsing most of the time), the upcoming version will be much faster by design.
Next-translate 1.0 demo - I18n your Next.js +10 pages in an easy way
Tags: nextjs, react, i18n, javascript
Published: 2020-11-25 22:10:11

---
title: Next-translate 1.0 demo - I18n your Next.js +10 pages in an easy way
published: true
description: The main goal of next-translate is to keep the translations as simple as possible in a Next.js environment.
tags: nextjs, react, i18n, javascript
cover_image: https://images.unsplash.com/photo-1451187580459-43490279c0fa?ixlib=rb-1.2.1&q=80&fm=jpg
---

I want to share a small demo of what version 1.0 of [next-translate](https://github.com/vinissimus/next-translate/tree/1.0.0-experimental) will be like.

{%youtube QnCIjjYLCfc %}

Now with Next.js +10 the i18n routing support is in the core, but we still need an easy system to load the translations without having to overwrite page by page the `getStaticProps`, `getInitialProps`, or `getServerSideProps` methods. Next-translate offers a solution through a Next.js plugin that automatically loads only the necessary files for each page and language. Fully compatible with SSG.

**GitHub**: https://github.com/vinissimus/next-translate/tree/1.0.0-experimental
RESTful Routes Cheat Sheet
Tags: cheatsheet, restful, routes
Published: 2020-11-25 22:00:16

Nothing like a cheat sheet when your making a RESTful API as new dev.

Enjoy!
- Justin

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/f2t7z59c7etazqpru5o5.png)
Your Career Growth Bundle
Tags: career, growth
Published: 2020-11-25 21:59:05

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9cj5giuzh8lpsneq7rm0.gif)

Hey dev.to Community,

It's Thanksgiving week and I've been feeling grateful for what I have. Also with the pandemic, stress and burnout that many of you are experiencing, I truly want to help you, ambitious and driven professionals in tech, grow your career by having clarity on your goal and going after them with ease and momentum in the new year.  

Here's a concise roadmap for your career success: 
1️⃣  Explore options and understand what's possible
2️⃣  Perform self-assessment and put together a Personal Development Plan with milestones for the next 6 - 12 months  
3️⃣  Execute on your plan and gain momentum
4️⃣  Smash your career goal!
To help you with your career journey, I've put together five resources as a bundle. Whether you're looking for a promotion, recognition, career change or employment, this career bundle contains all the tools and resources that you need to achieve your goal. 

💻  README.md for Software Developers 
Technology landscape has evolved and software is changing the world. Therefore, it’s no wonder that the career path of software developers is very different now compared to a decade ago. In this book, I share practical advice and useful tips to help you succeed in the software development industry.

👩🏻‍💻  The Accidental Remote Manager 
This book will enable you to understand and adapt the fundamentals of leadership that are critical to surviving the sudden transition to remote working. 

📝  Self-Assessment Worksheet
This worksheet includes 10 questions that you need to answer to get clarity on where you are currently in your career and where you want to be.

✅  Personal Development Plan
Take the first step in taking control of your own career today by creating a personal development plan. Use this template to create an actionable plan by filling in sections about your personal analysis, your career objectives and your action plan.

🎉  Nail That Interview
Let's face it, interviewing is a skill. Having technical skills required for any role is important, but being able to present yourself in the best possible light and performing well at an interview is equally, if not more, important, in order to get a job offer. This book reveals all the techniques and strategies that you need to know to nail job interviews at a tech company.

The RRP is $64.75 if you were to purchase these resources separately from my Career Hub.

However, for this week, I am bundling all of them up and giving a whopping 30% discount, so you can get **[all of the resources in one transaction](http://eisabai.fetchapp.com/sell/0a0607e0)** at $45.30. What a deal, right?

Hurry, because this deal only lasts this week. I can't wait to see you grow your career for 2021! 

🚩

All my best,

Isabel
1st day here 1st post. 
Tags: programming, prolog, productivity
Published: 2020-11-25 21:58:21

{% user stauroskou %}
Hello. 
My name is **Stavros** (Σταύρος [stavros]) I am an **undergraduate** student studying **Computer Science** today is my first day here I actually signed up spurred by a professor from my college.

Also am currently working on a startup project for mobile devices(IOS and Android) unfortunately I can't share more details about this now.. but I will share some details when it's ready.

On my blog, I will try to write about my progress in learning new technologies, diving deeper into what I already "know".

So am thinking of starting 365 days challenge, every day doing something either learning new things or to dive deeper into something else.

Thanks for now.. see you soon.
Autenticación con Azure Active Directory (AD)
Published: 2020-11-25 21:54:33

Una de las características principales de un proyecto es identificar las credenciales de un usuario al momento de iniciar sesión. Azure AD, es una solución de identidad basada en la nube, que nos brinda un montón de funcionalidades para cualquier solución de identidad. En este articulo mostraremos un ejemplo de como integrar esta herramienta en un proyecto con Angular mediante la librería @azure/msal-angular.

#Prerrequisitos:

1. Instalar Node.js https://nodejs.org/en/ .
2. Se requiere la cli angular para crear proyectos npm install -g @angular/cli

#Pasos: 

-Paso 1: Crear un nuevo Proyecto Angular. 
Comando ---> ng new NOMBRE_PROYECTO

-Paso 2: Crear un nuevo componente.
Comando ---> ng g c NOMBRE_COMPONENTE

-Paso 3: Instalar msal angular. https://www.npmjs.com/package/@azure/msal-angular
Comando ---> npm install msal @azure/msal-angular

MSAL para Angular permite que las aplicaciones web del lado del cliente autentiquen a los usuarios mediante cuentas de trabajo y escuela (AAD) de Azure AD.

-Paso 4: Registre la aplicación Angular en Azure Portal ( https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/walkthrough-register-app-azure-active-directory ) y obtenga la identificación del cliente y la identificación del inquilino de la aplicación.

-Paso 5: agregue los detalles de configuración de Msal en el archivo app.module.ts, importe el MsalModule (import { MsalModule } from '@azure/msal-angular').

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/v5c2q9ywm8o5qtk2ipm7.PNG)



#Ejecución
Inyectar el MsalService en el componente donde se ejecutara la autenticación. (import { MsalService } from '@azure/msal-angular'
)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yrxmrmxg4pgsmur6d9sj.PNG)


Desde un button invocar el siguiente método loginRedirect()

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ufttog4yqcmod6ouacfx.PNG)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yatxpgzuga21t899g0er.PNG)

Este método te deberá redireccionar al login de microsoft

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/37b3o0h52259ga41xms4.PNG)

Si el login es exitoso se  redireccionará a la aplicacion registrada en Azure Portal

#Comentarios

Azure AD permite basar la seguridad de tu empresa en la identidad del usuario, de tal forma que brinda un inicio de sesión único
PHP Functions for Golang - phpfuncs
Tags: go, php, functional, module
Published: 2020-11-25 21:02:10

Hello, Serkan is here.

This is my second post in the DEV community. Currently, I am making monthly earnings with websites developed with PHP and Python. But I am sympathetic to Golang. And I'd created a module for Go :)

# Why I created this module?

{% github serkanalgur/phpfuncs no-readme %}

While trying to learn Go, I realized that I was not able to reach the speed I used to be. I think this was due to the fact that I could not break the habit of coding with PHP for about 15 years.

After realizing this, I asked myself if I could write a module that could speed the transition from PHP to Go for both myself and beginners. So I could have speed up my learning process.

**This is the starting spark of phpfuncs module :)**

The module is 4 days old and I chose the MIT license. I rebuilt some PHP code with Go. During naming, I tried to use the same patterns as possible. For now, there are 93 functions (math, file system and general functions), 2 types and one constant depending on these functions.

You can check all functions on modules **[pkg.go.dev](https://pkg.go.dev/github.com/serkanalgur/phpfuncs)** page.

I take care to use the explanations and definitions available on PHP.net. I want to complete this module as fast as I can and provide convenience to software developers like me who switch from PHP.

You can also review and contribute to the module if you wish. I add an example of reading a file below. We can do this in the same way as we do with PHP (I haven't added the file writing function to the module yet).

## Installation
```bash
go get github.com/serkanalgur/phpfuncs
```
## File Read Example
As you can see in the example below, the plugin allows someone who has used PHP to use almost the same function structure in a very simple way.

{% gist https://gist.github.com/serkanalgur/ab822aec27e030f9fd18f93b14b1ec60 %}
###### Note: This example not suitable for Go Playground.

I organized the function names with underscores according to Go. I created some normal function names differently in order to avoid possible errors. For example, the name `fread()` should normally be `Fread()` but I created it as `FRead()`.

I hope I can help developers with this module.

Thank you for your reading.
SQL101 SQL Basics (NoSQL to SQL) all on Oracle Autonomous Database
Tags: sql, oracle, soda, nosql
Published: 2020-11-25 20:46:03

---
title: SQL101 SQL Basics (NoSQL to SQL) all on Oracle Autonomous Database 
published: true
description: A full demo that you can replay on http://sql101.pachot.net Recorded at DOAG: SQL Basics (NoSQL to SQL) all on Autonomous Database
tags: SQL, Oracle, SODA, NoSQL
canonical_url: https://www.youtube.com/watch?v=-eL-G-9cLVk&ab_channel=FranckPachot
---
👤 Dynamic Authorization with GraphQL and Rules
Tags: authorization, security, graphql
Published: 2020-11-25 20:29:31

🛠 Build a Flask and GraphQL quidditch management system that uses Auth0 rules to implement ABAC and GBAC.
[Read more](https://auth0.com/blog/dynamic-authorization-with-graphql-and-rules/?utm_source=content_synd&utm_medium=sc&utm_campaign=graphql_rules)
Host maven artifact in Github Repository
Tags: mulesoft, maven, java, github
Published: 2020-11-25 20:18:58

We often have some jar files or artifacts that needs to be imported via maven command.

Sometimes few artifacts are not available in maven repository and we need to install them manually to our maven .m2 folder. This is tedious job and every developer working on your project has to do the same.

So hosting your own maven repository comes useful and is available to every developer working on your project.

Hence I have created a bash tool to do the same.

Steps:

 * Create a empty GitHub repo.
 * Download the script "artifact_publisher.sh" from [here] (https://github.com/tirthankarkundu17/MavenGitPublish.git)
 * Open a terminal and use command chmod +x to make it executable and then run the script by simple typing ./artifact_publisher.sh
Enter the details as prompted.
 * Once you do these steps, you will get a maven hosted repository URL which you need to use in your maven projects to download these artifacts.

Let me know if you found this useful ! Also feel free to add more stuffs and raise a PR.
Coding on iPad
Tags: ipad, productivity, discuss
Published: 2020-11-25 20:03:41

---
title: Coding on iPad
published: true
description: Would you be able to perform basic programming tasks on an iPad?
tags: ipad, productivity, discuss
//cover_image: https://direct_url_to_image.jpg
---

Well, this is what I’ve been thinking about ever since I bought one. In general they are devices for consuming, not producing content. But since new Apple MacBooks are switching to ARM (same CPU architecture as iPads) we could see more development tools being also available for tablets.

I have seen some people using it for Python and also some applications for learning programming, but would like to know whether it could be used also for JavaScript or even JVM stuff :). 

Does anyone have any experience? Would like to read about it in comments.
Can Nextjs Replace Traditional Web Frameworks?
Tags: discuss, nextjs
Published: 2020-11-25 19:10:27

I was wondering for my next project if I can use nextjs independently.
Not just for SSR/SSG capabilities, but also for handling what was traditionally done by web-
frameworks like express / laravel / django etc...
Meaning using the API routes of nextjs.

Is there any gap that I'm missing? what can't it do and they can? is it considered a bad practice?