teleren/devto huggingface dataset:
Overview : First post
Tags: learningcurve, programming, paradigms, productivity
Published: 2018-06-09 08:57:42

---
title: Overview : First post
published: True
description: reposted from http://sdf.org/~sameers/code/
tags:  learning curve, programming, paradigms, Productivity   
---
Cross-posted from http://sdf.org/~sameers/code/ 
---
 [1] I am also experimenting with p2p and shifting most content from server client model . If you are in to that, checkout
http://localhost:43110/1HzjtGpGskdCz492xHWX2wtQ1591tqhpK3/code
and a test repo : 
git clone http://localhost:43110/1HzjtGpGskdCz492xHWX2wtQ1591tqhpK3/basicsDOTc.git 
---
Some formatting missing. check original article for better readability. 
References to this article So long as learning to code from OS was concerned, writing custom dot files as I needed helped most. Even for understanding the nuances of perticular languages , e.g. use-package package for DOTemacs has helped me see the point[s] of elisp or writing DOTmbsyncrc helped me in seeing why Python needed classes to talk to database for moving objects.. When it comes to recursive routines as they come in FP , I resort to circuits for representi them.
On that note, I learned about classes and hence modules or frameworks, as I was writing callable bash files for a web service in Bash, nat telnet fellshort,but as I like bash and wrote DOTashrc for it. Calling them recursively (or not) was a matter of of understanding. Hon mentions : sieve scripts for mail filters.
(\Sigma \cup N)^{*} N (\Sigma \cup N)^{*} \rightarrow (\Sigma \cup N)^{*} \S .... \quad\square
The part I actually like
I am more in to analyzing DFA of a regexp for evil inputs or using cantor's diagonal argument to show that one can't write a program to spit (0,1) or halting problem, to show that there can't be a general program to detect errors in a given piece of c++ code or axioms for correctness be it Turing tape or relational algebra. As practical example ; I ll write regex string of package in apt remove command , instead of bash wildcards, so that it can ,say, tell 23 from 24 as it looks up older versions of the package to be removed .
If I have to find divisors, I d rather focus on combinatorics modulo, congruence, peano axioms,then writing a script.
{*}
is Kleene star . This becomes inetersting if you consider Kleene's second recursion theorem.
Things I ve automated yet
Not to suggest that all scripts needed were originally written by me only.
My HTPC
Profiling, package loading & install of my emacs
Numbering in lists on this site (css)
Manual Paper folding in a paper mill.
[1]https://www.quora.com/How-are-programming-language-closures-related-to-closure-in-mathematics/answer/Sameer-Gupta
Do tattoos influence the probability of getting hired?
Tags: discuss, career
Published: 2018-06-09 05:20:38

---
title: Do tattoos influence the probability of getting hired?
published: true
description: Are we ready to accept people for who they are when it comes to tattoos, or not yet?
tags: 
- discuss 
- career 
---

