teleren/devto huggingface dataset:
Benefits of cloud services: -
Tags: cloudservices
Published: 2020-08-20 12:19:17

Cloud services can provide your business with many benefits, including lower costs and reduced maintenance requirements (among other benefits). [Cloud services](https://www.cloudanalogy.com/) include web-based email, document collaboration, technical support, database processing, data warehousing, and more. You may ask, "What does 'the cloud' mean? When information is uploaded to Facebook, Twitter, or other websites, it is placed in the "cloud." The same can be said for more formal data, such as medical records, customer information, etc.

More and more companies are ditching outdated hardware and going virtual. It may be time for you to do it too.

**Reduced costs: -**

Basically, cloud computing provides information on demand. This immediacy is in stark contrast to the old ways of slow servers and fallible processors. Since information is no longer tied to hardware, companies no longer need IT services on staff to maintain their data infrastructure. Additionally, most [cloud service providers](https://www.cloudanalogy.com/) offer their own software, deployment, and maintenance.

Also, some companies no longer need to experience increasing difficulties. Staff is no longer limited to available resources or materials. Resources can be better utilized as new hires can find all the software they need in one application.

**Improved scalability: -**

Additionally, companies no longer have to worry about hardware or large databases. The extra space, which was previously used to house databases or computers, can be used for other, more lucrative purposes. Businesses can also expand processor and RAM capacity easily and affordably while keeping the specific business applications needed at their fingertips. This can be particularly beneficial for businesses that grow and decline seasonally.

**Faster implementation: -**

The time it takes for a service provider to move all of its existing information, deploying it in the cloud, is minimal compared to the time it takes to replace or upgrade outdated hardware. Also, no further updates or replacements will be necessary. In other words, it's fast and one-time deployment, with minimal downtime (if applicable) for maintenance. For many companies, all corrections can be made with a single phone call or an online ticket request.

**Additional advantages: -**

With cloud services, energy and maintenance demands will be drastically reduced. In the event of a failure, external databases will automatically switch to disaster recovery and restore your data to a separate facility. These additional features may vary by the service provider and specific data center.

For more information about the cloud services and its several benefits do visit cloud analogy a [salesforce development company.](https://www.cloudanalogy.com/)
UX'ing that Copy and Paste
Tags: haxtheweb, javascript, security, ux
Published: 2020-09-11 19:22:11

Following up on our previous post detailing how we do word clean up, let's look deeper into the different considerations involved with a simple copy and paste in our editor HAX.

## HAX considerations
These are some special goals / considerations we go through for copy and paste operations.
- User can copy & paste from anywhere
- User expectation is to copy rich HTML structure and obtain similar
- User doesn't want to be touching code / cleaning up styles, classes, etc
- HAX wants to manage accurate structure yet HIGHLY cleaned, professional code

## Where we are
Because of the workflow involved this is a bit easier to see in action so I can discuss the different considerations and how they play out in the DOM. Check out this video stepping through the [code found in this link](https://github.com/elmsln/lrnwebcomponents/blob/master/elements/hax-body/lib/hax-store.js#L970-L1144).

{% youtube 0RimAy9hMM8 %}

## Where we need to be
We still haven't gotten undo/redo history alignment down. Need to be able to do:
- Insert HAX capable `video-player` via drag and drop
- Insert URL and convert to `video-player`
- Edit a paragraph and type fluidly without knowing a `p` tag powers it
- Copy and paste from anywhere to anywhere
- Undo and redo these operations with 100% accuracy

Ideas and discussion VERY welcome for how to do that undo/redo business. I'm very much mentally shot from school at home life and struggle to think deeply enough as to how to tackle that one right now. We'll figure it out some day, and then I'll write about it and do another video though :).
Understanding Arrays in JavaScript...
Tags: javascript
Published: 2020-09-11 17:25:04

#**What is an Array?**

We can use Arrays to organise data in JavaScript by making lists. Arrays can store any data types _(strings: "Hello!", integers: 5, booleans: false)_ and we can also use keywords _(let or const)_ to declare a variable and save it to an array.

#**How does an Array work?**

Arrays are represented by square brackets _[ ]_ and content inside _(elements)_. Every element within an Array has a numbered position known as index. This means the positions start counting from 0 rather than 1. 

For example: 
1. Below, I have created an array called _javaScript_. _javaScript_ is an array that has 3 elements.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3kp5yfdsvdv2pqozon2b.PNG)
2. The first element within an array is always at position [0]. The second element is at position [1] and the third element is at position [2].

3. Logging javaScript[1] to the console will access the element at index 1. _// output: arrays_.


#**Other cool things we can do...**

Did you know that we can also access individual characters in a string using bracket notations and the index?

_For example:_ 

let challenge = '100 days of Code';
console.log(challenge[10]);
//output: C


Did you know that we can update elements within an array?

_For example:_
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cm72zuf2r99kjo7rkzdi.PNG)

Another cool thing are Array methods: 
 
1. For example, we can use avengerCharacters.push('Black Panther') to push the element into the array, meaning adding 'Black Panther' to the list. 

2. We can use avengerCharacters.pop('Iron Man') to pop the element out of the array, meaning removing 'Iron Man' from the list. 

3. Array methods are a cool, quick and easy way to complete tasks. You can find more methods and explanations of each here: 
https://www.w3schools.com/js/js_array_methods.asp#:~:text=%20JavaScript%20Array%20Methods%20%201%20Converting%20Arrays,delete%20may%20leave%20undefined%20holes%20in...%20More%20

    or here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
How did I crack a bunch of FAANGs, and if I could do it, you can do it too!
Tags: career, architecture, computerscience, productivity
Published: 2020-09-11 19:10:49

I was lucky enough to crack a bunch of good companies, like Google, FB, and some more. Thought of putting down my preparation strategy and hopefully it can help someone.
Have a look @ https://www.codekarle.com/blogs/
Algorithms exercise: “find removed sequence item” and more
Tags: algorithms, interview, puzzler, leetcode
Published: 2020-09-11 19:02:45

You have an array with integers sequence from `1` to `1000`:

```
[1, 2, 3, 4, 5, ..., 1000]
```

# 1. Easy

An item with value `x` was removed, so the array became like:

```
[1, 2, 4, 5, ..., 1000]
```

Then the array was shuffled. How to find `x` in `O(n)` time and `O(1)` memory?

# 2. Harder
An item with value `x` was replaced with `x - 1` so the array became like:

```
[1, 2, 2, 4, 5, ..., 1000]
```

Then the array was shuffled. Again, you need to find `x` in `O(n)` time and `O(1)` memory.

# 3. Hard
And item with value `x` was replaced with `y` where `y` is any integer from `1` to `1000`, so the array became like

```
[1, 2, 9, 4, 5, ..., 1000]
```

or

```
[872, 2, 3, 4, 5, ..., 1000]
```
or even

```
[1, 2, 3, 4, 5, ..., 999, 214]
```

As usually, the array was shuffled, and your task is to find `x` and `y` in `O(n)` time and `O(1)` memory.

# Happy coding!
Answers will be published soon.
Go For It!
Published: 2020-09-11 19:00:32

The programming world is full of experts, semi-experts and brand new folks.  No matter where we find ourselves today, we will always digress to being new at something we're doing.

**Set Yourself Apart**

Studying is the key to climbing up the ladder. When our study is coupled with lab time we are exposing ourselves to having to synthesize the theory (reading) part. 

It is the lab time which drives home the concepts and allows us to create our own internal way of remembering things. Kind of like a mnemonic does. 

For example when lamba expressions first came out someone had already adopted a way to speak what it did.  Like this:

```typescript
 collection.map(item => function2(item));
```
The code above could be spoken as "for each item in collection, go to function2. By being able to "speak" the code we are able to synthesize this pattern any time we want to "speak".

What doesn't happen when we exclude lab time, is that we understand but can't "speak". For programming circles that's not good.

We know we are on the path when we do things like establish consistent patterns. One of them is good naming conventions. Here's a better example.

```typescript
 telephoneNumbers.map(number=>
  leaveMessage(number));
```
The function above leaves no ambiguity to programmers now or in the future. It's self documenting in a way.

**Typescript**

The huge advantage with TypeScript is that it is self-documenting and self-discoverable.  Just right click on any function and we can find all references as well as navigate immediately to the definition!

**JSDOC**

The advantage of JSDOC is that the user of our components will see the description when hovering over the function or property.  This allows us to put in dependencies and explain what each does in a more natural "spoken" manner. 

**Lab Time**

If we spend 6 hours a day inside of the Chrome Debugger, we are forced to pick up deep understanding. It's one thing to write code another to debug it. Favor lab time over just study.

**Manual Test Time**
Always retest all changes. For example, we may make a simple CSS change. But unless we test all components that use it we have no idea what that change may foul up.  

**Automated Test**
Yes, but... It's almost a total separate development effort. Cypress is one of the best right now, it makes automation work easy. But unless you are writing in depth automation tests, they are mostly acting as a Smoke test. Smoke tests are good for regression only. They identify things that once worked but do not work now.

**Summary**

That's how we set ourselves apart, but the problem is often we don't have the time to do these things.  The real issue; however, we don't have the time to ignore them. Do yourself a favor and stick to your lab proved ways of doing things that work for you.
Themeable React Monopoly board
Tags: react, showdev
Published: 2020-09-10 23:35:51

![Game board](https://www.coderdreams.com/wp-content/uploads/2020/09/monopoly_screenshot.png)

I’ve been working on a Monopoly game with a customized rule set and more gameplay options for players to try different strategies. I feel the standard rules make the game mostly based on luck.

It’s been a lot of fun so far mostly because it’s different from the stuff I usually work on and I’ve been learning a lot. Specifically React, CSS grid/flex, NodeJS, Express, Socket.IO, and more. *I think the biggest challenge is getting the networking code to work right and to deal with slow/lagging connections, disconnects, and so on.*

# Live Demo

I want to share some early React/CSS code for displaying the game board, [you can see it here.](https://romansery.github.io/react-monopoly-board/)

You can also find the [full source here](https://github.com/RomanSery/react-monopoly-board)

# Planned game features

One of the features of the game will allow players to create and save their own themes. Other players will be able to select from a list of existing themes. The demo is NYC-themed and you will be able to create your own by giving custom names to the squares.

Instead of having the player that lands on a square immediately purchase it, there will be a new auction system. There will also be more trading and negotiation possibilities between players including loans and rent forgiveness. 

If you’re familiar with RPG video games, there will be some elements of that as well. Similar to collecting $200 when you pass GO, each player will also receive ability points they can put into a variety of categories.

# About the code

The <mark>GameBoard</mark> component renders a set of <mark>GameSquare</mark> components. Each square is assigned an id that used to lookup configuration data. <mark>SquareConfigData</mark> configures various properties for each square such as color, position, type, and group.

The components in the squares folder are different display implementations that are used by the different square types. 

To change the theme data, just change the names in <mark>NyThemeData</mark>.
Unity Ads Tutorial / Monetize Your Game Under 5 Min
Tags: monetize, ads, unity3d, money
Published: 2020-09-11 18:47:04

In this short tutorial I'll explain how you can add ads to your Unity App in under 5 minutes so you can start monetize your game and make money

Next video will be strategies to place ads in your game for maximum profit!

{% youtube S2GqHBjzkCU %}

> Like this post? 
> Consider Support me via [Patreon](https://www.patreon.com/eranelbaz)
> Or Subscribe to my [YouTube Channel](https://www.youtube.com/channel/UCVUNeBGM5wZJKcOx0QwAaTA?sub_confirmation=1)
> You can also follow me on [Twitter](https://twitter.com/elbaz_eran)
DevHub
Tags: actionshackathon
Published: 2020-09-11 18:46:04

 GitHub Actions x DEV Hackathon


### My Workflow
DevHub A Social network for developers, It is a MERN stack based social network app that includes authentication, profiles and forum posts. 


### Submission Category: 

DIY Deployments, Phone Friendly and Wacky Wildcards


### Yaml File or Link to Code
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/nd2txkfawuv79yreaf65.png)

{% github https://github.com/Akanksha-P97/DevHub %}
"while loop developer" how to use pug/jade, scss, javascript, python(backend) - (Stack Tutorial 2)
Tags: pug, scss, javascript, python
Published: 2020-09-11 18:40:56

---
title: "while loop developer" how to use pug/jade, scss, javascript, python(backend) - (Stack Tutorial 2)
published: true
description: 
tags: pug,scss,javascript,python
//cover_image: https://direct_url_to_image.jpg
---
Hi guyes,
This is tutorial 2,
The previous tutorial we have learnt how to use for loop pug/jade, scss, javascript, python(backend) [Here you can see](https://dev.to/nikhilroy2/for-loop-developer-how-to-use-pug-jade-scss-javascript-python-backend-stack-tutorial-1-3h3p)
This tutorial we will use basic **while loop** in our stack web development.

**1. PUG/JADE**
In this pug/jade tutorial we can use this pug to html converter for practice purpose [PUG TO HTML](https://pughtml.com/)

*Example 1*
```
- var i=0
ul
 while i < 10
  li= i++
  

```
**2. SCSS**

*Example 1*
```
$border: 1;
@while $border < 10+1{
    li:nth-child(#{$border}){
        border: #{$border}px solid red;

    }
    $border: $border+1
}

```

**3. Javascript**
while loop
*Example 1*

```
let li = document.querySelectorAll('li');
let i = 0;
while(i < li.length){
    li[i].style.color = 'yellow';
    console.log(i)
    i++;
}
```

while loop with do (js)
*Example 2*


```
do{
    li[i].style.color = 'yellow';
    console.log(i)
    i++;
}
while(i < li.length)

```
"do" and while is very simple to use and the "while" making the condition and the "do" execute the callback.

Finally, Python
**4. Python**

*Example 1*

```
count = 0
while count < 10:
    print(count)
    count+=1

```

It almost looks little same as javascript but python has only 2 primitive loop
* For
* while

This is my sort tutorial hope you like it.
if you like this sort tutorial please like, comments.
Thanks.
Developer Dictionary: Client Server Pattern
Tags: beginners, computerscience, codenewbie, firstyearincode
Published: 2020-09-11 18:36:27

This post is part of a resource called Developer Dictionary. More about why I'm writing this [here](https://connectthedots.dev/developer-dictionary/)

***

Client, server, frontend, backend, fullstack, request, response, website, web application — all of these terms are used very frequently in the world of web development. And if you're been learning programming for the web, even few weeks, you've probably been exposed to these terms. Here I illustrate what these words mean so you have a clear picture of the concepts behind the words and how they relate to the structure of the web.

**What is the Client Server Pattern?**

We can think of a server as a computer that holds data related to our website and code that reads/writes that data. A client is another computer that has a browser — a program capable of running code on behalf of the user (usually Javascript code) and making requests to the server. Server awaits and responds to client requests. One server serves many clients.

The same client could communicate with multiple servers. And the same computer can act both a s client and as a server. These are roles played with the computer based on the context. For example, when you're programming locally and you run a server on your computer and your browswer acts as the client (If you're ever typed localhost in your broswer you know what I mean).  [Continue Reading](https://connectthedots.dev/client-server/)
Top 5 Things NOT to Say in a Job Interview
Published: 2020-09-11 18:25:32

 Top 5 Things NOT to Say in a Job Interview 👇

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0puyimbrhn2zxqy42j19.JPG)

Few of us enjoy job interviews. But if you’re going to land your dream job – whether it's a junior role or senior.

key phrases that will invariably mess up your chances, the moment you say them.

>five key sentences to avoid, why they’re so inappropriate, and what to say instead.

# 1. “I want this much money”

Yes, many employers are out to pay you as little as possible. 

Yes, you should be forthright and not accept less than what you’re worth. 

But that doesn’t mean you should start laying down red lines before you’ve even got the job.

That attitude of ‘How much are you going to pay me?’, right away, immediately puts me off interviewing someone.

The problem is that some people who are just graduating often think they’re much better than they really are. But even with a four-year degree, they’re really not.

# 2. “I think my work speaks for itself”

If you’ve been asked to interview, it’s a likely sign that someone’s impressed with your portfolio. Good job. 

But that’s only got you to the first stage. 

To succeed at the interview, you’ve got to explain the thinking behind your work,

the challenges you faced and how you overcame them.

If you fail to grasp this, and wrongly assume that your work “speaks for itself.

“At the interview, we look for people who can articulate their creative process, describe the challenges they’ve experienced.

# 3. “I actually don’t know much about the company”

if you walk into an interview showing that you’ve made little effort to research your prospective employer, 

why on earth would they think you’re going to make any effort as an employee? 

So get creative with Google read about the company

# 4. “No, I don’t have any questions”

Towards the end of the interview, you’ll be asked if you have any questions. “And the worst thing you can say is NO

“Make sure you have some questions up your sleeve, to show you’re interested in the job and company.”

You think that if you’ve read the company properly beforehand, you shouldn’t have anything left to ask,

but that's a mistake. 

Your research doesn’t reduce the number of questions you can ask at the interview, it simply gives you a chance to ask more intelligent and good ones.

# 5. “Yes, I can do that” (when you can’t)

In interviews, you should always sell yourself, exude confidence, and project an image of positivity. 

But in doing so, it’s easy to get caught up in your own hype and start exaggerating what your abilities and skillset actually are.

“I think the worst thing you can say in an interview is something that’s untrue because if they sense you’re talking crap, you just look even more under-experienced,” 

“It’s much better, to be honest, and say you don't know 

Hope this helps you 💙👍
JavaScript snippet: get trailing information after ("/", "-", "etc")
Tags: javascript, typescript, snippet
Published: 2020-09-11 18:24:10

---
title: JavaScript snippet: get trailing information after ("/", "-", "etc")
published: true
description: Javascript function to find trailing url
tags: javascript, typescript, snippet
//cover_image: https://direct_url_to_image.jpg
---


Recently I've been working on a job board website. It has URL structure as follows: "job/shopify-rails-junior-dev-4d5as18184das". Everything after last dash(-) is id in the database about this specific job ad. To extract it I wrote a short and simple function that allows you to get everything after the last slash, dash, etc.

### Javascript:
```
const test1 = "/shopify/php-programmer-4781"
const test2 = "/shopify/rails/1351"

function getTrailingId(punctuation, str)  {
    const trailingId = str.substr(str.lastIndexOf(punctuation) + 1)
    return trailingId
}

getTrailingId("-", test1) // 4781
getTrailingId("/", test2) // 1351
```

### Typescript:
```
const test1 : string = "/shopify/php-programmer-4781"
const test2 : string = "/shopify/rails/1351"
 
function getTrailingId(punctuation: string, str: string) : string {
   const trailingId : string = str.substr(str.lastIndexOf(punctuation) + 1)
   return trailingId
}
 
getTrailingId("-", test1) // 4781
getTrailingId("/", test2) // 1351

```
Leetcode September Day11
Tags: python, computerscience
Published: 2020-09-11 18:15:30

Question - Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product.

"""
Input: [2,3,-2,4]
Output: 6
Explanation: [2,3] has the largest product 6.
"""
Naive Solution - 
Iterate over all possible sub arrays and return the maximum.
Code - 
```
def maxProduct(self, nums: List[int]) -> int:
        ans = float('-inf')
        for i in range(len(nums)):
            for j in range(i, len(nums)):
                ans = max(ans, reduce(lambda x,y: x*y, nums[i:j+1]))
        return ans
```
Time Complexity = O(n^2)

A better solution is to maintain two variables, to store maximum and minimum product ending at current position.
Then we traverse the array once and for every index i in the array, we update the maximum and minimum product ending at A[i]. We update the result if maximum product found at any index is greater than the result.

```
def maxProduct(self, nums: List[int]) -> int:
        # to store the max and min ending till the previous index.
        max_ending, min_ending = 1, 1
        # to store the maximum result so far
        max_so_far = min(nums)
        for num in nums:
            temp = max_ending
            # update the max product ending at current index
            max_ending = max(num, max(num * max_ending, num* min_ending))
            # update the minimum product ending at current index
            min_ending = min(num, min(num * temp, num * min_ending))
            max_so_far = max(max_so_far, max_ending)
        return max_so_far
```