teleren/devto huggingface dataset:
First feature with DO App Platform | DO Hackathon 🚀
Tags: dohackathon, javascript, react, webdev
Published: 2020-12-16 00:16:31

### Day 1
We started out strong, go get a cup of coffee.
According to the previous post in this series, now it's time to create a small feature so as not to have a blank screen. We will see portions of the feature code and other steps that I had to do to mount the app on the new DigitalOcean platform. Let's go!

#### CODING SIDE
- coding the feature
Let's start by setting up the countdown function, passing it the tentative launch date of the project. I put it as January 04, 2021, this is the code that makes it possible.

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

- Then follows the creation of the component, which will update its value through the result of our core function. Note that we use modern React syntax (hooks and functional components). The code was such that

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

- We quickly add some styles as good frontend developers so that our screen is beautiful. Dont forget the emotional gif haha.

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


#### DIGITAL OCEAN SIDE
###### (Mini-tutorial)

- Once the code is in the repo, we go to digital ocean (APP PLATFORM)
It's really easy to upload a project here, they did a great job.
We go to the new option on the left *app* to start

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

- After that we give LAUNCH YOUR APP, that button

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

- We connect our repo and select it, we can have a limit of 3 static projects for free.

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

- We select a location where the app will be hosted, and then we select that it is a static project. We give the following and we will select the free plan. Next and done.
After this, just wait for the app to be configured on the platform (I was able to go get my coffee, since it took a few minutes to finish)

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

☕☕☕☕☕☕☕☕☕☕☕☕ ... ⏰

- It's all! If everything goes well it should be something like this.

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

