teleren/devto huggingface dataset:
Devmates.co [Array Search]
Tags: challenge
Published: 2019-09-26 11:13:44

*Hello👋, 
*My name is [Alex](https://twitter.com/alexwawl) and I'm maker of [Devmates.co](https://devmates.co).* 😊

*We are resolving daily coding problems which asked by top tech companies together. We share our solutions, give some help if anyone stuck, support each other and just hangout together in the internet.* 🍻☕️💬

*I get this problem from our members or just searching them in the internet(leetcode forums, Glassdoor, teamblind, etc.). Sometimes this problem can be very easy, sometimes too 👷‍♂️hard, everything depends on skills but we are trying to resolve all of them and Have Fun.*  🙌 

Today I want to share problem which was asked by 🏢 Google.

#####Problem:

Find the __starting__ and __ending__ position of a given __target__ value in array of integers __nums__ sorted in __ascending__ order.</p>

If the target is not found in the array, return [-1, -1].

#####Example:
__Input:__ nums = [3,4,7,7,9,9,9,10], target = 9
__Output:__ [4,6]

__Input:__ nums = [3,4,7,7,9,9,9,10], target = 8
__Output:__ [-1,-1]

Your algorithm's runtime complexity must be in the order of __O(log n)__
Payment Made Easy - Flutterwave
Published: 2019-09-26 10:54:21


Written by Opeyemi Sokefun

Flutterwave is a complete payment solution that helps you pay, transfer, save and monitor your money through the digital infrastructure.

Getting started with Flutterwave
To make payment and receive money from customers, visit www.flutterwave.com to have an active account. After creating an active account, you can choose Rave payment for business purposes or Barter payment for everyday transactions. 
 Note: You can make your payment through web, mobile, ATM, and POS

Product 
Rave is a platform for small and large scale business owners (NGOs, Sole traders, Freelancers, Entrepreneurs etc) that accepts a range of payment methods from customers around the world and help you monitor the customer's transaction habit. To receive payment, login to www.rave.flutterwave.com and get started. 

Barter is an everyday platform for all customers. It help ease personal and small payment across border which includes paying of bills,  buying tickets, transferring money. All you have to do is download here the web app that will help you to create an instant VISA and MasterCard for everyday Merchant payment and help track your transactions with local and international sales. Visit www.flutterwave.com/barter

Barter app also helps you manage your finances by saving as low as N50 Naira to N500, 000 as you enjoy life and make payment for Uber, Jumia, Flywire, Arikair.com, MarketHub, Booking.com, Dusupay, BroadPay, PennySmart, Xero, Quick books, Sage and Zoho, and Amazon.

About Flutterwave
Flutterwave is the new rave of prosperity that has helped reduce the financial exclusion in the global economy. With this, it has processed over $2.5billion in payment and over 100million transactions. It has also partnered with over 50 Africans banks and operational in Uganda,  Tanzania, Ghana,  Kenya, and Nigeria. They are now licensed in the United Kingdom and Zambia.
Adding a title to a Markdown link
Tags: markdown, tip, todayilearned
Published: 2019-09-26 10:54:10

Here’s a little something I learned recently about Markdown links.

You can optionally add a title to a link by enclosing it in quotes after the URL.

```
[Link to something awesome](https://dev.to/ "Check out Dev.to")
```

Unfortunately, not all websites support this. Here on Dev.to, for example, the string is ignored. On the other hand, it works on GitHub.

![Demo](https://thepracticaldev.s3.amazonaws.com/i/l7qbb2cseep3ct4q2q7e.gif)

Most Markdown cheatsheets I’ve seen don’t mention this so there’s always something new we can learn, I guess. :)
A no-fuss Laravel + Docker starter repo
Tags: laravel, docker, tutorial
Published: 2019-09-26 10:48:19

---
title: A no-fuss Laravel + Docker starter repo
published: true
description: When I first started with Laravel, I struggled with containerizing with Docker. Each tutorial was more complex than the next and nothing was straight forward. Here is the repo I wish I had.
tags: ["Laravel", "Docker", "tutorial"]
---

This starter repo was born out of frustration of getting docker working with Laravel. Hopefully this will save you some headache!

First, clone the repo here: https://github.com/christopherarter/Quick-Laravel-Docker-Starter


Prerequisites:

1. **PHP 7.1 (minimum)**
2. **Composer** [install guide](https://getcomposer.org/doc/00-intro.md)
3. **Docker** [install guide](https://docs.docker.com/v17.09/engine/installation/)
4. **Docker Compose** [install guide](https://docs.docker.com/compose/install/)

### Get started

 
1. Clone this repo and navigate to the repo folder. Run `composer create-project --prefer-dist laravel/laravel my-app`
4. Run `mv my-app/* my-app/.* ./ && rm -rf my-app`
5. Change the values in your `.env` to the values below:

```
DB_CONNECTION=mysql
DB_HOST=laravel_db
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=laravel_user
DB_PASSWORD=myStrongPassword1234
```
 
The last step, run `docker-compose up`

When you run `docker ps`, you should see your service running locally at `http://localhost:9000`

**To run migrations and commands that interact with the database** you need to be inside the laravel web app container. 

Run `docker ps` and get the id of the laravel web container. Next, run `docker exec -it <container-id> /bin/bash` and you should be at `/var/www/app`. You may now run artisan commands to interact with the database.

### Connecting to your database with a database tool 

To connect with this database using tools like MySQL Workbench, DB Beaver or TablePlus, you can access it with the `3305` port, username and password you specified in your `.env` file.
Let's not pit web components against frameworks
Tags: webcomponents, frameworks, javascript, webstandards
Published: 2019-09-26 10:33:06

---
title: Let's not pit web components against frameworks
published: true
description: Instead of suggesting that we should ditch frameworks, let's just take a fresh look at web components and see if they make sense to sprinkle into our existing framework based projects and update our thinking about them as web standards
tags: web components, frameworks, javascript, web standards
---

Let me just get this out there: I love web components. I've been following their journey and I've been working with them since before they were supported in all major browsers. But here's the thing, I don't love seeing people fighting for web components by telling everyone to ditch frameworks.

If you want to do something radical with web components, I think the best place to start is reevaluating if you have a use for them *in conjunction* with your existing framework based projects.

To me, the sad part around the web components discussion is that some people believe that they are still "only a Google thing", or that Polymer === web components. The fact is, web components did get their early start from Google dating back to 2011. Since then, all major browser vendors have weighed in on them, made changes to the specs around web components, and collectively they produced a series of standards. Web components are all based on web standards (https://github.com/w3c/webcomponents). Early on, saying that web components were "only a Google thing" would have been somewhat true, but in 2019 it's a very different story. I just encourage you to take a fresh look at them and see how well supported they are in all major browsers, and see how many companies are using them in both large and small ways to accomplish many different things. 

I don't think we need to try to pit web components against frameworks, that's not really the goal of web components. Instead, maybe just see if web components make sense for you or your team for creating pieces of an application for easy cross framework or frameworkless development. If it doesn't fit into anything you need or want, no problem. The nice part is that by reevaluating web components and the specs around them you can keep them in your mind for the future where they might be useful to you in another project. And as developers, by reacquainting ourselves with the standards that surround web components we can expand our toolbox 🧰 of web standards knowledge that we can tap into even outside the context of just web components.
Node, TypeScript boilerplate w/ linting, aliases, testing
Tags: javascript, typescript, node, boilerplate
Published: 2019-09-26 10:32:31

---
title: Node, TypeScript boilerplate w/ linting, aliases, testing
published: true
description: A lightweight authentication library for Node
tags: javascript,typescript,nodejs,boilerplate
---

I found myself continuously writing boilerplate code whenever I wanted to start a Node project. Whether it be an API or an experiment, I always start with this initial building block.

{% github o8e/node-ts-boilerplate %}
Use the ES6 import in Node.js
Tags: node, javascript, devtips, webdev
Published: 2019-09-26 10:25:28

---
title: Use the ES6 import in Node.js
published: true
description: use the ES6 import instead of require in node.js
tags: #node #javascript #devtips #webdev
---

If you decide to use the ES6 `import` instead of `require`, this is a simple presentation on how to achieve that using `babel`:

– First Install the core dependencies:

```
npm install babel-register babel-preset-env --save-dev
```

– Create a starter.js file that contain how your code has to be transpiled plus the file that contains your imports:

```js
require("babel-register")({
  presets: ["env"],
});

// Import the rest of our application.
module.exports = require("./test.js");
```

And now your can use `import` in your `test.js` file instead of require:

```js
import validator from "validator";

const email = "yep";

if (!validator.isEmail(email)) {
  console.log("the email is not valid");
}
```

To test the output:

```
node starters.js
```
Where the f**k did my time go?
Tags: discuss, productivity
Published: 2019-09-26 10:25:07

---
title: Where the f**k did my time go?
published: true
description: An idea of tracing one's steps through git, Email, Jira and Co.
tags: discuss, productivity
---

If you're anything like me, this sounds familiar: On Friday evening you realize how much didn't get around to and wonder what kept you busy all week 🙋‍♀️🙋‍♂️

To track and understand my work better I thought about retracing my steps in git, Email, Jira etc. Each git commit has a timestamp, each email too, and calendars show me which meetings I've been in. When you bring Jira into the picture it should even show you how much meetings and other distractions affect your story points.

I've built a quick prototype to show me a charts for different tasks based on my Calendar entries (meetings, focus time, learning time etc.) and first results are quite surprising! (Programming is a side activity and not my main job if you believe my calendar ;-))

What do you guys think would something like this work for you? Have you tried something like this already?

P.S. My prototype is not yet on GitHub. But if you're interested [let me know](http://mirror.vsaw.eu) and I can let you into the private beta :-)
How to access the MySQL CLI With MAMP
Tags: mysql, mamp, macos, terminal
Published: 2019-09-26 10:12:27

---
title: How to access the MySQL CLI With MAMP

published: true
description: 
tags: #mysql #mamp #macos #terminal
---

First, you’ve to start MAMP or MAMP PRO, and you open your terminal and type:

```
/Applications/MAMP/Library/bin/mysql -uroot -p
```

Enter the password, by default the password, is `root`:

```
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 254
Server version: 5.6.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
```

If you want to use the command `mysql` by default without typing the entire command line you can edit one of these dot files `~./bashrc` if you’re using bash or `~/.zshrc` in case of using *zsh* and add this alias:

```
alias mysql=/Applications/MAMP/Library/bin/mysql
```

After editing the file using *Vim* or *Nano* editor save the dot file, and run the `source` to validate the modification.

If you're using use zsh:

```
source ~/.zshrc
```

If you're using bash:

```
source ~/.bashrc
```

Now you can run the command `mysql` from the terminal and enter the username and the password:

```
mysql -uroot -proot
```
Swift Enumerations (Part 1)
Tags: swift, ios, mobile
Published: 2019-09-26 09:57:28


An enumeration defines a custom data type for a set of related values. Swift enumerations are much more flexible and powerful than we got used to in other languages. Enumerations in Swift are first-class type in their own right, they support computed properties, instance methods, custom initializers, extensions and can conform to protocols.

# Syntax

Swift enumerations are introduced with the enum keyword and writing their entire definition within a pair of braces. Here's an example that defines some different types of polygons:

{% gist https://gist.github.com/jaumevn/52f6974d289da14551d926a2ac9f4678 %}

Multiple cases can be arranged on a single line separated by comas:

{% gist https://gist.github.com/jaumevn/18eb9875c0924f4f31f5e08328c2f72b %}

You can match enumerations with various pattern matching constructs to retrieve the value of the enum, or act upon a specific case. Here's an example that prints the number of sides of the polygon for an specific case:

{% gist https://gist.github.com/jaumevn/d11d31118fec3a19288591e93f699323 %}

A switch declaration must be exhaustive when considering an enumeration's cases. If one of the cases of the enum is omitted in the switch declaration the code will not compile. If you don't need to provide a case for every enumeration case, you can provide a default case:

{% gist https://gist.github.com/jaumevn/ca0c732e7547722e2cdad8e7ff304b19 %}

When a variable is initialized with one of the possible values of an enumeration, the type is automatically inferred. In the following example, the variable figure contains the enum value triangle and so it automatically infers its type, Polygon. We can then set it to a different Polygon value using dot syntax:

{% gist https://gist.github.com/jaumevn/a0cd77c39ea96e8e84a9aa83fd21f6c7 %}

# Raw Values

Enumerations can have a value assigned to each case. Swift supports Integer, Floating Point, String and Boolean types for the value of an enum. You can access to the value assigned to each enumeration case with the rawValue property.

{% gist https://gist.github.com/jaumevn/e115057c0316a0ea63871b9b4144306e %}

# Nested enums

Enums can be nested in order to specify sub types. To nest a type within another type you must declare its entire definition within the outer pair of braces.

Following the previous example, we can consider two new specific sub types for the triangle enum case. Triangles can be classified by various properties relating to their angles and sides. Here's an example that classifies triangles by their sides:

{% gist https://gist.github.com/jaumevn/da84665d8f8c0e76f019410aa7c8a28a %}

Nested types can be used outside its definitions context using the dot syntax. You must prefix its name with the name of the type it is nested within:

{% gist https://gist.github.com/jaumevn/61507b44f39f4bafe586d2ece70414fe %}


---

If you find this post helpful, please recommend it for others to read. In the next chapter we will cover more advanced features such as associated values, methods and properties.
Oscar - Free wordpress theme
Tags: wordpress, theme, boostrap, design
Published: 2019-09-26 09:00:05

Oscar is a free, responsive WordPress theme made with bootstrap 4 with a colorful and modern design. It has a unique and special layout with a responsive wavy SVG header and footer backgrounds. This theme will help you make your blog fly. It will attract visitors and will never forget it. And this free WordPress theme with its modern design your blog will look more professional. You can use this free WordPress theme to present your store products, your ideas, your magazine items and also you can use it as a personal portfolio. Just enjoy this free WordPress theme.
Demo:https://webcodes.net/216
9 Basic Docker Commands with Examples
Tags: docker, devops
Published: 2019-09-26 08:56:41

Check out my latest post on the devdojo.com website!

I'm going through a few basic Docker commands with some nice examples.

Link to the post:

https://devdojo.com/tutorials/9-basic-docker-commands-with-examples

I strongly encourage everyone to go ahead and check out the devdojo.com website, there's a lot of valuable content there.
🗂️ What is the folder structure of project/library working on?
Tags: library, react, typescript, tree
Published: 2019-09-26 08:48:05

---
title: 🗂️ What is the folder structure of project/library working on?
published: true
description: 
tags: library, react, typescript, tree
---

Follow Angular style guide https://angular.io/guide/styleguide

```
tree -I 'node_modules|build'
```

An app

{% gist https://gist.github.com/iamandrewluca/660904bf6f3715fb82d6781e685cdced %}

A library

{% gist https://gist.github.com/iamandrewluca/f5073dbcd8443ecf0cd9dbd4b2b83aa2 %}
Best content writing agency in Kerala
Published: 2019-09-26 08:22:40

Quality content is the lifeline of online businesses. With high quality content in their websites, businesses can win the interests of their potential customers and enlighten them with all business information. This can lead to customer conversions, in fact provide businesses loyal customers. If you are planning to develop standard website content for your businesses, you can opt for the services of the <a href="https://infigcontenthub.com/">best content writing agency in Kerala</a>. With expert content writers in Kerala planning effective content strategies for their businesses, your business cannot fail but get best online visibility. With interesting content presented well, these websites are bound to generate interests of visitors in your business.

Seek the services of expert content writers in Kerala and highlight your businesses easily. Experienced content writers have good understanding on the requirements of your businesses and they plan innovative content strategies to provide a niche for your businesses online. They provide original content drafted flawlessly and help you build awareness on your brands, products and services of your businesses.
Tecnologías inmersivas: realidad virtual, realidad aumentada y realidad mixta.
Tags: dotnetters, vr, ar, mr
Published: 2019-09-26 08:17:34

El martes 24 de septiembre hemos arrancado la nueva temporada de @dotnetters Zaragoza, con una charla de la mano de Álvaro Monzón sobre tecnologías inmersivas: realidad virtual, realidad aumentada y realidad mixta.

![] (https://thepracticaldev.s3.amazonaws.com/i/xkn78kw72sbf6rqcttu4.jpg)

Al comienzo de la charla, Álvaro nos ha hecho un breve resumen de las tres realidades y ha mostrado las diferencias que existe entre ellas.

![] (https://thepracticaldev.s3.amazonaws.com/i/zu9zzzsqlqd90d5j3kxk.jpg)

Hemos aprendido que existen cuatro (4) tipos de realidades aumentadas:
   * Marcador
   * Geolocalización
   * Escaneo objeto 3D
   * Slam

![] (https://thepracticaldev.s3.amazonaws.com/i/uhn72d2ryxejyoyokgwk.jpg)

También hablamos de tecnologías:
   * Xamarin
   * Unity 3D
   * Xcode
   * Librerías nativas
   * Android
   * IOS, etc ...

 Tuvimos la oportunidad de hacer una pequeña práctica que realizó uno de nuestros asistentes en recompensa a su alta participación, la verdad es que nos sorprendió gratamente sus conocimientos y que no le diese vergüenza hablar.

![] (https://thepracticaldev.s3.amazonaws.com/i/vpwsw2qr6g606k578ekk.jpg)

 Hablamos de los diferentes tipos de gafas existentes actualmente en el mercado y las nuevas versiones que están por salir, como por ejemplo, Hololens.

 Hemos aprendido la diferencia entre una visualización 360º y la realidad virtual, como se realizan diferentes demostraciones para los clientes según sus necesidades, de tiempo, de costes y un sin fin de información que nos dejó a todos con más ganas de seguir aprendiendo de estas tecnologías.

 ![] (https://thepracticaldev.s3.amazonaws.com/i/8ptnxlwrfzm4a0tec142.jpg)

 Por último, pudimos ver varios vídeos de cosas impresionantes realizados con diferentes tecnologías y como muestra os dejamos este vídeo realizado por Álvaro Monzón y su equipo, que no tiene nada que envidiarle a los demás.

 https://www.youtube.com/watch?v=eDO9IacrVY8

 Y hasta aquí amig@s, tal vez haya una segunda parte, pero para saberlo tendréis que seguirnos en nuestro meetup:

 https://www.meetup.com/es-ES/dotnetters/

 Recordar que también podéis seguirnos en Twitter: @dotnetters y así os enterareis de estos tipos de charla.

 No queremos terminar este resumen sin dar las gracias nuevamente a Álvaro Monzón, a nuestros asistentes y a nuestro colaborador @etopia, porque pasamos una tarde nada virtual, muy real y excepcional !!!

 ![] (https://thepracticaldev.s3.amazonaws.com/i/ekbc3svmuo9ye6t78uqq.jpg)
Critique my resume
Tags: career, help
Published: 2019-09-26 08:07:09

I am a graduated computer scientist from Belgium, currently living in Germany. I had some difficulties in College,motivational problems didn't have great grades, didn't specialize in anything particular, most of my extra courses where in outer fields (chemistry for example).

 I love programming, I have a lot of personal projects, mostly modding games, which I love doing. But I struggle with deciding to spend my life doing this. My ideal job would be to work on a game of my own, but the current goal is to get a job, get income and kickstart my life.

After entering Germany, I worked for 8 months as a technical consultant, implementing ServiceNow. Which consisted of mostly pressing buttons, leaving me intellectually understimulated. I quitted that job and am now looking for an actual development position.

Thats it for the background, this is my current cv, any tips or advice would be greatly appreciated.

https://paste.pics/f8daedd63092a7e3b2e05698602fdb6e
Framework (tests) for the Framework god
Tags: espresso, unittests, optimization, productivity
Published: 2019-09-26 08:07:08

---
title: Framework (tests) for the Framework god
published: true
description: Torn between unit and Espresso tests? Read this!
tags: espresso, unit tests, optimization, productivity.
---

Absolutely everyone tests. The only difference is whether the test is automated or not.
Do you launch your app on a device to 'test' or do you write an espresso/unit test for it? You know you're doing one of them.
If you somehow don't do either, then your users are the de-facto testers ¯\\_(ツ)_/¯

Unit tests are amazing, you can run through complicated scenarios really quickly with them, and fast feedback is essential to fast work that maintains your mental model of what you're working on.

However, unit tests can't cover everything. What if, in Android, you wanted to check if your handling of the back button works as you expected?

What if you wanted to see if clicking the thing _actually_ opens the other thing? (yes have your UI state tested beforehand so you get early warnings if this isn't what you expect)

Even with that unit test, it's easy to not actually connect your ViewModel's observable to your navigation.

Hence we need Espresso.

But, since Espresso requires a lot of ceremony, resources and time to run, relegate it to only those parts of your system that your unit tests can't (reasonably) test.

Check out:
1. Navigation
2. Overall behaviour

Always keep it simple! When your designers go changing everything you don't want to have to change more tests than you need to.
It's better to trash a test that changes too often and learn what abstraction to write it with, than continuously go changing large swathes of tests each time something minor changes.

Good luck and reach out to me if you need help accelerating your entire Android team. I'm looking for a job.