teleren/devto huggingface dataset:
Daily Challenge #137 - Help the Bookseller
Tags: challenge
Published: 2019-12-13 16:01:08

---
title: Daily Challenge #137 - Help the Bookseller
published: true
series: Daily Challenge
description: Find all the books of L with codes belonging to each category of M and to sum their quantity according to each category
tags: challenge
---

A bookseller has lots of books classified in 26 categories labeled A, B, ... Z. Each book has a code c of 3, 4, 5 or more capital letters. The 1st letter of code is the capital letter of the book category. 

In the bookseller's stocklist, each code c is followed by a space and by a positive integer n (int n >= 0) which indicates the quantity of books of this code in stock.

For example an extract of one of the stocklists could be:

`L = {"ABART 20", "CDXEF 50", "BKWRK 25", "BTSQZ 89", "DRTYM 60"}`

or

`L = ["ABART 20", "CDXEF 50", "BKWRK 25", "BTSQZ 89", "DRTYM 60"] or ....`

You will be given a stocklist (e.g. : L) and a list of categories in capital letters e.g :

  `M = {"A", "B", "C", "W"}` 

or

  `M = ["A", "B", "C", "W"] or ...`

and your task is to find all the books of L with codes belonging to each category of M and to sum their quantity according to each category.

For the lists L and M of example you have to return the string (in Haskell/Clojure/Racket a list of pairs):

  `(A : 20) - (B : 114) - (C : 50) - (W : 0)`

where A, B, C, W are the categories, 20 is the sum of the unique book of category A, 114 the sum corresponding to "BKWRK" and "BTSQZ", 50 corresponding to "CDXEF" and 0 to category 'W' since there are no code beginning with W.

If L or M are empty return string is `""` (Clojure and Racket should return an empty array/list instead).

*Note:*
In the result codes and their values are in the same order as in M.

***
_This challenge comes from g964 on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Resources for finding remote jobs
Tags: career, beginners
Published: 2019-12-13 15:32:48

After working remotely for 5+ years, here are some recommended resources if you're interested in legitimate remote work opportunities:

