teleren/devto huggingface dataset:
Closure explained in an elevator, without saying the words “close over” 
Tags: closure
Published: 2017-12-06 15:30:23

---
title: Closure explained in an elevator, without saying the words “close over” 
published: true
description: 
tags: closure
---

There are plenty of articles discussing about the **closure**, too many to be listed here. They all eventually incorporate long code examples in various languages into the explanation, which is fine. Many articles choose to use the word **close over** to describe about **closure**, which [does not really mean a whole lot](https://stackoverflow.com/questions/30700027/what-does-it-mean-to-close-over-something), at least to me.

I attempt here to explain about **closure** here without showing any code, hence “in an elevator”.

A closure is simply a function defined inside another function. This inner function naturally has access to variables and constants defined in its outer function. This inner function can even modify the value of these variables (of course, the inner function cannot modify any constant, no matter where the constant is defined). That’s not all, this inner function also has access to arguments that get passed to the outer function. All of these facts are neither surprising nor interesting. But that’s all. That’s the definition of a **closure**. It’s easy to visualize. It’s easy to understand. A closure is an inner function that naturally has access to variables, constants and arguments of its outer function.

If the inner function is NOT returned by its outer function, all of the variables defined in the outer function and the inner function itself will cease to exist once the outer function returns or exits. Used in that way, a **closure** which is the inner function is nothing more than a small utility, helper function of a larger outer function.

What makes **closure** interesting is when this inner function is returned by its outer function. The caller of the outer function would save this returned inner function in a variable, which can later be invoked. When this happens, variables, constants and arguments of the outer will continue to exist even after the outer function has returned. This fact leads to many usages and patterns which makes **closure** a powerful concept.

That’s a 2 minute explanation with no code. Now we can exit the elevator.
Case sensitivity in HTTP
Tags: http, urlsession, case, sensitive
Published: 2017-12-06 15:10:28

---
title: Case sensitivity in HTTP
published: true
description: 
tags: http, urlsession, case, sensitive
---

Original post https://github.com/onmyway133/blog/issues/115

## Is URL case sensitive ?

According to [HTML and URLs ](https://www.w3.org/TR/WD-html40-970708/htmlweb.html)

> URLs in general are case-sensitive (with the exception of machine names). There may be URLs, or parts of URLs, where case doesn't matter, but identifying these may not be easy. Users should always consider that URLs are case-sensitive.

## Is header case sensitive?

According to [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2)

> Each header field consists of a case-insensitive field name followed by a colon (":"), optional leading whitespace, the field value, and optional trailing whitespace.

## Is method case sensitive?

Using `URLSession`, mostly we will get `200` with `request.httpMethod = "GET"` and `400` with `request.httpMethod = "get"`. Generally speaking, you should use some popular wrappers [Alamofire](https://github.com/Alamofire/Alamofire) or [Malibu](https://github.com/hyperoslo/Malibu) as they are mature enough. Spend your precious time solving more important problems instead.

According to [RFC 7231](https://tools.ietf.org/html/rfc7231#page-24)

> The method token is case-sensitive because it might be used as a gateway to object-based systems with case-sensitive method names.
Using bootstrapped paket
Tags: powershellmoments, powershell, paket, dotnet
Published: 2017-12-06 15:04:54

---
title: Using bootstrapped paket
published: true
description: 
tags: powershell-moments, powershell, paket, dotnet
---

I use the [Paket](https://fsprojects.github.io/Paket/) package manager in several of my projects by bootstrapping, and so I wind up with a `.paket` directory at the root of my project folder which contains the `paket.exe` I need to use.  I find it cumbersome to invoke it with relative paths like `../../../.paket/paket.exe`, so I wrote a little bit of powershell to ensure the bootstrapped paket is in my path.

This is in the Cmder `$PrePrompt` function, but if you're not using Cmder, you can do this in the `Prompt` function of your Powershell profile (which you would have to add if you don't have it already.  See [about_Prompts](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_prompts?view=powershell-5.1) for more info.

The relevant bits of my `user-profile.ps1` set up for Cmder:


```powershell
Function Get-AncestorPath ($dir, $name) {
    $target = Get-ChildItem $dir |? { $_.Name -eq $name }
    if ($target -ne $Null) {
        return $target
    } elseif ($dir.Parent -ne $Null) {
        return Get-AncestorPath $dir.Parent, $name
    } else {
        return $Null
    }
}

[ScriptBlock]$PrePrompt = {
    $paketDir = Get-AncestorPath $pwd ".paket" | Select-Object -ExpandProperty FullName
    if ($paketDir -eq $Null) {
        if ($Env:Path -like "*.paket*") {
            Write-Verbose "Removing .paket path from `$Env:Path"
            $Env:Path = $Env:Path -split ';' `
                |? { $_ -notlike "*.paket*" } `
                | Join-String -Separator ';'
        }
        return
    }

    Write-Verbose "Paket path: $paketDir"

    if (($Env:Path -split ';') -notcontains $paketDir) {
        Write-Verbose "Adding '$paketDir' to path..."
        $Env:Path = "$paketDir;$($Env:Path)"
    }
}
```
mrubyのJIT ver2　の構想
Published: 2017-12-06 10:13:06

---
title: mrubyのJIT ver2　の構想
published: true
description: 
tags: 
---

# はじめに

[mrubyのJIT](https://github.com/miura1729/mruby/)なるものを作っています。これは、[mruby](https://github.com/mruby/mruby)にJITコンパイラを加えたものです。[一定の成果](https://qiita.com/miura1729/items/a1828849ec8fec596e74) は得られたのですが、色々問題も発生してきました。もともと、動くことが第1目標で出来る限り無難な実装を選択したため、これ以上の拡張は厳しい気もします。

こんな問題があります。このような問題に対して解決するような新たなバージョンを検討します。

##　マルチスレッド
　当然ながらマルチスレッド化は全く考えていません。さすがにmrubyの設計思想に反して大域変数を使うようなことはしていませんが、生成されたコード領域はグローバルで排他制御していませんのでマルチスレッドには対応していません。そのため、H2Oでの使用は事実上不可能です。

## メモリ効率
　コンパイル時の型情報やVMに戻る際のレジスタ情報などmrubyのJITで必要なデータを保持するためにメモリを使うのですが、これが何も考えずにad-hocに設計したため非常に無駄の多いものになっています。luajitのコードを読み、もっと効率の良いデータ構造が設計出来ることに気づきました。

## 移植性
 もともと、mrubyのJITはx86　32bitのみで動くように開発しました。その後、x64でも動く様変更しましたが、armでの動作などは全く考えていません。

## コード領域の無駄遣い
　mrubyのJITはメソッドの再定義など動的な性質に対して、コードの自己書き換えで対応している場合があります。ところが自己書き換えで無効になったコード領域はそのまま何も使われずそのままになります。コード領域に対するGCが望まれますが、現状の構造ではそれは不可能です。

# マルチスレッド
　ここでいうマルチスレッドとは3つの意味があります。１つはmrubyのインスタンスがmrbを複数用意することで複数存在しそれぞれがマルチスレッド動く場合。H2Oはこの状態で動いているためH2Oに対応するためにはこの形での実行が出来ることが必要になります。2つめは、コンパイラ中で並列で動くこと。例えばコンパイルをバッググラウンドで行うとかはこれにあたります。3つめは、コンパイルされたコードがマルチスレッドまたは並列で動くこと。mrubyは標準ではマルチスレッドはサポートしていませんが、マルチスレッドまたは並列に実行するようコンパイルすることは可能であるような表記は存在します。
TFVC to Git migration. Branching and merging issues. Has anyone done it before and can someone help?
Tags: discuss
Published: 2017-12-06 10:00:03

---
title: TFVC to Git migration. Branching and merging issues. Has anyone done it before and can someone help?
published: true
tags: discuss
---


Hey guys,

We've recently migrated from TFVC to Git. We've got 4 teams who are at the end of their first sprint and they're having issues with merges of their branches, clashing with one another, and getting conflicts.

I'm looking for someone who's taken a similar route who can give a bit of guidance, or, alternatively, someone who just knows Git better than we do to give me a bit of an overview of branching and merging best practices. I think we're probably forcing too much TFVC terminology and process onto ourselves and not adopting Git properly, but none of us know Git enough to know where we're going wrong

Cheers!

Greg
DeepL - translation service
Tags: machinelearning, translation, learning, useful
Published: 2017-12-06 09:09:03

---
title: DeepL - translation service
published: true
description: DeepL - use machine learning for translation
tags: machineLearning,translation,learning,useful
---
> DeepL develops artificial intelligence for understanding and translating texts. She will support you from today.

Some time ago I discovered [DeepL.com](https://www.deepl.com/translator) and used it to translate my stuff since then.

I used Google Translator a lot before because it was fast, had an app for android and considered suggestions from users for corrections.
DeepL has an impressive amount of computing capacity in the background which makes it so fast.

As a german I got curious how the german project will evolve.

## The company
There was a company called *Linguee GmbH* from Cologne, Germany. Shortly before the launch of DeepL, they changed their name to *DeepL GmbH* and published the translation platform on the 28th of August 2017.

## The technology
DeepL is using supercomputers based in Iceland with more than 5.1 petaFLOPS! The database was trained to the database of Linguee pre-launch.
It uses Convolutional Neural Networks behind the scenes.

## Personal opinion
- Fast
- Translation while typing
- Same performance on mobile devices!
- Best translations so far (detection of context, meanings)
- Language detection works like a charm! Load website, type right away, copy result, close - done!

I want to draw attention to [DeepL](https://www.deepl.com/translator) translation service because my collegues and I are using it a lot now and are thrilled with it!
Maybe it comes in handy for some of you, too.

Leave your thoughts on it in the comments.
Web Development Series (WDS1)
Tags: css, html, wds, webdev
Published: 2017-12-13 20:29:25

---
title: "Web Development Series (WDS1)"
published: true
tags: CSS,HTML,WDS, webDev
canonical_url: http://thecodingexpress.blogspot.com/2017/12/WDS1.html
---

Web development is a really nice way to enter in coding. Although it is easy to see on its first sight, web development consists of many steps and one should conquer them step by step. Your website should be responsive, fast, attractive and must be as your condition. Learning web development is a long journey and require patience, consistency, and self-believe. So from this post, in this&nbsp;series, we will start learning various things needed to perfectly create a good website. Follow along, don't just read, try it yourself, ask doubts and keep coding.  
  
  

[![](https://www.eduonix.com/aDmiN_050716/public/uploads/headerimages/20170301155447.jpg)](https://www.eduonix.com/aDmiN_050716/public/uploads/headerimages/20170301155447.jpg)

  
Web development consists of mainly 3 steps:  
  

- **Learning Front End Development** - In simple language, you will create what user sees on a website including all text, images, contact forms and beautiful designs.
- **Learning Back-End Development** - This type of web development usually consists of three parts: a server, an application, and a database.Most of the code that is required to make an application work will be done on the backend.Backend code is run on the server, as opposed to the client.
- **Combining both front-end and back-end&nbsp;**

In Front End Development, we will focus on following technologies as of now and I will add more as we complete one after other.

- HTML
- CSS
- Bootstrap
- Javascript

Don't worry, we will start from very basic level, so it is OK if you don't know anything. I will try to post one article daily. We will start from HTML tomorrow.&nbsp;

So gear up guys. It is going to be an exciting journey.&nbsp;

Share this post with your friends. Let's learn together.

Bye...

###
Pomodoro works 😎
Tags: productivity, devtips
Published: 2017-12-06 06:25:18

---
title: Pomodoro works 😎
published: true
description: Learn how to work effectively with pomodoro technique.
tags: productivity, devtips
canonical_url: https://medium.com/@itsjzt/pomodoro-works-c76698702f6d
---

![bg image with instructions](https://cdn-images-1.medium.com/max/800/1*kEwlYMyiFobrgWH7BvdSSA.png)

Pomodoro ⏰ is a classical technique of working effectively with your time. In Pomodoro technique, we work in sessions of 25/5 (classically). It means you work on one task for 25 minutes and then after you reward yourself with 5 minutes of break.

Pomodoro is a great technique that works very good for me and it’s really easy to try. You will find yourself more productive and get more done. And if you are kind of person who doesn’t know how time flew away then Pomodoro is a must try.

read the full blog: [How to work effectively with pomodoro technique](https://medium.com/@itsjzt/pomodoro-works-c76698702f6d)
How do containers work when you're using both Docker and Kubernetes?
Tags: beginners, discuss, explainlikeimfive, docker
Published: 2017-12-06 03:49:22

---
title: How do containers work when you're using both Docker and Kubernetes?
published: true
description: How does this work?
tags: beginners, discuss, explainlikeimfive, docker
---

I'm new to containerisation, and have never actually used it in practise... or even used any of my developing skills in practice since I'm new to this whole 'developing' thing. I think I've got a *really* basic understanding of containers, but I don't understand how you'd use Kubernetes and Docker together in a workflow?

I really should have made this a like 'Explain Like I'm 5' sorta thing.
Explain Like I'm Five: What's a standard library?
Tags: explainlikeimfive, anonymous, discuss
Published: 2017-12-05 21:49:02

---
title: "Explain Like I'm Five: What's a standard library?"
published: true
description: 
tags: explainlikeimfive, anonymous, discuss
---

_This is an anonymous question sent in by a member who does not want their name disclosed. Please be thoughtful with your responses, as these are usually tough questions to ask and answer._
How to learn tech skills outside of your wheelhouse?
Tags: discuss, learn
Published: 2017-12-05 21:35:51

---
title: How to learn tech skills outside of your wheelhouse?
published: true
tags: discuss, learn
---

I'm a backend engineer that does a ton with API's all day, but my front end kung-fu needs time in the dojo. What things do y'all do to learn technologies outside your daily wheelhouse?
How do you choose between "cutting-edge" and "bleeding-edge"?
Tags: discuss, serviceworker, workbox, pwa
Published: 2017-12-05 19:19:15

---
title: How do you choose between "cutting-edge" and "bleeding-edge"?
published: true
description: 
tags: discuss, serviceworker, workbox, pwa
---

At work, we're transforming [our website](https://paintcollar.com) into a very good webapp. Trying.
To qualify as a real install-able [progressive webapp](https://developers.google.com/web/progressive-web-apps), [Google Lighthouse](https://developers.google.com/web/tools/lighthouse) requires us to score a 100% on their test.

The only thing we're missing out on is the caching technique. I'm old fashioned. I like [sw-precache](https://github.com/GoogleChromeLabs/sw-precache) and [sw-toolbox](https://github.com/GoogleChromeLabs/sw-toolbox). They're old. They've been around for a while and lot of folks are using it. *Google* backed.

I'm also very enthusiastic and curious. I like [workbox](https://developers.google.com/web/tools/workbox/) too. It's *very* new. *Google* is backing it **too**.

Now, I remember someone telling me (*master Oogway style*):

Be a cutting edge developer.
Not a bleeding edge developer.

*Can people please shed some light over this? How should we go about it?*


All/Any help appreciated. 🙌
*#firstPostOnDevTo* *#finally*
I'm Scott Hanselman, ask me anything! 
Tags: ama
Published: 2017-12-05 18:47:32

---
title: I'm Scott Hanselman, ask me anything! 
published: true
description: I work in Open Source on ASP.NET and the Azure Cloud for Microsoft. I have three podcasts and I've written a number of books and spoken in person to almost a half million developers worldwide. 
tags: ama
cover_image: https://thepracticaldev.s3.amazonaws.com/i/cbueyk43be6h2t3fpeoe.jpg
---

My name is Scott Hanselman. I'm a [programmer](http://github.com/shanselman), [teacher](https://hanselman.com/blog/), and [speaker](https://hanselman.com/speaking). I work in Open Source on ASP.NET and the Azure Cloud for Microsoft out of my home office in Portland, Oregon. 

I'm excited about community, social equity, media, entrepreneurship and above all, the open web.

Ask me anything!
Do software engineers at the largest tech companies (i.e. Google, Facebook, Apple, etc.) use Github for version control?
Tags: code, versioncontrol, softwareengineering, discuss
Published: 2017-12-05 17:51:20

---
title: Do software engineers at the largest tech companies (i.e. Google, Facebook, Apple, etc.) use Github for version control?
published: true   
description: I have always wondered this. If Amazon owns it do the other big players not risk using it for security reasons?
tags: Code, Version Control, Software Engineering, discuss
---
"There have been a couple of customers whose caches have just disappeared without us doing anything"
Tags: webdev
Published: 2017-12-05 17:47:53

---
title: "\"There have been a couple of customers whose caches have just disappeared without us doing anything\""
published: true
description: Software development is a shit show sometimes.
tags: webdev
---

Software development is a shit show sometimes. The title of this article is part of a response I got when a cloud service we were using just wasn't there anymore. Here's the whole response, with some info redacted to protect the (surely frustrated themselves) innocent.

> It looks as though your cache has been deleted (apparently on _[redacted]_). I'm guessing you didn't delete your cache. I need to investigate this properly, because we seem to have been getting some phantom cache deletion requests from _[redacted]_ in the last few days -- there have been a couple of other customers whose caches have just disappeared without us doing anything or apparently them doing anything either. Which is obviously very worrying. I've added extra logging to try to track down what's going on, but I've not caught a case right as it happened yet.

> In the meantime, the quickest way to get you going again is for you just to remove and re-add the _[redacted]_ to your app, which will create a new cache. We'll sort out some reduction in charges for this month to cover the inconvenience, and I'll get back to you as soon as I've tracked down what's really going on.


In addition to the issues on their end, we sort of ignored the error at first, so we were serving our app without a critical cache for a little while. And then when I got into the investigation, I tried to make a quick change successfully crashed the app in production for about a minute, and that isn't easy to do with our CI setup.

The company's support was very fast with their response. I'm thankful for the wonderful support once I got in touch with them. Note to self: Do this sooner.

It has been an all-around "one of those weeks" at [dev.to](/). But I'm really excited for [Scott Hanselman](https://dev.to/shanselman)'s "Ask Me Anything" scheduled for today at 2pm EST. He's definitely one of my programming heroes. I'm hoping nothing goes wrong. 🙃
This is how my complete development setup looks like
Tags: discuss, productivity, advice
Published: 2017-12-05 17:12:57

---
title: This is how my complete development setup looks like
published: true
description: My experience of setting productive development setup 
tags: discuss, productivity, advice
canonical_url : http://harshitrathod.com/2017/11/24/this-is-how-my-complete-development-setup-looks-like/
---


Hello folks,
Recently, I have Added my 2-year journey to achieve perfect development setup to my [blog](http://harshitrathod.com/2017/11/24/this-is-how-my-complete-development-setup-looks-like/). Let's discuss what can be done differently to get better result!!!
Non-authenticated Email Ordering
Tags: security, privacy, anonymous, discuss
Published: 2017-12-05 17:00:10

---
title: Non-authenticated Email Ordering
published: true
description: 
tags: #security #privacy #anonymous #discuss
---
_This is an anonymous question sent in by a member who does not want their name disclosed. Please be thoughtful with your responses, as these are usually tough questions to ask and answer._


url in email: `somepage.html?someuuid=xxxxxxxxxxxxxxxxxxxxx`

`someuuid` is directly associated with a user, and a credit card on file.

Click the link in the email, visit page with `someuuid` in url, click ORDER, and your card on file is charged, _without authentication_.

Share the email or the link with `someuuid` in url, and if someone clicks on it, it will place the order with the card on file, _without authentication_.

Marketing is arguing that there’s higher conversion, and a competitive edge by not making people authenticate, and is blocking authentication from being added…insists that it’s some genius feature. Yes, in 2017 these are the arguments.

Please comment on the a) legality b) PCI compliance implications c) privacy, and d) ethics of building and publishing an email ordering system in this way.

I need strong arguments. Marketing isn’t listening. Help.
What heuristics do you use when developing a frontend testing strategy?
Tags: discuss, testing
Published: 2017-12-05 15:50:57

---
title: What heuristics do you use when developing a frontend testing strategy?
published: true
tags: discuss, testing
---

I'm currently on an Angular project with a decent sized test suite (~1000 tests), but it takes a long time to run and misses a lot of critical bugs -- I want to take a more nuanced approach.

On a broad level: what's your frontend testing philosophy?

If that's too vague, here are some more specific questions to consider:

- What are your percentages of unit tests / integration tests / end-to-end tests?
- Are there good quantifiable metrics for how long a (unit) test suite should take to run?
- In terms of time spent on production code vs. tests, when is writing a challenging test *not* worth the effort (especially for E2E tests)?
- When, if ever, is it okay to remove tests for stable code?
- Do you split your test suite into different groups of tests? If so, how, and when do you run each group?