teleren/devto huggingface dataset:
Say hello to Deno
Tags: deno, javascript, ecmascript, typescript
Published: 2020-05-27 18:29:44

**Deno** is a Javascript runtime. Some devs will say that it is an alternative for **NodeJS** but it is not an alternative it is unique. 
**Ryan Dahl** the creator of **Nodejs** created this **Deno**.
##### NODE -> NO DE -> DE NO -> DENO
### Why Deno
* It is secure (It wont give direct access for files, environment and Network etc. User needs to give permissions to use)
* Supports Typescript
* Gives single executable file
* It had built-in utils like code formatter and inspector
* Uses V8 runtime 
* Built in rust
* No need **npm**
* *package.json* not required
* dependency manager not at all required
* Gives **Zero** dependency build 

### Installation
`Linux/Unix/OS X :`
```bash
curl -fsSL https://deno.land/x/install/install.sh | sh
```
`Windows Powershell :`
```
iwr https://deno.land/x/install/install.ps1 -useb | iex
```
`Other ways :`
```zsh
#Using Brew(MAC OS)
brew install deno
#Using Chocolatey (Windows)
choco install deno
```

### Running First Deno program
```bash
deno run https://deno.land/std/examples/welcome.ts
```

### Hello World with colored text on console
create a file name it `helloworld.js`
```javascript
import clc from 'https://deno.land/x/color/index.ts'
console.log(clc.red.text("Hello World"))
console.log(clc.blue.text("Hello World"))
```
Run the following commands to run your first Deno program
```bash
deno run helloworld.js
```
Create APIs in Minutes
Tags: API, python, WayScript
Published: 2020-05-27 18:17:12

##Introduction
Creating a fully functional API is traditionally a long task, but an industry standard and an absolute must for your technical customers. With WayScript, creating an API has never been easier. Let's take a look at how we can create a simple, fully functional API that you send requests to and receive back your desired information.

