teleren/devto huggingface dataset:
Enable GateKeeper  macOS
Tags: macos, tips, gatekeeper
Published: 2020-08-17 02:35:22

Have you disabled **Gatekeeper** on macOS? And want to reset security to system default settings, this post is for you.

Ok, so let's get started.

In this post, we will enable **Gatekeeper** back again only to allow applications from the App Store or Developers identified by Apple.

1. In terminal run the following command.
  ```toml 
  sudo spctl --master-enable
  ```

2. To verify that **Gatekeeper** is enabled, go to System Preferences, and you should see the following.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ym35w059gcw2hwaztn9o.png)
   * Only **App Store** and **App Store and identified developers** are displayed.
   * The option **App Store** and the **Identified developers** is selected.

That's it, now **Gatekeeper** is back 😃

If you want to disable **Gatekeeper** again, I show you how to do it **here**.
Arrow Function In Javascript | Javascript Crash Course
Tags: tutorial, javascript, webdev, codenewbie
Published: 2020-08-17 02:32:50

Hey YOU!
In this video, we are going to learn about the most exciting and interesting topic in Javascript, Arrow Functions. So, let's watch the video and learn what arrow function is and how are they different from normal function. After clearing the basics, we will write out very first arrow function.
Exciting! Huh, If you have any question about arrow function then feel free to ask me in the comments below.

Connect With Me:
Youtube: <a href="https://www.youtube.com/c/ShubhamSauravYT" target="_blank" rel="noopener noreferrer">ShubhamSauravYT</a>.
Twitter: <a href="https://www.twitter.com/hiShubhamSaurav" target="_blank" rel="noopener noreferrer">@hiShubhamSaurav</a>
Instagram: <a href="https://www.instagram.com/hiShubhamSaurav" target="_blank" rel="noopener noreferrer">@hiShubhamSaurav</a>
Facebook: <a href="https://facebook.com/hiShubhamSaurav" target="_blank" rel="noopener noreferrer">@hiShubhamSaurav</a>
MLflowでらくらくなMLライフサイクル管理：前処理・機械学習・予測API一連化
Tags: mlflow
Published: 2020-08-17 01:56:18

MLflow で実験のパラメータ、メトリックや学習済みモデルの記録については、情報が豊富に見つかりますが、しかし前処理と学習・予測を一連の処理としてパイプライン化する、分かりやすい簡単なサンプルが見つからなかったので、作ってみました。

よって、このサンプルでは、前処理と学習・予測のパイプライン化に重点を置きます。
また、MLflowで簡単に予測サービス(REST)を立ち上げられることについても少し触れます。

ソースコードはこちら
https://github.com/vochicong/h2o_mlflow


# 概要