We test the app through the link they give us ...
AND VOILÁ, ITS ALIVE! 💛 and is dynamic. You can visit this [here](https://lets-go-dohackathon-52xh3.ondigitalocean.app/)

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

***Its all for today. In the next post we begin to rub shoulders with the landing of the project. Get ready to grab frontend and lots of css. Don't forget follow me for more content!***
A friendly resource for data beginners
Tags: books, datascience, bigdata
Published: 2020-12-16 00:06:34

Hey everyone, 

We have just launched a book aimed at people starting to understand the basics of working with data. It provides a complete, high-level view of what working with data entails, paired with pointers on how to get deeper knowledge in each subject.

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

Let me know if you want a **50% discount** as a special year end offer. 

[Getting Started With Data on Amazon](https://www.amazon.com/Getting-Started-Data-should-successfully-ebook/dp/B08NZYCTQT/ref=sr_1_1_sspa)
How to copy contents from one file to another file synchronously in Node.js?
Tags: node
Published: 2020-12-16 00:00:00

---
  title: How to copy contents from one file to another file synchronously in Node.js?
  published: true
  tags: Nodejs
  date: Wed Dec 16 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/copy-contents-from-file-synchronously-nodejs
  cover_image: https://melvingeorge.me/_next/static/images/main-390fa7f65146c96f7179829e46598a77.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/copy-contents-from-file-synchronously-nodejs)
  
To copy the contents from one file to another file synchronously, we can use the `copyFileSync()` function from the `fs` (filesystem) module in Node.js.

```js
// Copy contents from one file to another file
fs.copyFileSync(src, dest);
```

Let's say we have a file named `myFile.txt` from which we need to copy the content (called source file) and another file called `copyFile.txt` where we will have to write the copied contents (called destination file).

First, let's require the `fs` module and define the source and destination files like this,

```js
// require fs module
const fs = require("fs");

// source to copy content
const src = "myFile.txt";
// destination for copied content
const dest = "copyFile.txt";
```

To copy the file synchronously we can use the `fs.copyFileSync()` function and pass the:

- `src` as the first argument
- `dest` as the second argument

to the function.

It can be done like this,

```js
// require fs module
const fs = require("fs");

// source to copy content
const src = "myFile.txt";
// destination for copied content
const dest = "copyFile.txt";

// use copyFileSync() function
// to copy contents from source file
// and write to destination file synchronously
fs.copyFileSync(src, dest);
```

- The destination file will be created even if it doesn't exist in the system and the copied contents will be placed there.

See this example live in [repl.it](https://repl.it/@melvin2016/copy-content-file-to-another-file-synchronously-nodejs).

### Feel free to share if you found this useful 😃.

---
"Don't come with a problem without a solution" is harmful
Tags: career, watercooler
Published: 2020-12-16 06:06:45

---
title: "Don't come with a problem without a solution" is harmful
published: true
date: 2020-12-16 00:00:00 UTC
tags: career, watercooler
canonical_url: https://www.ankursheel.com/blog/problem-without-solution-harmful
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/oa25mfdti403h0npw9fb.jpg
---

I have been told by a few managers that the fact that I bring problems without any solutions annoys them. They would rather have people bring solutions along with the problems. Although they probably mean well, I feel that this approach does more harm than good.

Without even realising it, what they have said is

> Of all the problems you find, I only want to know about the ones you can solve

## Why would someone not have a solution?

Consider that a direct report of this manager identifies an issue but they don’t bring it up because

- it is too complex for them and they don’t know where to start.
- they do not have the authority to solve the problem.
- they are not good at strategic or tactical thinking.
- they have not had the time to think through possible solutions and the solutions never become clear to them.

## Why is this a problem?

No matter what the reason, in the short term the manager has missed an opportunity for improvement and possibly a chance to prevent a problem before it becomes a full-blown crisis.

Over a period of time, this can have more harmful and far-reaching impacts

- It can cause employees to shut down in fear.
- Put stress on people to find the right solution to a problem before speaking up.
- Put stress on people to figure out if a problem is big enough or not.
- Prevent employees from asking for help.
- Using a sub-optimal solution.

But the worst is that it results in a low trust relationship.

## Why managers might think this approach is a good idea?

Now, it may be argued that managers do this to cultivate a sense of ownership and to discourage complainers. I think there are better ways to achieve both without having to resort to this approach.

To cultivate a sense of ownership, let the person bringing the problem own it assuming that they have been given the tools, authority etc to solve it.

I don’t think we should discourage the complainers. Yes, most of the problems they bring will be trivial but you will find that rare gem in all the problems which will make it worth it. If you have a chronic whiner who complains even about things that are fine, you might just have to let that person go.

## Conclusion

What are your thoughts on the approach “Don’t come with a problem without a solution”? Do you think its harmful or beneficial?
Starting our journey with Digital Ocean's Hackathon!
Tags: dohackathon, gamedev
Published: 2020-12-15 23:36:14

series : ["Bacteria Wars Server"]

I'am working on a turn based multiplayer game named Bacteria Wars. We have been working on the game for almost 2 years now. The game is meant to be played against other players online, but we couldn't find any propre solution for our needs. With this hackathon it's a great chance for our us to test out something new!
Take the JavaScript UI Component Survey, Help shape the JS ecosystem
Tags: javascript, webdev, react, angular
Published: 2020-12-15 23:27:02

Take the 2020 JS UI Component Survey: https://www.surveymonkey.com/r/JavaScript-UI-Component-Survey

The JavaScript UI Component ecosystem is changing rapidly. Developers often use a few options to procure these building blocks for their front-end applications - either developing components in-house from scratch, using widely available open source options or choosing enterprise vendors. Each option has it's own merit based on the type of web application being developed coupled with key factors such as performance, security, interoperability etc. 

The 2020 JavaScript UI Component Survey provides valuable insights into the component usage and future trends. I highly recommend participating in this ~2-3 minute survey. Participants will get full access to view the survey report and be entered to win $150 gift card and a free license of FusionCharts, a popular data visualization library. 

Access the survey at: https://www.surveymonkey.com/r/JavaScript-UI-Component-Survey
Day 277 : Ready
Tags: hiphop, code, coding, lifelongdev
Published: 2020-12-15 22:46:08

_liner notes_:
- Professional : Today is the first day of the internal hackathon. I'm going to be building a tool to validate JWT that can be used in our dashboard so developers can test their JWTs to make sure it's valid and not a source of errors in their application. Did some research and got it working. Found out that browser has a native function to decode the JWT. Pretty amazing. Especially since I don't think I'll have access to even install a library on the dashboard. Going to flesh out the application and add more options, but I'm excited and relieved that it's possible. haha. Hoping to have it all ready by tomorrow afternoon.

- Personal : What did I do last night? haha I remember watching an episode of Legion, but that's pretty much it. I may have went through some tracks for the radio show. I really need to start writing this stuff down. haha. Now, I remember, I caught up with some friends who I haven't spoken to in a while through Slack and wasted time on social media. haha

![Jacksonville, Fl, USA shore with a grassy beach](https://dev-to-uploads.s3.amazonaws.com/i/194thx546js2llfdon7d.jpg)

Going to finally test out the changes to the upload feature for my side project and watch an episode of "Legion". Also, the video I made this weekend for the feature some friends asked me to be a part of went up today. I did a post on Twitter and Instagram with a sped up version. You can check it out here:
{% twitter 1338919332995358720 %}

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube mgFGLL-7ylY %}
Front-end Prototype of the app, p.2
Tags: design, programming, prototype
Published: 2020-12-15 22:17:45

#series : ["DigitalOcean Hackathon"]

This is post is part of the DigitalOcean Hackathon Series.

In this post inshallah, I will present the prototype of the App where I will show you how the front-end will look like. 

The first image shows a blueprint of how the Home-page will look like and it's main functions.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/o6vz875vi9yauuayc9dm.png)

The second image shows a blueprint of how the Signup/Login form will look like. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vifnikwhl08d930q9jtm.png)

The third image shows a blueprint of how the lending form will look like. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2k73iyvojtm2ngmcgml6.png)

The Last image shows the user profile and how it will look like, the profile contains personal info of the user, past transactions, his/her total earnings. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/dxnhg26h8g30pwctspz2.png)