##Prerequisites
No requirements, but some documentation you may find useful:
[Working with Python](https://docs.wayscript.com/library/modules/python)
[Working with HTTP](https://docs.wayscript.com/library/triggers/http-trigger)

##Creating a API URL
To begin, we first need to consider where we want requests to go. In WayScript, we also need to activate our scripts to output the desired results. We can acomplish both of these tasks with one step. We can create a trigger, which activates our script. Specifically, the http trigger can provide us a URL for requests and also we activate our tasks. We can pull in an HTTP trigger as the head of our workflow:

![Create API Tutorial Image](https://cdn.wayscript.com/blog_img/92/1.png)

Like previously stated, this will create a url which we can customize, to receive requests at.

![Create API image 2](https://cdn.wayscript.com/blog_img/92/2.png)

In the above photo, we see that we can also configure our settings to allow parameters to be passed to us. This is crucial for any API.

##Handling the request
Once the user has gone to the url, sent a get request, or post request, we need to return some type of response back to the user. This is usually JSON or a success message. We can use several different modules to determine what to send to the user. In this tutorial, let's create a python step which will generate a random number.

![Create API image 2](https://cdn.wayscript.com/blog_img/92/3.png)

We'll generate this random number using some python code that might look like this:

import json
import random
value_from_url = variables['value']
random.seed(value_from_url)
number = random.randint(0,100000000000)
dict_x = {"number":number}
return_json = json.dumps(dict_x)
variables['return_json'] = return_json
​
We reference the parameter used in the url by accessing it in the variables dictionary. Then we create our new random number, and store it using the same dictionary.

##Sending the Response
Now all we need to do is send the JSON response when the user goes to the url or sends the request. We can do this using the HTTP response module.

![Create API image 2](https://cdn.wayscript.com/blog_img/92/4.png)

The JSON we created in the python step can now be passed using this module back to the user:

![Create API image 2](https://cdn.wayscript.com/blog_img/92/5.png)

##Questions, Feedback?
As always, if you have any questions please reach out to us on our discord and we would be happy to help. If you want to view this completed script, you can find it [here](https://wayscript.com/user/derricks/JSBzCV06) or view a youtube video tutorial on our [channel](https://youtu.be/XiARl4KP-Eo).
Merge two Sorted Linked List in Go
Tags: go
Published: 2020-05-27 18:12:45

A linked list is a linear way to structure the data so that any arbitrary number of data we can store. That means it's flexible on the memory limitation as compare to arrays.

#### What do I mean by linear?
A linear data structure is where I can go to only one other element from the current one.

One supposes you already have two linked lists and they are already sorted how do you merge it _effectively_? What I mean by being effective is how can you swap the node in memory of a list without having to manage an extra dummy node?

### Show me some code

{% gist https://gist.github.com/iAziz786/0559c95d22ff8eeac7fafe8d9ba6aead %}

Let go through each method one by one.

The first two are simple. The `Print` is to help print all the values in the linked list and `Push` will add value at the tail of the linked list.

### The Output is 3 5 7 11

As promised since both linked lists are sorted then the expected output is very simple to guess.

### `var result *Node = nil`

The `result` value is what we will be returning to the caller. At the start, there isn't any result so that's why keeping it `nil`.

### `moveNode(dest **Node, source **Node)`
The `dest` and `source` are pointers to a struct pointer. The value of `dest` will be a `nil` value because of `lastPtrRef = &((*lastPtrRef).next)`.  In this function what happening is, we're setting the last value to the next node of the sorted list while doing that we're also updating the `result` variable. We're also clearing the value which should be removed from the top of the sorted list.

### Reference
1. https://www.geeksforgeeks.org/merge-two-sorted-linked-lists/
Reactive Props in Functional React
Tags: react, javascript, functional
Published: 2020-05-27 18:12:37

When I was learning React, the first distinction I remembered was between **state** and **props**. States are reactive, meaning they can be mutated and change how the UI becomes as the enclosing component re-renders. Props, on the other hand, are static, immutable properties a component acquires on mounting.

In the old Angular world I came from, I could do something like this:

```js

<Component message={message} />

```

And internally, I could bind to this `message` as it changed from the enclosing context and make changes inside `Component`. This "portal" is a mean by which the outer context can interface with the otherwise encapsulated component, like a puppet being controlled by a puppeteer.

So when I learn that with a functional React component, I could do the same, I was pretty surprised. For example, to toggle a component "on" and "off", instead of doing this:

```js

{ visible ? <Component /> : null }

```

I could implement `Component` in a way that it accepts `visible` as a prop and decide if it renders inside the component:

```js

const Component = ({ show }) => {
  return show ? <h1>Hello, world</h1> : null;
};

```

and use it this way instead:

```js

<Component show={visible} />

```

Which I find much cleaner than the bracket evaluation because the interface is kept within the component. For example, instead of a simple visibility toggle, I could add a delay to the component showing and hiding, and this new feature will be implemented everywhere I use `Component`:

```js

const Component = ({ show, delay }) => {
  let timer = null;
  const [visible, setVisible] = useState(!show);

  // Whenever `show` changes, call setTimer that delays
  // the setting of `visible`.
  useEffect(() => {
    setTimer();
  }, [show]);

  function setTimer() {
    // clear any existing timer
    if (timer != null) {
      clearTimeout(timer)
    }

    // hide after `delay` milliseconds
    timer = setTimeout(() => {
      setVisible(!visible);
      timer = null;
    }, delay);
  }

  return visible ? (
    <h1>Hello, world</h1> 
  ) : null;
};

// use

<Component show={visible} delay={300} />

```

This is probably not a big deal for elite React users, but for someone new like me, it's just awesome. I can't be 100% sure if this works in class-based component too. 

### Anyone know about this?

<hr/>

If you're interested in my non-programming thoughts, you can [subscribe to my newsletter BETA School](https://joechasinga.substack.com/).

[![Joe Chasinga Newsletter BETA School](https://dev-to-uploads.s3.amazonaws.com/i/nhx7l8n1ufgeoqlc3pc7.png)](https://joechasinga.substack.com/)
Octograd 2020 -- Othello Gameplay Bot
Tags: octograd2020
Published: 2020-05-26 03:21:05

[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best describe your project and experience.)

[Note]: # (If you used the GitHub Student Developer Pack on your project, add the "#githubsdp" tag above. We’d also love to know which services you used and how you used it!)

## Othello AI Bot

One summer, I programmed a bot to play the board game Othello, which I then used in the CodeCup gameplay competition, earning top 50 internationally among all age groups, and first place out of high schoolers nationally.

## Demo Video
{%youtube qlfFvC63Lqw%}

## How I built it (what's the stack? did I run into issues or discover something new along the way?)

I built this program initially using the MiniMax algorithm for artificial intelligence gameplay.  This algorithm works by maximizing the user's future options, while minimizing the options of the opponent.

I initially treated every space the same, but over time developed a positional heuristic, which weighted the acquisition of different spaces differently (i.e. corners are really good, spaces next to corners are really bad).

After the heuristic was implemented, I made changes to the actual gameplay algorithm, switching to the NegaMax algorithm, which uses the same logic, but is more concise and is generally slightly faster.

To compete in CodeCup, I had to alter the rules of the game to fit the description of their "Flippo" game. This game allowed for the player to flip their own pieces and place pieces anywhere on the board, so the functionality had to be changed to match.

Overall, this project taught me a lot about artificial intelligence and how AI gameplay bots work, and gave me insight into advanced programming which I had never experienced before.

## Additional Thoughts / Feelings / Stories

In the future, I'd like to upgrade the algorithm I used to include Alpha-Beta Pruning, which would allow the AI to look "deeper", maximizing the score for more turns than is possible with MiniMax or NegaMax.


[Final Note]: # (CONGRATULATIONS!!! You are amazing!)
Web frameworks shootout
Tags: python, webapps
Published: 2020-05-27 18:07:13

{% youtube Pu_5ZjC7Tig %}

At October's Python Frederick presentation, I looked at 5 popular Python web frameworks and discussed the benefits and tradeoffs of each of these tools.  The video is available on YouTube for you to view.

These were the 5 web frameworks that we compared:

* [API Star](https://github.com/encode/apistar)
* [Falcon](http://falconframework.org/)
* [Flask](http://flask.pocoo.org/)
* [Django](https://www.djangoproject.com/)
* [Pyramid](https://docs.pylonsproject.org/projects/pyramid/en/latest/)

The presentation material is available in the [Python Frederick talks repository](https://github.com/python-frederick/talks/tree/master/2017-10-web-frameworks).

Additionally, the sample code for each framework can be downloaded from GitHub in a specific [web frameworks repository](https://github.com/mblayman/web-framework-shootout).

This article first appeared on [mattlayman.com](https://www.mattlayman.com/blog/2017/web-frameworks-shootout/).
Animation problem in macos vm of windows 10
Tags: windows, macos, vmware, animation
Published: 2020-05-27 18:06:29

Hi Developers,
I am using macOS Catalina on windows 10 by vmware workstation pro 15.5.0
It works well. By the way, I could see that many animations don't work on macos. By 2016, it worked well. But, after reinstalling windows os in 2017, I could see this kind of problems. When I try to see website on chrome, it's very uneasy if page includes image slider or 3d animations.
I am sure that you already met this problem.
If there is any way to fix this, let's share that technical talents :)

Thanks
Jamstack Virtual Conference 2020
Tags: jamstackconf
Published: 2020-05-27 17:52:59

---
title: Jamstack Virtual Conference 2020
published: true
tags: #jamstackconf
---

# What is your favourite talk so far?

I really enjoyed the COVID-19 one and the one about emerging markets in Africa. What about you?

Hop in – https://hopin.to/events/jamstack-conf-virtual
Lodash memoize() | Learn how to cache return values with _.memoize()
Tags: lodash, performance, webdev, javascript
Published: 2020-05-27 17:43:27

---
title: Lodash memoize() | Learn how to cache return values with _.memoize()
published: true
description: Tutorial on the Lodash MEMOIZE function including examples. I will show you how and when to use the memoize function and explain the concept of memoization.
tags: lodash, performance, webdev, javascript
cover_image: https://public-youtube.s3.eu-central-1.amazonaws.com/thumbnails/memoize.png
---

Who should watch this video:
- If you want to learn **how and why** to use the **lodash memoize** function to cache return values and **increase** your application **performance**. 

{% youtube KmP2fDijnWE %}

Leave a comment with feedback to help me improve my content.
Scripting To Saves Lives shutdown
Tags: glitch
Published: 2020-05-27 17:41:33

I have some very bad news, scripting to save lives is finished.

Our founder Riverside rocks said:

---------

Hello,

Unfortunately, ScriptingToSaveLives has gained very little traction. We have only raised $20 dollars and our website gets very little views. Right now, there are also only two people helping the cause. That is nowhere near what we need. Because of this, I am putting the project on hold. scriptingtosavelives.com and www.scriptingtosavelives.com will be forwarded to this post. The project will be put on hold indefinitely.

Thank you,
Riverside Rocks

-------

So here is the new guidelines for donations:

1. Any donated code older than 2 days shall be added
2. Any new code shall be ignored
3. Our services will remain open until next week

Thanks for everyone who played a part.
17lwinn- editor developer
Monkey patching and undoing patching in Ruby tests
Tags: ruby, testing, monkeypatching
Published: 2020-05-27 17:33:33

This was a really neat way of monkey patching method definitions in our ruby tests, without leaving any side effects.
```ruby


require 'test_helper'
class ComplexTest < ActiveSupport::TestCase
  describe 'with an API call half a second later' do
    before do
      Complex.singleton_class.send(:alias_method, :old_api, :api)
      Complex.send(:define_singleton_method, :api) do |_arg1|
        sleep(0.5)
        OpenStruct.new(status: 'succeeded'])
      end

    it 'succeeds' do
     assert Complex.operation
    end

    after do
      Complex.singleton_class.send(:alias_method, :api, :old_api)
    end
  end
end

# inside our complex.rb file, it remains the same

module Complex
  def self.api(argument1)
    # do fancy stuff
  end

  def self.operation
    # more stuff
    api(arg1)
  end
end
```
UITableView with multiple kinds of cells (also works on UICollectionView)
Tags: swift, tableview, cell, xcode
Published: 2020-05-27 17:29:13

Hi everyone =D  

I will show in this article how to use multiple types of cells in your UITableView or UICollectionView.
A lot of developers do that in the wrong way, using sections or rows to present another kind of cell.

### This tutorial will be separated on 3 fronts:
* *1 - Create a model*
* *2 - Register cells on your controller* 
* *3 - Organize it on cellForRow*

### Creating a model
First of all, I create a simple model to populate my table.

{% gist https://gist.github.com/fabriciomasiero/579dc6a87396705e493e53d466ec397e %}

The secret of this model is the **enum VehicleType**. That changes _everything_!

### Creating and register cell on table

After that, I create 3 kinds of cell:

Bike Cell

![Bike Cell](https://dev-to-uploads.s3.amazonaws.com/i/9jmh98j7g15pkcn5014r.png)
Car Cell
![Car Cell](https://dev-to-uploads.s3.amazonaws.com/i/8wv4aintx87x7dtwa1ka.png)

And finally, Motorbike Cell
![Moto Cell](https://dev-to-uploads.s3.amazonaws.com/i/femeu42c246v2geqeyar.png)



{% gist https://gist.github.com/fabriciomasiero/27b813f5b79caf23333513ebba65e5f2 %}

And create an array of vehicles:
{% gist https://gist.github.com/fabriciomasiero/6d02ee1db803fe8315c0836b78a96972 %}

### Set cell on cellForRow ###

Ok, we are almost done! What we need to do right now is configure our `cellForRow atIndexPath` or `itemForRow atIndexPath`. 
Write an switch case to determine what kind of cell table will present. Like this example:
{% gist https://gist.github.com/fabriciomasiero/7ebac127c0dd7def9f7ab745347eca27 %}

But, if you saw, each cell has a different size. Ok, let's do the same thing on `heightForRow atIndexPath`



{% gist https://gist.github.com/fabriciomasiero/2d794b66e53e3cb26fc821dd5bfa8cfe %}

And that's it! Simple, beautiful, and very easy!

I don't prepared a beautiful layout on these cells, but, take a look, we have 3 different cells on the same Table or Collection:



![View Controller](https://dev-to-uploads.s3.amazonaws.com/i/w1rhy63xxwkxjy7pkqwt.png)

[Download source code here =D](https://github.com/fabriciomasiero/MultipleCellTableView)
---

I hope I have helped everyone looking for this change. 
If you would like to extend the discussion, call me on [Twitter](https://twitter.com/fabri_masiero)

###### Happy Coding :) #######
Automate Development Environment setup via PowerShell
Tags: productivity, sideprojects, dotnet, csharp
Published: 2020-05-27 17:17:52

As a developer when we setup new Development machine we spent lot of time on finding and installing packages manually, there are times when this task has to be repeated by multiple developers , so what can we do to reduce some of pain point.

One way is to still continue old school way and  manually download and then install them or you can use following powershell script automate this process.

Following script I have used to setup my machine for generic C#.net Development Environment .

<i>
I have added commands to setup IIS as well because lot of folks in my team has to have same setting on IIS to run projects. You can ignore if you don`t need. Given script is quite straight forward , first of all you install chocolaty package and then let chocolaty handle all that manual hard work.
<i>

## Here is list of software which will be installed via following script

* Chocolaty
* GIT client
* IIS (all features which needs to be enabled for CP development )
* Webdeploy
* URL Rewrite
* Notepad++
* NodeJS
* NPM
* Postman
* Redis desktop manager
* Zeplin
* Service bus explorer

<b>Before you run this script make sure to run power-shell in elevated mode .</b>

<i>There are some software which you have to manually install because either these software's are not available on chocolaty or needs user input (Microsoft Visual Studio, MS SQL Server ) </i>

{% gist https://gist.github.com/DMehro/e9a54fdeccc5f4b9dbaea60e3f31380a %}


For more articles please visit my blog at https://dmehro.com/
Round One of CodeLand:Distributed Speakers, Announced!
Tags: codeland, meta, conferences, codenewbie
Published: 2020-05-27 17:17:29

---
title: Round One of CodeLand:Distributed Speakers, Announced!
published: true
description: Congrats to Our First Group of CodeLand 2020 Speakers!
tags: codeland, meta, conferences, codenewbie
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/n0f9m97iz1cpit067isp.png
---

_[CodeLand:Distributed](https://codelandconf.com/) is a community-first conference by DEV and [CodeNewbie](https://codenewbie.org) designed to help programmers level up their knowledge, motivation, and career. This year, the conference is entirely remote, allowing you to stay home, stay safe, and join us easily no matter where you are. We look forward to catching you live on July 23 & 24._

**Today, we are thrilled to share the first group of speakers for CodeLand:Distributed 2020! 🎉**

### Meet your speakers (Part I) ...

* Aisha Blake
{% user aishablake %}
* Alex Morton
{% user alexlsalt %}
* Beleicia Bullock
{% user belebull %}
* Charity Majors
{% user mipsytipsy %}
* Erika Heidi
{% user erikaheidi %}
* Josh Puetz
{% user joshpuetz %}
* Mai Irie
{% user mirie %}
* Miranda Limonczenko
{% user mlimonczenko %}
* Safia Abdalla
{% user captainsafia %} 
* Sangeetha KP
{% user humblefool_2 %}
* Vaidehi Joshi
{% user vaidehijoshi %}

* #### [Alex Qin](https://www.linkedin.com/in/alexandraqin/)
* #### [Amit Nambiar](https://www.linkedin.com/in/amit-nambiar-124623a1/)
* #### [Denise Yu](https://deniseyu.io/blog/)
* #### [Eyal Yavor](https://twitter.com/yulkes?lang=en)
* #### [Vanessa Mack](https://www.linkedin.com/in/vanessa-mack-09725092/)
* #### [Wesley Faulkner](https://twitter.com/wesley83?lang=en)

---

Stay tuned in the coming weeks for the second round of talented and inspiring CodeLand:Distributed speakers. Given their expertise and unique perspectives, we're looking forward to one of the best CodeLand conferences ever!


#### [>> Haven't registered for CodeLand:Distributed yet? Secure your spot today! The event starts at $0.](https://codelandconf.com/#tickets)

![yay!](https://media.giphy.com/media/IU2SFx9zVMyBi/giphy.gif)



_We know how much work goes into drafting submissions. Thanks to **everyone** who shared a talk or workshop proposal with us. We loved reading your thoughts and hope to see your name in a future CFP down the road._
Project: The Blue Leopard Mobile Version
Tags: webdev, html, css, 100daysofcode
Published: 2020-05-27 17:13:29

I have created a mobile version of the Web Page The Blue Leopard.

Some of the CSS Highlights that was learnt while building the Page.
1. Understanding Cascade - Source Order, Importance, Inheritance, Specificity.
2. CSS Properties like -
* text-transform (to make text uppercase/lowercase)
* transition (used to have motion slow while hover on the button )
* font-family (used googlefonts, cronos fonts)
* margin, padding, text-decoration, display, line-height, font-size, font-weight, width, color, background-image, background, text-align etc.,

Below is a glimpse of the project that was built. Thank you!



![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/am8qxus5qx83ek2wepsh.gif)
React 360
Tags: react, reactnative, javascript
Published: 2020-05-27 16:56:53

[React 360 · Create amazing 360 experiences](https://facebook.github.io/react-360/)

```bash
npm install -g react-360-cli
react-360 init first-project
cd first-project
npm start
```

[http://localhost:8081/index.html](http://localhost:8081/index.html)

React 360 is a new name for React VR.

---

My example website:

[react_360](https://react-360-test.firebaseapp.com/)

---

[Exploring React 360 VR Library](https://medium.com/better-programming/exploring-react-360-vr-library-7260d51dc776)

Check "Where to Go From Here"

Random ideas to try:

- add something to index.html and see how it renders top of the 360 image

```bash
npm run bundle
```

Everything used in static_assets needs to be copied to the new build directory under `static_assets` This directory need to be created there.

```bash
firebase login
firebase init
```

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

```bash
firebase deploy
```