* データ: [タイタニック号乗客の生存](https://web.stanford.edu/class/archive/cs/cs109/cs109.1166/stuff/titanic.csv)
* [Pandas](https://pandas.pydata.org/)で前処理
* [H2O AutoML](http://docs.h2o.ai/h2o/latest-stable/h2o-docs/automl.html?highlight=automl)で機械学習
* [MLflow custom model](https://mlflow.org/docs/latest/models.html#example-saving-an-xgboost-model-in-mlflow-format)で前処理と学習・予測をつなげる :notes:
* [MLflow models serve](https://mlflow.org/docs/latest/models.html#deploy-mlflow-models)で予測RESTサービス


# 開発環境の準備

[Conda](https://docs.conda.io/en/latest/miniconda.html)で環境作成

``` bash
conda env update -f conda-dev.yml
conda env update -f h2o/conda.yaml

conda activate h2o_mlflow
python --version # Python 3.8.5 など
java -version # openjdk version "1.8.0_152-release" など
```


# コード

`main.py` にコードが全部入っています。

* Preproc: データ前処理のクラス
  + Age, Fareの Min-Maxスケーリング
  + Pandas DataFrame から H2OFrame への変換　
* Learner: 機械学習のクラス
* Predictor: 予測専用のクラス

前処理・機械学習・テスト予測の実行

``` bash
mlflow run h2o
```


# 予測APIサービスの起動

`mlflow run` コマンドが数分で終わると、予測APIの起動コマンド例が出力されるので、コピーして使えます。デフォルトで5000番ポートが使われます。

``` bash
MODEL=/var/folders/j5/1fzcsqzd2_j1s3_5d3qm447h0000gn/T/tmpu_840dh5/main.model

mlflow models serve -m $MODEL
```

## 予測API用Dockerイメージ

簡単に作れます

``` bash
mlflow models build-docker -m $MODEL
```


# 予測APIテスト

``` bash
pytest h2o/test_api.py
```

同じテストデータにしたして、APIを使って予測させる場合と、
`main.py` でモデルを直接ロードして予測させる場合とを比較して、
同じ予測結果になることを確認します


# 参考）APIのJSON形式

Request

``` json
{ "columns": [ "x1", "x2", "x3" ],
  "data": [
               [ 3,    2,    5 ],
               [ 1,    4,    8 ] ] }
```

Response（分類問題）

``` json
[ { "predict": 0, "p0": 0.7, "p1": 0.3 },
  { "predict": 1, "p0": 0.6, "p1": 0.4 } ]
```
Building and deploying a Hugo site with CodeBuild
Tags: hugo, aws, s3, codebuild
Published: 2020-08-17 01:46:43

---
title: Building and deploying a Hugo site with CodeBuild
published: true
description: Using AWS CodeBuild to generate and deploy my Hugo site.
tags: #hugo, #aws, #s3, #codebuild
//cover_image: https://direct_url_to_image.jpg
---

If you follow along in the [Hugo documentation](https://gohugo.io/hosting-and-deployment/hugo-deploy/) there are many way to deploy your site. I already had a [CodePipeline](https://aws.amazon.com/codepipeline/) and [CodeBuild](https://aws.amazon.com/codebuild/) set up for my previous Gatsby blog, so I decided to leverage that instead.

The biggest hurdle in doing this, was figuring out what changes I needed to make to my CodeBuild project to make it work with Hugo instead of Gatsby. I searched online until I found a [blog post](https://kbild.ch/blog/2019-01-31-codepipeline/) with an example `buildspec.yml` for me to work from.

I made a few updates to the `buildspec.yml` and then deployed my site with the following.

```yaml
version: 0.2

env:
  variables: {}
  parameter-store: {}

phases:
  install:
    commands:
      - echo Entered the install phase...
      - apt-get -qq update && apt-get -qq install curl
      - apt-get -qq install asciidoctor
      - curl -s -L https://github.com/gohugoio/hugo/releases/download/v0.74.3/hugo_0.74.3_Linux-64bit.deb -o hugo.deb
      - dpkg -i hugo.deb
    finally:
      - echo Installation done
  build:
    commands:
      - echo Entered the build phase ...
      - echo Build started on `date`
      - cd $CODEBUILD_SRC_DIR
      - rm -f buildspec.yml && rm -f .git && rm -f README.md
      - hugo
    finally:
      - echo Building the HTML files finished
  post_build:
    commands:
      - echo Entered the post_build phase...
      - echo Build completed on `date`
      - aws s3 sync public/ s3://bucket-name --region region --acl public-read --delete
      - aws cloudfront create-invalidation --distribution-id XX --paths '/*'
artifacts:
  files: []
secondary-artifacts: {}
cache:
  paths: []
```

I updated my `buildspec.yml` to use the current version of Hugo [0.74.3](https://github.com/gohugoio/hugo/releases/tag/v0.74.3) and due to some troubleshooting issues, made the build of the site not be silent.

The biggest change is that I am leveraging the `post_build` phase instead of sending an artifact back out into the CodePipeline. I sync the built `public/` folder with my S3 bucket, deleting everything in the bucket, copying over the files, and making sure everything is `public-read`. The last line in the phase does a cache invalidation for my CloudFront distribution.

Now whenever I push to the main branch on my Git repo, the site is built and deployed automatically for me. The only issue left is that S3 does not play nicely with "pretty" URLs and I ended up setting my blog to use [ugly URLs](https://gohugo.io/content-management/urls/#ugly-urls) until I could make a Lambda function to fix it, which will be my next blog post.
What is the difference? Azure Pipelines PRE and POST Deployment Approvals
Tags: devops, cicd, pipelines, azuredevops
Published: 2020-08-17 01:24:04

It is very common to __ask for approval__ during a release pipeline, especially when deploying to important environments like QA, Production, etc..

Azure Pipelines offers the Approval feature to do so, and it comes in 2 flavors: ___Pre-deployment___ and ___Post-deployment___ approvals.

But what is the difference between those 2 methods? And why it matters?

Let's discover it together.

### Intro

Today we talk about _Release flow control using approvals_, and more specifically about the different behavior that the Pre-deployment and the Post-deployment approvals have when using Azure Pipelines.

First of all, I should say that this applies to the __Classic Release experience only__, because with the Multistage YAML Pipelines you can define only some "generic" approvals at environment level and those are de-facto pre-deployment approvals. I made a [video about Azure Pipelines Environments](https://youtu.be/gN4j65w7wIM) where I also cover the approvals for YAML Pipelines, I encourage you to check it out if you are into YAML Pipelines.

Alright, so you are using the Classic Release Pipelines and wanna ask for Approval. Should you use the pre- or the post-deployment approval? What are the differences between those 2?

### The Video

To answer these questions and show you how to set and work with those kind of approvals, I created an example and I've gone through that in the video below.

Enjoy the watch!

{% youtube UvuiswLWSeo %}

### Conclusion

As you have seen, the behavior between the 2 is pretty different.

What do you think?  

Let me know in the comment section below if you prefer using the Pre or the Post deployment approvals and why.

### References and Links

- [Examples and explanation about Pre- and Post-deployment approvals](https://youtu.be/UvuiswLWSeo)
- [Approvals for YAML Pipelines, as part of Environments](https://youtu.be/gN4j65w7wIM)
Fingerprint Image Quality library
Published: 2020-08-17 01:13:30

AFIS.IQ is a wrapper library, written in .NET C#, to check fingerprint image quality using AFIS.IQ.K native library (NFIQ) from NIST Biometric Image Software (NBIS)

Allows parallel execution checking image quality. Thread Safe x32 and x64.

[IQ C# Wrapper Library](https://github.com/alainrc2005/AFIS.IQ)<br/>[WSQ C Native Library](https://github.com/alainrc2005/AFIS.IQ.K)
Creating my first mobile app - Status Center
Tags: android, flutter, dart, mobile
Published: 2020-08-17 00:39:03

I have been playing with hybrid app development for some time, specifically with React Native. I was really into it, but I think there are still some hassles that I weren't happy with, like the eternising question to use or not expo, or modules that work or not with it, or simple themes or UI elements out of the box.

Some time ago I started to learn a bit of flutter, and really got impressed by the ton of things it has to offer out of the box, and realised that I wanted to give it a try.

So I started building my first 'real' app, Status Center using flutter. The idea came as I'm currently as a single person that manages the status page (statuspage.io) on my company, I had, sometimes, the necessity to update the page on the go, without getting on my computer, or to follow long steps to just post an update (open the mobile browser, search for the site, log in, etc). So I thought, why not create an app to help me with that (and maybe others that have the same "issue") and take this opportunity to learn something new.

I was surprised on how fast I could get a full 'native' looking screen with remote data to fill it (statuspage.io API). And as a I work with JavaScript/Node.js for quite some time, It was really fast for me to learn and get me adapted to the new language (dart), which is really cool.

With this app you can manage all incidents on your statuspage.io page. Having an overview of all of them, including maintenances. Also, create new incidents and maintenances, and post new updates to them. And the most important (not really), automatic dark mode ❤️, and no ads or tracking.

Currently it's only available for android, but I pretend to release it for iOS as soon as I can get some "sponsors" to help me pay the apple developer license (I don't have one yet), and in my country it's quite expensive. To help me, you can buy me some cups of ☕️ (coffee) on [buymeacoffee.com/valtlfelipe](https://www.buymeacoffee.com/valtlfelipe) or you can [buy the app](https://play.google.com/store/apps/details?id=im.felipe.statuscenter&utm_source=devto-blog-post).

The app is open source and available at https://github.com/valtlfelipe/statuscenter, feel free to contribute 😊.

Some screenshots, more [here](https://github.com/valtlfelipe/statuscenter/blob/master/README.md#screenshots):

![Status Center screenshots](https://dev-to-uploads.s3.amazonaws.com/i/cilk2nlgxwp9zlhlrxgj.png)

That's all! Thanks for reading, and make sure to check it out. Eventually I will be writing some posts about flutter.


---

Originally published at https://felipe.im on April 29, 2020.
GLab v1.9.0 released!
Tags: gitlab, glab, github, contributorswanted
Published: 2020-08-17 00:33:47

Just released v1.9.0 of glab (a GitLab Cli tool) with new cool features including WATCHING A RUNNING PIPELINE AND VIEWING A JOB'S TRACE/LOG DIRECTLY FROM YOUR CLI. 

https://github.com/profclems/glab
What is a Kubernetes Object
Tags: kubernetes, learning
Published: 2020-08-17 00:13:41

A Kubernetes object is _something_ that exists in a Kubernetes cluster. There are configuration files we can write, and these files are used to create Kubernetes objects.

In Kubernetes, there are _object types_. An object type has its own purpose.
An example of an object type is the **Pod** object type. Pod is used to run a container.

To specify an object type in a Kubernetes config file, we use the `kind` property.
```yml
kind: Pod
```

## Resources
- [https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/)
Build a React component that pulls data from Google Sheets
Tags: react, tutorial, javascript
Published: 2020-08-17 00:13:16

### After some updates this tutorial no longer works - an updated working tutorial can be found [here](https://w3collective.com/react-google-sheets/).

-------------------------------------

Google Sheets can be used to provide a makeshift database that’s easy to modify for non-developers.

It’s not the best solution for high traffic sites but works well for internal websites or when prototyping an app.

In this tutorial we’ll be using [Tabletop.js](https://www.npmjs.com/package/tabletop) to load data from a Google Sheet into a React component.

Let’s start by installing Tabletop.js into our React project using NPM:

```
npm install tabletop
```

For this tutorial I’ve created a simple spreadsheet with the following data:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/74qxcb3t8jlnxb308opj.png)

- All columns must have a “name” in the first row and not contain any weird characters (%).
- Google assumes an empty row is the end of the data and doesn’t return any rows thereafter.

Once the sheet is complete select “File” -> “Publish to web” so it becomes publicly visible.

Now for the code, create a file named MovieData.js and import React (we’ll be using hooks) and Tabletop:

```javascript
import React, { useEffect, useState } from "react";
import Tabletop from "tabletop";
```

Next create a `MovieData()` function and declare a variable that will store the data in a useState hook:

```javascript
function MovieData() {
  const [data, setData] = useState({}); 
}
export default MovieData;
```

We can now fetch the data using Tabletop inside a useEffect hook by adding the following to `MovieData()`:

```javascript
... 
useEffect(() => {
  Tabletop.init({
    key: "1SJ8LxWmaxKBTgDJLvfD9NZLctBT931x19--qH2yLxck",
    simpleSheet: true,
  }).then(function (data) {
    setData(data);
  });
}, []);
const movies = Array.from(data);  
...
```
 
`key:` is taken from the following section of the Google Sheet URL:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ltbm8gjlqbj5d0otj105.png)

Finally lets return the movie data in an unordered list by adding the following to the end of `MovieData()`:

```javascript
... 
return (
  <ul>
    {movies.map((el) => (
      <li key={el.movie}>
        {el.movie} ({el.year}) - Rating {el.rating}
      </li>
    ))}
  </ul>
);
...
```
How to run a process in the background in JavaScript?
Tags: javascript
Published: 2020-08-17 00:00:00

---
  title: How to run a process in the background in JavaScript?
  published: true
  tags: JavaScript
  date: Mon Aug 17 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/run-background-process-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-cbe842b27a2b997381e69edc97c7b320.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/run-background-process-javascript)
  
To run background processes or those process which has a low priority in JavaScript, You can use the `requestIdleCallback()` method.

This method helps to postpone some of the processes which are not super important like processes that involve sending analytics data to the server, caching images, etc.

When using the `requestIdleCallback()`, the processes are executed only when the main thread is free or when the user is inactive.

To use this first you have to check whether this method is available in the current browser context.

```javascript
if ("requestIdleCallback()" in window) {
  // if method exists
  // do some work
} else {
  // just do the work
  // by using a polyfill or a shim
}
```

- After checking, You need to call the `requestIdleCallback()` method.
- Pass a callback function as the first argument.

```javascript
// function for low priority job
function myLowPriorityJob() {
  console.log("Hey, I'm Processing my low priority job now 🦄!");
}

if ("requestIdleCallback" in window) {
  // if method exists
  // do some work

  // call method requestIdleCallback() and
  // passing myLowPriorityJob() callback function
  // as first argument.
  requestIdleCallback(myLowPriorityJob);
} else {
  // just do the work
  // by using a polyfill or a shim
}
```

If you want to run your process no matter what after a certain amount of time, you can pass an options object with `timeout` property as the second argument to the `requestIdleCallback()` method.

```javascript
// function for low priority job
function myLowPriorityJob() {
  console.log("Hey, I'm Processng my low priority job now 🦄!");
}

if ("requestIdleCallback" in window) {
  // passing object with timeout property
  // as the second argument
  // to make sure your process gets called after 4 seconds
  requestIdleCallback(myLowPriorityJob, { timeout: 4000 });
} else {
  // just do the work
  // by using a polyfill or a shim
}
```

### _NOTE: Use timeout only when necessary, using it everywhere without any reason may cause the whole process of your program to slow down._

### Feel free to share if you found this useful 😃.

---
My Top 5 Tech Podcasts 2020
Tags: podcast, tech
Published: 2020-08-17 00:00:00

---
title: My Top 5 Tech Podcasts 2020
published: true
date: "2020-08-17"
description: A list of my top 5 tech podcasts I currently listen to in 2020
tags: podcast, tech
canonical_url: https://aarondunphy.com/blog/my-top-5-tech-podcasts-2020
---

## [Syntax](https://syntax.fm/)

Hosted by [Wes Bos](https://wesbos.com/) and [Scott Tolinski](https://www.scotttolinski.com/). Syntax is a great listen if you're interested in full stack development / javascript as they always have some great tips and conversations. Also their intro is the best out there.

## [The Laravel Podcast](https://laravelpodcast.com/)

Hosted by [Matt Stauffer](https://mattstauffer.com/). The Laravel Podcast is amazing if you want to hear from some really interesting people from the Laravel community such as Jeffrey Way, Marcel Pociot and Jonathan Reinink.

## [Twenty Percent Time](https://twentypercenttime.simplecast.com/)

Hosted by [Tighten Co](https://tighten.co/). I've found the Twenty Percent Time podcast great for topics around your dev job such as being organised and imposter syndrome.

## [Full Stack Radio](https://www.fullstackradio.com/)

Hosted by [Adam Wathan](https://adamwathan.me/). Adam's podcast Full Stack Radio is really insightful to listen to if you're interested in building your own software products as you get to hear first hand from guest speakers on certain topics.

## [The Laravel Snippet](https://blog.laravel.com/snippets)

Hosted by [Taylor Otwell](https://twitter.com/taylorotwell). From the creator of Laravel, The Laravel Snippet is a quick and easy podcast to listen to if you want to hear from him on what he and the team at Laravel are working on lately and his views on certain topics.

--- 

What are your favourite podcasts?
Motivated people arent always motivated.
Tags: productivity
Published: 2020-08-16 23:52:09

"Success doesn't come to those who only get stuff done when they feel like it" - Anonymous

On a daily basis, we all have hundreds of things we want to accomplish. Some are prioritized and executed, but others fall by the wayside.

We see people like the Jacko Willink's and the Joe Rogan's always hustling, always making something out of their day, telling us to GET AFTER IT. Are they always just on fire and motivated?

> No, theyre not.

So what gives? How do they get so much done?

To be honest I think its a combination of attendance and looking internally to figure out ***how to get yourself to do what you don't want to do in that moment. ***

I ask myself the following:

> Am I being lazy or do I actually need a day off?

Sometimes, you really do need a day off. I know it, you know it, Jacko knows it. But it's important to identify when youre being lazy and making excuses, and when you actually need a day off. A trap I personally fall into is getting burnt out. I'll take a few days off, then I cant find the motivation to get going again. Ill come up with shit like, "Just one more day", "It's been a long week", "Ill start tomorrow". I personally think looking inward and being honest with yourself before you get burned out is a much more sustainable approach. 

> Why dont I want to do this?

This one I recently heard and it blew my mind. "Why am I putting this off, its been on my list for weeks"? And by now I've sold myself into believing its important. Well is it? If it was I would have done it, right? Maybe, I need to reanalyze my priorities. It's not that important anymore, or theres something getting in the way of me doing it, psychological, social or otherwise. Think about it next time you realize you keep putting the same things off on your list.

> Now lets talk tools

A nice tool I like to use is the Pomodoro Technique. This technique is essentially a unit of focused work and a unit of total relaxation. The time split for focused work to rest is somewhere around 30min/10min. When I really dont want to get something done I fucking know I should, I tell myself:

> "Just do 2 Pomodoros, and your done". 

When you do this one of two things happen.

1. You either get a burst of energy and creativity and keep going OR
2. You still dont want to work but youve gotten an hour of focused work in.

> Win win

"Lace up your damn shoes" - David Goggins

We all have days we dont want to train or go to the gym. David Goggin's, in a Joe Rogan podcast explained how when he doesnt want to go for a run he just tells himself to put his shoes on and he always gets it done. I suggest you do the same, it works for me :)

So, the next time you see someone doing something you want to be doing, think of the sacrifices they make on a daily basis and the tools they use to get their shit done when they dont want to.


Go get after it and thanks for reading

Scott