teleren/devto huggingface dataset:
Flutter issue: Android license status unknown on Windows
Tags: flutter, android, bugs, license
Published: 2020-03-02 04:20:12

---
title: Flutter issue: Android license status unknown on Windows
published: true
date: 2020-03-02 03:41:00 UTC
tags: Flutter,Android,Bugs,License
canonical_url: https://robbinespu.gitlab.io/blog/2020/03/02/flutter-issue-android-license-status-unknown-on-windows/
---

I keep getting `Android license status unknown` when installing flutter on Windows

```
PS D:\Workplace\flutter_projects> flutter doctor -v
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.657], locale en-MY)
    • Flutter version 1.12.13+hotfix.8 at D:\Workplace\flutter
    • Framework revision 0b8abb4724 (3 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Users\Robbi\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    X Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed
      instructions.

[√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] VS Code (version 1.42.1)
    • VS Code at C:\Users\Robbi\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.8.1

[√] Connected device (1 available)
    • SM A505F • XXXXXYYYZHW • android-arm64 • Android 9 (API 28)

! Doctor found issues in 1 category.

```

I am using Android Studio 3.6.1 on my windows 10 and there is no `C:\Users%user%\AppData\Local\Android\Sdk\tools\bin` directory created…this is so weird

![IMG](https://images2.imgbox.com/50/8a/RkN0UOy1_o.png#center)

the step I take is to install `Android SDK command line tool (latest)` from SDK tool

After `Android SDK command line tool (latest)` installed, open terminal (i am using Git Bash) navigate to `C:\Users\<YOUR_USERNAME_HERE>\AppData\Local\Android\Sdk\cmdline-tools\latest\bin` and execute `./sdkmanager.bat --licenses` then accept all SDK package licences and expecting this should solve the problem…

Unfortunately this still does’t work with `flutter doctor`.. dang! Do you know how to solve it? This issue already reported here [#51712](https://github.com/flutter/flutter/issues/51712)
Measure time with a higher order utility function
Tags: javascript
Published: 2020-03-02 11:29:44

I consider closures and higher order functions to be one of the most powerful language features, if not the most powerful. Here is a 2-liner function that uses both of them. Comes in handy for testing, debugging and measuring performance of some chunks of code.


```javascript
/*
* startTimer creates a function that returns time difference in milliseconds
*/
function startTimer() {
  const startTime = new Date()
  return () => new Date() - startTime
}
```

Example of usage:

```javascript
const getTimeDifference = startTimer()
 
// Should output a number around 3000 after 3 seconds have passed
setTimeout(() => {
  console.log(`${getTimeDifference()} milliseconds have passed!`)
}, 3000)
```

This allows you to start tracking multiple events at any given time and retrieve the time difference whenever it's required.

Cheers!
Introducing Terminal
Tags: laravel, symfony, bash, php
Published: 2020-03-22 12:25:29

---
title: Introducing Terminal
published: true
description: An elegant wrapper around Symfony's Process component.
tags: Laravel, Symfony, bash, php
---

---

# Terminal

![Preview](https://dev-to-uploads.s3.amazonaws.com/i/j5glx07tsyxlqiwq3iem.png)

An elegant wrapper around Symfony's Process component.

---
### Why?

I've been developing hosting related services for almost 4 years now. 

To complete various tasks, I have to write PHP code that executes bash scripts almost on a daily basis. Let's say you want to set up automatic updates for WordPress or put your site to the maintenance mode.

That's where Terminal comes in handy.

---
### Example

To activate "maintenance mode" in WordPress, you might need to execute this wp-cli command:

```
$ wp maintenance-mode activate
Enabling Maintenance mode...
Success: Activated Maintenance mode.
```

Now, with the Terminal, you can do this straight from your PHP script:

```php
Terminal::run('wp maintenance-mode activate');
```

---
### More

You can even setup timeout, retries, change the current working directory and much more:

```php
Terminal::in(storage_path('sites/123'))
    ->timeout(120)
    ->retries(3)
    ->run('wp maintenance-mode activate');
```

---
### Extending

Another cool feature of the Terminal is that you can easily define your custom commands.

```php
Terminal::extend('maintenanceOn', function ($terminal) {
    return $terminal->run('wp maintenance-mode activate');
});

Terminal::maintenanceOn();
```


---
### Testing

It gets even better.
Terminal comes with a bunch of beautiful testing utilities that help you write simple and expressive tests for your application.

```php
Terminal::fake();

Terminal::run($command = 'wp maintenance-mode activate');

Terminal::assertExecuted($command);
```

---
Feel free to check out full documentation at https://github.com/TitasGailius/terminal

Feedback is more than welcome!
Use applesauce to code faster
Tags: javascript, productivity, codequality, refactorit
Published: 2020-03-14 16:20:18

You are coding. You start getting into a flow. Then you get derailed trying to think of a variable name.

Most variable names are simple enough. Is this variable keeping track of for-loop counters? Name it `i` (or `j` or `k`).

```js
const array = ['Hello', 'World'];

for (let i = 0; i < array.length; i++) {
  for (let j = 0; j < array.length; j++) {
    for (let k = 0; k < array.length; k++) {
    }
  }
}
```

Is this variable an array that holds user objects? Name it `userArray`.

```js
const usersArray = [
  { name: 'Alice' },
  { name: 'Bob' }
]
```

But now you have a variable that holds the first 10 vegan users that live in NorthEastern United States? What do you call this?

```js
const ??? = [
  { name: 'Alice', dietaryRestrictions: 'vegan' },
  { name: 'Bob', dietaryRestrictions: 'vegan' },
  // ...
]
```

You scan through your code to see what naming conventions you used. If you're paranoid, you start thinking about all your future, unwritten code. What will all that code look like?

You've broken out of your [flow](https://en.wikipedia.org/wiki/Flow_(psychology)). After 2 minutes of meditation, you found a variable name.

```js
// rolls right off the tongue
const topVeganUsersInUnitedStates = [
  { name: 'Alice', dietaryRestrictions: 'vegan' },
  { name: 'Bob', dietaryRestrictions: 'vegan' },
  // ...
]
```

Great!

Now you're most likely married to the variable name. You spent so much time naming it in the first place, so why change it?

And this is even if you remember to change the variable name. You have an approaching deadline as you create your pull request. The last thing you'll want to do is look at your code, line-by-line, and update variable names.

This assumes that your variable even makes it to your pull request. You may have refactored your code during development and deleted the variable. What a waste!

```js
function getTargetUsers() {
  // 💀 topVeganUsersInUnitedStates
  return [
    { name: 'Alice', dietaryRestrictions: 'vegan' },
    { name: 'Bob', dietaryRestrictions: 'vegan' },
    // ...
  ];
}
```

In general, you want to delay decisions until you have the most information possible. We should do the same with naming variables.

---

I attended a refactoring workshop. The instructor used the name `applesauce` when he ran into a difficult variable. Why?

Having a default variable name speeds up development. Imagine if you had to think up new variable names whenever you created for-loops. That would take up a lot of time. Similarly to `i` for for-loops, we want to use `applesauce` for ambiguous variable names. This speeds up development.

> If applesauce is already taken, feel free to experiment with other sauces.

Also, it's so outlandish of a variable name that it stands out among the rest of your code. If the variable name survives all refactoring and makes it to the pull request, you will need to rename it.

During pull requests is the time when you have the most information to decide on the best variable name.

---
Do you have any variable naming tips & trips? Let me know about it.
tsParticles v1.10.1 Released
Tags: javascript, typescript, showdev, opensource
Published: 2020-03-14 19:46:00

# New tsParticles version released, 1.10.1.

## Release notes

- Fixed rotation for line shape
- Canvas context now has it's own classes for drawing
- Canvas context now is private
- Methods `play` and `pause` implemented, you can now easily control the animations without changing the config runtime

Options added:
- `particles.move.trail`: an object to add trails to particles
- `pauseOnCanvas`: a boolean to enable/disable the pause on window blur
- `lineLinked` shadow options

---

Checkout the demo here: <https://particles.matteobruni.it>

Do you want to replace the old, outdated and abandoned particles.js?
You're in the right place!

---

Here are some demos!

## Characters as particles

[![Particles chars demo](https://media.giphy.com/media/JsssOXz72bM6jGEZ0s/giphy.gif)](https://particles.matteobruni.it/#chars)

---

## Mouse hover connections


[![Particles mouse connections demo](https://media.giphy.com/media/XzvZThpVbxHxMYz5xt/giphy.gif)](https://particles.matteobruni.it/#connect)

---

## Polygon mask

[![tsParticles Polygon Mask demo](https://media.giphy.com/media/lNRfiSgaMFbL4FMhW6/giphy.gif)](https://particles.matteobruni.it/#mask)

---

#### Background Mask particles

[![tsParticles Background Mask demo](https://media.giphy.com/media/dWraWgqInWFGWiOyRu/giphy.gif)](https://particles.matteobruni.it/#background)

---

#### COVID-19 SARS-CoV-2 particles

[![tsParticles COVID-19 demo](https://media.giphy.com/media/fsVN1ZHksgBIXNIbr1/giphy.gif)](https://particles.matteobruni.it/#virus)

**Don't click! DON'T CLICK! OH NO IT'S SPREADING!!!!**

*COVID-19 is not funny. It's a serious world problem and we should prevent its spreading. If you are in a risky area please STAY AT HOME*

--

## GitHub repo
<https://github.com/matteobruni/tsparticles>

##npm
<https://www.npmjs.com/package/tsparticles>

##yarn
<https://yarnpkg.com/package/tsparticles>

##jsDelivr
<https://www.jsdelivr.com/package/npm/tsparticles>

---

Feel free to contribute to the project!
shhh-cli, a Go CLI client to interact with Shhh from the terminal
Tags: opensource, go, cli, showdev
Published: 2020-03-14 23:31:11

Not that long ago I shared a [post](https://dev.to/smallwat3r/shhh-a-web-app-to-share-encrypted-secrets-using-secured-links-with-passphrases-and-expiration-dates-1c32) about [Shhh](https://github.com/smallwat3r/shhh), a web-app I wrote to share encrypted secrets using secured links with passphrase and expiration dates, avoiding spreading sensitive data like passwords across time in emails.

I encourage people to host their own instance of Shhh, so they make sure their data is even more secure.

Python is my go-to language for development, but I always wanted to deep dive into Go. From my point of view, to learn a new language there is nothing better than learning while developing something useful.

So as my first Go program I've decided to write a CLI client for Shhh, allowing users to create and read secrets directly from their terminal. Handy :)

The source code is available here: https://github.com/smallwat3r/shhh-cli
From supermarket shelves to your doorstep in 90 minutes
Tags: ruby
Published: 2020-03-14 23:59:30

The challenge

Why go to the supermarket when iGooods can bring the supermarket to you? iGooods is transforming grocery shopping in St. Petersburg: bringing together customers, in-store staff and couriers to deliver your regular shopping right to your door, in as little as 90 minutes.

The solution

Across desktop and mobile, at home, in the office, in-store, and on the road, we’ve developed a complete solution that keeps each part of iGooods operating smoothly. Here’s how it works:

Customers select their favourite stores and begin shopping
After filling their carts, they check out and receive an estimated delivery time
Picking & packing staff prepare the orders in-store
Couriers collect the shopping and deliver them directly to the customers
Our responsive web app provides bespoke interfaces for customers, store operators, picking, and delivery staff, giving the information and tools they need, when they need them.

https://evrone.com/igooods
Star Wars Recursion
Published: 2020-03-15 04:59:22

Following my exploration of the maze recursion proved to be a powerful tool.  While exploring the a Star Wars API (also known as the "swapi") I was able to use recursion to search a portion of the API in its entirety. 

The Star Wars API (which can be found at http://www.swapi.co) is a neat little tool I've found useful to play around with.  What I found odd at first though is that when asking for a particular resource, "people" for example, not all results were returned at once.  For example...
```
JSON.parse(RestClient.get(http://www.swapi.co/people/))
```
...returns a hash with four keys.
```
["count", "next", "previous", "results"]
```
A quick look at the size of "results" show me I've received ten characters from the Star Wars movies.  But as "count" is an integer of 87, I know I'm missing 77 characters to dream about.  The "next" key points to another web address to what I assume will be ten more results.

How exactly can I get them all at once?  Recursion!

I figure I can write a method that will pull down the first results, check to see if there's a valid address in the "next" key, and if so use the same method to keep fetching characters.  In this pursuit I ended up with the following class...
```
require 'rest-client'
require 'json'

class Swapi
  def initialize
	@people = []
  end

  def get_planets(path)
	planets = JSON.parse(RestClient.get(path))
	planets["results"].each { |planet| @planets << planet }
	return "complete" if planets["next"] == nil
	get_planets(planets["next"])
  end

  def people
	@people
  end
end
```
With the instance variable I've got a spot to put all the results.  That combined with the main "get_planets" method that calls itself & a getter to view the results I execute it with the first people address...
```
p = Swapi.new
p.get_people("http://www.swapi.co/api/people/")
```
With that all 87 of the results are loaded into a single array.
A stable alternative to SQLite for offline desktop app?
Tags: help, desktop, database
Published: 2020-03-15 07:19:45

I prefer to use JavaScript/TypeScript if that matters. Also, it would be better if it is ACID-guaranteed. (I have seen LokiDB breaks, and all is lost.)

I wouldn't want to use Docker. (otherwise I can easily use MongoDB, with pseudo-file based.) It should be easy to install for end-users.

If I use Kotlin, I might try h2 database; but Kotlin is harder to code than TypeScript in general...

Some other criteria are

- User input queries (Actually, I converted it to JSON, before inputting to [ORM](https://github.com/patarapolw/liteorm).)
- Joins. I am trying to develop an app compatible with Anki ([schema](https://github.com/patarapolw/ankisync.js/blob/4e30a1ac289536c236f3bdde1d859f67bb9138e8/src/index.ts#L93)), and it involves a lot of joining.
- Async.
- Maintenance. NeDB and LokiDB seem not to be actively maintained anymore. Have tried [PouchDB](https://github.com/pouchdb/pouchdb), but not sure about stability; although CouchDB should be well maintained.
- JSON support, in order to evaluate `Record<string, string>` -- can even be something like [JSON1 extension](https://sqlite.org/json1.html)
Daily Developer Jokes - Sunday, Mar 15, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-03-15 13:00:05

---
title: "Daily Developer Jokes - Sunday, Mar 15, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Sunday%2C%20Mar%2015%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12596739999.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Why couldn't the React component understand the joke?

___A:___ Because it didn't get the context.
 -->
How to Create HTTP Server With Node.js
Tags: node, javascript, codenewbie, webdev
Published: 2020-03-18 15:36:29

http-Server
Creating a simple proxy server in node.js

Installation:

Globally via npm

brew install http-server

Running on-demand: npx http-server [path] [options]

As a dependency in your npm package: npm install http-server

Usage: http-server [path] [options]

[path] defaults to ./public if the folder exists, and ./ otherwise.

Now you can visit http://localhost:8080 to view your server

Note: Caching is on by default. Add -c-1 as an option to disable caching.

Code-

let http = require('http');

http.createServer(onRequest).listen(3000);

function onRequest(client_request, client_res) {
  console.log('serve: ' + client_request.url);

  let options = {
    hostname: 'www.google.com',
    port: 80,
    path: client_request.url,
    method: client_request.method,
    headers: client_request.headers
  };

  let proxy = http.request(options, function (res) {
    client_res.writeHead(res.statusCode, res.headers)
    res.pipe(client_res, {
      end: true
    });
  });

  client_req.pipe(proxy, {
    end: true
  });
}

More details-https://github.com/Hasib787/http-Server
Best way to improve your React code
Tags: react, javascript, css, html
Published: 2020-03-22 03:36:41

![Best way to improve your React code](https://blogreact.com/wp-content/uploads/2020/02/Score-2-150x150.jpg.jpg)

Maintaining code quality is the biggest challenge for beginners. In today post we are going to talk about two best ways to improve your React code By using these two methods you will automatically learn about the best practices for your React code.

### Ways to improve your React Code

I personally uses these two ways to improve my code in day to day life. The two methods are mentioned below

### [1. Using Eslint](https://blogreact.com/setup-reactjs-with-parceljs-eslint-babel-and-less-in-5-min-2020/)

![eslint react](https://blogreact.com/wp-content/uploads/2020/02/es-lint-1024x457.jpg)

Eslint is the life saver for the React developers. It will find and fix problems in your JavaScript code. The Eslint have below features

-   ESLint statically analyzes your code to quickly find problems. ESLint is built into most text editors and you can run ESLint as part of your continuous integration pipeline.
-   Many problems ESLint finds can be automatically fixed. ESLint fixes are syntax-aware so you won’t experience errors introduced by traditional find-and-replace algorithms.
-   Preprocess code, use custom parsers, and write your own rules that work alongside ESLint’s built-in rules. You can customize ESLint to work exactly the way you need it for your project.

**Installation**

```
npm install eslint --save-dev
```

**Setup Config**

```
 npx eslint --init
```

After that you need to follow steps shown on your terminal. You can check this  [article](https://blogreact.com/setup-reactjs-with-parceljs-eslint-babel-and-less-in-5-min-2020/)  for full details.

**Vscode Extension**

I strongly recommend using Eslint extension with your vscode to see the problems on your editor instead of terminal.

### [2. Using Deepscan](https://deepscan.io/)

![Best way to improve your React code](https://blogreact.com/wp-content/uploads/2020/02/deepscan-full.png)

DeepScan focuses on finding runtime errors and quality issues rather than coding conventions. It is ideal for you if you are serious about JavaScript code quality.

DeepScan follows the execution and data flow of program in greater depth. This enables finding issues that syntax-based linters can’t.

Simply put: DeepScan is a cutting-edge static analysis tool for JavaScript code.

DeepScan classifies issues by 2 categories and 3-level impacts. So you can focus on **major issues first and gradually**.

Also noisy issues are aggressively suppressed and **detailed guides** are provided to let you simply know where the problem is.

-   Check your code in terms of error and code quality lint tools can’t detect
-   Minimize code reviews by automated inspection
-   Learn best practices for JavaScript
-   Catch mistakes before committing
-   Ensure code quality for the whole project
-   Keep up with project status and issues
-   Get the measure on the project
-   Increase confidence before code ships

Checkout My Website [https://blogreact.com/](https://blogreact.com/)
let vs const - Let's discuss.
Tags: javascript, node, discuss
Published: 2020-03-22 10:35:15

We all are familiar with the difference between const, let and var. If not, please read this.

{% post https://dev.to/sarah_chima/var-let-and-const--whats-the-difference-69e %}

---

For those who are familiar, should know that in the modern-day JavaScript, **YOU SHOULD NEVER USE `var`.**

So now, what we are left with, is the `let` and `const`.

## 🔥 The two scenarios

People believe their ways of using them both. Strongly.

Here are the two types of people.

1) Those who use `const` for Constants (Like for `const PI = 3.14`)
2) Those who use `const` for everything that won't be let

### 📯 const for Constants

Some people believe that `const` should only be used for strictly constant values like the Action Type Reducer Strings, Math values and constants like PI, etc.

If you are that person, you are from **team CONSTANT SPARINGLY**.

### 📯 const for everything that won't be let

If you always use `const`, no matter what, and only use `let` when you change a variable, you are from **team CONSTANT FOR ALL**.

---

There has been a lot of talk around it on Twitter due to this tweet by Dan Abramov.

{% twitter 1208369896880558080 %}

The tweet pretty much sums up that he is from the team CONSTANT SPARINGLY.

If you have been seeing WesBos' tutorials, he seems like he is from the team CONSTANT FOR ALL.

Dan has provided [a beautiful explanation](https://overreacted.io/on-let-vs-const/) for why he thinks const shouldn't be used.

Also, [this writeup here](https://jamie.build/const) focuses on easily concluding this discussion. But still, what's your opinion on it?

---

What do you prefer? Let's Discuss!