teleren/devto huggingface dataset:
Identifying and Mitigating the Ninety-Ninety Rule in Software Development
Tags: meta, ios
Published: 2018-11-12 14:44:44

Eleven days ago, we were about 90 percent finished building the initial version of the DEV iOS app. And then I had a realization: We still had another 90 percent of work to do.

This is a phenomenon so common that  it has a name and Wikipedia page: [The ninety-ninety rule](https://en.wikipedia.org/wiki/Ninety-ninety_rule).

> The first 90 percent of the code accounts for the first 90 percent of the development time. The remaining 10 percent of the code accounts for the other 90 percent of the development time.

Despite feeling like we took a minimal approach from the start, we were _slightly_ off base in the approach and I saw a lot of pain in continuing down that path. So, despite being _this close_ to being finished, we started over.

I made this issue:

{% github https://github.com/thepracticaldev/DEV-ios/issues/88 %}

And then I spun up a proof of concept.

That proof of concept was basically enough. We went with a simple experience in order to launch a native iOS app. It _does_ make use of some of the niceties of iOS, and importantly does alleviate a few frustrating constraints of only existing in mobile Safari land on iOS. Importantly, it also means that we’ve launched platform to grow from. We have crossed the chasm and can now _learn_ how to provide the ideal native experience.

# **On Friday we [submitted the app to the App Store](https://itunes.apple.com/us/app/dev-community/id1439094790)**

We knew that launching quickly rather than living in prototype purgatory was important.  What was less obvious was how simple it was to throw out a lot of work and start rewriting the whole app in one night. This was a new one.

Almost all the code for the current app is located in one file, simply titled `ViewController.swift`.

The night that I realized we needed a shift, I actually began writing three versions of the app. One in Xcode/Swift, one in Flutter, and one in React Native. I also encouraged others to take part in the bakeoff. In this process, the truly native Swift approach always won out for me.

I wrote a bit more about this approach, and I maintain that we made a good call:

{% link https://dev.to/devteam/why-not-react-native-why-not-flutter-why-not-meteor-why-not-nativescript-573h %}

I also started a thread about the sunk cost fallacy at play, and got a lot of validating feedback:

{% link https://dev.to/ben/do-you-have-any-bad-sunk-cost-fallacy-stories-3dkm %}

Now that we have planted our flag in iOS land, it's time to settle and expand. Beginnings are far less important than middles. We want to quickly transition from this beginning phase to a new period of maintenance and growth.

Happy coding ❤️

_Android coming soonish_ 🤖
Papers We Love - Reflecting on Trusting Trust
Tags: pwl, discuss, c, computerscience
Published: 2018-11-12 14:17:28

---
title: Papers We Love - Reflecting on Trusting Trust
published: true
description: 
tags: pwl, discuss, c, computerscience
---

Hello everyone, and welcome to the first paper of Papers We Love!  @thejessleigh was kind enough to get the word out announcing the group and asking for feedback last week, and we heard you loud and clear - this week's paper is on ethics, and it's called "Reflections on Trusting Trust".  You can read the paper [here](https://www.archive.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf).  The paper uses C for its examples (many of our favorite languages, let alone _us_, didn't exist in 1984!), but I feel the C is simple enough that you don't need to know C to understand it.  Give it a read and let's share our thoughts in the comments below!

Personally, I like this paper because it's short - weighing in at a paltry three pages (something I appreciate as a new dad!).  It also goes over some neat programming tricks that we often forget about in contemporary programming, such as self-reproducing programs (also known as _quines_) and self-hosting compilers.  The latter has a special place in my heart, having worked on a self-hosting compiler for a couple years.

This time we picked a paper on ethics - it happens to be the only paper on ethics from the Papers We Love repository.  If you know of any other interesting papers on ethics that you think we should read as a group, plus feel free to recommend them!  Regardless, I think we'll be rotating between topics as we pick papers to discuss each week.
React Hooks Api Intro - How To Use useState And useEffect
Tags: javascript, react
Published: 2018-11-12 14:16:26

---
title: React Hooks Api Intro - How To Use useState And useEffect
tags: javascript, react
published: true
description: Recently React got new hooks api, that allows to have state in purely functional components. Let’s see how it looks like and experiment a bit!
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ye6vqhhmyoe7zvfscgwz.jpeg
---

Recently React got new hooks api, that allows to have state in purely functional components. Let’s see how it looks like and experiment a bit!

* [Watch The Video](https://youtu.be/jK6nuBPfVIk)
use List::AllUtils;
Tags: perl, cpan, module, list
Published: 2018-11-12 14:00:15

---
title: use List::AllUtils;
published: true
description: use List::AllUtils;
tags: perl,cpan,module,list
---

Did you know about the module [List::AllUtils](https://metacpan.org/pod/List::AllUtils)?

It puts the goodness of `List::Utils` and `List::MoreUtils` into one nice package. Or... was it `List::Util` and `List::MoreUtils`? `List::MoreUtil`? Or is it actually `List::SomeUtil`? *Gaaahrhg!*

Well, that's the problem it solves. Now you can forget about which of those modules were named what, `use List::AllUtils;` and just go on with your life. It also adds a few more nice functions from `List::UtilsBy`.

Props to [Dave Rolsky](https://metacpan.org/author/DROLSKY) ([@houseabsolute](https://twitter.com/houseabsolute) on the Twitter machine) for being lazy on our behalf!


## RTFM

It's a good idea to be roughly aware what kinds of operations are available for dealing with lists for next time you need them.

Read the manual on [meta::cpan](https://metacpan.org/pod/List::AllUtils), or locally using `perldoc` (after installing the module, probably using the [cpanm](https://metacpan.org/pod/App::cpanminus) client).

```shell
perldoc List::AllUtils
```


## Highlights

Here are a few standard things on the level of basic language features you should know about.

* `sum`, `sum0`
* `min`, `max`
* `uniq`


And a few niceties worth taking a look at.

* `any`, `all`
* `pairmap`, `pairgrep`
* `pairwise`
* `part`
* `sort_by`, `nsort_by`

But there are many more useful functions in there.

Used correctly these could save you a lot of time and bugs by replacing imperative for loops with more expressive and precise flow control.

Which function helped you out the most? *Add to the discussion* below, or [on /r/perl](https://www.reddit.com/r/perl/comments/9we8m4/use_listallutils/)!
Functional Components in Vue.js
Tags: vue, javascript, webdev
Published: 2018-11-12 13:17:17

---
title: Functional Components in Vue.js
published: true
description: 
tags: vuejs, javascript, webdev
---

Although Vue.js is basically very performant, each additional component uses memory resources. Not every component needs its own Vue instance and change detection. The use of functional components can save resources.

Functional components do not receive a Vue instance at runtime. Rather, such components behave as if they were part of the higher-level component. Functional components are therefore particularly suitable for simple and generic UI components such as buttons, list elements or dropdown controls. A practical example of a functional component is the placeholder for routing views *<router-view/>*.

You can create functional components by adding the attribute *functional* in the template tag with a template. However, developers often implement functional components with their own render functions.

A functional component does not have its own instance and therefore no this context. To access properties, event handlers, and other definitions, a functional component is given an object context.

An exemplary render function is structured as a functional component as follows:

```javascript
export default {
  name: 'SimpleList',
  functional: true,
  props: {
    items: Array
  },
  render(h, context) {
    return h("ul", context.props.items.map(item => h("li", item)))
  }
}
```
The render function gets the object context as second attribute and the access to the array is now not done with this.items, but with context.props.items.

After importing the component, you can use it as follows:

```html
<template>
  <div>
    <SimpleList :items="languages"/>
  </div>
</template>

<script>
import SimpleList from './SimpleList'

export default {
  data() {
    return {
      languages: ['German', 'French', 'Italian']
    }
  },
  components: {
    SimpleList
  }
}
</script>
```

Output: 
+ German
+ French
+ Italian
★ Calling an invokable in an instance variable
Tags: laravel, php
Published: 2020-01-02 23:06:50

---
title: ★ Calling an invokable in an instance variable
published: true
date: 2018-11-12 13:00:00 UTC
tags: laravel, php
canonical_url: https://freek.dev/1208-calling-an-invokable-in-an-instance-variable
---

Invokables in PHP are classes that you can use as a function. They have been around since PHP 5.3 and have [many](https://jenssegers.com/85/goodbye-controllers-hello-request-handlers) [interesting](https://laravel.com/docs/master/scheduling#defining-schedules) [use](https://symfony.com/doc/current/controller/service.html#invokable-controllers) [cases](https://laracasts.com/series/php-bits/episodes/6). Here's a quick example.

```php
class Invokable
{
	public function __invoke()
	{
		echo 'I have been invoked';
	}
}
```

You can use it like this:

```php
// outputs 'I have been invoked'
$invokable();
```

Nice! Now let's use an invokable as an instance variable. Consider this code where we define a new class which has an invokable as an instance variable:

```php
class Foo
{
	/** \Invokable */
	protected $invokable;

	public function __construct(Invokable $invokable)
	{
	   $this->invokable = $invokable;
	}

	public function callInvokable()
	{
		// let's implement this
	}
}
```

Let's see how we could implement that `callInvokable` function. Your first hunch could be to do this:

```php
public function callInvokable()
{
   $this->invokable();
}
```

This will blow up because this code tries to call a non-existing function called `invokable` function on `Foo`.

To do it right you have three options:

```php
public function callInvokable()
{
	// first option: nice
    call_user_func($this->invokable);
		
	// second option: ok too
	$this->invokable->__invoke();

    // third option (only avaible for PHP 7): ?
	($this->invokable)();
}
```
Magento 2 Store Pickup with Store Locator Extension by FME
Tags: magento2storepickup, magento2storelocator
Published: 2018-11-12 12:44:31

---
title: Magento 2 Store Pickup with Store Locator Extension by FME
published: true
description: 
tags: Magento 2 store pickup, Magento 2 store locator
---
Magento 2 store pickup extension allows customers to select a nearby store to pick up the order and save shipping cost & time. They can also schedule the date & time to pick up an order. This extension also allows merchants to create multiple store locations with Google maps directions. Display each store locator with all the details such as store title & description, address, contact details, holidays, timetable etc. 

[Collect from the nearest point of sale](https://www.fmeextensions.com/magento-2-store-pickup-extension.html) module offers multiple benefits. Customers can order online and pick up a store to collect the same at a scheduled date & time. Besides, it creates and displays an unlimited number of stores with a separate landing page for each store. You can create tags for each store to help customers easily recognize them. Add private, public and corporate holidays to each store to display off working days. Similarly, create timetables for each store to show their working hours.

##Major Features of Magento 2 Store Pickup Extension

- Enable store pickup facility for customers 
- Add multiple store locations
- Dedicated landing page for each store
- Display directions to each store on Google maps
- Add tags to each store
- Attach products to each store & show their availability
- Display stores with all the details
- Display holidays for each store
- Display each store’s working hours
- Import data from Magento 1 store

See features of advanced [Magento 2 store locator extension](https://www.fmeextensions.com/google-maps-store-locator-extension-magento-2.html). 

Get Magento 2 Store Pickup from Marketplace: https://marketplace.magento.com/fme-store-pickup.html
How a physical game table inspired my next project
Tags: react, game, inspiration, algorhythm
Published: 2018-11-12 11:46:54

The other night we went to a location called "Pyramide" which is like a bar / pub combined with an area of gaming fun.

There are pool tables, arcade maschines, you can play darts and there are those wonderful gaming tables like this one:

![Gaming table google result](https://thepracticaldev.s3.amazonaws.com/i/zdnufkf23ym57chjz1gv.jpg)

We had a fun time playing monopoly and other games but one game was new to me: **Filler**

The rules are simple:
- Own at least 50% of the stones to win
- You can only use colors not used by the person before you and not your actual color
- You can only own new stones with your color if they are not owned already
- You can only own new stones if they are connected to your already owned ones

![Filler android game screenshot](https://thepracticaldev.s3.amazonaws.com/i/tz8hygj6ocf9fu3mqlar.png)
*Source: Play store screenshot of [Android app](https://play.google.com/store/apps/details?id=org.xbasoft.fillerclassic&hl=en_US) I discovered*

## The project
Because I do a lot with React at the moment, I chose react to build the game.
[Demo](https://darksmile92.github.io/filler-game-react/)

#### Scope
- Build the basic game as react app
- Enhance game with opponent
- Make it smart

#### Current state
Right now the game is working in single player mode and I am working on the opponent mode actively.

#### ToDo / plan
- Implement AI / strategies for opponent
- Create different solving strategies
- Refactor / cleanup code

#### Why am I telling you this?
I would love to get some input from you and I think this is a great base to start a little game project with potential.
Also this is my first approach to do such a thing in react, I created games only with C#, Python and C++ before.

And maybe together we can make a challenge out of it (like Robocode) so everyone writes a solver strategy when the project is more mature?


{% github DarkSmile92/filler-game-react %}
My favourite aliases
Tags: alias, shell, bash, zsh
Published: 2018-11-12 11:01:54

Inspired by [Daniels Blogpost](https://danielmiessler.com/blog/some-of-my-favorite-shell-aliases-from-over-the-years/), I had a look in my `alias.zsh` file, that i use to keep all aliases in one place.

## alias for all the aliases
```
alias aliases="cat ~/.dotfiles/zsh/.zsh/aliases.zsh"
```

Not sure if you have an alias? Can't remember the specific alias you're looking for? Just `aliases` and you'll get the list. 


## git

For my git workflow, i'm relying heavily on aliases to reduce the typing necessary:

```bash
alias gc="git commit"
alias gs="git status"
alias gd="git diff"
alias gf="git fetch"
alias gm="git merge"
alias gma="git merge --abort"
alias gr="git rebase"
alias gp="git push"
alias gpf="git push --force-with-lease"
alias gu="git unstage"
alias gg="git graph"
alias gl="git log --pretty --oneline --graph"
alias gA="git add -A"
alias gri="git rebase -i"
alias grc="git rebase --continue"
alias gra="git rebase --abort"
```

## sbt
Currently I'm working with scala and sbt most of the time, and due to that circumstance, I've added several aliases for that.

```bash
alias sfmt="sbt scalafmt test:scalafmt sbt:scalafmt"
alias sdt="sbt clean dependencyTree"
alias sdc="sbt clean dependencyCheck"
alias sdu="sbt clean dependencyUpdates"
alias ssg="sbt clean scapegoat"
alias sct="sbt clean test"
```

## weather
Do you know the days, when you barely manage to glimpse the sun? Fear no more - with that alias you're informed about the weather in your `<location>`!

```bash
alias weather="curl http://wttr.in/<location>"
```




_picture credit to [kevin ku](https://unsplash.com/photos/w7ZyuGYNpRQ?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_
How to buck up mysql's dump to AWS S3
Tags: mysql, aws, s3
Published: 2018-11-12 10:29:00

---
title: How to buck up mysql's dump to AWS S3
published: true
description: 
tags: [mysql, aws, s3]
---

```shell
#! /bin/bash

db_name="YOUR_DATABASE_NAME"
db_user="YOUR_DATABASE_USER"
db_host="YOUR_DATABASE_HOST"
s3_bucket="YOUR_S3_BUCKET_NAME"
s3_key="YOUR_S3_KEY_PATH"


filename="db_dump_$( date "+%y%m%d_%H:%M:%S" ).sql"

aws s3 cp <( mysqldump -u ${db_user} -p -h ${db_host}  ${db_name} ) \
  s3://${s3_bucket}/${s3_key}/${filename}
```
Stackless Quicksort
Tags: algorithms, python, sorting
Published: 2018-11-16 23:36:17

---
title: Stackless Quicksort
published: true
tags: algorithms, python, sorting
canonical_url: https://scotchka.github.io/blog/html/2018/11/08/stackless_quicksort.html
---

Quicksort is a famous example of a recursive algorithm. Here is a sub-optimal implementation:

```python
def qsort(lst, start=0, end=None):
    if end is None:
        end = len(lst)
    if end - start < 2:
        return

    pivot_position = partition(lst, start, end)

    qsort(lst, start, pivot_position)
    qsort(lst, pivot_position + 1, end)
```

The partition function chooses a pivot value and places it at the correct position, with smaller values to its left and larger values to its right. It also returns the final position of the pivot value.

```python
def partition(lst, start, end):
    pivot = lst[start]
    rest = lst[start + 1 : end]

    left = [item for item in rest if item <= pivot]
    right = [item for item in rest if item > pivot]

    lst[start:end] = left + [pivot] + right
    return start + len(left)
```

For brevity, we use list slicing instead of swaps, but the discussion does not depend on how the partitioning is done.

In the above implementation, observe that each recursive call stands alone, simply sorting a segment of the list. As this [article](https://bertrandmeyer.com/2014/12/07/lampsort/) points out, the recursive call stack serves merely to ensure that the list is divided into smaller segments until every item is a pivot or belongs to a segment of one item.

Because the order in which different parts of the list is sorted is immaterial, we don’t need recursion or even a stack for that matter. Here is an implementation of quicksort using a set to track which segments are still to be sorted:

```python
def qsort_stackless(lst):
    not_sorted = {(0, len(lst))}

    while not_sorted:
        start, end = not_sorted.pop()
        pivot_position = partition(lst, start, end)
        if pivot_position - start > 0:
            not_sorted.add((start, pivot_position))
        if end - (pivot_position + 1) > 0:
            not_sorted.add((pivot_position + 1, end))
```

The set `not_sorted` contains start and end indices of segments which remain to be sorted. Note that the pop method returns an **arbitrary** element of a set, which becomes empty when no unsorted segments remain. The list is then sorted. Let’s check a test case:

```python
>>> lst = [3, 2, 1, 4, 5]
>>> qsort_stackless(lst)
>>> lst[1, 2, 3, 4, 5]
```
Is there a way to persistently display background jobs?
Tags: help, linux, bash
Published: 2018-11-12 09:53:44

I'd like to get into the habit of suspending my editor instead of opening a new shell. Sometimes I forget that I have already started my editor and I'll have several processes running. With my setup, this could turn into a problem if I'm modifying files open in other processes.

I was thinking it would be nice to have a list of background jobs in my prompt, or maybe just some sort of indicator that I have a job suspended.

Even better, I could open a tmux pane and run the jobs command. However, I'd like this to be "persistent" like when tailing a log. Is there a way to keep jobs running in "watch mode"?
Hackathon tools
Tags: hackathon, help, discuss
Published: 2018-11-12 09:27:50

---
title: Hackathon tools
published: true
description: What tools help you and your team get kickstarted at a hackathon?
tags: Hackathon, help, discuss
---

In the past, I had a list of good tools for saving time during hackathons.
All I can remember nowadays is Ngrok and theprogrammableweb

https://ngrok.com/
https://www.programmableweb.com/apis/directory

What are your go-to tools for hackathons?
What is the future of Redux?
Tags: discuss
Published: 2018-11-12 07:37:13

Redux is the reason why I started using React in my projects. Having a global state that is updated by a series of actions and a view that is updated deterministically from the state makes development and, specially debugging, extremely pleasurable.

Redux Devtools is also an extremely powerful tool that has no equal in any other JS framework.

On the other hand, I have the feeling that Redux is falling out of grace lately and the tendence is going back to stateful components.

Does Redux still have some place in the hearts of the React community?
React Native Show Message for empty FlatList
Tags: react, reactnative, android, javascript
Published: 2018-11-12 07:20:23

---
title: React Native Show Message for empty FlatList
published: true
description: React Native Show Message for empty FlatList
tags: #react #reactnative #android #javascript
---

Post Link : <a href="https://www.skptricks.com/2018/11/react-native-show-message-for-empty-flatlist-view.html" > React Native Show Message for empty FlatList</a>

This tutorial explains how to display empty message "No Data Available" in FlatList view in react native application, when there is not data present in FlatList data source object.  Lets consider the scenarios where we have to load bulk data in FlatList view using server side rendering, in that case we need provide appropriate message to user for the request data and their corresponding response. Generally we are come across with below scenarios :
 When data is available, then it will display the data in FlatList view using renderItem prop.
 When data is not available, then it will display the error message "No Data Available" to user.

<a href="https://www.skptricks.com/2018/11/react-native-show-message-for-empty-flatlist-view.html" > React Native Show Message for empty FlatList</a>

<img src="https://3.bp.blogspot.com/-Fwkielx1ej0/W-kZoPUrI9I/AAAAAAAACIA/TsTTW4PNaqQ0UKB5vfBjadPKY2iOgUpMgCLcBGAs/s640/empty.png" />