Saw this one on [Twitter](https://twitter.com/xira_infotech/status/1005299940715741184) and immediately thought of sharing it here because I'm really curious about the responses.

> Does having tattoos influence the probability of being hired as a developer/programmer?

My status: I have a full sleeve on my right arm and one other visible tattoo on my left arm. So far, I haven't had any negative experiences with recruiting within IT, but that might be directly related to the type of companies and cultures I'm engaging with.

If you have tattoos, what are your experiences? Or maybe you don't but know about a policy at work? Or, maybe, just maybe, you've got an opinion about this topic? Share away!
Which is the best cloud backup for developers? 
Tags: question, discuss, cloud, backup
Published: 2018-06-09 02:10:58

---
title: Which is the best cloud backup for developers? 
published: true
description: 
tags: question, discussion, cloud, backup
---

I've been using Google Drive for years. My projects folders, photos, videos and similar important stuff are all backed up at GD.

I had tried Dropbox in the past but didn't jump ship since I was ok with GD.


So which is the best in your opinion? I'm looking to try other options if they provide anything interesting which GD doesn't already.
Filter Null Values from a List with Java8 Lambda
Tags: java, functional, java8
Published: 2018-06-08 23:03:18

---
title: Filter Null Values from a List with Java8 Lambda
published: true
description: Remove null values from a Collection, like an ArrayList or Set with a Java Lambda
tags: java, fp, java8
cover_image: https://thepracticaldev.s3.amazonaws.com/i/u9bya8rdc3cs7o2mpc9f.png
canonical_url: https://www.gunnargissel.com/filter-null-value-from-list-with-java8-lambda.html
---

A common task with Java streams is to clean up the input data so later steps can work without thinking too hard.  Likely the #1 most common cleanup step is to remove nulls from a Collection.

Streams make it easy:

    myCollection.stream()
      .filter(Objects::nonNull)
      .do.what.you.need

Compare with the classic approaches:

    while(myCollection.remove(null));
    // do what you need, but you better not need that original list, because it's gone...
    myCollection.removeAll(Collections.singleton(null));
    // do what you need, but you better not need that original list, because it's gone...

Like the stream approach, these are short and sweet, but unlike the stream approach they modify the original list.  The first example is also pretty slow.

I like the stream approach because I can chain additional tasks after the filter task, including `map`. `sorted`, `reduce` and more!.  I find the traditional imperative iterative approach to be not only wordier, but conceptually harder to follow.
Argon2 for Dovecot on Debian
Tags: security, dovecot, debian, argon2
Published: 2018-06-08 22:23:59

---
title: Argon2 for Dovecot on Debian
published: true
description: Install libsodium/Argon2 on Debian Stretch for Dovecot to allow to create passwords for hashed with Argon2. `doveadm pw -s argon2`
tags: #security #dovecot #debian #argon2
cover_image: https://thepracticaldev.s3.amazonaws.com/i/oj84ke69lule9xxy3gat.jpeg
---

## TL;DR

```bash
echo "deb https://packages.sury.org/php/ stretch main" > /etc/apt/sources.list.d/sury.list
apt-get update
apt-get install libsodium-dev dovecot-dev build-essential libtool-bin
git clone https://github.com/LuckyFellow/dovecot-libsodium-plugin
cd dovecot-libsodium-plugin
./autogen.sh
./configure --with-dovecot=/usr/lib/dovecot --with-moduledir=/usr/lib/dovecot/modules
make
make install
libtool --finish /usr/local/lib/dovecot/auth
```
## Details

the [dovecot wiki][2] tells us, that Argon2 is currently the most secure hashing algorithm. dovecot on debian stretch doesn't has the argon2 algorithm bundled.

```bash
root@mail:~# doveadm pw -l
MD5 MD5-CRYPT SHA SHA1 SHA256 SHA512 SMD5 SSHA SSHA256 SSHA512 PLAIN CLEAR CLEARTEXT PLAIN-TRUNC CRAM-MD5 SCRAM-SHA-1 HMAC-MD5 DIGEST-MD5 PLAIN-MD4 PLAIN-MD5 LDAP-MD5 LANMAN NTLM OTP SKEY RPA PBKDF2 CRYPT SHA256-CRYPT SHA512-CRYPT
```

to be able to use `doveadm pw -s argon2` you need to install the [dovecot-libsodium-plugin][1]. means build it yourself (but only the extension).


- configure `packages.sury.org/php` als apt repository
- install required packages
- clone the [dovecot-libsodium-plugin][1] repo
- build (you have to specify the dovecot and module path on debian)


not sure about the sury repo, only noticed, that after i have installed the `php-sodium` extension, the `libsodium23` and `libsodium-dev` where installed from there
```
Get:1 https://packages.sury.org/php stretch/main amd64 libsodium23 amd64 1.0.16-2+0~20180103211631.7+stretch~1.gbpb56693 [153 kB]
Get:2 https://packages.sury.org/php stretch/main amd64 libsodium-dev amd64 1.0.16-2+0~20180103211631.7+stretch~1.gbpb56693 [171 kB]
```

after the installation you should get this:
```
root@mail:~/dovecot-libsodium-plugin# doveadm pw -l
MD5 MD5-CRYPT SHA SHA1 SHA256 SHA512 SMD5 SSHA SSHA256 SSHA512 PLAIN CLEAR CLEARTEXT PLAIN-TRUNC CRAM-MD5 SCRAM-SHA-1 HMAC-MD5 DIGEST-MD5 PLAIN-MD4 PLAIN-MD5 LDAP-MD5 LANMAN NTLM OTP SKEY RPA PBKDF2 CRYPT SHA256-CRYPT SHA512-CRYPT SCRYPT ARGON2
```

[1]: https://github.com/LuckyFellow/dovecot-libsodium-plugin
[2]: https://wiki.dovecot.org/Authentication/PasswordSchemes

- edited and enhanced after reading https://github.com/LuckyFellow/dovecot-libsodium-plugin/issues/6#issuecomment-350849536
- cover image by Pixabay https://www.pexels.com/photo/door-handle-key-keyhole-279810/
Uncover Bad Network Traffic on your Phone
Tags: ios, security, privacy, showdev
Published: 2018-06-08 22:14:34

---
title: Uncover Bad Network Traffic on your Phone
published: true
description: Uncover and block bad network traffic on your phone 
tags: ios,security,privacy,showdev
---

{% github agrinman/sift-ios %}

Sift shows you what every app on your phone is really doing. Uncover network traffic in real-time for every app on your phone. Create rules to block sites like ads and tracking pages.

- Inspect network traffic
- Monitor background activity
- Block bad sites and tracking pages
- iOS Developers: debug networking in your live apps

<img width="200px" style="display: flex-inline" src="https://github.com/agrinman/sift-ios/raw/master/screens/1.PNG"/>
<img width="200px" style="display: inline" src="https://github.com/agrinman/sift-ios/raw/master/screens/2.PNG"/>
<img width="200px" style="display: inline" src="https://github.com/agrinman/sift-ios/raw/master/screens/3.PNG"/>

## About
Sift can answer questions like: are apps tracking me even if I disable analytics? are apps malicious? are they connecting to strange urls? are they doing network activity in the background?

**Inspect network traffic for any app on your phone**. Using push notifications, Sift shows you real-time network requests made by other apps. 

**Monitor background activity**. Sift can even show you what network requests apps are making in the background.

**Create rules to block urls like tracking sites, ads, etc**. Use Sift to block any site you don't like for every app on your phone.

**Debugging tool for developers** Use Sift to debug network traffic for your production app: inspect background activity, see how your app handles connection failures to certain sites, etc.

**Sift is completely private** Sift never shares or sends your network traffic data anywhere. Data that Sift collects never leaves your phone.


## FAQ
### Why isn't Sift on the App Store?
It turns it out that network content filters are not permitted for regular app store apps (it only works in supervised device mode). So I decided to release the source code instead -- any donations are greatly appreciated :)

