teleren/devto huggingface dataset:
Hands of the privates
Tags: discuss
Published: 2020-05-12 10:01:24

---
title: Hands of the privates
published: true
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/ug14lpdlhj0jinoo9sum.jpg
description: Why shouldn't you test private methods? Why even making things private to begin with?
tags: discuss
---

I am not a fan of private visibility. It prevents extensibility, but more importantly, it prevents unit testing. 

_You shouldn't unit test private methods._ I hear you say. But why not?

It is time for a bad analogy. Lets say I have I have this `FoodFactory` and I have a great hamburger recipe. So I would have the method

```java
public Hamburger createHambuger() {
    // ...
}
```

We probably all agree that this method should not contain every single step in creating a hamburger, but you would probably do something like this.

```java
public Hamburger createHambuger() {
    Stack parts = new Stack();
    parts.add(createBottomBun());
    parts.add(getLettuce());
    parts.add(getTomatoSlice(2));
    parts.add(createPatty());
    // ...
    parts.add(createTopBun());
    return assembleHamburger(parts);
}
```

At some point in time we start getting complaints that the top bun does not have sesame seeds on top. Which is weird, because it _is_ part of the top bun. After some extensive debugging and eating a lot of hamburgers we find out that sometimes `createTopBun()` returns the bun upside down.

This would be an easy fix. We just create a unit test to assert `createTopBun()` returns the bun right side up, and ... wait! Our awesome hamburger is a top-secret recipe, so all our steps should be private methods. The only way to test if the top bun is right side up I need to create a full hamburger and then dissect the result. Which would also mean my test setup needs to also take care of having the inventory to create the patty, etc. All I wanted was to verify the top bun.

With the exception for security related parts, why should I make things private instead of protected? 
And why should I not test private methods?
The ColdBrew - Introduction
Tags: code
Published: 2020-05-12 10:14:55

---
title: The ColdBrew - Introduction
published: true
description: A small introduction into TheColdBrew
tags: #discuss #code
---

Hey all! Little bit of a shameless self promo here. Decided to take a little self plunge and work on youtube channel for tech related content! So this is just a small little intro into what it's about.

Here you go: https://youtu.be/z3WttAlrvNk
Mywifiext net setup support and guidance
Tags: mywifiext, mywifiextnet
Published: 2020-05-12 10:11:56

At Mywifiext, we have professionals who are always available to help you with <a href="https://mywifiext-net.support/">Mywifiext net</a> login and netgear extender setup success. New Extender Setup is the foremost solution to keep all your smart devices like computers, gaming devices, mobile devices, laptops, and more connected with a seamless and dependable internet connection.
<a href="https://mywifiext-net.support/">https://mywifiext-net.support/</a>
Post Makers - Week 8
Tags: jobhunt, quarantine, react, javascript
Published: 2020-05-12 10:11:30

2 Months have now passed since graduating from the Makers Academy.

The more that time passes, the more I see this pandemic situation in an optimistic light. I am carrying on with learning the intricacies of React, started working on Algorithms ( as I see this is a keen interview topic), and find myself reading about any and all articles I come across regarding coding/tech in general. 

What is most productive however is my review of the course. I find myself completing week challenges from the course syllabus in a few hours, and completing bonus challenges, and additional features....and enjoying it. When I am working through some of the user stories, I have flashbacks of panic, dread, confusion and disbelief - what I was feeling when I first worked on these exercises. Now I am flying through the work, laughing at my previous self, but also realising that there is no shortcut to time.

I now understand the world of coding more than 3 months ago, appreciate practises and methodologies, and understand the core concepts more and more. Testing has been a big revelation to me, mocking in particular. I remember spending the first and second weeks main issue was to do with testing, and stubbing out some behaviour. This time around it made sense, and worked - it bloody worked! I felt so good that I quickly completed the same projects in a second language. Ruby code became JavaScript code, RSpec tests became Jasmine tests, and I felt this calming sense of I am a better developer than I was than 3 months ago.

