teleren/devto huggingface dataset:
Our First Livestream at JuniorDevSG
Tags: beginners, discuss, showdev, career
Published: 2020-02-13 16:34:55

# Introduction
Since we had multiple event cancellation within the developer community in Singapore due to the 2019 novel coronavirus and our [DORSCON - Disease Outbreak Response System Condition](https://www.channelnewsasia.com/news/singapore/dorscon-coronavirus-singapore-pandemic-response-need-to-know-12364618) level was raised from **yellow** to **orange**. 

Therefore we chose to have a live stream instead of an in-person meetup that we usually do for our [JuniorDevSG](https://www.meetup.com/Junior-Developers-Singapore/) for the health and safety of our JuniorDevSG community member.


# JuniorDev SG Social

{% youtube BznHJps6H8s %}


# In conversation with JDSG Leadership Team

{% youtube YYONr26ySPY %}


# Announcing the JuniorDevSG Mentoring Program

{% youtube KQqlFIggbmk %}


* [JuniorDevSG Mentoring Program Slides](http://bit.ly/2Gekbpo)

* [Mentor Signup](https://bit.ly/jdsg-mentor-signup-batch2)

* [Mentee Signup](https://bit.ly/jdsg-mentee-signup-batch2)
The fastest way to prototype API in Rails application
Tags: ruby, rails, apidevelopment
Published: 2020-02-13 20:14:25

---
title: The fastest way to prototype API in Rails application
published: true
description: 
tags: ruby, rails, API-development
cover-image: https://dev-to-uploads.s3.amazonaws.com/i/p93wlzti793uycpyyy3z.png
---

Hello, Ruby community,

https://github.com/igorkasyanchuk/fake_api

I've for a review one gem which could help you to build prototype (or production-ready) API in your Rails application.

![Demo](https://dev-to-uploads.s3.amazonaws.com/i/7fsgpn8k6dknxt2orfqg.png)

Very often if you are just backend developer you need to implement some skeleton of API for Frontend Team. Most of the time you need to quickly change response, change format, rename something and have data that looks real. 

When we are writing unit tests we often using Faker gem and FactoryBot to get nice sets of data and close to "real" user names, emails, etc.

So the idea of this gem is to use Faker to help you to build API prototype quickly and use syntax similar to Rails routing and FactoryBot to define API routes and responses.

Just check the demo and give a chance to this gem.

PS: You are also welcome to contribute :)
Best Collaboration Tools for Remote Workers
Tags: career, productivity
Published: 2020-02-14 02:52:22

Since remote workers don't see each other face to face, the need for tools to let them communicate as if they're face to face is important. With the advent of the Internet, this is possible.

Here's a list of the best communication tools for remote workers.

# Slack

Slack is one of the most business communication software made in recent years. Ut's cross-platform and has a web version. People can chat, hold teleconferences, and add emojis to their messages.

They can also chat in groups via different channels or create chats with several people. Data can be shared via file upload and links which can be previewed inside Slack.

# Zoom

Zoom is a teleconferencing platform that lets people join audio and video chats. It also has a text chat box as a supplementary feature. It also supports chatting via the phone.

The user base of Zoom is growing rapidly, with 30000 users in 2014 to 200000 in 2017.

The satisfaction of Zoom is higher than the other competitors like Google Meet or Skype.

# InVision

InVision is great for sharing graphic designs in a team, which is useful for many industries like software development, publishing, etc. It lets us inspect the designs in detail like displaying the CSS styles of each part of the design, which is handy for software developers.

Other features including getting colors and rapid prototyping by creating designs that simulate what the finished product would do.

It also has a whiteboard called InVision Freehand that lets us add wireframes, plan, and design presentations.

# GitHub

GitHub is a platform that lets us host software code in a remote server via Git. Git is a distributed version control software that lets people pull code from remote servers into their own computer, work on it, and then push the code back onto the servers.

Then they can open pull requests to let people review their code and comment on their changes.

It cares about security. There're many options to secure private repositories via tokens and encryption keys.

# Trello

Trello is a simple project management software that displays project task statuses on a board that's divided by status.

It doesn't take much effort to manage the simple board, and people can comment on tasks on the board. This lets people communicate about tasks without having too much overhead. Therefore, it's great for fast-paced companies like startups.

# Conclusion

For remote workers, online collaboration tools are very important. Fortunately, many companies have hopped onto the bandwagon to come up with solutions that solve many remote teams' problems.

With these tools, remote workers can work just as productively as onsite workers, at least for office jobs.
Which Techie Are You?
Tags: discuss, illustrations, comics, humour
Published: 2020-02-14 11:31:10

---
title: Which Techie Are You?
published: true
description: Our desks tell a lot about ourselves, don't they? What is your style? 
tags: discuss, illustrations, comics, humour
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/76j8y68yfscszyf3ripv.png
canonical_url: https://eheidi.dev/blog/which-techie-are-you-1251
---

Which techie are you? Tag yourself in the comments!

![Tech Girls Full](https://dev-to-uploads.s3.amazonaws.com/i/mm22or9oo94cadydt49u.jpg)

1. **The Dancing Queen / King** - when the tune is right, you stand up for some sick moves. Singing along is optional but highly encouraged.

2. **The Artsy** - your desk might look a bit messy and there's definitely plenty of pens, colors, papers, and whatnot art supplies.

3. **The Cat Whisperer** - maybe it's the heat, maybe it's the funny moving images on the screen, nobody knows for sure - but your desk is typically claimed by felines who will make sure you notice they're there.

4. **The Pack Leader** - good boys / girls make sure you feel loved throughout the day; a snack or two and some belly rubs are expected in return.

5. **The Minimalist** - not much to say or see, but things are certainly on the right spot?

6. **The Mom / Dad** - your desk has a unique mix of random toys and maybe some lovely but at the same time awful hand-made mother day's gifts. There's also coffee, but it might be cold...

7. **The Tech Deeva** - nail polish, hand cream, lipstick and lip balm... just the basics. Maybe you're a youtuber, maybe not, but you definitely know some tricks to look good in the camera.

8. **The Librarian** - e-readers are boring, you prefer *real books*. Lots of them. Maybe you didn't read them all, but who cares? They are there for when you need them.

I am mostly number 2 and number 6, but sometimes I'm a 1 and a bit of a 7 as well! :)
Go map data structure
Tags: go, beginners
Published: 2020-02-20 12:25:05

<a href="https://golang.org">Go</a> comes with many data structures, including a <a href="https://golangr.com/maps/">map</a> data structure.

A (hash)map maps keys to values, this is a common data structure in programming. Many languages support it including Go and Python (dictionary).

Unlike an array, it has a one to one mapping. The key can be used to quickly get the value without using a loop

```go
m["Cat"] = "Meow"
fmt.Println(m["Cat"])
```

Above the key is "Cat" and the value is "Meow", which is then returned.


## Introduction

You can use the **make()** function to create a map. If you call the make() function is returns a map initialized and ready for use.

In Go it's important to define the data types of the key and the value.
You can create all kind of maps, like a string to string mapping.

Example, map a key to a value where both are <a href="https://golangr.com/strings/">strings</a>

```go
var m map[string]string

// map key (string) to value (string)
m = make(map[string]string)
```

Go lets you map a key to value, where the value is an integer (int64):

```go
var m map[string]int64

// map key (string) to value (integer)
m = make(map[string]int64)
```

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

## Go Map Example

The example below creates a map (string -> string), sets a key pair and returns a value using a key. The **map** function makes the map. Then one (key,value) pair is set.

```go
package main

import "fmt"

var m map[string]string

func main() {
	m = make(map[string]string)
	m["Cat"] = "Meow"
	fmt.Println(m["Cat"])
}
```

The output of the above program is

    Meow
    
    Program exited.

So the value was given for the key "Cat", the key pair is ("Cat","Meow").

An example of a key-value mapping with integers, where there are multiple items. The **map** function is used to initialize the map.

```go
package main

import "fmt"

var m map[string]int64

func main() {
	m = make(map[string]int64)
	m["Serge"] = 33
	m["Thomas"] = 25
	m["Juan"] = 28
	fmt.Println(m["Serge"])
}
```

This program outputs:

    33

    Program exited.
Daily Developer Jokes - Thursday, Feb 20, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-02-20 13:00:17

---
title: "Daily Developer Jokes - Thursday, Feb 20, 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=Thursday%2C%20Feb%2020%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/5e1259082460c.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 do kayakers make bad programmers?

___A:___ Because they're afraid of waterfall.
 -->
Serach and replace free code camp algorithms
Tags: replit, node
Published: 2020-02-20 14:27:17

---
title: Serach and replace free code camp algorithms
published: true
tags: replit, nodejs
---

/*function myReplace(str, before, after) {
 var result=[];  
 var arr = after.replace(/john/i, "John" ).replace(/algorithms/i, "Algorithms" ).replace(/spelling/i, "spelling" ).replace(/mall/i, "mall" ).replace(/sitting/i, "Sitting" ); 
myFunction();
function myFunction(){
 result = str.replace(before, arr);
   
}
 console.log(result)
  return result;
} 
 
myReplace("Let us get back to more Coding", "Coding", "algorithms");    
//mall|algorithms|john|sitting|spelling.
*/

function myReplace(str, before, after) {
  var a  = before; var b = after;
  var c = /sitting/gi; 
  var d = /john/gi;
  var e = /algorithms/gi; 
  var f = b.replace(c, "Sitting").replace(d, "John").replace(e, "Algorithms"); 
  var g = str.replace(a, f); console.log(g)
  return g;
}

myReplace("Let us go to the store", "store", "mall");  
myReplace("He is Sleeping on the couch", "Sleeping", "sitting"); 
myReplace("This has a spellngi error", "spellngi", "spelling"); 
myReplace("His name is Tom", "Tom", "john");
myReplace("Let us get back to more Coding", "Coding", "algorithms");

/*Note: skip the comments to test the firt function".*/

{% replit @oscarhernandez6/Rocky-Solution-Intermediate-Algorithm-Scripting-Search-and %}
File-Like Objects in Python
Tags: python, beginners
Published: 2020-02-20 15:15:32

<a href="https://python.org">Python</a> supports file like objects, that don't write to the disk but stay in the memory.

You can create file like objects with <a href="https://docs.python.org/2/library/stringio.html">StringIO</a>. From Python version > 3 this is part of the <a href="https://docs.python.org/3/library/io.html">io module</a>. 

These files live only inside the computer memory, not on the disk. Python can <a href="https://pythonbasics.org/read-file/">read files</a> from the disk, but this article focuses on files in memory.

## StringIO

To start using file-like objects, first import the `io` module. Then create a new file with `io.StringIO()` where the parameter is the file contents.

```python
>>> import io
>>> 
>>> myFile = io.StringIO()
```

Now put some data into the file and read it with `.read()`

```python
>>> myFile = io.StringIO("Data into the file")
>>> myFile.read()
'Data into the file'
```

Try to read it again, the file is empty?

```python
>>> myFile.read()
''
```

No, the cursor is at the end. Set the cursor at position zero and you can read again.

```python
>>> myFile.seek(0)
0
>>> myFile.read()
'Data into the file'
>>> 
```

You can mimick file like behavior with it:

```python
>>> import io
>>> myFile = io.StringIO("Feeling good")
>>> data = myFile.read()
>>> print(data)
Feeling good
>>> 
```

## Write file

You can write data into the memory file too, by using the `.write()` method. This method is part of the object and as parameter takes a string (there's also regular <a href="https://pythonbasics.org/write-file/">write file</a>)

The `.write()` method lets you write any data into the file. The usual escape character work `\n` for a new line.
 
```python
>>> myFile = io.StringIO("")
>>> myFile.write("Write a line into the file\n")
>>> myFile.write("Second line.\n")
```

Then read the file with `.getvalue()`.

```python
>>> data = myFile.getvalue()
>>> data
'Write a line into the file\nSecond line.\n'
```

Close the memory file:

```python
>>> myFile.close()
>>> 
```

**Related links:**
* <a href="https://docs.python.org/3/library/io.html">Python io module, for working with streams</a>
* <a href="https://gumroad.com/l/dcsp">Learn Python, programming course</a>
How to Upgrade to Python 3.8 on Ubuntu
Tags: python, linux, ubuntu, unix
Published: 2020-03-11 12:39:32

---
title: How to Upgrade to Python 3.8 on Ubuntu
published: true
date: 2019-12-09 00:00:00 UTC
tags: python, linux, ubuntu, unix
canonical_url: https://tech.serhatteker.com/post/2019-12/upgrade-python38-on-ubuntu/
---


In this article, we upgrade to `python 3.8` and configure it as the default version of python.

Out of the box default python version for Ubuntu 18.04/10 is `python 3.6` and for Ubuntu 19.04/10 is `Python 3.7`.  As now, `Python 3.8.1` is the lastest stable version released on Dec 18, 2019.  So it would be better to upgrade last major version.

My Ubuntu version is 18 LTS, however for 19.{04, 10} replace below all `python3.6` with `python3.7` and run so.

OK, lets start:

## Step 0: Check the current python version
Rrun below command to test the current version installed of python.

```bash
$ python3 --version
```

Output will be like:

```bash
python 3.6.8
```

## Step 1: Install python3.8

Install python by typing:

```bash
$ sudo apt update -y
$ sudo apt install python3.8
```

## Step 2: Add python 3.6 & python 3.8 to update-alternatives

```bash
$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
```

## Step 3: Update python 3 to point to python 3.8

By default, `Python 3.6` is pointed to `Python 3`. That means when we run `python3` it will execute as `python 3.6` binary but we want to execute this as `python 3.8`.

Type this command to configure `python3:`

```bash
$ sudo update-alternatives --config python3
```

```bash
user@ubuntu1804:~$ sudo update-alternatives --config python3
There are 2 choices for the alternative python3 (providing /usr/bin/python3).

  Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /usr/bin/python3.6   1         auto mode
  1            /usr/bin/python3.6   1         manual mode
  2            /usr/bin/python3.8   2         manual mode

Press <enter> to keep the current choice[*], or type selection number:
```

You should get the above output. Now type 2 and hit enter for `Python 3.8`. Remember the selection number may differ so choose the selection number which is for `Python 3.8`.

### Alternative update python 3 to point to python3.8
`/usr/bin/python3` is just a `symlink`. Delete it and make a new `symlink` to `python3.8`:

```bash
$ sudo rm /usr/bin/python3
$ sudo ln -s python3.8 /usr/bin/python3
```

## Step 4: Test the new version of python3

```bash
$ python3 -V
python 3.8.0
```

All done!
react-create-app devel server + subdomain + https
Tags: react, security, javascript
Published: 2020-02-21 11:29:39

Hello everyone,

I'm trying to do a https request from a create-react-app to get a login cookie.
To do this I have to be in the same subdomain of these call, thus I have added to my .env file:

.env
```
HOST=local.www.subdomain.org
```

Due to the call is https I have changed my package.json (I have to work in windows 😥)

package.json
```javascript
"start": "set HTTPS=true&&react-scripts start",
```

`EDIT: If you add HTTPS=true in .env file it will work too`

If I call to https://localhost:3000
It is givig me an error in console, but the app is working:

```
webpackHotDevClient.js:60 WebSocket connection to 'ws://localhost:3000/sockjs-node' failed: Connection closed before receiving a handshake response
./node_modules/react-dev-utils/webpackHotDevClient.js	@	webpackHotDevClient.js:60
__webpack_require__	@	bootstrap:785
fn	@	bootstrap:150
1	@	index.js:3
__webpack_require__	@	bootstrap:785
checkDeferredModules	@	bootstrap:45
webpackJsonpCallback	@	bootstrap:32
(anonymous)	@	main.chunk.js:1
```

When I try to call https://local.www.subdomain.org:3000

It is givign mi an error but the app is not launched:

```
SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.
```

Someone knows what is the reason for this error.

Thank you 


`EDIT: I found the solution of that in https://github.com/facebook/create-react-app/pull/8079#issuecomment-562373869. The reason is because in react-scripts if https protocol is being used we should use WebSockets over SSL/TLS (WSS) protocol instead of WebSockets (WS) To solve you have to update the react-script version from 3.3.0 to 3.x.x or do a downgrade to 3.2.0.`
What was your win this week?
Tags: discuss, weeklyretro
Published: 2020-02-21 14:29:20

---
title: What was your win this week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

👋👋👋👋

Looking back on your week -- what was something you're proud of?

All wins count -- big or small 🎉

Examples of 'wins' include:

- Getting a promotion!
- Starting a new project
- Fixing a tricky bug
- Cleaning your house...or whatever else that may spark joy 😄

![scooby-spa](https://media.giphy.com/media/3o7WIAevY5uEJGLC3C/giphy.gif)

Happy Friday!
De split() methode (Dutch)
Tags: python, beginners, dutch, nederlands
Published: 2020-02-21 17:55:40


De <a href="https://docs.python.org/3.8/library/stdtypes.html#str.split">split()</a> methode zet een Python <a href="https://pythonbasics.org/strings/">string</a> om in een <a href="https://pythonbasics.org/list/">list</a>. Ofwel, het geeft een lijst van strings terug. Het breekt de gegeven invoer op door het scheidingsteken.

Als er geen scheidingsteken wordt gegeven, dan is een spatie het scheidingsteken.


**Voorbeeld 1:** als er geen scheidingsteken is gespecificeerd...

```python
>>> x='mijn naam is abc'.
>>> print(x.split())
```

Voer de bovenstaande code uit en uw uitvoer ziet er uit als

```
['mijn','naam','is','abc']
```

Dit werkt op elke string

```python
>>> y = 'hii welkom'
>>> print(y.split())
['hii', 'welkom']
>>> 
```

**Voorbeeld 2:** als er een scheidingsteken is gespecificeerd

```python
>>> x = 'mijn,naam,is,abc'
>>> print(x.split(','))
['mijn', 'naam', 'is', 'abc']
>>> 

```

Of bijvoorbeeld:

```python
>>> y = 'mijn naam is, jouw naam is, wij zijn'
>>> y.split()
['mijn', 'naam', 'is,', 'jouw', 'naam', 'is,', 'wij', 'zijn']
>>> 
```

**Voorbeeld 3:** wanneer **maxsplit** is gespecificeerd

De tweede parameter geeft het maximum aantal splits aan, *maxsplit*.

```python
>>> items = 'Melk, Kip, Brood, Boter'
>>> items.split(', ',0)
['Melk, Kip, Brood, Boter']
>>> items.split(', ',1)
['Melk', 'Kip, Brood, Boter']
>>> items.split(', ',2)
['Melk', 'Kip', 'Brood, Boter']
>>> items.split(', ',3)
['Melk', 'Kip', 'Brood', 'Boter']
>>> 
```

**Meer Voorbeelden**

Je kunt dit ook gebruiken bij het lezen van input waarden. Let hierbij op dat de variablen strings zijn en geen ints.

```python
>>> x,y = input("Voer twee waarden in: ").split()
Voer twee waarden in: 5 10
>>> x
'5'
>>> y
'10'
>>> 
```
Data types in Python (Dutch)
Tags: python, beginners, dutch, nederlands
Published: 2020-02-21 18:37:59

De gegevens die in het geheugen zijn opgeslagen, kunnen van verschillende aard zijn. 

Binnen <a href="https://python.org">Python</a> spreken we niet over data gegevens in het geheugen (het is immers geen machine taal) maar over <a href="https://pythonbasics.org/variables/">variablen</a>.


Zo wordt bijvoorbeeld de leeftijd van een persoon opgeslagen als een numerieke waarde (int) en zijn of haar adres als alfanumerieke tekens (<a href="https://pythonbasics.org/strings/">string</a>). 

## Data types

Python heeft verschillende standaard datatypes die gebruikt worden om de gegevens te definiëren.

Python heeft deze vijf standaard datatypes

* Nummers (Int, Float)
* String
* List
* Tuple
* Dictionary

In dit artikel bespreken we de twee meest voorkomende data types: integers en strings.

## Voorbeelden

Leren door voorbeelden, de volgende voorbeelden maken gebruik van variablen en verschillende data types.

**Voorbeeld 1 :**

Een variable met het data type string (tekst). Een string kan een lengte hebben van nul of langer.

```python
>>> x = "Leuk"
>>> print("Python is " + x)
Python is Leuk
>>> 
```

**Voorbeeld 2 :**

String variables kunnen samengesteld worden. In het onderstaande voorbeeld combineren we twee variablen (x,y) tot een variable z.

```python
>>> x = "Python is "
>>> y = "gemakkelijk uit te voeren"
>>> z = x + y
>>> z
'Python is gemakkelijk uit te voeren'
>>> 
```

Python maakt het mogelijk om een enkele waarde toe te kennen aan meerdere variabelen tegelijk. Bijvoorbeeld: 

```python
>>> a = b = c = 1
>>> a
1
>>> b
1
>>> c
1
>>> 
```

Hierbij is het data type nummeriek (int), dat wil zeggen: gehele getallen.
Het type is op te vragen met `type()`.

```python
>>> type(a)
<class 'int'>
>>> type(b)
<class 'int'>
>>> 
```

Mocht je komma getallen willen, dan kan dat. Gebruik dan de punt as komma. Hierbij is het data type overigens geen int maar een float.

```python
>>> a = 1.5
>>> b = 2.3
>>> type(a)
<class 'float'>
>>> type(b)
<class 'float'>
>>> 
```