of-course this design is not final as I will be following the agile methodology where I will be developing the app in sprints and add other features on the way.

in the next post inshallah I will share with you the database design and the above features implemented with Html, CSS and bootstrap.
What we've learned while doing interviews for developer conferences
Published: 2020-12-15 22:05:04

__TL;DR:__ we took a super-casual approach to speaker interviews - kids, dogs, family - and it worked.
---
We help businesses talk to game developers to be more visible, so we feel and understand the industry.

Instead of persuading speakers to film a 15 sec "please come to my talk" blurb, conferences connected us to their flagship speakers and we did a set of super-casual livestreams on twitch, then cut them into 20 minute videos for YouTube and several 2-3 minute videos for Instagram.

> I can explain our #livestreaming tech, formats, what works and what doesn't ☕ If there's interest, but now I'd like to focus on casual interviews as a developer conference marketing asset. 

The more casual format with a human touch and focus on speaker's life, kids, hobbies and less focus on their work got the best response. 

I think people are tired of endless webinars, and such light and funny interviews are the next best thing to networking. And many people miss networking.

Here's [the YouTube playlist with clean copies](https://www.youtube.com/playlist?list=PLOY5WvYhE7ctvbgLXO-Hkh4yAr_9BvT8T) (no conference overlays, extra logos, intros, etc) of our hangouts as a reference.

Gamedev Stories is what I am referring to as casual interviews.
|Database| Database: Connecting to Mongo with Mongoose
Tags: javascript, html, css, webdev
Published: 2020-12-15 21:59:45

---
title: |Database| Database: Connecting to Mongo with Mongoose
published: true
description: 
tags: javascript, html, css, webdev
//cover_image: https://direct_url_to_image.jpg
---

                -What is Mongoose 
                -Schema Constraints
                -Model Instance Methods 
                -Adding Model Static Methods
                -Mongoose Virtual 
                -Defining Mongoose Middleware 


###What is Mongoose 
Object Data Mapper / Object Document Mapper 

Mongoose is a ODM, which maps documents coming from a database into usable JavaScript objects. 

