teleren/devto huggingface dataset:
Task 3: "Hello World" in C# using the command line in Linux
Tags: helloworld, cli, beginners, tutorial
Published: 2019-09-20 01:54:48

So the task is to write the first program to output "Hello World" on the console screen. 

Honestly, I have done this so many times and things much more complex than this using C#, but I have never done it on Linux using CLI and a text editor which in this case is Sublime Text 3. There are two ways to do this and I will be discussing both in this post.

# First method uses the Mono compiler which should be installed first before following the steps below:

1.open Sublime Text and create new .cs document with the following lines of code:

using System;

class HelloWorld {
  static void Main() {
    Console.WriteLine("Hello from Manmeet!");
  }
}

2.save the file.

3.open Terminal and change the present working directory to the location where the .cs file is saved.

4.then use the command below to generate an executable file of the .cs file.

mcs -out:HelloWorld.exe HelloWorld.cs


mcs: references the 4.0-profile libraries (the APIs as defined in .NET 4.0) and supports C# 4.0

5.use the command below to run the code.

mono HelloWorld.exe

# Second method uses the .Net Core CLI tools only and you don't have to install a third-party compiler like Mono for this:

1.open the command prompt and create a new folder. Navigate the folder created and then create a new console project by the following command: 

$ dotnet new console

This command will create two files in your folder. First would be the .csproj project file with the dependencies necessary to build a console app and the second file is the program.cs file in which you can write the code you want and serves as the entry point for the application. 

2.change the code in program.cs suitably to desired code in the text editor. 

3.change directory to the project created by doing 

$ cd <name of the project folder created>

4.then run the code by using the command 

$ dotnet run 
  



Click on the link below for the previous post in this series:
https://dev.to/mechatrona/task-2-install-the-sublime-text-3-netcore-2-x-git-in-ubuntu-27i9
Seek-Help!
Tags: javascript, help
Published: 2019-09-20 01:31:45

hi everyone and have a nice day!