### How do I use it/install it?
Make sure you have XCode installed. Clone the code, open the .xcodeproj, plug in your iPhone, and hit run. You might have to authorize XCode to deploy to your phone/ sign into iCloud in XCode.

### Is there XCode 10 support?
Yep -- just switch to the `xcode-10` branch.
How do I use .forEach on DOM Elements?
Tags: todayisearched, javascript
Published: 2018-06-08 20:00:30

---
title: How do I use .forEach on DOM Elements?
published: true
description: Figuring out how to loop through a NodeList.
tags: todayisearched, javascript
---

The title of this post is what I originally googled. Here's what got me there: 

I was working on displaying local times for the event listings on [dev.to/events](https://dev.to/events) (haven't made a PR yet). To do this, I added a class to all elements with a timestamp, like this: 

`<span class="utc-time"><%= event.starts_at %></span>`


I wanted to grab all the timestamps on the page, loop through them, and update their `innerHTML` to reflect the local time. I usually use `for` statements when I need to loop stuff, but I decided to try the `.forEach` function.

```js
var timestamps = document.getElementsByClassName("utc-time");
  
timestamps.forEach(function(timestamp) {
      localTime = updateLocalTime(timestamps[i].innerHTML);
      timestamps[i].innerHTML = localTime;
    });
```

I got this error:

![Uncaught TypeError: timestamps.forEach is not a function](https://cl.ly/400n160P2g1M/download/Image%202018-06-08%20at%203.17.28%20PM.png)

Eventually, I realized that `timestamps` was not an array, it was a _NodeList_ and at the top of [mdn documentation](https://developer.mozilla.org/en-US/docs/Web/API/NodeList), it clearly states: 

>Although NodeList is not an Array, it is possible to iterate on it using `forEach()`. It can also be converted to an Array using `Array.from()`.

>However some older browsers have not yet implemented `NodeList.forEach()` nor `Array.from()`. But those limitations can be circumvented by using `Array.prototype.forEach()` (more in this document).

I probably should have googled "How to loop through a NodeList" for specificity. Anyway, so then I wrote this: 

```js
    Array.prototype.forEach.call(timestamps, function (timestamp) {
      localTime = updateLocalTime(timestamp.innerHTML);
      timestamp.innerHTML = localTime;
    });
```

And it worked! But when I showed it to @maestromac, he told me that a simple `for` statement would have worked. And would probably be a bit safer. So I went back to what I was most familiar with: 

```js
    for (var i = 0; i < timestamps.length; i++) {
      localTime = updateLocalTime(timestamps[i].innerHTML);
      timestamps[i].innerHTML = localTime
    }
```

At least I learned something about NodeLists today ¯\_(ツ)_/¯
test case example
Tags: programming, softwaredevelopment
Published: 2019-10-01 16:20:26

---
title: test case example
published: true
cover_image: https://esabook.files.wordpress.com/2018/06/software_testing_test_case-1024x538.png
tags: Programming,software development
canonical_url: https://esabook.wordpress.com/2018/06/08/test-case-example/
---

### Is this a bug report?

> Yes

### Have you read the Bugs section of the Contributing to React Native Guide?

> Yes

### Environment

1. `react-native -v`: 0.4.5
2. `node -v`: 7.4.0
3. `npm -v`: 5.0.3
4. `yarn --version` (if you use Yarn): 0.24.5

Then, specify:

1. Target Platform (e.g. iOS, Android): iOS
2. Development Operating System (e.g. macOS Sierra, Windows 10): macOs Sierra
3. Build tools (Xcode or Android Studio version, iOS or Android SDK version, if relevant): XCode 8.3.3

### Steps to Reproduce

1. Implement React-Native FlatList in a module.
2. Render a component in renderItems prop
3. nest FlatList inside `` element
4. Pull up on device to attempt to refresh

### Expected Behavior

> Call onRefresh function on pull up.

### Actual Behavior

> onRefresh function is not called.

### Reproducible Demo

> Snack Link: [https://snack.expo.io/HJYx3Kx4W](https://snack.expo.io/HJYx3Kx4W)

<pre>
...
  constructor(props) {
    super(props);
    this.state = {
      stories: [],
      isFetching: false,
    };
  }
  componentDidMount() { this.fetchData() }
  onRefresh() {
    this.setState({ isFetching: true }, function() { this.fetchData() });
  }
  fetchData() {
    var that = this;
    axios.get('http://192.168.0.13:3000/api/story/get/by/geo')
      .then((res) => {
        that.setState({ stories: res.data, isFetching: false });
        that.props.dispatch(StoryActions.setStories(res.data))
      })
  }
  render() {
    return (
      <ScrollView>
        <FlatList
          onRefresh={() => this.onRefresh()}
          refreshing={this.state.isFetching}
          data={this.state.stories}
          keyExtractor={(item, index) => item.id}
          renderItem={({item}) => (<StoryFeed story={item} id={item.id} /> )}
          />
      </ScrollView>
    )
  }

</pre>

_Origin link: [https://github.com/facebook/react-native/issues/14756](https://github.com/facebook/react-native/issues/14756)_
CSS Designs for React. Recommendations?
Tags: react, design, css, discuss
Published: 2018-06-08 01:30:57

---
title: CSS Designs for React. Recommendations?
published: true
description: 
tags: react, design, css, discuss
---

This is more like a discussion blog post. Also, is my very first blog post here in DEV.to yay! 🎉🎉🎉

So just recently I've been getting my hands dirty on learning ReactJS. I'm a student (not currently in university) and I love programming both on Web and Mobile. I chose ReactJS because of its capabilities to develop for both Web and Mobile and also because it's one the trending libraries today. 

Previously, I've made quite a few web apps with Google's Polymer 2.0 and I can say that it was really awesome using Polymer 2.0. One of the major benefits of using Polymer 2.0 was (for me) the design. It was all `material-ly` and has this `googlish` feel to it which I really loved. 

Now that I'm learning and probably switching to ReactJS (specifically for the web) I'm looking for some design frameworks that I can use. I'm really quite lazy on the css stuff and I prefer working on the functionality and the look of the app without the nitty-gritty work of css. 

Recently I've come across react-mdc but noticed that it hasn't been in development for almost a year now. I like the `material` look of it though, but I'm wondering what you are using and what are your recommendations?

Thanks for DEV.to for this amazing community btw! The articles and the nuts on this site are really awesome! Learning a lot of stuff here.
How do you prototype or visualize code ideas?
Tags: discuss, beginners, programming
Published: 2018-06-08 01:10:24

---
title: How do you prototype or visualize code ideas?
published: true
description: Open question
tags: discuss, beginners, programming, 
---
![Rube Goldberg Machine](https://thepracticaldev.s3.amazonaws.com/i/a3zc5f3khi9eusjf2fg7.jpg)

Sometimes when I'm working on an idea, I want to get that idea out of my head and into written code format, even if I never actually run it or test it.

I'll usually start with some pseudo-code written down on scratch paper, but when it comes to actual syntactically-correct code, I'll fire up an editor and type it out just to see what it looks like. I do this for data types or objects, or functions or methods, or interfaces, or what have you.

Then I end up with a scratch directory with files such as "scratch.go", "scratch1.go", "coord.go" and other random names.

I've even considered and maybe even experimented a bit with using source control to be able to keep ideas, even after I've moved on to better ideas.

One thing that does help is using an editor with syntax or lint checking, such as vim or vscode.

Does anyone else have a better process for this?
The journey #0 - Learning iOS development
Tags: ios, beginners, productivity, webdev
Published: 2018-06-07 18:34:52

---
title: The journey #0 - Learning iOS development
published: true
description: My journey learning iOS development starts here.
tags: iOS, beginners, productivity , Webdev 
---

Hello everybody out there interested in iOS development. I am 19 years old, I live in Portugal and I am a first year Computer Science student who just wants to dive in the world of app development — more specifically iOS.

![](https://thepracticaldev.s3.amazonaws.com/i/jgvhoia5hgizhawg2n7c.jpeg)

When you start learning computer science, you start counting from zero. So, here we go! This is “The Jorney #0 — Learning iOS development” and in this series I am going to share with you my progress, my struggles, my victories and above all my journey studying and learning iOS development.

Motivation — Why iOS development

Everyday, new apps arrive to the App Store. And in their own way this apps have an impact on its users lives. Weather this apps make you laugh with your family or boost your productivity, they make you live your life in a different way. And the developers that work on them have the chance to really have an impact on other people’s lifes.

Improving others lives with technology should be the porpuse of developing new tools for everybody to use. And apps are one of the best ways to give people this tools.

{% youtube ckjkz8zuMMs %}

Also, apps development is something that I have been interested for a very long time. If you stop to think about it, in app development you have the change to be creative in two completly different ways. You get the change to design the user interface and write the code that makes it come to live. And if in the end it all works as expected you can publish your app and have people from all over the world to use it.

Do what you love, and put your whole heart into it, and then just have fun. — Tim Cook

Its all about the journey…

Starting something from zero is hard and thoughts like: “OMG… What am I doing?”, “ How can I ever learn all this?”, “I am never going to be as good as…” — come up all the time.

But the thing is. Everybody started from zero. Some had more help than others. Some are more lucky! Sure… That’s how life is. Life is not a race neither a board game where we all start from square 1–0 sorry… :D. But we are responsible for creating our own lucky moments and improving our current situation.

![](https://thepracticaldev.s3.amazonaws.com/i/nia3sky5opu8ctkzcmwx.jpeg)

By working hard, I believe everydody can be succesfull in anything they do. And this is where proactive serendipity comes in. Proactive serendipity is putting yourself in a position where you can also be lucky and achieve your dreams and goals. But for that to happen you have to be willing to work hard and do the best you can with the tools you have. In the end, one must remember that…

The Journey is the reward.— Steve Jobs
Hash Tables — BaseCS Video Series
Tags: computerscience, basecs
Published: 2018-06-07 17:23:39

---
title: Hash Tables — BaseCS Video Series
published: true
description: My favorite way of thinking about hash tables is by thinking about libraries and all of the books that they have.
tags: computerscience, basecs
series: BaseCS Video
---

My favorite way of thinking about hash tables is by thinking about libraries and all of the books that they contain. If we think about some of the biggest libraries in the world and their collection of books, imagine how difficult it would be to find one single specific book in a collection of those unsorted books. All the libraries in the world have a great system of organizing and sorting through books.

You can think about all of the books in a library as a collection, or a dataset. In computer science, or in programming, the data sets that you have to deal with are generally pretty big. Being able to find one piece of data, just like finding one book on a bookshelf in a huge library of books, is a pretty common task. In this video, we'll go into how hash tables help us deal with these kinds of problems.

For more on hash tables, check out this accompanying post:

{% link https://dev.to/vaidehijoshi/taking-hash-tables-off-the-shelf %}

I hope you enjoy! Feel free to continue the discussion in the comments.

[![SparkPost Logo](https://thepracticaldev.s3.amazonaws.com/i/v5svhunrn8s5jpjiumlk.png)](https://sparkpost.com/)

### _This video series is sponsored by [SparkPost](https://www.sparkpost.com/). There's never been a better way for developers to send email._
Developing Well-Organized APIs with Node.js, Joi, and Mongo
Tags: node, mongodb, restify, joi
Published: 2018-06-07 16:01:20

---
title: Developing Well-Organized APIs with Node.js, Joi, and Mongo
published: true
description: In this article, you will learn how to create well-organized APIs with Node.js, Restify, Joi, and MongoDB.
tags: #nodejs #mongodb #restify #joi
canonical_url: https://auth0.com/blog/developing-well-organized-apis-with-nodejs-joi-and-mongo/
---

In this article, you will learn how to build well-organized APIs with Node.js, Restify, Joi, and MongoDB. You will also have a chance to learn how to use dependency injection on this stack. 

[Read on 💚🛠](https://auth0.com/blog/developing-well-organized-apis-with-nodejs-joi-and-mongo/?utm_source=dev&utm_medium=sc&utm_campaign=apis_nodejs_mongodb)

![Developing Well-Organized APIs with Node.js, Joi, and Mongo](https://thepracticaldev.s3.amazonaws.com/i/vo0kinvgrxgct3g14vrj.png)