teleren/devto huggingface dataset:
Horizontal and Vertical scaling
Tags: scaling
Published: 2018-11-15 19:51:17

---
title: Horizontal and Vertical scaling
published: true
description: 
tags: scaling
---
Scalability is being able to handle more request and both vertical and horizontal scaling handle these request differently. Horizontal scaling has multiple servers that receive the request but vertical scaling has only one big server that handles them. In this article I’m going to share with you the good and bad of these scaling.

![Alt text of image](https://thepracticaldev.s3.amazonaws.com/i/5hdx2b9l0b4kgzju54e5.png)

Horizontal scaling has what’s called load balancing so if one of the servers fails then the load balancer redirects the request to other servers and if a new server is added the load balancer will start to send requests to it. This ensures that the client request are reliable by sending request to working servers, it’s working efficiently with multiple servers, and it provides flexibility by increasing or decreasing the number of servers.  Since vertical scaling is only one huge server this can’t be done.

The bad thing about vertical scaling is that it has hardware limits. Yes you can add more resources like cpu/ram/disk capacity to your server but it’s not enough if you have large users. This is why horizontal scaling is ideal for big companies because they can add more servers if the demand is needed and its scaled well as users increase.

Now the good thing about vertical scaling is that it has data consistency. This is because there is only one system where all the data resides. Having a horizontal scaling where transaction send data across multiple servers can get complicated and is harder to maintain. This can be impractical especially if you had a transaction where the operation had to be atomic causing it to lock all servers and data.

When deciding which scaling to use its best to decide which one is most suitable for your needs. If you’re running a small company and don’t expect many users/data to increase then having a vertical scaling can be ideal for you. If you’re working with a large company where there are increase in users then using horizontal scaling is the way to go.
Chromostereopsis
Tags: chromostereopsis, illusion, canvas, javascript
Published: 2018-11-15 18:32:23

---
title: Chromostereopsis
published: true
description: a visual illusion whereby the impression of depth is conveyed in two-dimensional color images 
tags: chromostereopsis, illusion, canvas, javascript
cover_image: https://thepracticaldev.s3.amazonaws.com/i/d0bj8vwmq1y83iezdklh.png
canonical_url: https://jsfiddle.net/victorqribeiro/vxf2ajzm/
---


![Chromostereopsis](https://thepracticaldev.s3.amazonaws.com/i/d0bj8vwmq1y83iezdklh.png)

Chromostereopsis is a visual illusion whereby the impression of depth is conveyed in two-dimensional color images, usually of red-blue or red-green colors, but can also be perceived with red-grey or blue-grey images.

The code used to generate this image is [here](https://jsfiddle.net/victorqribeiro/vxf2ajzm/)

You can read more about Chromostereopsis [here](https://en.wikipedia.org/wiki/Chromostereopsis)
General Portfolio Advice for Newbies
Tags: career, beginners, webdev, portfolio
Published: 2018-11-15 18:01:05

Ali has this thread currently going

{% link https://dev.to/aspittel/portfolio-advice-thread-56g9 %}

I would definitely ask a question or peruse the feedback her and others are giving.

I felt like offering a few general pieces of advice based on a lot of portfolios I have seen.

- Portfolio sites are more important than you think. It's hard to stand out as a newbie and this is a great way to demonstrate professionalism.
- When in doubt, stay minimal! Design is incredibly hard. CSS is hard. If you are not incredibly confident in your design skills, do more with less. Even if you are confident, minimalism is definitely appealing.
- Consider forking some else's site if they have offered it up for this. Check out @flexdinesh's great project [Dev Landing Page](https://github.com/flexdinesh/dev-landing-page)
- Keep fiddling and improving your portfolio site. It's a really nice ongoing project. It will not be perfect the first time.
- Think performance! Minimize images, minimize css, JavaScript, etc. Use a hosting service that leverages CDNs. There are lots of them these days. In general, Netlify and others are great products to know about.

Even if design isn't important to your ultimate work, it's important to humans. Impute your value by making smart choices with your portfolio site.

If you are looking for your first dev job, always be shipping software along the way. Don't wait for opportunities to code. Work on your portfolio, work on your personal projects, optimize for presentation value in all aspects of your work.

Your portfolio will become much less important as you progress in your career. On that note, check out [my personal site](http://benhalpern.com).

Oh, one last thing: Make sure to put the [DEV badge](https://dev.to/p/badges) on your site so people know you're part of the community. _I'm obviously biased, but I actually think demonstrating that you're already building your online presence in software communities goes a long way._ 🙂
What am I missing out if I'm not using a VM/Container for my development setup?
Tags: explainlikeimfive, devops
Published: 2018-11-15 17:52:20

---
title: What am I missing out if I'm not using a VM/Container for my development setup?
published: true
description: 
tags: explainlikeimfive, devops
---

_[Originally asked at Laracasts](https://laracasts.com/discuss/channels/servers/what-am-i-missing-out-if-im-not-using-a-vmcontainer-for-my-development-setup)_

---

What up peeps.

For the past few weeks, I've dabbled and played around with Docker and Homestead (_a prepackaged Vagrant box with Laravel goodies_) just to see what's in store. But still, I can't see how much I'm gaining for the effort when my current setup (locally installed PHP7.2+Postgres+Redis etc. on a Linux box which is pretty much identical to my production setup) already works. Can someone fill me in? Maybe I'm looking at it the wrong way.

Thanks for your input!
¿Piensas quedarte en Python 2?
Tags: python, discuss
Published: 2018-11-15 17:29:39

Lo que muchos pensaron que era una broma es al fin oficial. El proyecto Calibre, el organizador y lector de libros electrónicos libre [no va a migrar a Python 3](https://bugs.launchpad.net/calibre/+bug/1714107). Muchos otros proyectos han presentado declaraciones similares, lo cual ha creado rumores de:

1. Un fork de CPython que mantenga el lenguage y la biblioteca como en 2.7.
2. Algo como `from __past__ import x`.
3. Dejar Python 2.

¿Cuáles de estas soluciones crees que sea viable?
Developing Robust Web Apps with JavaServer Faces and Java EE
Tags: java, javaserverfaces, javaee, programming
Published: 2018-11-15 17:29:10

---
title: Developing Robust Web Apps with JavaServer Faces and Java EE
published: true
description: Learn how to use JavaServer Faces, the popular frontend Java EE specification, to build robust and secure web applications.
tags: #java #javaserverfaces #javaee #programming
canonical_url: https://auth0.com/blog/developing-robust-web-apps-with-javaserver-faces-and-java-ee/
---

To see JavaServer Faces and Java EE in action, in this article, you will build a simple microblog web application. Visitor of your application, without having to authenticate themselves, will be able to see every publication that your users add. However, to share their thoughts through the app, first, visitors will have to authenticate themselves through Auth0. The goal here is to have a sample application that is both complete (in the sense of having public and protected views) and easy to grasp (without complex and long source code).

[Read on 🚀](https://auth0.com/blog/developing-robust-web-apps-with-javaserver-faces-and-java-ee/?utm_source=dev&utm_medium=sc&utm_campaign=jsf_javaee)

![Developing Robust Web Apps with JavaServer Faces and Java EE](https://thepracticaldev.s3.amazonaws.com/i/22l9l41dkc74reh2uozm.png)
Windows 10 WSL Ubuntu 18.04 proxy configuration for apt.
Tags: windows, linux, apt, configuration
Published: 2018-11-15 17:13:58

---
title: Windows 10 WSL Ubuntu 18.04 proxy configuration for apt.
published: true
description: Using Windows Subsystem for Linux (WSL) can be a great tool for dev's, op's, and admin's alike.
tags: #windows, #linux, #apt, #configuration
cover_image: https://blog.davidjeddy.com/wp-content/uploads/2018/10/windows10-ubuntu.png
---

<!-- wp:paragraph -->
<p>Using Windows Subsystem for Linux (WSL) can be a great tool for dev's, op's, and admin's alike. The downside often these roles are after larger organization that gave Firewalls and tight proxy security.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>I found myself in this exact situation. The corp. proxy uses a *.pac file script. Nothing in the Debian world does. Ugg. Here is how I got Debian apt to work behind a proxy.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Original Solution Source from the <a href="https://www.linuxquestions.org/questions/debian-26/using-apt-behing-a-pac-http-proxy-592148/">Linux Questions Forums</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:preformatted -->
<pre class="wp-block-preformatted">wget http://some.domain.tld/some-proxy.pac</pre>
<!-- /wp:preformatted -->

<!-- wp:paragraph -->
<p>...or you can probably just open it with a browser.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Look for the proxy address that is used if all other options fail. Typically towards the bottom / in a function call of its own.</p>
<!-- /wp:paragraph -->

<!-- wp:preformatted -->
<pre class="wp-block-preformatted">    function FindProxyForURL(url, host) { return "PROXY proxy.foo.com:8080; DIRECT"; }</pre>
<!-- /wp:preformatted -->

<!-- wp:paragraph -->
<p>Take note of the URL:PORT address.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Finally, put this in your /etc/apt/apt.conf file:</p>
<!-- /wp:paragraph -->

<!-- wp:preformatted -->
<pre class="wp-block-preformatted">    Acquire::http::Proxy "http://proxy.foo.com:8080";</pre>
<!-- /wp:preformatted -->

<!-- wp:paragraph -->
<p>Log out and back in. At this point <code>apt-get update -y</code> and related apt commands should work as expected.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":1173} -->
<figure class="wp-block-image"><img src="https://blog.davidjeddy.com/wp-content/uploads/2018/11/apt-get-update.png" alt="" class="wp-image-1173"/></figure>
<!-- /wp:image -->
Git case sensitive
Tags: git, osx, windows
Published: 2021-03-05 22:47:45

---
title: Git case sensitive
published: true
date: 2018-11-06 00:00:00 UTC
tags:
  - git
  - osx
  - windows
canonical_url: https://www.emmanuelgautier.com/blog/git-case-sensitive
---

Today, I was wondering to know why on the CI pipeline, tests were failing due to missing files but those files are on the file system locally and push on the GIT repository. This issue came from files renamed updating from lowercase to uppercase.

Windows & OSX file systems are not case sensitive. So if you are one user of one of these two operating systems, here the two solutions you can use.

One simple workaround is to use the `git mv` command as follows:

```git
git mv camelcase camelCase
git commit -m "fix camelCase name"
```

Another solution you can use is to configure GIT to be case sensitive with the current files system type.

From this documentation de [git-config](https://gitirc.eu/git-config.html)

> Internal variable which enables various workarounds to enable Git to work better on filesystems that are not case sensitive, like APFS, HFS+, FAT, NTFS, etc. For example, if a directory listing finds "makefile" when Git expects "Makefile", Git will assume it is really the same file, and continue to remember it as "Makefile".

To enable it, assign the value `false` to `core.ignoreCase` config

```git
git config core.ignorecase false
```
Portfolio Advice Thread
Tags: career, beginners, webdev, portfolio
Published: 2018-11-15 16:08:36

---
title: Portfolio Advice Thread
published: true
description: Link to your portfolio and get advice from other devs!
tags: career, beginners, webdev, portfolio
cover_image: https://thepracticaldev.s3.amazonaws.com/i/y6xq8z57mpp7kmcxgid5.jpg
---

Having a [fun portfolio](https://www.alispit.tel/) has been really pivotal for me career-wise. I would love to help some other devs create their own [kickass portfolios](https://dev.to/aspittel/building-a-kickass-portfolio-28ph). I would love to give feedback for anyone who would like some! 

Below, post a link to your portfolio, and, optionally, specific things you would like feedback on.

Other devs, feel free to leave feedback too, just remember to make that feedback actionable and kind!
Generating beautiful HTML forms with FireDrill
Tags: firebase, angular, productivity, materialdesign
Published: 2018-11-15 15:40:14

---
title: Generating beautiful HTML forms with FireDrill
published: true
description: Using FireDrill to generate HTML forms with Material Design styling from Firebase data.
tags: #firebase #angular #productivity #materialdesign
cover_image: https://thepracticaldev.s3.amazonaws.com/i/571uzee2ghyk3axyyslm.png
---

In a previous [Post](https://dev.to/scottlepp/introducing-firedrill---power-tools-for-firebase-g9f) I showed you how to use [FireDrill](https://firedrill.co) to easily find data in your Firebase database. Now I'll show you how you can easily generate beautiful material design based html forms from your data.

Let's do this! Head over to [FireDrill](https://firedrill.co).

See [here](https://dev.to/scottlepp/introducing-firedrill---power-tools-for-firebase-g9f) for how to Connect.


Once you're connected, click **Forms**. Enter your collection that you want to generate a form from, then click **Generate Form**. You will see the form generated below. Notice it will detect the datatypes based on your data and generate the appropriate input.

![gen](https://thepracticaldev.s3.amazonaws.com/i/2h8cxq3gk2p990fv3pb9.png "Generate")

So we see it's generated the appropriate inputs based on the data: checkboxes, text inputs and date pickers are generated. Now we want to move our fields around. Hover over a field to see it's drag indicator.

![drag](https://thepracticaldev.s3.amazonaws.com/i/hahtof5v3mrtbr9526s7.png "Drag")

So I've dragged **available** down to the bottom, and also moved **created** down a bit. 

![drop](https://thepracticaldev.s3.amazonaws.com/i/5g55amho6160a9831n90.png "Drop")

Great, this is the form I want. Now let's **Copy** it so we can add it to an app we are developing.

![copy](https://thepracticaldev.s3.amazonaws.com/i/q9dxgu97i9l3jpni72lm.png "Copy")

That's it! Now the HTML form is copied to your clipboard! Let's paste it into our favorite HTML editor (VS Code for me) and see what it looks like.

![paste](https://thepracticaldev.s3.amazonaws.com/i/leh1vlf5nux0sg5thcpx.png "Paste")

Awesome! In a matter of seconds we've generated a complete HTML form. **NOTE** The form elements use components from [Angular Material](https://material.angular.io/), so you'll need that included in your project.

If you like [FireDrill](https://firedrill.co) show some love and give me a star on [GitHub](https://github.com/scottlepp/fire-drill). Thanks for reading!
I am full-time blockchain developer for 6+ months, AMA!
Tags: ama, webdev, blockchain, javascript
Published: 2018-11-15 15:34:18

---
title: I am full-time blockchain developer for 6+ months, AMA!
published: true
tags: ama,webdev,blockchain,javascript
---

Hey there!

There is so much confusion and hype in the blockchain space. So many different protocols/ideas/test-networks/implementations/tokens/coins BUT it's the most interesting and technically challenging space I have ever been exposed to and I love it! 

I would like to help you jump into the space, explore the tech or just spread some knowledge I acquired in the last year.

PS: I focus mainly on Ethereum blockchain but feel free to ask me anything, I have opinions and understanding of several other blockchains.

Let's do this!
Current State-of-the-Art for LAMP Workflows?
Tags: help, lamp, docker, cicd
Published: 2018-11-15 14:27:29

---
title: Current State-of-the-Art for LAMP Workflows?
published: true
tags: help, lamp, docker, cicd
cover_image: https://thepracticaldev.s3.amazonaws.com/i/h9t6bjesonf3wfckavam.png
---

Hey There, Dev!

What's the current state-of-the-art for LAMP workflows? My client has a small team, and they're currently just uploading files via FTP to a GoDaddy shared server - No source control, no tests, no deployment, just FTP 🤷‍♂️. They also don't have any sort of local development workflow, so no XAMPP/MAMP, vagrant, docker, etc.

In order to open the door to more modern workflows, I want to get them pushing feature branches and opening merge requests on GitLab and have some CI/CD running. I also want to set up some local-development facility so that we don't have to wait for FTP to sync, then fetch static resources from GoDaddy's *ahem* somewhat under-performing servers on each load.

My present thinking is something along the lines of:

- Apache or NGINX in docker serving static files and running PHP
- A separate MySQL container running the database.
    - We'll either instantiate a new DB for each user's local dev box or point the development containers to a development DB server.
- Docker for Mac / Docker for Windows for local dev
    - Or is there some GUI wrapper around docker that would make this a less painful process? I tried Local by Flywheel once and it wasn't half bad.
- GitLab CI to run deployments either to GoDaddy (docker on GoDaddy?) or to one of the cloud providers.

Orchestrating the DB across multiple instances is not a priority at the moment, but if we're going to invest in a more sophisticated workflow than uploading over FTP, we ought to have future orchestration in mind, so what are some common gotchas?

If you were doing this, would you take this approach or another?
What is CORS in Azure?
Tags: azure, api, webdev, cors
Published: 2018-11-15 14:01:51

---
title: What is CORS in Azure?
published: true
description: I recently discovered CORS. Do you know what it is?
tags: #azure, #api, #webdev, #cors
---

I was recently working on a project involving blob storage in Azure. There was something keeping me from uploading my file and it took me forever to figure out what blocked it. It was the freaking CORS settings in Azure. So like a good developer, I went out into the documentation to figure out how to fix it.

After I got my project blob storage working, I realized that even though I had fixed the problem I still didn't know what CORS really was. Now that I kind of know what it is and what it's used for, I'm going to try to briefly explain it to you.

CORS (cross-origin resource sharing) lets you use APIs and data from different origins. An example of this would be using the Google Maps API. You can access that data because they allow your web domain to use it. It also means you'll be able to upload a picture, document, or other data to a blob storage without needing to touch the database first which can be really nice. 

Here's a little background about why CORS is even needed. Most web browsers, like Chrome and Firefox, use a security restriction known as same-origin policy. This blocks a web page from calling APIs in a different domain. The reason we don't want to allow calls from different domains is because of the possibility of cross-site scripting attacks. That could take down your website and compromise your database.

That's why it's important to know about CORS. Let's look at an example. Say you are calling an API from https://google.com on your website https://corsexample.com. The browser will send your request with an origin HTTP request header. Based on the CORS settings for https://google.com, you might be allowed through.

If they have their Access-Control-Allow-Origin CORS setting configured to give your domain access, then you're good to go. If they don't have that setting configured to give you access, then you'll get an HTTP error like a 403 server error.

Here's a simple picture of what happens when you aren't an allowed origin.

![without origin](https://thepracticaldev.s3.amazonaws.com/i/mx142mca3h9giyz6m9er.JPG)

Here's one when you are an allowed origin:

![with origin](https://thepracticaldev.s3.amazonaws.com/i/guevk5k50uxelx1evjbc.JPG)

In practice, it's pretty straightforward to use. All you have to do is update a few lines inside of Azure and you're good to go. You can see more about that in their wonderful documentation: [[1]](https://docs.microsoft.com/en-us/azure/cdn/cdn-cors) [[2]](https://docs.microsoft.com/en-us/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services)

That's what CORS is. It's a defense against scripting attacks that you can make exceptions to. Hopefully this will help you on some of your future projects. At the very least hopefully you could sum up CORS to someone else. Like in an interview…

<hr>

Hey! You should follow me on Twitter because reasons: https://twitter.com/FlippedCoding
Javascript App Advice
Tags: help
Published: 2018-11-15 12:55:36

---
title: Javascript App Advice
published: true
tags: help
---

Hey guys, 

Really enjoy dev.to thank you!

I am a novice programmer, I have C# SQL Javascript experience, but in this past year have improved my javascript knowledge tenfold.


I've been working with and really enjoy Polymer 2, then 3 and now dabbing in a little Lit-html.
However, I am taking a break from the main app, I am planning to build a dashboard PWA for a client.

I can't really find the sufficient tooling in Polymer/webcomponents at the moment to build a 'Wow' dashboard so I am going to be looking at probably some Javacript frameworks.

I haven't ever used any before and wanted to ask for suggestions on what to look at first. I want to use purely Javascript as that is my strong point.

I would also welcome any comments on my approach using Polymer/webcomponents for building my main app, as sometimes I feel like I may have taken the wrong path down a cross road.

Educate someone who feels like he is living under a rock, and doesn't know which way to tunnel.

TIA!
Best materials (free or paid) for learning/understanding .NET
Tags: discuss, dotnet
Published: 2018-11-15 12:28:11

---
title: Best materials (free or paid) for learning/understanding .NET
published: true
description: 
tags: discuss, dotnet
---

Hey there!

I'm looking for good materials for learning .NET. Are there approaches to better understanding the framework/language or just tips on how to learn that you guys would suggest? Is there something i should *unlearn* (besides a bigger emphasis on singletons) since i have a PHP background? Any recommandation would help.

Thanks in advance, guys!
JavaScript problem
Published: 2018-11-15 12:25:21

---
title: JavaScript problem
published: true
description: 
tags: 
---

Problem 1:

Using JavaScript, write a program to calculate the credit card balance after one year if a person only pays the minimum monthly payment required by the credit card company each month.

The following variables contain values as described below:

balance - the outstanding balance on the credit card

annualInterestRate - annual interest rate as a decimal

monthlyPaymentRate - minimum monthly payment rate as a decimal

For each month, calculate statements on the monthly payment and remaining balance. At the end of 12 months, print out the remaining balance. Be sure to print out no more than two decimal digits of accuracy - so print

Remaining balance: 813.41
instead of

Remaining balance: 813.4141998135 
So your program only prints out one thing: the remaining balance at the end of the year in the format:

Remaining balance: 4784.0
A summary of the required math is found below:

Annual interest rate = .12

Monthly interest rate= (Annual interest rate) / 12.0
Minimum monthly payment = (Minimum monthly payment rate) x (Previous balance)
Monthly unpaid balance = (Previous balance) - (Minimum monthly payment)
Updated balance each month = (Monthly unpaid balance) + (Monthly interest rate x Monthly unpaid balance)

JavaScript only, no HTML

File Type: .js