This was important for me....the course was so intense, non stop and busy that I never had a chance to breathe, take a look around and observe what I had achieved. This quarantine has given me the time to take a look around and appreciate just how far I have come.

Apologies for the self absorbed rant, but i'm proud what I have achieved, and happy to be on this journey.

As always, stay safe during these crazy times, I wish everyone the best of health.

David
📸 I re-created an analog camera in HTML & CSS 
Tags: codepen, css, design, html
Published: 2020-05-12 10:05:38

I made another camera in CSS, this time I went for the Sardina (from Lomography). The code can be viewed on [CodePen](https://codepen.io/fossheim/pen/RwWJKWR), and I also have a [GitHub repo](https://github.com/sarahfossheim/art.css) where I collect all the CSS drawings I make.

{% codepen https://codepen.io/fossheim/pen/RwWJKWR %}

I had a lot of fun making this one (and even live streamed my process 🙌), and am trying to create one of those a week. Feel free to send me suggestions if there's something you think I should try to recreate, or follow my [Twitch](https://twitch.tv/sarahfossheim) to be notified next time I live-code 🤩

I especially enjoyed creating the flash, viewfinder and lens. Glass reflections can be time-consuming because they require a lot of gradients on top of gradients, but the result is also incredibly rewarding.

Also for reference, this was the picture I started from:
![Sardina camera](https://pbs.twimg.com/media/EXzi7cbXkAAA63L?format=jpg&name=large)

And if you're having trouble viewing the pen, here's the end result:
![Sardina camera in CSS](https://pbs.twimg.com/media/EXzi7cUWsAY6fRY?format=jpg&name=large)

👉 [View all my css drawings on CodePen](https://codepen.io/collection/nwzQJq)
👉 [Read my Polaroid tutorial](https://dev.to/fossheim/how-i-recreated-a-polaroid-camera-with-css-gradients-only-4la5)
👉 [Read my Macintosh tutorial](https://dev.to/fossheim/re-creating-a-macintosh-with-gradients-and-box-shadows-25h4)
learning programming with an app is a bad approach
Tags: discuss, android, codenewbie
Published: 2020-05-12 10:01:39

I think that learning to program by using someone's android app is not the best way to learn programming, I once learnt java using an app, only to later find that the person copied the tutorials from some pdf and pasted it in his app. 

The tutorial was in java6, an outdated version of the language, while at the time , java8 was already released.

After studying other programming tutorial apps on the appstore, I realised almost all of them suffered from the same disease.

What do think guys, have you observed something similar, or opposite?
API Calls with retries
Tags: node, api, microservices, javascript
Published: 2020-05-12 09:48:29


*Have you run into a situation when you needed to call a buggy API that responds with an error ever so often? 
What's the solution if you have no control over that API?*
**Retries to the rescue!**

As it happens...
 1. Our `fetchDataWithRetries` function takes in the maxReties (uses 3 as a default value)
 2. When called, this function returns a function and we make use of closure to capture the value of `tries` and `maxTries`
 3. The returned function -  `apicall` - takes in the URL to be called.
	 4. If the response is a success - return it as is
	 5. If there's an error increment the tries, check for max retry limit and recursively call itself

``` 

    const fetch = require('node-fetch');
    
	function fetchDataWithRetries(maxTries) {
		maxTries = parseInt(maxTries);
		if(!maxTries) maxTries =  3;
		let tries =  0;
    		return function apicall(url) {
    			if (!url) return Promise.reject("URL required")
    			console.log("APICALL " + (tries + 1));
    			return fetch(url)
    			    .then(function (res) {
    					console.log("fetch success");
    					return res.json();
    				})
    			    .catch(e => {
    					console.log("Fetch Error")
    					if (++tries < maxTries)
    						return apicall(url);
    					return Promise.reject(e)
    				});
    	    }
   }

 const 	retyCount = 2, APIURL = 'https://jsonplaceholder.typicode.com/users/1';

fetchDataWithRetries(retyCount)(APIURL)
    .then(data => console.log(data))
    .catch(err => console.log(err));
```
6 Cool Projects I Have Developed Using JavaScript
Tags: watercooler, showdev, slimcoder
Published: 2020-05-12 09:27:11

---
title: 6 Cool Projects I Have Developed Using JavaScript
published: true
description: My Personal 6 Projects
tags: watercooler, showdev, slimcoder
cover_image: https://cdn-media-1.freecodecamp.org/images/1*H-25KB7EbSHjv70HXrdl6w.png
---

## Projects List:
* [Whatsapp Bot](#project-1)
* [E-Commerce Website](#project-2)
* [md2Urdu](#project-3)
* [Forum Application](#project-4)
* [Real Time Chat Application](#project-5)
* [Offensive Word Detection](#project-6)
* [Final Note](#project-7)

### 1) Whatsapp Bot <a name="project-1"></a>

Whatsapp bot is developed using Node.js, DialogFlow, and Twilio. 
This project scrapes the web and returns the requested data to the user.

{% youtube -7ULYd8NR4A %}

Don't forget to star/fork and contribute on GitHub.

{% github Techistan/Whatsapp-Bot %}

### 2) E-Commerce Website <a name="project-2"></a>

E-Commerce Website is developed using MERN Stack Technology. This project is a very simple one.

{% youtube szu0xPTtWBA %}

Don't forget to star/fork and contribute on GitHub.

{% github Techistan/E-Commerce %}

### 3) md2Urdu <a name="project-3"></a>

md2Urdu is vscode extension that coverts .md files written in any language to the Urdu language.

This Extension is created by using TypeScript.

{% youtube YjdElOfG-Yw %}

Don't forget to star/fork and contribute on GitHub.

{% github Techistan/md2urdu %}


### 4) Forum Application <a name="project-4"></a>

This project is created by using Electron.js and Firebase.

{% youtube _4UffxFwe9U %}

Don't forget to star/fork and contribute on GitHub.

{% github Techistan/Forum-Application %}

### 5) Real Time Chat Application <a name="project-5"></a>

This project is created by using Electron.js and Firebase.

{% youtube UUulEAaVktA %}

Don't forget to star/fork and contribute on GitHub.

{% github Techistan/Group-Chatting %}

### 6) Offensive Word Detection <a name="project-6"></a>

Last but not least.

This project use for detecting bad words when someone types an offensive word. It detects and converts that word to an asterisk (*).

{% youtube RrDml-SPLic %}

Don't forget to star/fork and contribute on GitHub.

{% github Techistan/Offensive-Word-Detection %}

### 7) Final Note <a name="project-7"></a>

*All the above projects are open source because I <3 Open Source so PR is always welcome.*
Getting Wiser with Pursuing Creative Impulses
Tags: devjournal, codenewbie, womenintech
Published: 2020-05-12 09:23:05

_This post was originally published on May 12, 2020 on [my blog](https://alexlsalt.github.io/blog)._

Here's my learning/progress moment for this morning: Even when I'm struck by the lightning bolt of a great idea, it's not always good to start setting things in motion for that great idea right at the very moment it hits.

Granted, this has been one of the defining factors of my life thus far. I've always believed in the power of feeling the fear and pursuing my creative impulses anyway. They've always led me to amazing places in my life.

But the unfortunate downside to pursuing those creative impulses without proper planning and reflection has always been that they and I get past the honeymoon phase and ultimately fade out, if not mutually deciding to each go our separate ways.

This has happened with projects I still consider near and dear to my heart - the fondest memories of their inception and initial implementation (*pats self on back for that unexpected alliteration*) coupled with that eventual flickering out of that first all-consuming inspiration.

As I get older, I'm realizing that I'm starting to take a step back and give a nod to the longer view of a project idea. If that doesn't work, I just take it to Arthur who gives me a *full* dose of reality by questioning its feasibility.

But the thing is - pursuing those creative impulses in spite of their questionable feasibility basically encapsulates the very idea of enjoying the journey in itself instead of putting off all pleasure until the destination. 

I pursue creative impulses because there's so much to be learned from the process. If it doesn't work out (and, by the way, what does 'work out' even mean??), it's still so, so, so worth it.

Anyway - this morning, I had a wonderful idea for a project I want to launch...

...That is, eventually.

My past self would have surely scraped all current (and not to mention, important) projects to the side in the single-minded pursuit of this Sexy New Idea™. But my present self recognizes the wisdom in taking the time to wrap up her current projects and checking back in with this fancy newcomer after a bit of time has passed.

After all, if it's as much of a winner as I consider it to be right this very second, I know it'll stand the test of a few weeks' time.
Kubernetes CI/CD - my experience
Tags: kubernetes, cicd, docker
Published: 2020-05-12 05:17:06

---
title: Kubernetes CI/CD - my experience
published: true
description: 
tags: kubernetes, ci/cd, docker
---

Kubernetes has been fun to learn!
EXCEPT for CI/CD.

Here's some constructive criticism: Out of all the tools I've tried, they all have such awful developer experience, that after weeks of failed attempts I chose to build my own CI/CD server which I run on my local machine using github webhooks, ngrok, and a thin koa server that runs commands for me.

So far I've tried:

Jenkins X
Jenkins
GoCD
Flux
Brigade
Keel
Spinnaker
GitKube

Maybe it's the fact that I insist on never downgrading from Helm 3, or some of the tools are pretty fresh, but as a developer wanting to get my idea to market, I just don't have time to mess with tools that take multiple days to understand or set up.

I'm writing this as feedback, because I don't think I'm the only one. Something else that desperately needs addressed is that `docker in docker` doesn't just automatically work for building images, which may have contributed to my failed experiences with the tools above.
Photographer Portfolio Style with CSS
Tags: css
Published: 2020-05-12 08:48:45

[Photographer Portfolio Demo](https://heggy231.github.io/chingu-webdev-speedrun-challenge/frontend/photo-portfolio)

To make the text color more blend to its background color, use opacity 50%.

```css
.about-me {
  font-size: 20px;
  opacity: .5;
}
```

- CornflowerBlue and azure color go well together

<p class="codepen" data-height="265" data-theme-id="dark" data-default-tab="html,result" data-user="heggy231" data-slug-hash="mdeKGva" style="height: 265px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="mdeKGva">
  <span>See the Pen <a href="https://codepen.io/heggy231/pen/mdeKGva">
  mdeKGva</a> by Heggyhere (<a href="https://codepen.io/heggy231">@heggy231</a>)
  on <a href="https://codepen.io">CodePen</a>.</span>
</p>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>


- Typeface is another word for Font-style

- To change the entire page's font, select `body` element to style.

- Add background img to your site:

```css

  body {
    background-image: url("https://s3.amazonaws.com/hypnotize_bg.png");
  }

```
Job rejection depression
Tags: career, firstjob, help, beginners
Published: 2020-05-12 08:46:11

---
title: Job rejection depression
published: true
description: How to deal with a job rejection?
tags: #career #firstjob #help #beginners
---
Hello World!

Over the past 2 weeks, I have gone through 3 job rejections for a junior/entry-level developer in all cases going through to the final round but not receiving an offer. It is beginning to take a toll on my confidence in my abilities as a developer. Anyone who has gone through such a phase or could help with some advice and how I can improve in such situations will be greatly appreciated.
How to Set Specific Dimension of Profile Picture in Facebook Graph Api Request?
Tags: backend, facebookgraphapi
Published: 2020-05-12 08:34:02

https://stackoverflow.com/questions/61746510/how-to-set-specific-dimension-of-profile-picture-in-facebook-graph-api-request
Hi, how to Set Specific Dimension of Profile Picture in Facebook Graph Api Request?
any help would be much appreciated.
Win Upto $10K In Bounty for Deploying Solidity Contract on XinFin-XDC Mainnet.
Tags: smartcontract, blockchain, dapps, xinfin
Published: 2020-05-12 08:27:47

If you already have solidity smart contracts, you can deploy them on XinFin.Network to be eligible for free XDC coin bounty. Bounty valid till 30 June 2020. Interesting DApps will have provisions to get marketing grants on top of the bounty.

For more details: https://medium.com/xinfin/win-upto-10k-in-bounty-for-deploying-solidity-contract-on-xinfin-xdc-mainnet-5d154d7656f7
Style healthy recipe site with css
Tags: html, css
Published: 2020-05-12 08:08:56

[Recipe site demo](https://heggy231.github.io/chingu-webdev-speedrun-challenge/frontend/healthy-recipes-project)

Selector for `p` that also have a class of '.cook':

```css
p.cook {
  color: green;
}
```

Select `li` inside of `.ingredients` class and style list item differently than its default value: `list-style`:

```css
.ingredients li {
  list-style: square;
}
```
Managing connections in PostgreSQL
Tags: database, postgres
Published: 2020-05-12 07:41:25

Commands to manage maximum number of connections in a PostgresSQL

### Get `max_connections` value
```
show max_connections;
```

### Updating `max_connections` value
```
alter system set max_connections = 1000;
```
and then restart the service 
```
sudo service postgresql restart
```

### Count number of used connections
```
SELECT sum(numbackends) FROM pg_stat_database;
```

### List all connections

```
select * from pg_stat_activity;
```
New York Blockchain Week Virtual Hackathon with $50K+ in prizes from 12 top projects
Tags: hackathon, blockchain
Published: 2020-05-12 07:23:06

New York Blockchain Week Virtual Hackathon is in full swing! 

<b>Date</b>: May 6 - 27
<b>Sponsors</b>: From the legendary blockchain projects, including Aave, Stellar, Arweave, ETC Labs, Synthetix, Elastos, Sia, REN, Biconomy, PoolTogether, FOAM, Quantstamp, and Uniswap.
<b>Organizers</b>: Gitcoin, [Consensus Distributed](https://www.coindesk.com/events/consensus-2020), and [Ethereal Summit](https://www.etherealsummit.com/)
Check out the challenges and join the hackathon: Click [HERE](https://gitcoin.co/hackathon/new-york-blockchain-week/?tab=hackathon:20)

Hackers will be encouraged to attend Ethereal and Consensus talks. Conference attendees will be encouraged to hack. We can all learn & earn together.

Source: [Gitcoin](https://gitcoin.co/)
The best investment you will make
Tags: career, motivation, beginners, strategy
Published: 2020-05-12 07:19:17

---
title: The best investment you will make
published: true
description: Invest in yourself rather than in the stock market
tags: career, motivation, beginner, strategy
---

The best investment if you are young (not only if you are young) is probably not investing all your money in assets like the stock market.

You probably don't reached the highest potential of your income.

So investing in yourself will probably have an higher effect on your income than investing in assets like stocks or fonds.

If you have higher skills and knowledge on your field, you will earn more money.

I don't say that you should not invest a little bit of your money. I build up financial resource assets since I am 18 years old.

But your biggest asset is yourself. So investing in yourself should be more important to you than investing in other assets. You should always choose investing in yourself before investing in the stock market etc.

In Brian Tracys book "No Excuses" he describes the 3%-formula. He says, that to guarantee your lifelong success, you should make a decision today to invest 3% of your income back into yourself.

So if you are making 10,000$, invest 300$ in yourself.
If you are making 50,000$, invest 1,500$ in yourself.
If you are making 100,000$ invest 3,000$ in yourself.
I think you got the point.

This is definitely something that everybody can apply, no matter how much money they earn at the moment.

Investing in yourself with the 3% rule will increase your income by far more than only 3%. Especially if you are young, your yearly income will increase at a high rate if you put in the effort.
Docker users on Windows, do you use WSL2?
Tags: question, discuss
Published: 2020-05-12 07:17:51

---
title: Docker users on Windows, do you use WSL2?
published: true
description: What are the up and downsides of using WSL2 with docker on windows?
tags: question, discussion 
---

Hi all, A year ago I switched from the MacOS to Windows. In part due my keyboard kept breaking on my €3300 MacBook Pro, but also in part due the promise of WSL. I'm using Docker for about 4 years for development, but it never worked quite right with the original WSL. 

Are there any WSL2 users that use Docker? What is your experience?