teleren/devto huggingface dataset:
Make A Recursive Anonymous Factorial Function In Python.
Tags: lambda, recursion, python
Published: 2018-07-04 08:54:09

---
title: Make A Recursive Anonymous Factorial Function In Python.
published: true
description: 
tags: #lambda, #recursion, #python
---

I'm currently taking [Structure and Interpretation of computer programs](https://inst.eecs.berkeley.edu/~cs61a/sp18/) from the University of Berkeley. Here is a nice question from one of the homeworks. You might want to try your hands at it.

*Q6: Anonymous factorial*
The recursive factorial function can be written as a single expression by using a conditional expression.

    >>> fact = lambda n: 1 if n == 1 else mul(n, fact(sub(n, 1)))
    >>> fact(5)
    120
However, this implementation relies on the fact (no pun intended) that *fact* has a name, to which we refer in the body of *fact*. To write a recursive function, we have always given it a name using a *def* or assignment statement so that we can refer to the function within its own body. In this question, your job is to define fact recursively without giving it a name!

Write an expression that computes *n* factorial using only call expressions, conditional expressions, and lambda expressions (no assignment or def statements). Note in particular that you are not allowed to use *make_anonymous_factorial* in your return expression. The *sub* and *mul* functions from the *operator* module are the only built-in functions required to solve this problem:

    from operator import sub, mul

    def make_anonymous_factorial():
    """Return the value of an expression that computes factorial.

    >>> make_anonymous_factorial()(5)
    120
    >>> from construct_check import check
    >>> check(HW_SOURCE_FILE, 'make_anonymous_factorial', ['Assign', 'AugAssign', 'FunctionDef', 'Recursion'])
    True
    """
    return 'YOUR_EXPRESSION_HERE'
Adopting Microservices Architecture?
Tags: microservices, devops
Published: 2018-07-04 06:57:36

---
title: Adopting Microservices Architecture? 
published: true
description: Listed here are the advantages of Microservices
tags: microservices, devops,
---

You have a monolithic architecture and three million lines of code. Finding the mistake that is causing the code to break is a huge task. 

What should you do? How about adapting to a Microservices architecture? 

You might ask me the advantages, so here I have a list. 


