teleren/devto huggingface dataset:
how to Contribute to the Ara voice assistant
Tags: hacktoberfest, contributorswanted, java
Published: 2019-10-01 15:50:31

Hello, ITS HACKTOBERFEST!!!!!!!!!!!!!!!!!!!!! (I am excited).

# Why contribute
For most of this year I have been working on Ara alone, and this month I am going to change that, with the help of you. I have several areas where I could use some help.

* Security
* Web development
* Usability
* Just stuff in general

The last one is VERY important. I simply can't build a complicated software system alone, in a reasonable time. here is a good example of what I am saying.
{% github https://github.com/FultonBrowne/Ara-Server/issues/13 %}

To me this is why Open source is so important you get a bunch of view points on a single issue so you find the BEST way to do something. this is why I would like you to contribute this hacktoberfest, to make this voice assistant the best voice assistant ever.

# Some things to start with
To contribute you need to know where, here is my servers code,
{% github FultonBrowne/Ara-Server %}
and my android clients code.
{% github FultonBrowne/Ara-android %}
Each of these have a bunch of issues and projects you can help with. one thing that would be great would be an IOS client, I dont' have A mac so I can't make it, If you have a mac and you're interested contact me on the dev chat. 
# The Stack
Ok, lets go server down. The server is in java and little kotlin it uses the gradle build system and is hosted on Heroku. If you contribute I would recommend you work in Intellij Because I know it works well. the server is there to combine multiple RSS feed using RomeTools and serves as a skills api host.

now for the app, the app is in native android, So, if you don't know, Java, kotlin, and XML. This really needs some work, the voice stuff is done locally so you can interact with on board skills (Still working on that), And I don't have a good enough TF lite file, so voice stuff is like half done. Some other stuff like the UI and settings page could use some work, so go check it out.

# Thank you for reading!!!
My #Hacktoberfest Goals
Tags: javascript, hacktoberfest, github, devjournal
Published: 2019-10-01 15:42:49

Every year Digital Ocean puts on a hackathon in October called Hacktoberfest and this year they are partnering with DEV. As some may remember last October was the very end of my nanodegree program so I didn’t participate.

WHY I’M PARTICIPATING
I’ve been wanting to get into open source for a couple months now to be able to use the skills I’ve been learning and interact with others’ code again since I miss that and I feel as though participating in something globally, like Hacktoberfest, will help motivate me to actually start.

Since it is my first time doing open source I’m going to start off with easier issues, but would I really be me if I didn’t add on more goals for myself?

HACKTOBERFEST GOALS:
Contribute to one climate change- based project
Do one PR where I have to learn something new
One contribution using C++ (if I fail on any this will be it since it’s a super new language to me)
One contribution utilizing React or Vue frameworks

What are your October goals? Who else is participating? Have you contributed to open source before?

Full text here: https://jkimexploring.wordpress.com/2019/10/01/hacktoberfest-2019/
Daily Hacktoberfest Miscellaneous discussion (October 1st)
Tags: discuss, hacktoberfest, watercooler
Published: 2019-10-01 15:34:30

Hey folks, in addition to all the great posts folks are making in the hacktoberfest tag in general, I am going to post daily threads just for random chat. Feel free to use the comments to promote a repo, ask for help, really anything.

{% tag hacktoberfest %}

Happy coding!
Simple Read More, Read Less in Vuejs
Tags: vue, codepen, javascript
Published: 2019-10-01 15:26:15

{% codepen https://codepen.io/E-ben/pen/dybBLow %} 
A simple Read More, Read Less I created in Vuejs. This would take tens of lines of code in vanilla JS but just 6 lines of logic in Vue. 
Just import the Vue CDN in your script tag.
Could I have done it better?
Let me know your thoughts!
Insertion Sort Quick Reference
Tags: coding, interview, computerscience, tutorial
Published: 2019-10-01 15:03:47

---
title: Insertion Sort Quick Reference
published: true
description: Code, key points, and complexity of the insertion sort algorithm
tags: coding, interview, computerscience, tutorial
canonical_url: https://interview.codes/reference/insertion-sort-quick-reference/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/wfbpmszmusfvtl8ub9fu.png
---



Insertion sort is a commonly taught algorithm for sorting a list of items. Though not commonly used, as it's not efficient, it may come up during [interviews](https://interview.codes/). It also uses concepts that might be beneficial when writing other algorithms. This is a quick reference for insertion sort.


# Algorithm Design

Insertion sort takes an unsorted list and produces a sorted version of it.

It is a stable sorting algorithm.

```
Insertion-Sort( input )
	output = empty list
	for each item in the input
		find location item in the output using upper bound (binary search)
		insert item at location in the output
```

Refer to [sample code in Python](https://github.com/mortoray/interview.codes/blob/master/insertion-sort/main.py).

# Algorithm Complexity

## **Time:** Comparisons

The number of comparisons it the number of times two items are compared with each other. This is typically done using only the less than `<` comparison.

For each item in the list `n`, the algorithm searches for the correct location using binary search `O(log n)`. This puts an upper bound on the number of comparisons at `O(n · log n)`.

## **Time:** Copies

The number of copies is the number of times an item is copied to a new location, either from the input or within the output.

All items must be copied from the input to output, making a minimum of `Ω(n)` operations. If the input is in sorted order, this will be the number of copy operations.

In the worst-case scenario the list is sorted in reverse order. In this scenario each insertion into the output will need to move all existing items in the list. For each `n` items, there could be up to `n` copy operations. This is `O(n²)` copy operations.

## Space

The algorithm needs to allocate space in the output for each item in the output. It needs no additional space. This is a space complexity of `θ(n)`. 

# Notes

Due to its costly time complexity for copy operations, insertion sort is not typically used to sort a list. It is however an efficient way to insert a limited number of items into an already sorted list.

Inserting one item with insertion sort is `O(log n)`, whereas adding an item to a list and resorting is `O(n · log n)`.

----

>View my [video class](https://edaqa.link/InsertionSort-IC) that covers the design, complexity, and code of the algorithm.
WatchOS modular large complication

Published: 2019-10-01 14:55:13

Hey guys,

This doesn’t really fit on this subreddit, but since there is no watchkit development subreddit, I thought I’d try here.

The calendar app on watch has a complication for the modular large slot. The design is like this: header colored red, first line colored white & second line colored gray. I want this for my complication but I can only get it to header red & other lines gray. Is this a private api that the calendar app is using or am I missing something.

Thanks in advance. https://tweakbox.mobi/ https://getappvalley.com/
Package Your Tools
Tags: centos, linux, redhat, rpm
Published: 2019-10-01 14:36:42

RPMs in $HOME! Amaze friends! Confound enemies! Install the binary versions YOU want! All this and more with *native tools* and *no root*!

Enough hype yet? This is a simple and maybe-ugly way to get RPMs that install into your $HOME directory to simplify management of hosted shells and tight VMs/containers where management infrastructure would be too much overhead. You won't need root to *install* these RPMs, but *will* need a RHEL/Centos host to build them on; [Circle CI](https://circleci.com/)'s free tier is great for this.

I feel like I misled DeChamp in [a comment thread](https://dev.to/dechamp/comment/fm7j) talking about the socket options for `fuser`, so I'll use this article as a roundabout apology and employ `fuser` as an example.

### Building RPMs for $HOME

1. Install rpm-build on the builder VM to do the heavy lifting: 
`sudo yum install rpm-build -y;`

2. Install the [FPM](https://github.com/jordansissel/fpm.git) gem on the builder VM to handle the RPM building : 
`git clone https://github.com/jordansissel/fpm.git; 
cd fpm && gem install --no-ri --no-rdoc fpm;`

3. Create an install tree for your script on the builder VM. This file system tree will be reflected on the target host that the RPM is installed-on:
`mkdir -p $HOME/var/tmp/bin`

4. Add the scripts, libraries, configs and whatever else to $HOME/var/tmp/bin:
`cp $HOME/psmisc/src/fuser $HOME/var/tmp/bin`

5. Add a helper script called `var/tmp/bin/fuser-after.sh` to relocate installed files:
`[[ -d  $HOME/bin ]] || mkdir $HOME/bin;
[[ -d  $HOME/bin ]] && mv /var/tmp/bin/fuser $HOME/bin;
`

*Please give these scripts distinctive names*, RPM won't want to install over an existing script.

6. Build an RPM from the contents of $HOME/var:
`cd && fpm -s dir -t rpm -n fuser --after-install 'var/tmp/bin/fuser-after.sh' var`

### Installing RPMs for $HOME

Now don't let your enthusiasm fizzle when `rpm -i` comes back with "error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)"! If root doesn't want to share its tree house we'll build our own! 

```bash
mkdir $HOME/rpmdb
find /var/lib/rpm -type f |xargs file| awk '/Berkeley/ {print $1}' | tr -d ':' | while read src 
do 
    db_dump $src | db_load $HOME/rpmdb/$(basename $src); 
done;
rpm --dbpath $HOME/rpmdb --rebuilddb;
```

Now we can install our RPMs like so:

`rpm --dbpath $HOME/rpmdb -i fuser-1.0-1.x86_64.rpm`
An i18n engine with translation rules?
Tags: help, translation
Published: 2019-10-01 14:31:09

This is a long shot, but hopefully someone can help!

Some time ago I found an i18n engine that allowed you to define custom rules to improve the translation quality. Most i18n engines simply interpolate the argument to the translated string. This causes non-natural translations. An example is languages that use articles and apostrophes, like Catalan, French or Italian, or languages with cases, like German or Lithuanian.

This i18n engine let you define custom rules on how to generate those apostrophes depending on the argument that you're sending to the translated string.

Anyone knows something about it?

Thanks!
#inktechtober
Tags: sketchnote, sketchnotes, beginners, inktechtober
Published: 2019-10-01 14:20:19

---
title: #inktechtober
published: true
description: Let's have some fun sketching tech!
tags: sketchnote, sketchnotes, beginner, inktechtober
cover_image: https://thepracticaldev.s3.amazonaws.com/i/1o5g3vt6tyk96tsm3xbk.jpeg
---

Let's have some fun sketching tech concepts with our own version of inktober: #inktechtober!

Each day, sketch the concept for the day and post it with the #inktechtober hashtag. Check the full image [here.](https://thepracticaldev.s3.amazonaws.com/i/1o5g3vt6tyk96tsm3xbk.jpeg)

Sketches can be color, black and white/digital/pencil/pen/those old crayons. 

We're going for making some marks every day instead of perfection. 

Let's get sketching!!
Matt’s Tidbits #36 - How to get complete code coverage in unit tests for a nullable Kotlin “var”
Tags: mattstidbits, android, kotlin, testing
Published: 2019-10-01 14:03:01

[Last week I wrote about a strategy for debugging complex unit test failures.](https://medium.com/@matthew.b.groves/matts-tidbits-35-a-strategy-for-debugging-complex-unit-test-failures-1d4097a0903e) This time, I’d like to tell you about a strange code coverage issue with Kotlin and how to resolve it!

If you’re writing unit tests for a Kotlin class, you may not see complete code coverage for code like this (even if you’re testing `bar()` with both null & non-null values of `foo`):

{% gist https://gist.github.com/mpeng3/fdf350bc1e2bb49627a3d227e3f83460 %}

Because `foo` is a var, the compiler can't guarantee that another thread won't access it and change its value between the time you check `if(foo != null)` and the time you call `foo?.size()`. This is why you have to use the `?` when calling `foo.size()` - because the compiler won't smart cast the `var` from `String?` to `String` even though you're inside a null-checking if statement.

Unless you want to write tests that actually capture the value of `foo` changing mid-method, it's much better to write this code like this:

{% gist https://gist.github.com/mpeng3/d724b5fda61d399ea788e8a645eb5fe7 %}

In this 2nd example, the compiler automatically creates a constant `val` reference to `foo` that's internal to the `let` block, and can therefore guarantee that `foo` (`it` inside the `let` block) is non-null. This also eliminates the code coverage issue as the value is only checked for null once.

In my opinion, this approach is also much cleaner than handling it yourself by manually creating a temporary `val` like this:

{% gist https://gist.github.com/mpeng3/fa4634ae073abf3e10a426498a0d74b1 %}

What was initially baffling about this was that I was using a nullable `var` such as in the example above, and this class only had two methods which both had `synchronized` blocks wrapping all changes to `foo`. It took me a while to tumble to the fact that the compiler was worried about multi-threaded access, and that this was one instance where the code coverage tool just isn't smart enough to be able to determine that multithreaded access was not a concern.

Have you discovered other strange/unexpected behaviors like this with Kotlin related to code coverage? If so, how have you solved them? Please let me know in the comments below! And, please [follow me on Medium](https://medium.com/@matthew.b.groves) if you’re interested in being notified of future tidbits.

*This tidbit was originally delivered on October 12, 2018.*
A participation guide for Hacktoberfest
Tags: tutorial, opensource, hacktoberfest, beginners
Published: 2019-10-01 13:59:05

Hacktoberfest starts today 🎉

This is a month-long celebration of open source software. To participate you need to open four pull requests between October 1 and October 31. If you do that you all receive stickers and a limited edition t-shirt for that year's celebration. Only the first 50,000 first participants will earn a t-shirt.

## How to participate

First of all you need to sign in on the event's website:

https://hacktoberfest.digitalocean.com/

You can now start contributing on GitHub! It takes in account all PRs made on public repositories.

## I'm new to open source, how can I contribute?

[Benjamin Petetot](https://twitter.com/bpetetot) wrote an [article](https://dev.to/bpetetot/getting-started-in-open-source-2pf2) about "Getting started" in open source. It explains how the open source world works. There are also pointers to website that lists repositories waiting for contributions.

Digital ocean have made [guides](https://www.digitalocean.com/community/tutorial_series/an-introduction-to-open-source) about the technical aspect of making a contribution. There are ressources about `git` and the `pull request` mechanism.

## I'm an open source maintainer, how do I participate?

You should make your repository friendly to new comers. I wrote an [article](https://dev.to/yvonnickfrin/preparing-your-project-being-open-sourced-5bdp) to help you to prepare your project in order to get its first contributions.

Hackotberfest's website lists all repositories having issues labelled by `Hacktoberfest`. Feel free to add this label to issues that are easy to fix like your project's `good first issues`.

You can promote your project during the month to grab a few contributors. [Thomas Betous](https://twitter.com/tbetous) and [Franck Abgrall](https://twitter.com/FranckAbgrall) have made a [cheatsheet](https://github.com/zenika-open-source/open-source-promotion-cheat-sheet/#readme) to help you on this subject. It is available in english, french and german.

This year Dev.to is one of the sponsor and the platform wrote an [article](https://dev.to/devteam/hacktoberfest-starts-in-six-days-3hi2) about how to use the website during the event as a participant or a maintainer.

Have a nice Hacktoberfest 🙌 and don't forget to share your pull-requests here ❤️
Docker basics/ cheatsheet
Tags: docker, containers, unix
Published: 2019-10-01 13:56:50

---
title: Docker basics/ cheatsheet
published: true
description: 
tags: docker,containers,unix
cover_image: https://3kllhk1ibq34qk6sp3bhtox1-wpengine.netdna-ssl.com/wp-content/uploads/2017/01/how-to-deploy-java-apps-with-docker-a-quick-tutorial@3x-1560x760.png
---

### Create image using this directory's Dockerfile
docker build -t <somename> 

### Run <somename> mapping port 8000

- docker run -p 8000:80 <somename>   

### Same thing, but in detached mode
- docker run -d -p 8000:80 <somename>          

### Enter a running container (you can also do sh)
- docker exec -it [container-id] bash  
          
### See a list of all running containers      
- docker ps       

### Gracefully stop the specified container                     
- docker stop <hash>    

### See a list of all containers , active and inactive 
- docker ps -a 
          
### Force shutdown of the specified container
- docker kill <hash>   

### Remove the specified container from this machine   
- docker rm <hash>      
   
### Remove all containers from this machine
- docker rm $(docker ps -a -q) 
    
### Show all images on this machine
- docker images -a   
 
### Remove the specified image from this machine     
- docker rmi <imagename>   
  
### Remove all images from this machine   
docker rmi $(docker images -q)    

### Log in this CLI session using your Docker credentials
- docker login    
       
### Tag <image> for upload to registry
- docker tag <image> username/repository:tag 

### Upload tagged image to registry
- docker push username/repository:tag   

### Run image from a registry
        
- docker run username/repository:tag
Daily Challenge #80 - Longest Vowel Change
Tags: challenge
Published: 2019-10-01 13:52:08

---
title: Daily Challenge #80 - Longest Vowel Change
published: true
series: Daily Challenge
description: return the length of the longest vowel substring
tags: challenge
---

The vowel substrings in the word `codewarriors` are `o,e,a,io`. The longest of these has a length of 2. Given a lowercase string that has alphabetic characters only and no spaces, return the length of the longest vowel substring. Vowels are any of `aeiou`.

Good luck!

***
_This challenge comes from KenKamau at [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Contributing to Hacktoberfest
Tags: hacktoberfest, opensource, github, javascript
Published: 2019-10-01 13:50:22

![Hacktoberfest](https://hacktoberfest.digitalocean.com/assets/logo-hf19-header-8245176fe235ab5d942c7580778a914110fa06a23c3d55bf40e2d061809d8785.svg "Hacktoberfest")
So its October and at this time of the year we celebrate open source festival Hacktoberfest. This is the time when everyone comes forward to contribute towards open source.
Hacktoberfest is open to everyone in our global community. Whether you’re a developer, student learning to code, event host, or company of any size, you can help drive growth of open source and make positive contributions to an ever-growing community. All backgrounds and skill levels are encouraged to complete the challenge.

Just made 4 pull requests in GitHub-hosted repositories/projects. What are you doing? Come along and start contributing to win exciting goodies...


[![Open Source Love svg3](https://badges.frapsoft.com/os/v3/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)
Expressive module that binds redux state to localStorage
Tags: redux, localstorage, react, javascript
Published: 2019-10-01 13:50:00

I just published this module. Initially I was looking for existing solution in npm but all the available ones either didn't work for me or they were just too complicated for the most common use cases. I decided to write my own which I used in one of our projects and I realized that it might be useful for more people so I created a module out of it.

You can find the code here

https://github.com/jahnestacado/redux-tattoo

Feedback is always welcome :)
Query Log Laravel, understanding what happens behind the “rags”.
Tags: php, laravel
Published: 2019-10-01 13:36:58

![](https://miro.medium.com/max/1024/1*3iN4ZkcPGkFmmjP7ZjO_oA.jpeg)

So you’re writing some querys in Eloquent Laravel and suddenly someone asks what actually happens behind the “curtains” that involve the abstraction of your favorite Framework and you don’t know how to respond, find out how below.

----------

## knowing `getQueryLog() method`

This method has been available since version 4.2 of Laravel, meaning it is nothing new, but many developers are unaware. What he does is very simple; it generates a complete log with very interesting information about the behavior of a query, to use it’s simple, just look below:

```php
<?php

namespace API\Repositories;

use API\Repositories\Contracts\WorkoutPlanRepositoryInterface;
use API\WorkoutPlan;
use Illuminate\Support\Facades\Validator;
use DB;

final class WorkoutPlanRepository
{

    public function workoutPlanByUser($id)
    {
        DB::enableQueryLog();

        $workoutPlansByUser = WorkoutPlan::with('user', 'workoutType')
            ->where('fk_user', $id)
            ->get();
        
        dd(DB::getQueryLog());
    }
}
```
```js
array:3 [

    0 => array:3 [
      "query" => "select * from "workout_plan" where "fk_user"=?"
      "bindings" => array:1 [
          0 => "1"
    ]
      "time" => 4.57
  ]
    1 => array:3 [
      "query" => "select * from "user" where "user"."id" in (?)"
      "bindings" => array:1 [
          0 => 1
    ]
      "time" => 3.22
  ]
    2 => array:3 [
      "query" => "select * from "workout_type" where "workout_type"."id" in (?, ?, ?)"
      "bindings" => array:3 [
          0 => 1
          1 => 2
          2 => 3
      ]
      "time" => 3.55
     ]
]
```
Here we have some **really important** information for our application, our query was written using the [Eager Loading](https://laravel.com/docs/5.5/eloquent-relationships#eager-loading) technique through the Laravel [with ()](https://laravel.com/api/5.6/Illuminate/Database/Eloquent/Builder.html#method_with) method that defines the relationships that must be loaded.

The first information is the query executed, note that we are executing three querys, the second information refers to the values ​​used in the querys, in our case values ​​for the **where** and **in** clauses **,** and finally the time spent to “rotate” our search .

After this article you will never be “awkward” when asked what happens when such a query is executed, I hope this tip will be useful for you until the next.