teleren/devto huggingface dataset:
Quill SQL Server: Returning via OUTPUT
Tags: quill, scala, sqlserver
Published: 2019-12-10 11:11:38

Besides [NDBC Postgres module](https://juliano-alves.com/2019/11/29/quill-ndbc-postgres-a-new-async-module), the release of Quill 3.5.0 brings an interesting feature for Microsoft SQL Server users: returning via OUTPUT.
![](https://thepracticaldev.s3.amazonaws.com/i/wyv52ast2d9iqgdx6y5j.png)

## The `returning` feature

Quill has the `returning` feature, which behaves in different ways, according to the limitations of each database. Postgres has the largest set of functionalities around `returning`, given that Postgres dialect supports the [`INSERT ... RETURNING`](https://www.postgresql.org/docs/9.6/sql-insert.html) clause:

```scala
case class Product(id: Int, description: String, sku: Long)

val q = quote {
  query[Product].insert(lift(Product(1, "My Product", 1011L))).returning(r => (r.id, r.description))
}

ctx.run(q)
// INSERT INTO Product (id, description, sku) VALUES (?, ?, ?) RETURNING id, description
```

Quite useful. SQL Server supports a very similar feature [via `OUTPUT` clause](https://docs.microsoft.com/en-us/sql/t-sql/queries/output-clause-transact-sql?view=sql-server-2017). The 3.5.0 release brings this feature to Quill as well.

> While implementing this feature I've found the inspiration to write the post [Contributing to Quill, a Pairing Session](https://juliano-alves.com/2019/11/18/contributing-to-quill-a-pairing-session/), so if you are interested in how this feature came to life, there you go :)

## `INSERT ... OUTPUT`

The way to use the new feature in SQL Server is exactly the same:

```scala
val q = quote {
  query[Product].insert(lift(Product(1, "SQL Server", 1433L))).returning(r => (r.id, r.description))
}

ctx.run(q)
// INSERT INTO Product (id, description, sku) OUTPUT INSERTED.id, INSERTED.description VALUES (?, ?, ?)
```

As mentioned before, it is more limited than Postgres `returning`. While we can even query the return clause in Postgres, the best we can do on SQL Server are arithmetic operations:

```scala
val q = quote {
  query[Product].insert(lift(Product(1, "SQL Server", 1433L)))
}

ctx.run(q.returning(r => r.id + 42))
// INSERT INTO Product (id, description, sku) OUTPUT INSERTED.id + 42 VALUES (?, ?, ?)
```

This is a limitation of SQL Server, so there's not much Quill can do about it - except for [making sure that invalid operations don't compile](https://github.com/getquill/quill/blob/master/quill-sql/src/test/scala/io/getquill/context/sql/SqlActionMacroSpec.scala#L692).

Do you use Quill with SQL Server? Give us feedback about the new feature!

[Originally posted on my blog](https://juliano-alves.com/2019/12/05/quill-sql-server-returning-via-output/)
Clean up k8s/Rancher
Tags: kubernetes, rancher, linux, docker
Published: 2019-12-10 10:49:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Clean up k8s/Rancher
slug: clean-up-k8s-rancher
date: 2019-12-10 10:49
published: true
tags:
  - kubernetes
  - rancher
  - linux
  - docker
---

This script is mostly for myself in the future. While playing around with Kubernetes and Rancher, machines become polluted with directories in `/var`, `/etc`, and `/opt`. Pollution is bad. This script will remove those as well as wiping down a system.

Warning: this contains a system prune, and removes everything.

```
#!/bin/bash
#
# Clean up k8s/rancher
# (Run as root or rm -rf will fail)

docker ps -qa | xargs docker rm -f
docker system prune

cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico"
for dir in $cleanupdirs; do
  echo "Removing $dir"
  rm -rf $dir
done
```
I built a tool to help me keep track of my job hunt - JobHuntBuddy
Tags: showdev, vue
Published: 2019-12-10 10:44:11

Over the past two months I've been looking for a new job and I realized how important it was to keep track of applications.

I was *making a list of potential jobs*, *tracking which applications I've sent*, and *keeping notes about each lead*. Instead of using Excel I wanted a web app and I've been looking for a new project for a while, so I built [JobHuntBuddy.co](https://jobhuntbuddy.co).

![Search and Filter](https://thepracticaldev.s3.amazonaws.com/i/2iercbhhbrlwuod3j06c.gif)

It's still quite early, but I believe the core functionality is there:
- Add a **Lead** with a *company name*, *job title*, *link to job posting*, and a few more key pieces of information about the job.
- **Status** - manage the status of an application so you know where in the process you are, and if there's any action you should be taking. Currently either 'Just a prospect', 'Application Sent', 'Interview Set', and 'Rejected'
- **Notes** - I like to keep notes about job listings so I remember what I said in the cover letter, questions I should ask during the interview, or anything else that I don't want to forget (or confuse with a different job listing)

#### Why?

1. It scratches my own itch
2. I wanted to learn [Nuxt](https://nuxtjs.org/), so I needed a new project
3. I wanted to keep it open source as a code example, since most of my recent work is not publicly available.

#### The Stack

Built with [Vue.js](https://vuex.vuejs.org/) / [Nuxt](https://nuxtjs.org/) (SSR), using [Firebase](https://firebase.google.com/) for authentication and data storage, and hosted on [Heroku](https://www.heroku.com/).

### Conclusion
This has been a really fun project and I've **learned a ton**. Coming from mainly using Laravel with some Vue.js components on the front, to creating a complete application with Javascript has been a huge learning experience. I look forward to continue learning and growing with Javascript.

If have any feedback, criticisms, or anything else I look forward to answering comments!

---
### Edit
I'm rebuilding the app using Laravel & Vue.JS. The version I talked about on this post will remain live, open source, and free. It's been moved to [FREE.jobhuntbuddy.co](https://free.jobhuntbuddy.co)


Check it out for yourself: [JobHuntBuddy.co](https://jobhuntbuddy.co)

Github: [messerli90/jobhuntbuddy](https://github.com/messerli90/jobhuntbuddy)

Follow me on Twitter: [@michaelmesserli](https://twitter.com/michaelmesserli)
Puppeteer Quick Tip: How to do Basic Authentication
Tags: puppeteer, javascript, automation, basicauthentication
Published: 2019-12-10 10:39:58

A friend of mine ask about how to do basic authentication on Puppeteer. Fortunately it's quite easy.

Example of website with HTTP Basic Authentication enabled.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/m0xef6dl970pbqk6m7jx.png)

Here is the example of Puppeteer to handle HTTP Basic Authentication.

```js
const puppeteer = require('puppeteer');

(async () => {
	// set some options, set headless to false so we can see the browser in action
	let launchOptions = { headless: false, args: ['--start-maximized'] };
	
	// launch the browser with above options
	const browser = await puppeteer.launch(launchOptions);
	const page = await browser.newPage();
	
	// set viewport and user agent (just in case for nice viewing)
	await page.setViewport({width: 1366, height: 768});
	await page.setUserAgent('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36');
	
	// set the HTTP Basic Authentication credential
	await page.authenticate({'username':'YOUR_BASIC_AUTH_USERNAME', 'password': 'YOUR_BASIC_AUTH_PASSWORD'});
	
	// go to website that protected with HTTP Basic Authentication
	await page.goto('https://WEBSITE_THAT_PROTECTED_BY_HTTP_BASIC_AUTH');

	// close the browser
	// await browser.close();
})();
```

Above code will run Puppeteer on headful mode and on the last part I comment the `await browser.close()` to see the browser in action.

The key is this code. It will set Pupeeteer to handle the basic authentication on a website.
```js
await page.authenticate({'username':'YOUR_BASIC_AUTH_USERNAME', 'password': 'YOUR_BASIC_AUTH_PASSWORD'});
```

I hope you enjoy it. Thank you.
Citizen Developer? - Just my two cents
Tags: citizendeveloper, powerapps, powerplatform
Published: 2019-12-10 10:27:35

Since Microsoft Ignite took place this year I was thinking of how to explain the term **_Citizen Developer_** to someone. I think my colleague [Paul Heisterkamp](https://twitter.com/braul) wrote something ([Link](https://msdyn365fo.wordpress.com/2019/12/05/this-is-my-understanding-of-a-citizen-developer/)) which pretty much nailed it.

![Citizen Developer/Every developer](https://thepracticaldev.s3.amazonaws.com/i/fobdnpfa974y3d879y80.png)

Nevertheless I have some additions to the beforementioned text. From my point of view Pro Developers/Enterprise Developers in this context should focus on delivering kind of Lego bricks (in a way of building blocks which can be stacked together) to the Citizen Developers so that they can create a solution for their specific problem.

In addition Pro Developers/Enterprise Developers should also focus on building new skills which can't be automated in the future. But what are skills which can't be automated in the future? The article [Are You Developing Skills That Won’t Be Automated?](https://hbr.org/2019/09/are-you-developing-skills-that-wont-be-automated?_lrsc=4bba76ec-d222-4289-b307-b974ba7cbed0) pretty much sums it up from my point of view even though not especially for developers.

After reading the article in my opinion Pro Developers/Enterprise Developers should always focus on creating solutions which add business value and moreover **understand** what problems people are trying to solve.<br/>
Therefore they should aid their colleagues/customers which are Citizen Developers by understanding their needs and providing solution blocks so that they can then create solutions as mentioned before for their problems on their own.

What do you think on this interpretation and outlook for the future of (Pro/Enterprise) developers?
Moving My Programming Blog Posts from WordPress to Dev.To
Tags: devto, wordpress, blog
Published: 2019-12-10 10:14:10

---
title: Moving My Programming Blog Posts from WordPress to Dev.To
published: true
description: Where I discuss trying to get things moving
tags: Dev.to, Wordpress, blog
---

I've been using WordPress for a while now for various blogging purposes. I've started and closed more programming blogs on the platform than I can remember. I've tried self-hosting (never again), I've used their hosted blog system. In any case I was never really satisfied. If I what I blog about is simply my experiences in living in Europe, or something silly like my love of Minecraft, then WordPress is fine. However, when I want to write about what I've learned as a developer, or anything where I need to post code snippets, then WordPress just doesn't work for me. I need a better tool for this. So along came Dev.to. At first I admit I wasn't sure what it was all about. I figured it was just a social media service for developers, which is fine within itself as we always need to network, but then I realized people were posting blogs there. So I started thinking, and after my last post on my WordPress blog I realized that I need to make a move. So I'm beginning to work on moving things from my WordPress.com account to here. This is probably going to take some time but I'm determined that this is where I want to start posting my blogs. So how will I do this? Well let me explain how I have my personal website setup.

## My Site
So my personal site I've done as a mostly static webpage, using some bootstrap css and a little jQuery work. The JavaScript part is simply to display my most recent posts from my blog. I accomplished this with the use of WordPress' API. So what will I need to do? I'll need to make this small dynamic portion of my website support the Dev.to API. Honestly that was the deciding factor for this change. Dev.to provides a RESTful API that I can use to request my posts and display links.

## Goals
So here is what I'm currently working on for updating my website to work with Dev.to:
* Update the icon set to Friconix (Done)
* Update the dynamic blog post display
* Adding content to Dev.to

As for the last one I'm not sure if I should move all my older posts from WordPress, or if I should just start with new content here. I think if I do move things over I will only move some of the posts that seem relevant. I'll have to really think that over.

I really want to have this all done by the end of the year. I think it is doable even with all the holidays.
404 page in Production doesn't work #gatsby 
Tags: help, gatsby
Published: 2019-12-10 10:00:36

I created a 404 page in `src/pages`404.js`. 
I expect 404 page to be there in production but I just got 404 Not Found error (nginx).
When it's local environment, wrong URL redirect to 404 page for development.

Why 404 page I created is not showed in production??
Data Structure and Algorithms: Palindrome String.
Tags: python, tutorial, beginners, codequality
Published: 2019-12-10 09:58:11

Hey there, today we are gonna check if a string is **Palindrome** or not. Now, before doing that we need to understand what a palindrome is...

Basically a palindrome is defined as a string that is written the same forward and backwards. For example -: abcdbca, if you read this from backwards it will the same.

So, how can we implement this algorithm in python? 
Well, it's just a few lines of code in python...

```python
def isPalindrome(string):
    reversed_string = ""
	for i in reversed(range(len(string))):
		reversed_string += string[i]
	return string == reversed_string
```

In the above code, we defined a function and it takes a parameter of string. In the second line, we define a variable `reversed_string` and assign it to an empty string. In the third line of code, we start a for loop with a range of length of the string in the reversed order, Because we want the reversed string of the input string. In the fourth line of code, we assign the input order of string in reversed order to the `reversed_string` variable. In the fifth line of code, we check if input `string` is equal to the `reversed_string` if it then returns True, else returns False.

Hey, it's my first article. I hope you liked this article. I will be back with more amazing content until then enjoy.

![bye](https://media.giphy.com/media/jUwpNzg9IcyrK/giphy.gif)
Go-UnderCover : Simple tool to install/use Kali-Undercover on all Linux distros
Tags: kalilinux, hacking, sofianehamlaoui
Published: 2019-12-10 09:11:04

Everyone was happy with this new "Kali Undercover mode" on the new Kali Linux 2019.4 release. 
So the idea is : Why only Kali Linux, let's do it for all Linux distros! 
Here comes Go-UnderCover ❤. 
Same code,Same role, but not for one only distro.

• The Github repo : GUC : Go Under Cover
https://github.com/SofianeHamlaoui/Go-undercover
Show Ruby/Gem version in repository on GitHub organization
Tags: github, audit, dependencies, ruby
Published: 2019-12-10 09:04:41

---
title: Show Ruby/Gem version in repository on GitHub organization
published: true
description: Clone repositories and check them on your local machine.
tags: github, audit, dependencies, ruby
---

# TL;DR

Clone repositories and check them on your local machine.

shallow clone into ~/tmp/packsaddle20191210

```
mkdir -p ~/tmp/packsaddle20191210
cd ~/tmp/packsaddle20191210
github-repos -org packsaddle -z | xargs -0 -P4 -I {} git clone {} --depth 1
```

https://github.com/sanemat/go-githubrepos
[Git clone repositories in a GitHub organization](https://dev.to/sanemat/git-clone-repositories-in-a-github-organization-gh8)

check Ruby version

```
for dir in */; do (cd $dir; git grep -n -E "^[ ]{3}ruby 2" -- Gemfile.lock| tr -s '\n' '\0' | xargs -0 -I {} printf "$(basename $(pwd))/{}\n") done
// or
for dir in */; do (cd $dir; grep -nH -E "^[ ]{3}ruby 2.*$" -- Gemfile.lock| tr -s '\n' '\0' | xargs -0 -I {} printf "$(basename $(pwd))/{}\n") done
```


check gem version, e.g. rails

```
for dir in */; do (cd $dir; git grep -n -E "^[ ]{4}rails " -- Gemfile.lock| tr -s '\n' '\0' | xargs -0 -I {} printf "$(basename $(pwd))/{}\n") done
// or
for dir in */; do (cd $dir; grep -nH -E "^[ ]{4}rails .*$" -- Gemfile.lock| tr -s '\n' '\0' | xargs -0 -I {} printf "$(basename $(pwd))/{}\n") done
```

For example
```
ruby-cron_for_github-app/Gemfile.lock:14:    rake (0.9.2.2)
ruby-saddler/Gemfile.lock:24:    rake (13.0.1)

```
Advent of Code 2019 Solution Megathread - Day 10: Monitoring Station
Tags: adventofcode, challenge, adventofcode2019, spoilers
Published: 2019-12-10 08:35:35

---
title: Advent of Code 2019 Solution Megathread - Day 10: Monitoring Station
published: True
description: We joined the Santa Force to go new places, meet new asteroids, and destroy them
tags: adventofcode,challenge, adventofcode2019, spoilers
series: Advent of Code 2019 Solutions
cover_image: https://i.imgur.com/WwIj6c7.png
---

No IntCodes today, just too many asteroids.

### [Day 10 - The Problem](https://adventofcode.com/2019/day/10)
We home in on the distress call to find the elves trying to find the best place to monitor the asteroids. Of course we need to stop and help them, as this is our best chance of getting through the asteroid belt in one piece.

Part 1 has us scanning for a new monitoring station location, optimized for the best view of the spinning rocks.

With slopes and distances safely under our belt, the elves decide to just blow everything up. Part 2 is doing some calculations to settle a bet on the results of their spinning asteroid destruction laser beam.

### Ongoing Meta

#### Dev.to List of Leaderboards

* `120635-5c140b9a` - provided by [Linda Thompson](https://dev.to/lindakatcodes) 

 If you were part of [Ryan Palo](https://dev.to/rpalo)'s leaderboard last year, you're still a member of that! 

If you want me to add your leaderboard code to this page, reply to one of these posts and/or send me a DM containing your  code and any theming or notes you’d like me to add. (You can find your private leaderboard code on your "[Private Leaderboard](https://adventofcode.com/2019/leaderboard/private)" page.)

I'll edit in any leaderboards that people want to post, along with any description for the kinds of people you want to have on it. (My leaderboard is being used as my office's leaderboard.) And if I get something wrong, please call me out or message me and I’ll fix it ASAP.

There's no limit to the number of leaderboards you can join, so there's no problem belonging to a "Beginner" *and* a language specific one if you want.

#### Neat Statistics

I'm planning on adding some statistics, but other than "what languages did we see yesterday" does anyone have any ideas?

##### Languages Seen On Day 09

* javascript x 3
* python x 3
* c
* clojure
* kotlin
* ruby
* swift


##### Completion Stats

By applying a best-fit descending power trend-line to the 1 and 2 star  columns on the [stats page](https://adventofcode.com/2019/stats), my estimates predict:

2 stars on day 25: 6358 people

1 star on day 25: 420 people. <sub>_Nice_</sub>

If you're still going, take heart in that you are in a _rapidly_ dwindling pool of people.

Doing other questionable statistics gives me: 415/6248
Text Detector using firebase MLKit
Tags: firebase, android, java, mechinelearning
Published: 2019-12-10 07:56:05

---
title: Text Detector using firebase MLKit
published: true
description: Text Detector
tags: firebase,  android,  java, 
 mechinelearning
---

Good day all
This is a Text Detector app i created using Google API and firebase MLKit
https://play.google.com/store/apps/details?id=com.mobile.textdetector
Text to speech
Translate up to 60 languages
Download and give a review
Communication between EAR to another EAR
Tags: help
Published: 2019-12-10 07:34:20

I have to send session object from one One EAR application to another EAR application ( deployed on same/different server).
For Eg: i have one app running with some session Id and on button click, it should take session id for validation, close/kill current application and open new application in same window with validating session object (user name).

P.S: I was looking with Post call, but I don't want to change my current application functionality, because in future another application can be deployed as new application.
Talk like Pythonista 1 - Data Types
Tags: python, tutorial, pytonista, idle
Published: 2019-12-10 07:32:58

In programming languages data types using to represent and understand the value of data.Beside of that , we can decide what operations can be performed on data.Each programming languages has same approaches generally , but it is not standardized and every languages has their data type classification.

In Python , we've got 

-Numbers
-Boolean
-Strings


__NUMBERS__

Any numeric value classified as Number.These numbers has types according to their represented data.These are integers , floats and complex numbers.In Python 3 , the limit is only computer memory for decide to how long data will be represent.However float values are represented as 64-bit double-precisions.

-_Integers_

Positive or negative whole numbers  are integers.Python using decimal system for all numbers.However if we need to other number systems,we can use prefix with numbers.

Prefix  | Interpretation | Base
  ------------- | ------------- | -------------
0b (zero + lowercase letter 'b')  | Binary  | 2
0o (zero + lowercase letter 'o')  | Octal   | 8
0x (zero + lowercase letter 'x')  | Hexadecimal | 16

Some examples with integers

```
>>> 3
3
>>> 0b10110
22
>>> -47
-47
>>> 0o5
5
>>> 0o12
10
>>> 0x21
33
```
-_Floats_

Float numbers wider than integers and the are fractional numbers.They have got negative and positive values and decimal point.

```
>>> 3.0
3.0
>>> -24.3
-24.3
>>> 8e-2
0.08
```

e is using for scientific notation and retuns a float value multiplied by the specified power of 10.

-_Complex numbers_
Complex numbers are written in the form, x + yj, where x is the real part and y is the imaginary part.


-_Strings_

Strings are character sets.We create strings enclose charactes with single quotes or double quotes.
```
>>> "Hello , World!"
'Hello , World!'
>>> 'This is a sentence'
'This is a sentence'
>>> "I'm a developer"
"I'm a developer"
>>> 'I\'m a developer'
"I'm a developer"
```

If we need to use single quote , you have to enclose characters with double quote and vice-versa.Either , you can use escape character backslash "\".

-_Boolean_

Boolean has two value.True or False.We can test boolean values simple binary logic problems.

```
>>> True and False
False
>>> True or False
True
```
Gorgeous Gatsby Starter for documentation
Tags: react, gatsby
Published: 2019-12-10 07:17:02

---
title: Gorgeous Gatsby Starter for documentation
published: true
description: ⚛️ Gatsby theme for antv websites
tags: react, gatsby
---

- [GitHub Repo](https://github.com/antvis/gatsby-theme-antv)
- [Preview site](https://g2plot.antv.vision/)

## Features

- ⚛ Prerendered static site
- 🌎 Internationalization support by i18next
- 📝 Markdown-based documentation and menus
- 🎬 Examples with live playground
- 🏗 Unified Theme and Layout
- 🆙 Easy customized header nav
- 🧩 Built-in home page components

## Usage

Create a Gatsby site from [gatsby-starter-theme-antv](https://github.com/antvis/gatsby-starter-theme-antv).

```
yarn global add gatsby-cli // or npm install gatsby-cli -g
gatsby new mysite https://github.com/antvis/gatsby-starter-theme-antv
```

Start developing.

```bash
$ cd mysite
$ yarn start
```

![](https://user-images.githubusercontent.com/507615/69481549-49b39d00-0e4d-11ea-87fd-1e7741f4bdf1.png)

![](https://pbs.twimg.com/media/EKSpnNJUcAYeG9U)


## Websites using it

- ✨ https://antv.vision
- ✨ https://g2plot.antv.vision
- ✨ https://g2.antv.vision
- ✨ https://g6.antv.vision
- ✨ https://f2.antv.vision
- ✨ https://l7.antv.vision
- ✨ https://graphin.antv.vision