## Resources/lists
[900+ start-ups hiring remotely in 2019 (Google Sheet)](https://docs.google.com/spreadsheets/d/1TLJSlNxCbwRNxy14Toe1PYwbCTY7h0CNHeer9J0VRzE/edit#gid=1279011369)

[18 vetted remote job boards](https://careersidekick.com/best-remote-job-boards/)

[Forbes list of 100 remote companies (slightly old - 2018)](https://www.forbes.com/sites/laurashin/2018/01/17/work-from-home-2018-the-top-100-companies-for-remote-jobs/#76f197a976f0)

[100 more companies hiring remotely right now](https://www.outsite.co/blog/remote-companies-hiring)

[Remote job search via LinkedIn](https://www.linkedin.com/jobs/search/?keywords=%22remote%22&location=Remote&locationId=OTHERS.remote)

## FB groups

[Remote nomad jobs](https://www.facebook.com/groups/remotejobsfordigitalnomads/?ref=group_header)

[Remote jobs](https://www.facebook.com/groups/901954586546769/?ref=group_header)

[Digital nomad jobs](https://www.facebook.com/groups/DigitalNomadJobs/?ref=group_header)

[Remote & travel jobs](https://www.facebook.com/groups/RemoteTravelJobs/?ref=group_header)

[Remote jobseekers](https://www.facebook.com/groups/1656684637696507/?ref=group_header)

[Let's work remotely](https://www.facebook.com/groups/letsworkremotely/?ref=group_header)
3 best-read blogs in Angular Weekly #82
Tags: angular, ngrx, rxjs, typescript
Published: 2019-12-13 15:24:42

---
title: 3 best-read blogs in Angular Weekly #82
published: yes
description: Weekly curated blogs and tools for Angular developers. 
tags: angular, ngrx, rxjs, typescript
---

<img src="https://miro.medium.com/max/671/1*T9eAjYxBmznsxzZZq9kT2w.png" />

<h3><strong><a href="https://medium.com/better-programming/how-i-got-rid-of-state-observables-in-angular-2c69cbbbbd0e">1. How I got rid of state observables in Angular</a></strong></h3>

<p><strong>2 minutes —</strong> And I am not going back. <i>By Alessia Amitrano.</i></p>

<h3><strong><a href="https://blog.snowfrog.dev/dependency-inversion-in-angular/">2. Dependency inversion in Angular</a></strong></h3>
<p><strong>3 minutes —</strong> Angular has a powerful dependency injection system. Learn how to use it so that your code complies with the Dependency Inversion Principle. <i>By Philippe Vaillancourt.</i></p>

<h3><strong><a href="https://nirisarri.github.io/2019-12-05-dockerizing-an-angular-application/">3. Dockerizing an Angular application</a></strong></h3>

<p><strong>3 minutes —</strong> In my last project, the UI team decided not to host its Angular app in Docker. I started looking into it, as probably for other projects this will be necessary. <i>By Nicolas De Irisarri.</i></p>

<h2><strong>About the Angular Weekly</strong></h2>
<p><a href="https://www.getrevue.co/profile/AndreyKutsenko">The Angular Weekly</a> is a mailing consisting of the latest blogs and tools curated for Angular pros. I’m <a href="https://github.com/KutsenkoA">Andrey</a>, your curator, working from the Netherlands to help building a cloud platform for front-end developers that is called Jexia.</p>
<br></br>
<p>Do you have a question, feedback or you want to notify me about a recent blog for Angular Weekly pros? Reach out to me via andrey at angular-weekly.com.</p>
3 best-read blogs in React Ninjas Newsletter #82
Tags: react, redux, javascript, typescript
Published: 2019-12-13 15:21:46

---
title: 3 best-read blogs in React Ninjas Newsletter #82
published: yes
description: Weekly curated blogs and tools for React developers. 
tags: react, redux, javascript, typescript
---

<img src="https://miro.medium.com/max/1173/1*z5_qoTNVHDFBUgoBOgULkg.png" />

<h3><strong><a href="https://dmitripavlutin.com/orthogonal-react-components/">1. Everyday React patterns</a></strong></h3>

<p><strong>13 minutes —</strong> I’ve been writing React applications for a few years now, and I’ve noticed that some patterns tend to repeat themselves. In this post, I’ll review these patterns which will summarize about 99% of the React code I write every day. <i>By Lucas Reis.</i></p>

<h3><strong><a href="https://calendar.perfplanet.com/2019/javascript-component-level-cpu-costs/"> 2. JavaScript component-level CPU costs</a></strong></h3>
<p><strong>8 minutes —</strong> Story about how much CPU is consumed by an application’s JavaScript, by framing the discussion around components — the atomic building blocks of the application. <i>By Stoyan Stefanov.</i></p>

<h3><strong><a href="https://gist.github.com/FlorianRappl/23a548aa1d58e14fe00e34011c8fc57a"> 3. Micro front-ends based on React</a></strong></h3>
<p><strong>7 minutes —</strong> In this post I want to shed some light on the topic — having introduced micro front-ends for larger applications in the last 3 years. <i>By Florian Rappl.</i></p>

<h2><strong>About React Ninjas Newsletter</strong></h2>
<p><a href="https://www.getrevue.co/profile/Andres-from-Jexia">React Ninjas Newsletter</a> is a mailing consisting of the latest blogs and tools curated for React pros. I’m Andrés, your curator, working from the Netherlands to help building a cloud platform for front-end developers that is called <a href="https://www.jexia.com">Jexia</a>.</p>
<br></br>
<p>Reach out to me via andres at weekofreact.com, if you want.</p>
3 best-read blogs in Up & Running Weekly #50
Tags: kubernetes, docker, opensource, devops
Published: 2019-12-13 14:50:24

---
title: 3 best-read blogs in Up & Running Weekly #50
published: yes
description: Weekly curated blogs and tools for DevOps, SRE and I&O professionals. 
tags: kubernetes, docker, opensource, devops
---

<img src="https://miro.medium.com/max/1161/1*wX9j8msQbQmpuGLo_nmElw.png" />

<h3><strong><a href="https://platform9.com/blog/stateful-applications-with-kubernetes/">1. Kubernetes stateful applications tutorial</a></strong></h3>

<p><strong>11 minutes —</strong> Learn how to support stateful apps in Kubernetes: K8s storage constructs, how to persist data, Persistent Volumes, PVC, StatefulSet deployments, and more. <i>By Platform9 Systems.</i></p>

<h3><strong><a href="https://engineering.indeedblog.com/blog/2019/12/unthrottled-fixing-cpu-limits-in-the-cloud/">2. Unthrottled: fixing CPU limits in the cloud</a></strong></h3>
<p><strong>5 minutes —</strong> Indeed solved a CPU throttling issue that affects nearly every container orchestrator with hard limits, including Kubernetes, Docker, and Mesos. <i>By Dave Chiluk</i></p>

<h3><strong><a href="https://engineering.linecorp.com/en/blog/building-large-kubernetes-clusters/">3. Building large Kubernetes clusters</a></strong></h3>
<p><strong>6 minutes —</strong> The background of implementing Nucleo, LINE’s in-house Kubernetes-based service, taking care of infrastructure on behalf of developers. <i>By Lee Seung.</i></p>

<h2><strong>About Up & Running Weekly</strong></h2>
<p><a href="https://www.getrevue.co/profile/cloud-architecture">Up & Running Weekly</a> is a mailing consisting of the latest blogs and tools curated for DevOps pros. I’m <a href="https://github.com/snedi">Denis</a>, your curator, working from the Netherlands to help building a cloud platform for front-end developers that is called Jexia.</p>
<br></br>
<p>You have a question, feedback or you want to notify me about a noteworthy blog? Reach out via denis at upandrunningweekly.com.</p>
My year in dev
Tags: myyearindev
Published: 2019-12-13 15:08:54

I came across this awesome tool on [this post](https://dev.to/maurogarcia_19/my-2019-in-dev-2b96) and thought it would be nice to share my stats :)

[My year on dev.to](https://year-in-dev.cephhi.com/stats/dansilcox)

Why not have a go yourself!
Web Development and Trends in 2020
Tags: vue, webassembly, svelte, stencil
Published: 2019-12-13 14:28:38

Things change quickly in web development, thankfully many of us are just as quick in putting out blogs and videos to keep everyone up to do. Below are some videos to get you prepped for 2020.

## My 2020 Guide to Becoming a Web Developer
A general guide on what technologies to learn depending on the path you want to take.

https://www.youtube.com/watch?v=VRxgL0myw1k

## 2020 Top 5 Trends Video
I discuss Static Sites, Serverless, WASM, Vue, Stencil/Svelte

https://www.youtube.com/watch?v=msKQNjbyM80

## Bonus

Comparison of Vue, Angular and React

https://www.youtube.com/watch?v=_EwtLQ7BZkc

Comparison of Svelte and Stencil

https://www.youtube.com/watch?v=Cu-JVd8MKaU

Why Learn PHP in 2020

https://www.youtube.com/watch?v=drVpiBniIKg
Giving Thanks for Diversity in Tech: Eve Porcello
Published: 2020-01-07 00:29:04

---
title: Giving Thanks for Diversity in Tech: Eve Porcello
published: true
date: 2019-12-13 14:00:58 UTC
tags: 
canonical_url: https://www.thisdot.co/giving-thanks-for-diversity-in-tech-eve-porcello
---

![EvePhoto](//images.ctfassets.net/zojzzdop0fzx/59ZZ8wJOWtbjJwJbiZX30I/48f940c996f1600876cc386a364e98fc/EvePhoto.JPG)

Eve Porcello is the co-owner of [Moon Highway](https://moonhighway.com/), a curriculum development company focusing on JavaScript, Node.js, React, and GraphQL as well as a writer for O'Reilly and a video content creator for LinkedIn Learning and egghead.io.

Eve is the co-author of Learning React: Functional Web Development with React and Redux (2017), Learning GraphQL: Declarative Data Fetching for Modern Web Apps (2018), and the forthcoming Learning React: Modern Patterns for Developing React Apps (exp July 2020). Her speaking credits also include talks at OSCON, Reactathon, React Rally, GraphQL Summit, and many more conferences!

When asked about the topics of diversity and inclusion in tech, Eve had a lot to say as a very active speaker and workshop presenter: “Diversity and inclusion are talked about together a lot. Diversity is all about making sure that there are diverse people in the room. Inclusion is all about making sure that everyone is welcomed, supported, and provided with a true opportunity to succeed. I speak and teach workshops at conferences, and many conferences tout their diverse lineups. But often when diverse speakers arrive, they're not provided with enough support. Speakers are excluded from events. Speakers are grilled by audience members who think they don't know enough to be there. Speakers have to pay out of pocket for travel and wait 30, 60, 90 days for reimbursement.”  

But she added that she would love to offer her advice and assistance to anybody looking to get into conference speaking: “If you're interested in speaking at a conference or giving a workshop, I'm always available to help. Find me on Twitter or LinkedIn!”  In fact, speaking and writing are both ways that Eve encourages rising women to learn and grow within tech, saying “ I'd always recommend writing articles or creating video content about your experiences as you learn. This is a great way to prove your expertise and to solidify your learning by teaching.”

If you don’t see Eve at one of her many speaking and teaching engagements, you can find her on the ski slopes, where she loves to push herself to step out of her comfort zone- much like she does when coding and learning about new technologies!

If you would like to keep up with Eve, you can check her out at [@eveporcello](https://twitter.com/eveporcello).
Swinject, protocolos y tipos de datos
Tags: swift, ios, di
Published: 2019-11-24 21:01:39

---
title: Swinject, protocolos y tipos de datos
published: true
description: Una clase sencilla para usar Dependency Injection en swift
tags: swift, iOS, DI
---

En general al empezar un proyecto si tienes la costumbre de crear un singleton para pasar de manera sencilla valores de un lado a otro, en su lugar deberías considerar la inyección de dependencias.

Una forma rápida de lograrlo es usar una librería que implemente ese patron, en nuestro caso usaremos `Swinject` y para hacer las cosas más fáciles de inyectar y pedir al contenedor, haremos uso de el protocolos y una extensión al mismo para que se pueda inyectar desde un `String` hasta una `clase`, `estructura`, `valor de enumeración`, etc.

```swift
// tyoc213

import Swinject

enum InjectName:String {
    case myValue
    case serviceResponse
    case anInt
}

extension Container {
    func resolve<R>(from: InjectName) -> R {
        let r:Inject<R> = resolve(InjectContainer.self, name: from.rawValue) as! Inject<R>
        return r.value
    }
    
    func register<T>(from: InjectName, value:T){
        register(InjectContainer.self, name: from.rawValue) {_ in Inject<T>(value: value)}
    }
}

protocol InjectContainer {
}

struct Inject<T>:InjectContainer{
    var value: T
    init(value:T) {
        self.value = value
    }
}

```

Entonces, una vez creado el contenedor en el appDelegate se puede insertar y extraer datos de la siguiente forma



```swift
contenedor.register(.anInt, 1)
contenedor.register(serviceResponse, someInstance)
contenedor.register(.myValue, "some value")
```

Y para obtener esos datos


```swift
let a:Int = contenedor.resolve(.anInt)
let a:ResponseService = contenedor.resolve(.serviceResponse)
let a:String = contenedor.resolve(.myValue)
```

Se tiene que especificar el tipo de dato en la asignación ya que al ser un `template` necesita resolver el tipo de dato al momento de compilar.
jPrime CFP is open
Tags: cfp, conferences
Published: 2019-12-13 11:09:24

## Call for papers 
__for jPrime conference is now open !__

Submit your talk here https://jprime.io/cfp


__About jPrime__

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

jPrime is a conference with talks on Java, various languages on the JVM, mobile, web and best practices. Its sixth edition will be held on 27th and 28th May 2020 in Sofia Tech Park.

It's run by the Bulgarian Java User Group (http://jug.bg) and backed by the biggest companies in the country.

jPrime features a combination of great international speakers along with the best presenters from Bulgaria and the Balkans. It is divided in two tracks and provides great opportunities for learning, hacking, networking and fun.

We do not cover the plain tickets but we do cover all the diners, the transportation from and to the airport, the hotel and well basically the whole stay here, we even do an networking event after the conference with some sightseeing in our country.

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



__Once again the cfp can be accessed here https://jprime.io/cfp __.

Keep in mind we always HAVE streaming, completely FREE and we always have all the recordings available (so it might help you to apply later to some other conferences like DEVOXX or JOKER) some time after the conference at our youtube channel

https://www.youtube.com/user/BulgarianJUG

And you can check some some conference photos in flickr:  https://www.flickr.com/photos/132936671@N08/albums/with/72157669160528575
What you must know about AWS auto-scaling
Tags: todayilearned, aws, devops
Published: 2019-12-13 13:00:16

*TL;DR style notes from articles I read today.*

### [When AWS autoscale doesn't](http://bit.ly/2PImR3d)

- Scaling speed is limited. If the ratio of your actual metric value to target metric value is low, the maximum magnitude of a scale out event will get significantly limited. 
- Short cooldown periods can cause over-scaling or under-scaling because a scaling event may trigger before a previous scaling event has concluded.
- Target tracking autoscaling works best in situations where at least one ECS service or CloudWatch metric is directly affected by the running task count, the metrics are bounded, or relatively stable and predictable.
- The best way to find the right autoscaling strategy is to test it in your specific environment and against your specific load patterns.

*[Full post here](http://bit.ly/2PImR3d), 8 mins read*

---

### [4 common misconceptions about AWS auto-scaling](http://bit.ly/2RCzIXd)

- Do you think auto-scaling is easy? No, it is not. Maintaining the templates & scripts required for the auto-scaling process to work well takes a significant time investment. 
- It is a myth that elastic scaling is more common than fixed-size auto-scaling. Most useful aspects of auto-scaling focus on high-availability and redundancy instead of elastic load scaling. 
- A common misconception is that load-based auto-scaling is appropriate in every environment. Some cloud deployments will be better off without auto-scaling or on a limited basis.
- There's a delicate balance between perfect base images and lengthy configurations that need to be run in an auto-scale event. This depends on how fast the instance needs to be spun up, how often auto-scaling events happen, the average life of an instance, etc.

*[Full post here](http://bit.ly/2RCzIXd), 6 mins read*

---

### [Autoscaling AWS Step Functions activities](http://bit.ly/38oDVn9)

- Transactional flows are an ideal use case for auto-scaling because of unused compute capacity during non-peak hours.
- When you need to detect any scaling-worthy events, AWS components like Step Functions Metrics and Cloudwatch Alarms come in handy.
- Support a scale-down cool-off time to prevent two consecutive scale-down actions within a certain amount of time.
- Guard your system against any malicious, delayed, or duplicated scaling notifications by validating incoming scaling signals.
- Review historical statistics for scale-down alarms so that they’re less susceptible to triggers and never occur during peak hours.
- For a safe rollout, increment steps till you gradually reach the ideal minimal instance count. 

*[Full post here](http://bit.ly/38oDVn9), 5 mins read*

---

*[Get these notes directly in your inbox every weekday by signing up for my newsletter, in.snippets().](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is)*
The Best Java Frameworks:
Tags: productivity, javaframeworks, java
Published: 2019-12-13 12:50:47

The Best Java Frameworks:

1. Spring MVC
2. Struts 2 Java framework
3. Hibernate Java framework
4. Jsf Java framework
5. Vaadin Java framework
6. Google Web Toolkit
7. Grails Java framework

Depending on the project type, sometimes it is wise to have all the tools under one roof shaking things up, but quite often it makes more sense to trim the fat and go for a light-weighted concept instead.
Another question to ask is whether your busy teammates are up for some learning and have spare time to allocate to knowledge crunch. Often times it’s worth to simply hand over your development to a <a href="https://www.romexsoft.com/hire-java-developers/">Java remote team</a>.

Read more about <a href="https://www.romexsoft.com/blog/7-best-java-frameworks-for-2016/">Java best Frameworks</a>
What was your win this week?
Tags: discuss, weeklyretro
Published: 2019-12-13 12:12:55

---
title: What was your win this week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

👋👋👋👋

Looking back on your week -- what was something you're proud of?

All wins count -- big or small 🎉

Examples of 'wins' include:

- Getting a promotion!
- Starting a new project
- Fixing a tricky bug
- Cleaning your house...or whatever else that may spark joy 😄

![pinwheel-happy-piggy](https://media.giphy.com/media/sTczweWUTxLqg/giphy.gif)
Hello world examples in 10 different languages
Tags: beginners, webdev, examples, programming
Published: 2019-12-13 12:04:52

---
title: Hello world examples in 10 different languages
published: true
description: how to write a hello program in 10 different programming languages.
tags: beginners,webdev,examples,programming
cover_image: https://thepracticaldev.s3.amazonaws.com/i/8w8wg0fyjq1wph54o0tg.png
canonical_url:
---

In this article, you learn about how to write a hello world program in 10 
different programming languages.


### 1. C

```c
#include <stdio.h>

int main(void)
{
  printf("Hello World\n");
  return 0; // ends the program
}
```

### 2. C++

```c++
#include <iostream>
using namespace std;
int main()
{
    cout << "Hello, World!"; // std output stream
    return 0; // exit status
}
```

### 3. C# (c sharp)

```csharp
using System;

namespace HelloWorld
{
    class Hello {
        static void Main(string[] args)
        {      // prints hello world
            System.Console.WriteLine("Hello World!");
        }
    }
}
```

### 4. Java

```java
class HelloWorld {
    public static void main( String []args ) {
        System.out.println( "Hello World!" );
    }
}
```

### 5. Php

```php
<?php
echo "Hello World!";
?>
```
### 6. Python

```python
print('Hello ,world');
```

### 7. Ruby

```ruby
puts "Hello World!"
```

## 8. Scala

```scala
object HelloWorld {
  def main(args: Array[String]): Unit = {
    println("Hello, world!")
  }
}
```

### 9. JavaScript

```js
console.log('Hello World');
```

### 10. Kotlin

```kotlin
fun main(args: Array<String>) {
    println("Hello World!")
}
```

[How to fix the error “Module was compiled with an incompatible version of Kotlin](https://techintra.com/fix-module-was-compiled-with-an-incompatible-version-of-kotlin/)

I hope you learned something new if your favorite programming language is missing in the above list try to add it in the below comments section.
How to remove last character from a string in Swift
Tags: swift, beginners
Published: 2019-12-13 11:42:26

---
title: How to remove last character from a string in Swift
tags: swift,beginners
description: Here is an example that removes the last character from a string.
published: true
canonical_url: https://reactgo.com/swift-remove-last-character/
---

To remove the last character from a string we need to use the `removeLast()` method in swift.

Here is an example that removes the last character `d` from a string.

```swift
var str = "Fun World"

str.removeLast()

print(str)
```

Output:

```swift
Fun Worl
```

>Note: The `removeLast()` method modifies the original string.

Swift version: 5.1