Mongoose provides ways for us to model application data and define a schema. It offers an easy way to validate data and build complex queries from the comfort of JS. 

It is also possible to define a preset schema ahead of time and then enforce it. Data will conform to that schema. 

The goal of Mongoose is to take Mongo and make it work seamlessly better with JavaScript. 



###Schema Constraints

Schema types handle definitions of path defaults, validation, getters, setters, field selection defaults for queries. 

Schema type is a configuration object for individual properties. 

Schema types can be string, number, date, boolean, mixed, objectID, array, etc... 

Schema type options 

required, default, select, validate, get, set, immutable, and transform. 

###Model Instance Methods
Instances of models are documents. Documents have many of their own built-in instance methods. 
An instance method is available on every single instance versus a class or static method. 





###Adding Model Static Methods
Static methods that live on the model itself, not on instances of the model. 

####Two ways to add a static method to the model 
add a function property to schema.statics 
call the Schema#static() function 




###Mongoose Virutals 
Virtuals are document properties that can get and set but that do not get persisted to MongoDB. The getters are useful for formatting or combing fields, while setters are useful for de-composing a single value into multiple values for storage. 



###Defining Mongoose Middleware 
Middleware are functions passed during execution of asynchronous functions. Middleware is specified on the schema level and is useful for writing plug-ins. 

Mongoose has 4 types of middleware: document, model, aggregate, and query, 
The keyword this will refer to the document. 

####Common middle ware functions
Validate, save, remove, updateOne, deleteOne and init
How to Install the `nano` Text Editor on AWS CloudShell
Tags: nano, linux, aws
Published: 2020-12-15 21:58:05

I know the basics of `vim` and I *even* know how to exit it(!) but I'd much rather use <a href="https://www.nano-editor.org/">GNU Nano</a> as my editor at the terminal. Yet, the Amazon Linux 2 distribution with AWS CloudShell doesn't include it!

Here's what to do to install it into your home folder so that it remains in place long-term:

```
# Install basic developer tools and dependencies
sudo yum -y groupinstall "Development Tools"
sudo yum -y install git-core zlib zlib-devel gcc-c++ patch readline readline-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel xz

# Download and compile nano
cd ~
mkdir ~/bin
wget https://www.nano-editor.org/dist/v5/nano-5.4.tar.xz
tar xf nano-5.4.tar.xz
cd nano-5.4
./configure --prefix=$HOME
make && make install

# Clean up and add ~/bin to PATH
cd ..
rm -rf nano-5.4
rm nano-5.4.tar.xz
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
```

Now you can run `nano`:

```
nano
```
[Video] How to host your static websites for free on the DigitalOcean App platform
Tags: devops, github, webdev, dohackathon
Published: 2020-12-15 21:48:04

This video shows you how to deploy and host your static websites for free on the new DigitalOcean App Platform!

{% youtube pPcSpYssyvo %}