![Advantages of Microservices](https://thepracticaldev.s3.amazonaws.com/i/cfvr0bz72mr4fs7rpinr.png)
Detecting Object vs Array in JavaScript by example
Tags: showdev, javascript, node, tips
Published: 2018-07-04 13:16:12

---
title: Detecting Object vs Array in JavaScript by example
published: true
tags: showdev,javascript,node,tips
canonical_url: https://codewithhugo.com/detecting-object-vs-array-in-javascript-by-example/
---

Let’s say we want to measure the depth of we have an object with mixed nested arrays/objects like so:

```js
const obj = {
  myKey: {
    nest: {
      doubleNested: 'value',
      nestedArray: [ { key: 'value' } ]
    }
  }
};
```

The difficulty lies in detecting whether we should treat the value as an object (dictionary) or as a list.

We should be able to do this with the following:

```js
function maxDepth(obj, depth = 0) {
  if (typeof obj !== 'object') {
    return depth;
  }
  const [values, depthIncrease] = Array.isArray(obj)
    ? [obj, 0]
    : [Object.values(obj), 1];
  return values.length > 0
    ? Math.max(...values.map(
      value => maxDepth(value, depth + depthIncrease))
    )
    : depth;
}
```

```js
// Some of these fail even although
// the assertions hold 🙄
console.assert(maxDepth({}), 0);
console.assert(maxDepth(''), 0);
console.assert(maxDepth([ { one: 'deep' } ]), 1);
console.assert(maxDepth({ one: 'deep' }), 1);
console.assert(maxDepth({ one: [ { two: 'deep' } ] }), 2)
console.assert(maxDepth({ one: { two: 'deep' } }), 2)
```

To break down object vs primitive type detection, it’s a case of `typeof obj === 'object'`, see this quick reminder of types of things:

```js
console.assert(typeof '', 'string');
console.assert(typeof new String(), 'string');
console.assert(typeof 1, 'number');
console.assert(typeof Infinity, 'number');
console.assert(typeof NaN, 'number');
console.assert(typeof undefined, 'undefined');

console.assert(typeof [], 'object');
console.assert(typeof null, 'object');
console.assert(typeof {}, 'object');
console.assert(typeof new Map(), 'object');
console.assert(typeof new Set(), 'object');
```

Now to separate Objects vs Arrays it’s `Array.isArray` every day, although we could use a check on `.length`, there’s also the caveat of `Set` or `Map` being passed around the function:

```js
// Console.assert flips out again
// even though the assertions hold
console.assert(Array.isArray({}), false);
console.assert(Array.isArray(new Map()), false);
console.assert(Array.isArray(new Set()), false);

console.assert(Array.isArray([]), true);
console.assert(Array.isArray(new Array()), true);
```

We could also use `.length > 0`, although that will check for a **non-empty** Array, or `.length != null`, and that’s a great use case for `!=`/`==`, but let’s stay away from that lest someone changes it to a `!==`/`===`.

> This was sent out on the [Code with Hugo newsletter](https://buttondown.email/hugo) last Monday.
> [Subscribe](https://buttondown.email/hugo) to get the latest posts right in your inbox (before anyone else).
Habits of efficient developers
Tags: productivity, devtips
Published: 2018-07-16 11:22:54

---
title: Habits of efficient developers
published: true
tags: productivity,devtips
canonical_url: https://danlebrero.com/2018/07/04/habits-of-efficient-developers-wearedevelopers-2018-video/
cover_image: https://danlebrero.com/images/blog/habits-efficient-wearedevs-slides.jpg
series: Efficient Development
---

I did a conference talk at WeAreDevelopers regarding "Habits of efficient developers". If you don't have time to watch the whole presentation, here is a summary:

{% youtube 6GmSEVkz1dU %}

Slides in [keynote format](https://danlebrero.com/slides/habits-of-efficient-developers.key), [ppt format (untested!)](https://danlebrero.com/slides/habits-of-efficient-developers.pptx) and [SlideShare (some are broken!)](https://www.slideshare.net/DanielLebrero2/habits-ofefficientdevelopers).

Full talk:

{% youtube 9-cyC6O81Bk %}

Feedback and questions welcomed!
React
Tags: react, visualstudiocode
Published: 2018-07-03 21:55:21

---
title: React
published: True
description: newbie question about React.
tags:  React, Visual Studio code
---

Could someone please explain to me how would i run an React website inside of visual studio code? I have a project that really peeks my interest into learning react. Its seems like a good library to work with so that why i have made this choice. Is there anyone who could share with me how i would be able to run any react website from within visual studio code. What would be the necessary resources things like plugins and compilers required to get a react website up and going. Thanks, andrew
Test in Production: From End-to-End Checks to Observability
Tags: devlive, video
Published: 2018-07-03 19:52:05

---
title: Test in Production: From End-to-End Checks to Observability
published: true
description: 
tags: devlive, video
---

We've got unit tests, functional tests, and integration tests — but where are our tests for production? How we define (and check for!) "correct behavior" for an app running in the wild?

In this workshop, we'll start by creating an end-to-end check together (like an integration test on prod!) on a fun, interactive demo app. Then, we'll go one level deeper by adding custom instrumentation.

You'll leave with a deeper understanding of how to ask questions of your app and how to think about ensuring "correctness" in production.

Prerequisites:
Folks should come prepared to make HTTP requests and parse JSON responses (in whatever language/environment they prefer).

*This DEV Live Stream was recorded on June 28, 2018*
Join the next Live Stream. See all upcoming events [here](https://dev.to/events).
Vue.js and AWS Lambda: Developing Production-Ready Apps (Part 2)
Tags: vue, aws, mongodb, express
Published: 2018-07-03 19:38:34

---
title: Vue.js and AWS Lambda: Developing Production-Ready Apps (Part 2)
published: true
description: In this series, you will learn how to develop production-ready applications with Vue.js and AWS Lambda.
tags: #vuejs #aws #mongodb #expressjs
canonical_url: https://auth0.com/blog/vue-js-and-lambda-developing-production-ready-apps-part-2/
---

In this series, you will use modern technologies like Vue.js, AWS Lambda, Express, MongoDB, and Auth0 to create a production-ready application that acts like a micro-blog engine. [The first part of the series focused on the setup of the Vue.js client and on the definition of the Express backend API](https://auth0.com/blog/vue-js-and-lambda-developing-production-ready-apps-part-1?utm_source=dev&utm_medium=sc&utm_campaign=vuejs_lambda).

The second part will show you how to prepare your app for showtime. You will start by signing up to AWS and to mLab (where you will deploy the production MongoDB instance), then you will focus on refactoring both your frontend and backend apps to support different environments (in this case, development and production).

[Read on ☁️](https://auth0.com/blog/vue-js-and-lambda-developing-production-ready-apps-part-2/?utm_source=dev&utm_medium=sc&utm_campaign=vuejs_lambda)

![Vue.js and AWS Lambda: Developing Production-Ready Apps (Part 2)](https://thepracticaldev.s3.amazonaws.com/i/e2loiwblzili9oji5fwn.png)
Importance of diagrams
Tags: discuss
Published: 2018-07-03 17:38:08

---
title: Importance of diagrams 
published: true
tags: discuss
---

Do you use diagrams in your development processes? If yes: do you draw on the whiteboard, or use an electronic tool? Which language do you use, UML, Simon Brown’s C4 model, or something else? Is the time doing it well spent?
Introducing our July 2018 sponsors
Tags: meta
Published: 2018-07-03 17:26:41

---
title: Introducing our July 2018 sponsors
published: true
description: Our wonderful sponsors are vital to the health of dev.to and it is great to work with companies contributing so much to the ecosystem.
tags: meta
cover_image: https://thepracticaldev.s3.amazonaws.com/i/nlqmrnc7ht5ulnkmhq6r.png
---

We are proud to announce our sustaining community sponsors for July. Our wonderful sponsors are vital to the health of [dev.to](https://dev.to) and it is great to work with companies contributing so much to the ecosystem.

In July, we have two new sponsors and one continuing sponsor. Please check out their wonderful services.

## DigitalOcean

[DigitalOcean](https://try.digitalocean.com/performance/?utm_source=devto&utm_medium=display&utm_campaign=Devto_2018_Brand) is a much-loved cloud computing platform. I'm always impressed by how well-built _and well-documented_ the DigitalOcean core products are. It's easier said than done, and they've been able to stay ahead of the curve.

## Stream

[Stream](https://getstream.io/try-the-api?utm_source=dev.to&utm_medium=banner&utm_campaign=july)'s API is tailor-made for creating news feeds and activity streams. We should know, as we chose Stream to construct the easier-said-than-done components of the dev.to notifications feed. If you are implementing a feed, let Stream do the heavy lifting.

## Underdog

[Underdog](https://underdog.io/?utm_medium=homepage&utm_source=devto&utm_campaign=homepage2018-jun-30&utm_content=engineers-tech-companies) matches great devs with awesome tech companies in the major US markets of SF and NYC. If you are looking for a position in one of these hubs, skip the line and let Underdog be your partner in the process.

***

These organizations are helping us build the best community we can. I urge you to check out their offerings if you are in the market for their services.

Happy coding ❤️
Helium - The Cryptocurrency Nano Course
Tags: cryptocurrency, blockchain, python
Published: 2018-07-03 15:53:32

---
title: Helium - The Cryptocurrency Nano Course
published: true
description: Make your own cryptocurrency
tags: cryptocurrency, blockchain, python
---
## Helium - The Cryptocurrency Nano Course

![Helium Cryptocurrency Cover Image](https://thepracticaldev.s3.amazonaws.com/i/pvc7k75c0ip0zo9ei4it.png) 

**A deep dive [ cryptocurrency course](http://crypticbox.com/). No previous programming experience needed! You'll learn python enroute to coding your own crypto.**

<!---
ps- This course has been reviewed by [Karan Garewal](https://www.linkedin.com/in/karangarewal)
-->


The big takeway is that **NO**  prior experience in Python or Cryptocurrency development is required. 

*Questions? Comments? Unicorns? Down below please!*

### 1. Pre - requisites
 - Basic Mathematics and Algebra
 - Some coding experience preferable motivation and determination

### 2. Content
 - Theory of Cryptology
 - How to program in Python
 - Construction of a real cryptocurrency

### 3. Course objectives
 - Understanding of cryptographic theory
 - Proficiency in the Python language
 - Ability to design and code a cryptocurrency

### 4. Course features

![Course features](https://thepracticaldev.s3.amazonaws.com/i/d96r4dexlgohp9q8diy0.png)

### 5. Curriculum

![Course Modules](https://thepracticaldev.s3.amazonaws.com/i/a199ba85i1ffp69m4ya8.png)

### 6. Course Resources

12 Modules and 2 books (all included).
Using global tool "dotnet outdated" to check for the latest NuGet package updates
Tags: dotnet, aspnetcore
Published: 2018-07-04 16:21:43

---
title: Using global tool "dotnet outdated" to check for the latest NuGet package updates
published: true
tags: dotnet,aspnetcore
canonical_url: https://tattoocoder.com/using-global-tool-dotnet-outdated-to-check-for-the-latest-nuget-package-updates/
---

 ![Using global tool](http://tattoocoder.com/content/images/2018/07/Screen-Shot-2018-07-02-at-5.27.43-PM.png)

Just recently the [.NET Core June 2018 Update](https://blogs.msdn.microsoft.com/dotnet/2018/06/22/net-core-2-1-june-update/?WT.mc_id=none-devto-shboyer) dropped and the [ASP.NET Workshop I had just set up for CI/CD build](https://tattoocoder.com/learning-devops-and-building-the-asp-net-core-workshop-up-to-date/) was in need of an update to [2.1.1 (Release Notes)](https://github.com/dotnet/core/blob/master/release-notes/2.1/2.1.1.md).

- Get the latest [2.1.1 Runtime](https://www.microsoft.com/net/download/all?WT.mc_id=none-devto-shboyer) | [2.1.301 SDK](https://www.microsoft.com/net/download/all?WT.mc_id=none-devto-shboyer) from the [downloads page at](https://www.microsoft.com/net/download/all?WT.mc_id=none-devto-shboyer) [http://dot.net/](http://dot.net/)

Looking through all of the `save-points` there are and of course the main `/src`, the challenge is to know what NuGet packages have changed and what versions are the latest etc., to be updated.

That is where a great .NET global tool, [`dotnet-outdated`](https://github.com/jerriep/dotnet-outdated) comes in to play.

- Read more about [dotnet global tools in the docs](https://docs.microsoft.com/dotnet/core/tools/global-tools?WT.mc_id=none-devto-shboyer)

Install the tool using the .NET CLI - `dotnet tool install --global dotnet-outdated`, then I can either be at the solution(.sln) level or project(.csproj) level and type `dotnet outdated`.

![Using global tool](http://tattoocoder.com/content/images/2018/07/Screen-Shot-2018-07-02-at-5.27.43-PM-1.png)

The output shows each NuGet package, the current version used and the latest version. You have an option to pass `-pr` if you'd like to look for Pre-Release versions too.

Another nice option is the `-vl` or Version Lock option, which allows for locking on Major or Minor when checking for outdated packages.

Updating each of the projects was very fast using the defaults, making the changes to the \*.csproj files and then having the CI/CD process do its magic upon commit.

This is another great example of where .NET global tools can make the experience better. Would love to see this tool give an option for auto-updating. It is open source at [https://github.com/jerriep/dotnet-outdated](https://github.com/jerriep/dotnet-outdated).
Why you Should Choose to go With Rapid App Prototyping before Build Your MVP
Tags: blog, minimalviableprodu, mvp, rapidappprototypin
Published: 2018-07-04 10:32:56

---
title: Why you Should Choose to go With Rapid App Prototyping before Build Your MVP
published: true
tags: Blog,Minimal Viable Produ,MVP,Rapid App Prototypin
canonical_url: 
---
![](https://www.itfirms.co/wp-content/uploads/2018/07/rapid-app-prototype-mvp.jpg)
The reason of the [why should you choose rapid app prototyping prior to building your MVP](https://www.itfirms.co/why-you-should-choose-to-go-with-rapid-app-prototyping-before-build-your-mvp/)? Check out some of the different protoyping models, as well as why you should go through the trouble of developing an MVP before further project development.
How to aggregate GitHub, GitLab and Bitbucket tickets
Tags: github, bitbucket, gitlab, productivity
Published: 2018-07-10 13:55:29

---
title: How to aggregate GitHub, GitLab and Bitbucket tickets
published: true
tags: github, bitbucket, gitlab, productivity
canonical_url: https://daniele.tech/2018/05/how-to-aggregate-github-gitlab-and-bitbucket-tickets/
---

One of my most requested things was to have an aggregator of task assigned to me in various platform. Ignoring labels, priorities and milestone because they are consistency used between various projects and services.

The post [How to aggregate GitHub, GitLab and Bitbucket tickets](https://daniele.tech/2018/05/how-to-aggregate-github-gitlab-and-bitbucket-tickets/) appeared first on [Daniele Mte90 Scasciafratte](https://daniele.tech/eng).
What kind of library RxJs and Angular use to generate API documentation ?
Tags: question, documentation
Published: 2018-07-03 13:54:00

---
title: What kind of library RxJs and Angular use to generate API documentation ?
published: true
description: 
tags: question,documentation
---

I'm developing some TypeScript library and I looked to existing API documentation, and I stumbled into those from [Angular](https://angular.io/api) and the new one from [RxJs](https://rxjs-dev.firebaseapp.com/api).

I wondered if anyone knew what sort of library/process they use to generate those pages, I would be very interested to know !
Serverless application architecture, patterns, and implementation
Tags: serverless, logicapps, azurefunctions, eventgrid
Published: 2018-07-13 15:07:50

---
title: Serverless application architecture, patterns, and implementation
published: true
tags: serverless,logic-apps,azure-functions,eventgrid
canonical_url: https://blog.jeremylikness.com/serverless-application-architecture-patterns-and-implementation-5aaabb3acda6
---

#### An overview of serverless with implementations using Azure Functions, Logic Apps, and Event Grid.

I blogged and tweeted about serverless the first time just over a year ago.


> Create and host a #serverless n-tier #Angular app using #Azure Functions and #Blob storage [https://t.co/nVc7wkiPzu](https://t.co/nVc7wkiPzu)
> 
>  — [@jeremylikness](https://twitter.com/jeremylikness/status/850433555830276096)

I am amazed how much momentum serverless has gained over time and am very happy with the advanced tools that are available to implement serverless in Azure. There is still a lot of confusion around what serverless is, when to choose it, how to implement it and what scenarios exist that are suited to serverless. To address this knowledge gap over the past several months I’ve been working on a project that I’m happy to announce was released just last night: a *free* online eBook titled “[Serverless apps: Architecture, patterns, and Azure implementation.](https://jlik.me/duy)”

[![](https://cdn-images-1.medium.com/max/1024/1*v9tbh3og2zRk0eHdZ9UrGw.jpeg)](https://jlik.me/duy)

The book starts with an overview of traditional architecture patterns and approaches to deploy applications. The overview is used for context to compare/contrast with serverless. The book then covers serverless architecture, including challenges to consider and various design approaches. I show how to implement serverless using the Azure serverless platform that includes [Azure Functions](https://jlik.me/duz), [Logic Apps](https://jlik.me/du0), and [Event Grid](https://jlik.me/du1). I conclude with a list of business case and scenarios that link out to samples and hands-on labs.

The book can be browsed online or downloaded in PDF format and will provide you with a starting point to understand the power of serverless computing.

Regards,

![](https://cdn-images-1.medium.com/max/197/1*KwXn3ElS7vnWIk8lNVhBsA.gif)

* * *
Need your help: Show me your GraphQL Schema
Tags: graphql, vue, discuss
Published: 2018-07-03 12:40:50

---
title: Need your help: Show me your GraphQL Schema
published: true
description: 
tags: graphql, vue, discuss
---

Hello Community!

I need your help. I'm the maintainer of [Vuex-ORM-GraphQL](https://dev.to/phortx/vue-3-graphql-kj6). It's a tough job to cover all those different ways to design a GraphQL Schema. You would help me a lot if you could run  the introspection query below against your GraphQL API and send me the result.

This way I can analyze what different schema designs are out there and write unit tests to ensure that my plugin can handle them all :)


Disclaimer: Please make sure it's ok to send me the schema! Don't send me any secret or sensible information you may be sentenced for. However I promise to keep the stuff you send me secret and I will delete it right after analyzing it. I will not use them for any other purpose or distribute it.

Here is the introspection schema, you can run it against your API by using GraphiQL for example.

```graphql
{
  __schema {
    types {
      name
      description

      fields(includeDeprecated: true) {
        name
        description
        args {
          name
          description
          type {
            name
            kind

            ofType {
              kind

              name
              ofType {
                kind
                name

                ofType {
                  kind
                  name
                }
              }
            }
          }
        }

        type {
          name
          kind

          ofType {
            kind

            name
            ofType {
              kind
              name

              ofType {
                kind
                name
              }
            }
          }
        }
      }

      inputFields {
        name
        description

        type {
          name
          kind

          ofType {
            kind

            name
            ofType {
              kind
              name

              ofType {
                kind
                name
              }
            }
          }
        }
      }
    }
  }
}
```

Send me the result as a private gist to bk@itws.de.

Thank you very much for your help!
How to install Node.js on any Raspberry Pi
Tags: node, raspberrypi, beginners, tutorial
Published: 2018-07-03 12:39:40

---
title: How to install Node.js on any Raspberry Pi
published: true
description: A quick tutorial showing you how to install Node.js on any Raspberry Pi
tags: #node #raspberrypi #beginners #tutorial
---
![alt text](https://s3-eu-west-1.amazonaws.com/wia-flarum-bucket/2018-07-03/1530621440-312950-blog-nodejs-9touvegvpm.jpeg)
Hi All,
Here's a quick tutorial showing you how to install Node.js on any Raspberry Pi. When logged into your Pi (either by SSH or desktop), run the following 5 commands one by one:

```
cd ~
wget https://nodejs.org/dist/v4.3.2/node-v4.3.2-linux-$(uname -m).tar.gz 
tar -xvf node-v4.3.2-linux-$(uname -m).tar.gz
cd node-v4.3.2-linux-$(uname -m)
sudo cp -R * /usr/local/
```
To check Node.js is installed correctly, run `node -v`. It should return `v4.3.2`. Run `npm -v` to check if NPM (Node package Manager) has also been installed.