teleren/devto huggingface dataset:
OpenEMM python client
Tags: openemm, python
Published: 2019-05-03 09:36:19

---
title: OpenEMM python client
published: true
description: 
tags: openemm, python
---

### Py-OpenEMM
[**OpenEMM**](http://www.openemm.org) is a feature-rich web-based enterprise application for email marketing, newsletters and service mails.

**Pre-requisites:**
- Python 2.7 or higher
- Python Suds 0.4 or higher


**Installation:**
- Clone repo

  ```bash
  git clone https://github.com/pratz/py-openemm.git
  ```

**Configuration:**
- Move to directory where you have cloned the repo

  ```bash
  cd py-openemm/pyopenemm
  vi config.py
  ```

- Open `config.py` file and enter openemm wsdl url, username and password

  ```bash
  OPENEMM_URL = 'http://127.0.0.1:8080/cms_services/urn:agnitas-webservice?wsdl'
  WEBSERVICE_USER = 'test_user'
  WEBSERVICE_PASSWORD = 'test_123'
  ```

**Usage:**
- Create client connection

  ```python
  from pyopenemm.connection.connect import create_connection
  client = create_connection()
  # connect to webservice , returned is suds client
  ```

- Get OpenEMM client

  ```python
  from pyopenemm.webservice.service import OpenEMM
  openemm = OpenEMM(client)
  ```

- Find subscriber

  ```python
  # get subcriber by email
  subscriber = openemm.find_subscriber(('email','test@gmail.com'))
  ```

- Get subscriber details

  ```python
  subscriber_details = openemm.get_subscriber(subscriber)
  ```

- Add new subcriber

  ```python
  user_dict = {'email':'openemm@openemm.com','firstname':'openemmfirstname','lastname':'openemmlastname','gender':0}
  new_subscriber = openemm.add_subscriber(user_dict,True,'email',True) # add new subscriber to openemm

  # Four parameters of add_subscriber() method
  # user_dict = Dictionary containing user information
  # double_check - If True, check if subscriber is already in database
  # key_column - column used for double_check
  # overwrite - If True, subscriber gets updated
  ```

[**Feel free to Contribute back**](https://github.com/pratz/py-openemm)
Dockerfile Tip 1: Define a Base Layer
Tags: docker
Published: 2019-05-03 09:32:45

With the advent of the Multi Stage Dockerfile, it's very common for people to very specific layers that do a single task; which often utilise the same 
"primary" base layer.

**Example:**

```Dockerfile
FROM elixir:1.8 AS deps

RUN mix deps.get

FROM elixir:1.8 AS compile

COPY --from=deps ...

RUN mix compile
```

This allows lengthy tasks to utilise the build cache and pass artefacts between layers, without rerunning the lengthy task. However, I often see this "primary" layer duplicated 4/6/10 times in a single Dockerfile; making maintenance cumbersome.

## The Tip

Create an empty layer with your primary image:

```Dockerfile
FROM elixir:1.8 AS base

FROM base AS deps

# ...

FROM base AS compile

# ...
```

This reduces duplication and makes maintenance, and pull-requests, easier to review/manage/change.

Until next time
:metal:
Netrc python client
Tags: python, netrc
Published: 2019-05-03 09:31:07

---
title: Netrc python client
published: true
description: 
tags: python, netrc
---

### What is Netrc file ?
Netrc file contains user credentials and is used to auto-login. It is usually located in users home directory `.netrc` but location can be overridden with `NETRC` environment variable. Netrc also supports macros `macdef` to automate tasks. Netrc can be used with ftp, curl, git etc.


**Netrc file sample:**

  ```bash
  ~ $ cat .netrc
  machine product.company.com
  login first.last
  password secret-password

  macdef macro-name1
  command1
  command2
  ```

**Get client:**

  ```bash
  curl -o netrc_client.py  "https://gist.githubusercontent.com/pratz/789dc165c6d9f79be86608547b128c69/raw/41fb7796f6b6d0a09ac5ddeaf8c79de30a2387ed/NetRc%2520-%2520read,%2520write,%2520update"
  ```

**Client compatibility:**
- Linux/Mac
- Python 2.7.x


**Usage:**

  ```python
  # create client
  netrc_instance = NetRc(
          "product.company.com",
          login="first.last",
          password="secret-password",
          account="", # account is optional
          )

  # create or update file content
  netrc_instance.create_or_update()

  # Custom file path (not recommended, as other programs might look for .netrc in users home directory)
  NETRC_FILE_PATH = /custom/file/path
  netrc_instance.create_or_update(path=NETRC_FILE_PATH)
  ```

**Warning:**
- Netrc stores credentials in plan text. This is how netrc is meant to be ;)


**Use case:**
- Its a good idea to use netrc when you have token based authentication.
- Automation for service accounts with token based authentication.
Artifactory python client
Tags: python, artifactory
Published: 2019-05-03 09:22:34

---
title: Artifactory python client
published: true
description: 
tags: python, artifactory
---

### Py-Artifactory
[**Artifactory**](https://www.jfrog.com/artifactory) is a artifact repository manager which supports software packages created by different technologies.
It can also be integrated with major CI/CD and DevOps tools.
This article shows how we can communicate with artifactory using a python api client.


**Pre-requisites:**
- Python 2.7 or higher
- libxml2/libxslt (will be deprecated in future releases)

  ```bash
  # Debian based
  sudo apt-get install libxml2-dev libxslt1-dev

  # RedHat based
  sudo yum install libxml2-devel libxslt-devel
  ```

**Installation:**
- Fire-up below command in terminal, `tag` specifies a version number.

  ```bash
  pip install git+https://github.com/veritasos/py-artifactory.git@<tag>
  ```

**Usage:**
- Create client instance

  ```python
  from artifactory import Artifactory
  artifactory = Artifactory(
          url="http://127.0.0.1:8081",
          username="username",
          password="password",
          )
  ```

- List users

  ```python
  user_list = artifactory.security.users.list()
  ```

- Get user

  ```python
  user = artifactory.security.users.fetch("user.name")
  ```

- Create user

  ```python
  user = artifactory.security.users.new()
  user.name = "first.last"
  user.password = "test"
  user.email = "first.last@testartifactory.com"
  user.groups = ["readers"]
  response = user.create()
  ```

- And much more ......

  ```
  Artifactory Users
  Artifactory Groups
  Artifactory Permissions
  Artifactory Repositories
  Artifactory Repository Replication
  Artifactory LDAP
  Artifactory User Api Keys
  ```

**Detailed documentation:**
- A much more detailed documentation is provided here [**py-artifactory**](https://github.com/VeritasOS/py-artifactory)
- [**Feel free to Contribute back**](https://github.com/pratz/py-openemm)
Top 10 Ethernet cable hacks
Tags: ethernetcable, ethernethack, ethernetcablehack
Published: 2019-05-03 09:03:41

---
title: Top 10 Ethernet cable hacks
published: true
description: In this article, you’ll find out about ten simple Ethernet cable hacks that can improve your work within Ethernet network. Read on to learn how to make your Ethernet connections even more efficient.
tags: ethernet cable, ethernet hack, ethernet cable hack
---

**What is Ethernet?**

The ethernet protocol defines the principles by that PCs connected to a local area network (LAN) exchange data packets. the quantity of computers in the network can vary from 2 to several thousand. to connect with one another the computers use a "star" topology. That is, all devices (PCs) are interconnected by suggests that of a switch - active network equipment.

![](https://www.eltima.com/images/upload/products/eltima/articles/cable/222222.jpg)


The physical transmission medium for ethernet protocol is a cable. most frequently it's a copper twisted pair, a fiber optic cable, or their combination when it comes to FTTx. RJ-45 is employed as a connector for an eight-core (2x4) twisted pair. The socket for ethernet plug can be the input of any network card in a computer or router. To avoid the loss of signals, the length of a twisted pair cable shouldn't exceed 100 m, whereas a fiber-optic cable ought to be no longer than 10-70 kilometer (depending on its type). the maximum data rates are 100/1000 Mbit/s correspondingly.

Find out how you can reanimate or upgrade your cable [here](https://www.serial-server.net/ethernet/ethernet-cable-hacks/).
EP14: Side Quest - Games as a Service
Tags: podcast
Published: 2019-07-15 11:41:54

---
title: EP14: Side Quest - Games as a Service
published: true
tags: 
canonical_url: 
---

On this Episode, [Elias](https://twitter.com/Jor_Eli360) takes over, and as is to be expected, it's all about video games. With guests [Epic Credos](https://twitter.com/EpicCredos), [Cholwe](https://twitter.com/cholweshabukali), [Eddie](https://twitter.com/Picassoiam) and Daniel Tumelo, we talk about the changing landscape of the video game industry and community.

In the news, we talk about [Mark Cerny's Wired interview](https://www.wired.com/story/exclusive-sony-next-gen-console/), where he talks publicly about the next generation PlayStation console (unofficially dubbed the PlayStation 5), and we discuss what these revelations mean for the future of PlayStation.

In the show's topic, the panel discuss the current state of video games, the Games as a Service model, and how this affects the different sectors of the industry: game development, ESports and community. 

We also discuss both Apple and Google's differing approaches to a subscription based model with [Apple Arcade](https://www.apple.com/lae/apple-arcade/) and [Google Stadia](https://store.google.com/us/magazine/stadia?hl=en-US) respectively.

And finally we discuss the [brewing war for the PC games distribution market](https://www.theverge.com/2019/4/16/18334865/epic-games-store-versus-steam-valve-pc-gaming-console-war-reimagined) between Steam and The Epic Games Store, and the effect it may have on PC gaming.

**Links and Info:**

- Elias's PSN: **I\_Am\_Eli504**
- Elias's Xbox Live: **I Am Eli504**
- Elias's Steam: **i\_am\_eli360**
- Cholwe's PSN: **Elen\_Cho**
- Epic Credos's Steam: **EpicCredos**
- Team Gematrix: [Facebook](https://web.facebook.com/teamgematrixgg/) | [Twitter](https://twitter.com/TeamGematrix) | [Twitch](https://www.twitch.tv/teamgematrix) | [Instagram](https://www.instagram.com/teamgematrix/)
- Orison Softworks:[Facebook](https://web.facebook.com/0ris0n/) | [GitHub Repo](https://github.com/Mellorison/_0rison)
- Project Lumpa: [Facebook](https://web.facebook.com/ProjectLumpa/)
- LudoHub: [Site](https://ludohub.com/) | [Facebook](https://web.facebook.com/ludohubzambia/) | [Twitter](https://twitter.com/ludohubzambia) | [Instagram](https://www.instagram.com/ludohubgaming/)

Leave us a review on [iTunes](https://podcasts.apple.com/us/podcast/codecast-zambia/id1442693166?mt=2) to let us know what you think about the show.
PizzaQL - the open-source order management system
Tags: showdev, react, javascript, graphql
Published: 2019-05-03 07:55:47

---
title: PizzaQL - the open-source order management system
published: true
description: An open-source order placement & management system for pizza restaurants
tags: showdev,react,javascript,graphql
cover_image: https://thepracticaldev.s3.amazonaws.com/i/vxt8y0wvkow4s7r6oqhj.jpg
---


[PizzaQL](https://github.com/pizzaql/pizzaql) an order placement & management system for pizza restaurants maintained by [xxczaki](https://github.com/xxczaki), a 16-year-old developer from Poland. The project is still being developed, but it's already usable and the author is looking for some constructive criticism & suggestions. Show him some love :)

{% github pizzaql/pizzaql %}
Find nearest numeric values
Tags: functional, javascript
Published: 2019-05-03 04:31:05

I wasn't a fan of functional programming when I first saw it. It seemed like clever overengineering and trading simple, procedural code for complex one-liners. I had just gotten used to not trying to be clever and creating temporary variables just for future me to understand what was going on.

However, I mostly go by intuition when deciding whether to further optimize. If the little voice in my head insists there's a better way of doing something, it won't let go until I find it. This particular problem is especially well-suited to functional programming.

My goal is to find the value or values numerically closest to a given search value. Since there may be more than one, this requires two passes. The first pass is to find the smallest difference between the search and all searched values. Then, on the second pass, every value that close is considered a match. I do this against a `Map()` and push keys onto `matches`, but for simplicity it's shown with a bare array.

```javascript
const haystack = [1, 2, 2, 3, 4, 5, 6];
const search = 2.5;
let matches = [];
```

```javascript
let closest = Number.MAX_VALUE;
for (const value of haystack) {
	const difference = Math.abs(value - search);
	if (difference < closest)
		closest = difference;
}

for (const value of haystack) {
	const difference = Math.abs(value - search);
	if (difference <= closest)
		matches.push(value);
}

matches;
<- [2, 2, 3]
```

At the very least, each pass on its own can be made functional. `Array.reduce()` is a good candidate for finding the closest value, since it's reducing an array from many elements to one. We pass in `Number.MAX_VALUE` again as the initial value to ensure a search far out of our range still creates a match. Each successive pass uses `Math.min()` to find successively closer values. Then, a simple `Array.filter()` can traverse the haystack and return an array with values nearest the numeric search.

```javascript
let closest = haystack.reduce((closest, current) =>
	Math.min(Math.abs(current - search), closest),
	Number.MAX_VALUE
);

matches = haystack.filter(value =>
	Math.abs(value - search) <= closest
);
<- [2, 2, 3]
```

Since `closest` only appears once in the second block, it's technically possible to stuff all of the first block into the second and make it a true one-liner. Resist the temptation as that would cause it to find the closest value over and over again for every element of the array, unless static analysis has come a long way.
Explaining loose-equality in javascript
Tags: javascript
Published: 2019-05-03 04:09:50

---
title: Explaining loose-equality in javascript
published: true
description: Many times javascript behaves in "strange" ways but really those behaviors make sense if you really understand them and loose-equality is one of them
tags: javascript
---
One of the most "strange" behaviors of javascript is how the `==` equality operator works. You can see pieces of code like this: 

```javascript
  42 == '42' // true
```

On the internet, you'll find one common explanation about this, and is that `==` operator compares only the value in both sides of the equality without looking the `type`. This is a correct explanation but is not very accurate.

One more accurate explanation is that `==` reduces both sides of the equality to their `number representation` and there, it makes the comparison. Consider the following:

```javascript
  0 == false // true
```

Zero is already a number, but what happens with `false`?
If you convert `false` to a number you'll get this

```javascript
  Number(false) // 0
```

Then, the final comparison will be this

```javascript
 0 == 0 // true
```

Having this in mind, check this out:

```javascript
 [] == ![] // true
```
The comparison above, follows the same rule that I've mentioned before. the empty array `[]` if is converted to a number, gives as result:

```javascript
 Number([]) // 0
```
On the other side of the comparison, we have `![]` as we have the `!` operator, this one changes the boolean value of the empty array. The boolean representation of `[]` is:
```javascript
 Boolean([]) // true

```

And as we have the `!` operator the result is `false`, and as we saw above, the number representation of `false` is `0`.

As final comparison we are going to have:

```javascript
 0 == 0 // true
```
I really hope that this blog post help you to understand this behavior of javascript, the feedback is welcome and if you like this content I would be very happy if you share it. 
Thanks for reading.
Decode FutureBuilder
Tags: flutter
Published: 2019-06-29 16:01:34

---
title: Decode FutureBuilder
published: true
tags: flutter
canonical_url: https://medium.com/flutter-community/decode-futurebuilder-bc1a5e6507d4
---

[![](https://cdn-images-1.medium.com/max/901/1*OpAHSdQ8KKyxW9twyPqY3Q.png)](https://medium.com/flutter-community/decode-futurebuilder-bc1a5e6507d4?source=rss-64fbd8c9e171------2)

An in-depth look at Flutter’s FutureBuilder Widget

[Continue reading on Flutter Community »](https://medium.com/flutter-community/decode-futurebuilder-bc1a5e6507d4?source=rss-64fbd8c9e171------2)
[Notice] New RFv2 Update Patch v0.16.7.1
Tags: microbitcoin, opensource, blockchain, mining
Published: 2019-05-03 03:07:25

---
title: [Notice] New RFv2 Update Patch v0.16.7.1
published: true
description: another small update for RFv2 which fixes a possible attack vector. 
tags: microbitcoin, opensource, blockchain, mining
---
There is another small update for RFv2 which fixes a possible attack vector. 

Please update your nodes to the latest release patch v0.16.7.1
https://github.com/MicroBitcoinOrg/MicroBitcoin/releases/tag/0.16.7.1

There is no change to the block height which Rainforest v.2 will be activated at block height 915,000. 
Estimated for May 7th at 00:42 UTC

Pools, exchanges, and all node holders, update your daemon to the latest release.

Here’s the countdown timer
[Rainforest v2 Countdown Tracker](https://microbitcoinorg.github.io/upgrade)

---
A Zeno Paradox: Starting a new project
Tags: beginners, productivity, requestforpost, help
Published: 2019-05-03 02:47:50

# The setup

So you want to build a program? There are so many decisions to make at the start of a project that it can become overwhelming.

* What language/framework to use?
* What database structure is most appropriate?
* What is your development workflow going to be?
* What tools/libraries can help with the project?

And most importantly -

**What do you build first? Second? Third?**

This is the part that is most difficult.

* Start with a UML outline?
* Define API endpoints?
* Basic application scaffolding and user tables?
* Spent a week in designing sprints and breaking things into features?

# Question for the community

* What do you do? 
* What tools do you use? 
* How do you decide what your first line of code is going to be about and the first commit?
* What tools do you use to plan out all the features and milestones?
* How far do you define the roadmap and do you do this all before before writing code?
* What project management software do you use?
* What role does pseudo code and database schemas play in the planning process/priority?
* Are there more modern or experimental approaches to getting started?

> Any step may be divided conceptually into a first half and a second half. Before taking a full step, the runner must take a 1/2 step, but before that he must take a 1/4 step, but before that a 1/8 step, and so forth ad infinitum
- Zeno’s Paradox
How do you get the most value from daily standup meetings?
Tags: discuss
Published: 2019-05-03 02:13:48

---
title: How do you get the most value from daily standup meetings?
published: true
tags: discuss
---

My team has always done a daily standup. We have done two variations of it. One where each person explains what they did yesterday, what they're doing today, and mentions any blocking issues. Another version where we look at each active item on the kanban board and review it's state. 

As the standup meeting becomes routine, people's updates either become repetitive or they go into way more detail than anyone needs and everyone is pretty checked out.

Any suggestions on how you keep standup valuable on your team, and make sure it is fulfilling it's original purpose?
I landed a Junior Front End Developer role after 3 months of self study, Ask Me Anything!
Tags: ama
Published: 2019-05-03 00:30:40

---
title: I landed a Junior Front End Developer role after 3 months of self study, Ask Me Anything!
published: true
tags: ama
cover_image: https://thepracticaldev.s3.amazonaws.com/i/vsjhawtm74dkuhginouv.png
---

I'm now 3 years into my career and still loving it, happy to help out anyone looking to start in the industry! 💖
Multiple Scale Modeling for Predictive Material Deformation Analysis with FEATool Multiphysics
Tags: featool, multiphysics, multiscale, simulation
Published: 2019-05-03 09:57:43

---
title: Multiple Scale Modeling for Predictive Material Deformation Analysis with FEATool Multiphysics
published: true
tags: featool, multiphysics, multiscale, simulation
canonical_url: https://www.featool.com/news/2019/05/03/Multiple-Scale-Modeling-for-Predictive-Material-Deformation-Analysis.html
---

A multi-scale modeling and simulation study using FEATool Multiphysics to investigate stretching and deformation of a ligament under uniaxial tension is presented in the following. The study demonstrates how the FEATool simulation software can be used by students and non-experts to perform simulations and quickly get relevant results with a minimum of effort and time. The presented study was a collaborative effort by students, Rachel Aronow, Aaron da Silva, Rose Dennis, Abdel Kader Geraldo, Dean Katsaros, Melissa Sych, and Richard Touret, under the guidance of Professor QianYong Chen at the University of Massachusetts Amherst [1].


![Multiple Scale Modeling for Predictive Material Deformation Analysis](https://www.featool.com/images/featool-multiphysics-multiple-scale-modeling-for-predictive-material-deformation-analysis.jpg)


Summary
-------

Material deformation and stress-strain is an active area of
mathematical modeling relevant to industrial and research-oriented
materials science. It is important to take variations in material
properties into account in these models. Multi-scale models that
incorporate inhomogeneity were studied and modeling frameworks that
address this need were created and tested. Incorporating variations in
material properties at the micro scale resulted in significantly
different predictions of material deformation under similar
loading. Variations in material properties were accounted for through
averaging over stresses in representative volume elements (RVEs).


Reference
---------

[1] Aronow R. et al.
[_Multiple Scale Modeling for Predictive Material Deformation Analysis_](https://www.math.umass.edu/sites/www.math.umass.edu/files/newsletters/2018_umass_math_newsletter_210.pdf),
Mathematics and Statistics Newsletter, University of Massachusetts
Amherst, Volume 33, pp 4-6, 2017-2018.