Useful links:
- [Affiliate link for $100 free credit for DigitalOcean](https://m.do.co/c/2a9bba940f39) so you could spin up your own servers:

- The [Tails TailwindCSS](https://devdojo.com/tails) project

- If you are planning to build something awesome during the holiday season make sure to join the https://dev.to and DigitalOcean hackathon! There are four fun categories, with some seriously awesome prizes:
{% link https://dev.to/devteam/announcing-the-digitalocean-app-platform-hackathon-on-dev-2i1k %}
How I Landed My First Developer Job: My Internship Story
Tags: career, webdev, culture, codenewbie
Published: 2020-12-15 21:41:26

{% youtube RP60B2G5FkE %}

Here’s the story of how I got my start in software engineering. If you have any questions feel free to leave a comment below and I’ll get back to you.

Also feel free to connect with me on Twitter or YouTube! 

Website: https://darindoria.com
YouTube: https://www.youtube.com/channel/UCdfakO1sxJ_TfQKx18rDxSg
Twitter: https://twitter.com/_darindoria
GitHub: https://github.com/ddoria921
DevAnalytics at DOHackathon: backend returning useful data
Tags: dohackathon, angular, python
Published: 2020-12-15 21:31:26

This day I made some small changes and a spectacular improvement. 

I integrated half of the statistics calculation of [DEV Analytics](https://dev.to/sandordargo/my-dev-birthday-gift-for-you-dev-to-analytics-19f2) to the Flask backend. 

In addition, now you can pass from the UI your API Key and it will retrieve all the available statistics in a few secs and you'll get the data dumped on the screen.

![Data is coming in](https://dev-to-uploads.s3.amazonaws.com/i/wicr9kxkafh667zu0nts.png)

For tomorrow, I have no big plans, I just want to finish the backend with the rest of the statistics.
|Database| Database: MongoDB
Tags: javascript, html, css, webdev
Published: 2020-12-15 21:11:08

---
title: |Database| Database: MongoDB
published: true
description: 
tags: javascript, html, css, webdev
//cover_image: https://direct_url_to_image.jpg
---


              -Introduction to Database
              -SQL vs. NoSQL Database
              -Why Mongo
              -Inserting with Mongo
              -Updating with Mongo

            


###Introduction to Database
####Why use a database instead of just saving to a file?
Databases can handle large amounts of data efficiently and store it compactly. They provide tools for easy insertion, querying and updating of data. Databases generally offer security features and control over access to data. 


###SQL vs. NoSQL Database
SQL Databases also known as structured query language databases. Relational databases are pre-defined schema of tables before any information that is inserted into them. 

NoSQL databases do not use SQL. There are many types of no-sql databases, including document, key-value, and graph stores.  

Popular SQL Databases 
MySQL, Postgres, SQLite,Oracle, Microsoft SQL Server 

Popular No-SQL Databases 
MongoDB, CouchDB, Neo4j, Cassandra, Redis 



###Why Mongo
Mongo is very commonly used with Node and Express (MEAN and MERN stacks). 
It's easy to get started with, popularity also means there is a strong community of developers using Mongo. 




###Inserting with Mongo
When a collection does not currently exist, insert operations will create the collection. 

```

db.collection.insertOne()

```

will insert a single document into a collection. 

it is possible to insert a single document and to insert many documents. 


```
insertMany()

```

The insert() method can insert either single or many documents. 


```
insert()
```
The Self-Taught Developer Book
Tags: showdev, learning, beginners
Published: 2020-12-15 21:10:52

After a few years working on this programming book project, it’s finally ready for launch!

![The Self-Taught Developer](https://dev-to-uploads.s3.amazonaws.com/i/jtfao4vx7vjt62d9ascz.png)

I wrote [The Self-Taught Developer](https://www.amazon.com/Self-Taught-Developer-Tricks-Anyone-Programming/dp/B08QBK41XX/) after working with so many talented self-taught programmers. I was self-taught in the sense that I started programming during my young teenage years. I also endured the many years of formal higher education with a Computer Engineering BS and a Computer Science MS. I think I really learned programming from projects and the work experience. 

I wanted to impart what I learned to self-taught developers to encourage that coding is for accessible for anyone.

[The Self-Taught Developer Book](https://www.amazon.com/Self-Taught-Developer-Tricks-Anyone-Programming/dp/B08QBK41XX/)
Swapping Values in Es7
Tags: javascript, news
Published: 2020-12-15 20:58:46

News of JavaScript ES7 has recently been around boasting its new features. After reading various articles on its cool new features,i decided to share my favorite of them. 

Before ES7 swapping 2 values was annoying and counterintuitive, the idea is to store one value in a temporary variable so that you can exchange them, adding extra lines of code. In total you need minimum 3 lines of code to swap to values. Say we want to swap the contents of a and b, we need to introduce a third variable, c:

```Javascript
let a=1, b=2, c;
c = a;
a = b;
b = c;
```

With ES7, the new way is super simple and intuitive:

```Javascript
let a=1, b=2;
[a,b] = [b,a];
```

Amazing, isn't it? Super simple and just one line!

Hope you enjoyed that one!