im pretty new to javascript as well as propramming. (been for only 1 month)
im practicing this question (im NOT allowed to use if-then operator as teacher's assignment): 
------------------------------------
Here is a sample:
first: Q. I made 26 cupcakes and ate 15 of them. How many am I left with?
A. 11

second: The next time the page loads, the numbers should change, so the problem may look like:
Q. I made 45 cupcakes and ate 2 of them. How many am I left with?
A. 43

third: The numbers used in this word problem should change randomly. This means
that we need to generate the numbers for the questions and the answer using
JavaScript.

HINT: you will need to use the Math.random() method to complete this part.
Here are the characteristics of the problem along with the possibilities you need to consider:
 + The generated random numbers should always be between 0 and 50.
 + You should never encounter a scenario in which you make less cupcakes and
eat more. For example:
Q: I made 45 cupcakes and ate 47 of them. How many am I left with?
 + In case you don’t eat any cupcakes, the question should say:
Q: I made 45 cupcakes and ate none of them. How many am I left with?
instead of saying
Q: I made 45 cupcakes and ate 0 of them. How many am I left with?
and the answer should say:
A. I don't need to do any calculations.
 + You are not allowed to use the if…then construct.
------------------------------------------------------------------
This is my code (i still have errors and issues):

<script>
var made= Math.floor(Math.random() * 50) + 1; 
var eat = Math.floor(Math.random() * 50) + 0;
let b= (eat== 0? "none" : eat);
console.log ("Q. I made " +  (made== 1? "1 cupcake": made + " cupcakes") + " and ate " + b + " of them. How many am i left with?");
console.log ("A: " + (b== "none"?"I don't need to do any calculations.": (0 <=  eat < made <= 50, made-eat))); 
document.write ("Q. I made " +  (made== 1? "1 cupcake": made + " cupcakes") + " and ate " + b + " of them. How many am i left with?" + "<br>"); 
document.write ("A: " +(b== "none"? "I don't need to do any calculations.": (0 <=  eat < made <= 50, made-eat)) );
</script>
Is there a pattern to collaboration?
Tags: discuss
Published: 2019-09-20 01:13:32

---
title: Is there a pattern to collaboration?
published: true
tags: discuss
---

#Is there a pattern to collaboration?

Development is a collaborative sport. But so much of it is an individual's journey through problems. While it is an open secret that more eyes on a piece of code, makes better code, what is it the stops us from implementing these collaboration practices while writing code?

I wonder if it is the up-front cost versus the apparent rewards. Much like the concept of a positive externality (from economics) where, the overall good that say pair-programming has, or code reviewing before PR's does on the general app health, is not effectively correlated to the action. 

So is there a pattern you follow when it comes to collaboration?
A web tools site
Published: 2019-09-20 00:37:44

Hi, guys. I made a web develop tools, site name is [codetools.online](https://codetools.online/). There are some useful online tools that I used in testing, debugging, and development. Such as:
- [markdown editor](https://codetools.online/markdown-editor/)
- [json editor](https://codetools.online/json-editor/)
- [html formattor](https://codetools.online/html-formatter/)
- [js minifier](https://codetools.online/js-minifier/)


And I made some easy-to-use logo generator.
- [Youtube logo](https://codetools.online/youtube-logo/)
- [tiktok logo](https://codetools.online/tiktok-text/)
- [pornhub logo](https://codetools.online/pornhub-logo/)

If you have any question or suggestions, please let me know.
Code Newbie Advice
Tags: codenewbie, firstyearincode, advice
Published: 2019-09-20 00:25:08

I started learning to code nearly a year ago in October 2018. Here's the advice I'd give to myself if I could go back in time and speak to past Olivia.

1. *Document everything you learn.* 
Before I started learning I read a lot of articles and posts that encouraged students to keep a blog to document their code journey. With working full time and squeezing in at most 2 hours of coding a night I thought it'd be too much effort so I didn't. 
I regret this. 
Since I was short on time I could have been short with words, too. I should have just created a Twitter account to document my journey. I created a Twitter this month to document what I'm doing and I wish I had done this sooner.

2. *Join dev communities.*
I didn't know that so many existed online and they've been a great source of information, encouragement, wisdom, and support. Now I'm on a couple of Slack channels, Twitter, dev.to of course, and I've joined some tech organizations. They keep me accountable and excited about programming. I also have joined some tech meetups in my area. Being self-taught it's especially important to get together with other devs in real life to talk about programming and get used to interacting with other tech people. 

3. *If you're programming to get a job learn about other job skills and the interviewing process earlier rather than later.*
I think a lot of newbies neglect this, and it's so important especially if, like me, this is more than just a hobby; it's a gateway to a better life and a fulfilling career.

4. *Learning and doing enhances confidence.*
I still don't feel super confident about my programming abilities but I've learned that knowledge and action are excellent ways to boost confidence. I've let my lack of confidence keep me from coding when I've had the time or opportunity to do so because I felt stupid or inadequate. This only reinforced my feelings of stupidity and inadequacy. Learn as much as you can and you'll feel empowered to learn even more and to build more.

5. *Believe you can and you're halfway there.*
Learning to code can be scary. It's frustrating and failure is inevitable, but if you keep faith and persevere through the challenges you **will** grow to be an awesome developer!
The Swift Programming Language Companion: The Basics
Tags: ios, swift, beginners
Published: 2019-09-19 23:56:04

This article is part of a series on learning Swift by writing code to The Swift Programming Language book from Apple.

### The Swift Programming Language Companion

* [Introduction](https://dev.to/loufranco/the-swift-programming-language-companion-introduction-4k0a)

### The Basics

So, to recap, we have the book and Xcode side-by-side. We're going to read the first chapter, [The Basics](https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html#), and write code in the Playground.

Before you start, if you have an app idea, keep that in mind. If you don't, just pick some app you use and know well and keep that in mind. As an example, I am currently working on a workout watch app that I will use to manage my running. I will show you how I use that to generate exercises for myself.

#### Constants and Variables

When you read this section, you are going to learn about how to declare constants and variables. The book gives several examples. Type them into the Playground if you wish.

Then, generate similar code based on your app idea.  For example, for my app:

```swift
let numberOfLaps = 5
var currentLap = 0

var workoutName: String 
workoutName = "5 x 100m"
```

The other very important thing that was introduced is that there is a way to describe the code with a sentence. The first line above can be read as: "Declare a constant called numberOfLaps and set its initial value to five".

So, as an exercise, 

> Declare a variable called numberOfMinutesRunning and set its initial value to 0

Then,

> Change the value of numberOfMinutesRunning to 1

#### What's next

This chapter covers declarations and types, but starts getting more complicated at Optionals. So, read through, type in code, generate more code based on some app you keep in mind and in the next post, I'll dig a little deeper on Optionals.

If you have any trouble, ask in the comments below.
A Container/Dependecy Injection for Flutter apps
Published: 2019-09-19 23:46:44

In the past few months We made a simple and small Container library to use internally in the company that I'm currentlly working for. It is available in this [repository](https://github.com/nextbss/injector_io) on GitHub. You can try it and leave some feedback. We will keep it up because we are using it for real projects.

### Features

- Create singleton instances;
- Create factory instances (recreated on every call);
- Register instances using `Module`;
- Get instances from anywhere using the `get()` function.
- Logs printed while in `DEBUG` mode.
- Easy to test.
- Doesn't use reflection.

### Concepts
- **get()** => Used to resolve the instance of a registered class.
- **inject()** => Used to resolve a dependency inside a Module.
- **single()** => Used to register a singleton instance. You will receive a the same instance every time you use `get()`.
- **factory()** => Used to register a factory instance. You will receive a new instance every time you use `get()`.

Read more [here](https://pub.dev/packages/injectorio) and give it a start.
Programming Music
Tags: discuss, productivity
Published: 2019-09-19 22:46:53


What kind of music do you generally prefer for coding?  Personally I find myself looking for:
- Long (30min+) mixes so I can keep the same tempo going
- No vocals, I find listening to vocals makes it much harder for me to concentrate on coding (others might not be bothered by them)

Below are some of the mixes I enjoy, normally I would just open them in the background on my 2nd monitor (it helps that the visuals are also pleasing without too much going on)

{% youtube l9nh1l8ZIJQ %}
{% youtube 4F7sdy2rZws %}
{% youtube kmjiUVEMvI4 %}
{% youtube cc3Dofs_j0E %}
{% youtube rr0gvSS1OzE %}

Do you have any favourite mixes?  Let me know in the comments.
Update nodeJS to the latest version in Ubuntu
Tags: node, nvm, ubuntu, npm
Published: 2019-09-19 22:24:26

---
title: Update nodeJS to the latest version in Ubuntu
published: true
description: Update nodeJS to the latest version in Ubuntu
tags: nodejs,nvm,ubuntu,npm
---

NVM (Node Version manager) with *--lts*

NVM installs both the latest stable node and npm for you

`curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash`

`source ~/.nvm/nvm.sh`

`nvm install --lts`

`nvm use --lts`

`npm --version`

Now you are ready
Cultivating Coder's Bootcamp Summer 2019
Tags: coding, bootcamp, javascript
Published: 2019-09-19 22:11:49

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/pqcq1kki8nb13qgb466y.jpg)

One of the Cultivating Coder's bootcamp's collab this year was in San Bernadino, with Goodwill. It was intensive and we made some cool projects:

1. [One Stop Dev Shop](http://onestopdevshop.herokuapp.com/)

2. [GeoMapstr](http://www.geomapstr.com/)

Cultivating Coder's fully sponsors the students and they get a free laptop. And most times there are snacks too! (nice, healthy ones). Besides that they get exposed to instructors who work in different capacities in  the software development realm. Also the students don't have to move out, the bootcamp comes to them.

We started out with the basics (HTML5, CS3, Twitter Bootstrap & Git). Then we started learning JavaScript in particular with context to DOM scripting. Finally we stepped into server side JS  with node.js, express.js and some mongoDB (with mongoose.js ODM). 

The basic premise was to start off with a basic frontend project, add some functionality and refactor it into a backend project, therefore making it fullstack!

The students were all the way from late 20's upto mid 50's. Overall, it was a learning experience for me as an instructor as well, as each group has been quite different. 

The goal was to <b>BUILD</b> and to build in class while I and the co-instructor were there to facilitate the projects. The ideas for the projects were taken from the students themselves. 


The weekend before the class started, there were a couple of earthquakes in California, so 1 group ended up coding <b>GeoMapstr</b> which sorts and filters through earthquakes acccording to magnitude, AOED (Area of affected disaster) and frequency (last 30 days, 1 month, 6 months etc). The app also included a signup/login feature as the next feature of the app was geolocating the user in reference to an earthquake. 

Whereas, the shopping cart group which was <One Stop Dev Shop</b>  built upon one of the student's current businesses, which is hemp clothing. The functionality of the cart was built from scratch with vanilla JS. 

I'm very grateful to the team that I work with. They are doing lots of good by opening doors for others. Door opener's not gate keepers!

Oh we also made twitterbots for fun :) [Here](https://twitter.com/GeoMapstr) and [here](https://twitter.com/codedeploy)
What is your favorite SQL viewer/tool
Tags: discuss, sql, database
Published: 2019-09-19 22:09:48

---
title: What is your favorite SQL viewer/tool
published: true
description: What are the best tools for viewing a DB
tags: discuss,sql, database
---


It should be great to compile a list of best SQL viewers/tools available out there. So, based on the requirements, sometimes we need a simple interface for viewing a table, others, we need a whole tool for making more complex process over a DB (Save queries, Entity-Relationship diagrams, etc)

Let's make a list of best SQL viewer/tools in the market.

Updated list:
- [DBeaver](https://dbeaver.io)
- [PSequel](https://dbeaver.io/) (simplest one, just for PostgreSQL)
- TablePlus
- HeidiSQL
- DbBrowser
- MYSQL Workbench
- Oracle SQL Developer
That Ultimate Project
Tags: javascript, discuss, opensource, webdev
Published: 2019-09-19 21:52:39

Dev.to is a great place to learn. But what I haven't seen here till now is that nobody talks about making something as a community. I always feel that somewhere there's a big gap in what we have today in terms of available technological tools.
Howsoever I want and whatever I think of,given my experience in development,it leads me to small ideas only. What can we make as a community for JS(Yes,I am a bit biased for JS)?

![Idea](https://thepracticaldev.s3.amazonaws.com/i/4rqr8i2evdwxendbuoi2.jpg)
Why can't we make something awesome,for starters,say Dev.js(don't know what it will do and how it will be different from other JS frameworks), another framework/library that can revolutionise web development?
Please give your views. Seriously want to do something in Open source and for the Dev community.
Looking forward to awesome ideas.
AWS CDK sample with Existing S3 bucket and existing SNS topic
Tags: aws, cdk, awscdk, typescript
Published: 2019-09-19 21:34:13

---
title: AWS CDK sample with Existing S3 bucket and existing SNS topic
published: true
description: I created a AWS CDK construct that generates a set of services that indirectly receives S3 ObjectCreated event
tags: AWS, CDK, AWSCDK, TypeScript
---

You cannot add a new S3 notification to existing S3 buckets by CloudFormation. However, you can add an SQS subscription to existing SNS topics.

S3 => SNS topic => SQS subscription => Lambda


```typescript
import core = require("@aws-cdk/core");
import lambda = require("@aws-cdk/aws-lambda");
import s3 = require("@aws-cdk/aws-s3");
import sns = require("@aws-cdk/aws-sns");
import sqs = require("@aws-cdk/aws-sqs");
import { SqsEventSource } from "@aws-cdk/aws-lambda-event-sources";
import { SqsSubscription } from "@aws-cdk/aws-sns-subscriptions";

export class ExistingS3BucketAndSNSTopicToLambdaThroughSQS extends core.Construct {
  constructor(scope: core.Construct, id: string) {
    super(scope, id);

    const bucket = s3.Bucket.fromBucketName(
      this,
      "ExistingS3Bucket",
      "bucketName"
    );

    const handler = new lambda.Function(this, "lambda", {
      runtime: lambda.Runtime.NODEJS_10_X,
      code: lambda.Code.asset("lambda/dist"),
      handler: "index.main",
      timeout: core.Duration.seconds(30),
      environment: {
        BUCKET_NAME: bucket.bucketName
      }
    });

    bucket.grantRead(handler);

    const topic = sns.Topic.fromTopicArn(
      this,
      "ExistingSNSTopic",
      `arn:${core.Aws.PARTITION}:sns:${core.Aws.REGION}:${core.Aws.ACCOUNT_ID}:existing-sns-topic`
    );
    const queue = new sqs.Queue(this, "queue");

    topic.addSubscription(new SqsSubscription(queue));

    handler.addEventSource(
      new SqsEventSource(queue, {
        batchSize: 1
      })
    );
  }
}
```


This example is working well with AWS CDK v1.6.1. In the future it might be broken because AWS CDK is in its public beta.


Gist: https://gist.github.com/katryo/ff3cf8b5e3f12823ad7bc2468db054cd
Trivia: The letter "e" is special. 🧙‍♂️
Tags: css, html, webdev
Published: 2019-09-19 21:29:35

So you think you know all the CSS values and that only numbers are well.. numbers.

Well what if I told you that there is one number or should I say letter that you can enter in a number field and use in CSS values you would not expect. e is a trend setter because in CSS you can do this:

``` CSS
z-index: 9e9;
```

Interesting no?

In html this will also work:

``` html
<input type='number' value='e'/>
```

Okay so before I explain.. I was once presented with a feedback form asking me to rate my experience between 1 and 10, I didn't think much of the form so I entered e, I'm not sure what the SQL database behind this thought of my helpful data, but there you go, you can't rely on client side validation.

Okay what is e all about? E or exponent is equivalent to pow() or power of. In my CSS example this notation gives a huge number 9 times 10 to the power of 9 (edit) and certainly larger than 9999px, so if you want to write less for your money's worth, e is the way to go.

Html number fields also count e as a number when no other letter will actually be typeable.

So that's e, a computed notation worth knowing.
30 Day Challenge: Finish Line
Tags: beginners, productivity, journey, personaldevelopment
Published: 2019-09-19 17:04:57

---
title: 30 Day Challenge: Finish Line
published: true
description: 30 Day Challenge: Finish Line
tags: beginners, productivity, journey, personal development
---

30 Days ago, I started my [30 Day Challenge: Write one Post per Day](https://dev.to/miku86/30-day-challenge-write-one-post-per-day-3jpm).

I wrote 29 post.
I failed one day.
I went from ~1.000 followers to **2.972**. (I only added links to old posts, so no active marketing.)

I want to give a small feedback about my learnings,
I will use the content of my intro post for it.

```
I want to strengthen my publishing habits
```

This worked.
I time-blocked one hour to write and I knew every day, that I had to deliver. Next time, I would make a longer list of topics to write about.

```
I want to tackle my fear of publishing
```

Most of the time I had thoughts like "Ouh, this is some basic stuff, every one can read about it in the docs, no one will care.".
But it went better than expected.

```
I want to share my knowledge
```

Looking at the views and reactions, I can see a clear difference between my series about `NodeJS` and `PostgreSQL`.

The more followers I had, the more views and reactions I got.
But this was only true in a series.
So I think, that `NodeJS` is more interesting than `PostgreSQL`, or my posts weren't that interesting.

`1000*x^29=2972` => `x≈1.0383`

So 1 post got me an increase of 3.8% in followers.


```
I want to strengthen my writing skills
```

This was okay. Most of the time half of the blocked time went into reading about the proper english translation. My english writing skills aren't that good, my german one's are really good, so I got stressed all the time, because my english reads like 5th grade english.

```
I want to benefit from social accountability
```

The thougth that someone is waiting for my post definitely helped me.


### Summary

This was a great experience and I am really happy & proud.
I will start working at a new software project, afterwards I will start a new writing challenge.
How do you handle incidence response?
Tags: discuss, devops
Published: 2019-09-19 21:05:11

How does everybody document and handle incidence response, especially within smaller team? (i.e. If everybody from the sub-team is on vacation how do you document steps to debug, troubleshoot, and fix issues and where does that documentation live, do you give non developers the ability to roll back deploys if issues arise or provide ways to remotely monitor your applications)

I'm trying to design and implement a procedure in which if an issue arises and the immediate developers aren't available, we target the right person to resolve the issue and provide them with all the resources required to resolve the issue or escalate it to us on vacation if the issue is critical.