teleren/devto huggingface dataset:
How to avoid mocking repository for Unit Tests
Tags: design, testing, csharp
Published: 2020-06-12 12:47:10

---
title: How to avoid mocking repository for Unit Tests
published: true
description: Try to push your impure dependencies outward as shown here.
tags: design, testing, csharp
---

### I commonly see code written like this, even in courses.

```csharp
public class DeskBookingProcessor
{
  public readonly IBookingRepository _bookingRepository;
  public readonly int _capacity;
  
  public async Task<Booking?> Book(BookingRequest request)
  {
    var currentBookings = await _bookRepository.GetBookingsAsync(request.Date);
    if (currentBookings + 1 > _capacity)
    {
      return null;
    }
    else
    {
      var booking = new Booking(request);
      await _bookingRepository.SaveAsync(booking);
      return booking;
    }
  }
}
```
The drawback is you have to mock a whole IBookingRepository (Even the methods this feature doesn't use) to test your booking logic.

### Alternatively, you could do this

```csharp
public class BookingAgent
{
  public Booking? Book(BookingRequest request, int currentBookings, int capacity) =>
    currentBookings + 1 > capacity
      ? null
      : new Booking(request);
}
public class DeskBookingProcessor
{
  public readonly IBookingRepository _bookingRepository;
  public readonly int _capacity;
  
  public async Task<Booking?> Book(BookingRequest request)
  {
    // Impure Collect
    var currentBookings = await _bookRepository.GetBookingsAsync(request.Date);
    var agent = new BookingAgent();

    // Pure Calculation
    var booking = agent.Book(request, currentBookings.Count(), capacity);

    // Impure Commit
    if (booking != null) await _bookRepository.SaveBookingAsync(booking);

    return booking;
  }
}
```
Now your unit tests don't need to mock impure dependencies, just test the BookingAgent by passing the parameters.

Leave it to your integration tests flex the combination of the pure logic and impure dependencies. Prefer the kind that stand up a whole test server and send HTTP requests and check HTTP responses. 


That is all.
New Web Developer Skills You Probably Don’t Have
Tags: career, freelancing, git
Published: 2020-06-13 18:57:05

---
title: New Web Developer Skills You Probably Don’t Have
description: These are critical skills you'll need for a web development career that are often missed in bootcamp, university, or if you're self-taught.
published: true
date: 2020-06-12 12:44:00 UTC
tags: career,freelancing,git
canonical_url: https://raddevon.com/articles/new-web-developer-skills-you-probably-dont-know/
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/9p9wqbiqefzb4pc4rr8f.jpg
---

{% youtube Tl1r1eUOWG8 %}

Video Notes
-----------

You know about a lot of the skills you’re going to need to be a web developer. You’ll want to know how to write HTML and CSS, declare variables, write functions, use object-oriented programming, and so on. In this video, I’m focusing on **skills you may not have** – skills [bootcamps](https://raddevon.com/articles/i-graduated-coding-bootcamp-now-what/) and university programs don’t often teach and that you wouldn’t be likely to seek out on your own if you’re self-taught.

What did I miss? Please let me know in the comments!

The best way to put your skills to a practical test and get started in web development (unless you have a way to conjure up 3 years of experience out of thin air) is to try freelancing. I have [a short email course](https://raddevon.com/enroll-in-the-freelancing-crash-course/) that will help you start your freelance web development business!
Data Science Master Coaching
Published: 2020-06-12 12:38:50

Ever questioned how Google, Yahoo, and other serps pull out information from the millions of websites online? All coaching comes with multiple tasks that completely test your expertise, learning and practical knowledge thus making you fully business-ready. With this Information Science Training In Hyderabad, students will get to build knowledge of basics ideas like statistics, R & Python programming to advanced ideas of AI, Machine Learning, Deep Studying & TensorFlow.

With the arrival of Synthetic intelligence, the importance of massive data analytics goes to grow as the machines would not be capable of draw inferences and that is one thing that might stick with the people to decide. You may have excellent and in-depth information about Python and the choice options you taught me. I'm delighted to share my opinion about my experience.

A Information Scientist is somebody who extracts the info , cleans it, manipulates it, visualizes it , and explains it to a non technical viewers, such that actionable data can be utilized by the business. Upgrade yourself by attending this information science course in Hyderabad It's taught by an professional teacher who can also be a real time knowledge scientist.Anyone can be a part of this coaching , irrespective of your background.

By the point of course completion, we suggest our college students profiles to these corporations and put together them for the interviews by conducting multiple mock interview classes. Basic commencement is ok to learn Knowledge Science. Information Science has now become a serious necessity for businesses no matter its size. Being a pioneer in the subject of delivering trade related Information Science Coaching In Hyderabad, we've got efficiently made tie-ups with many reputed firms and start-ups. <a href="https://www.excelr.com/business-analytics-training-in-bangalore

">Business Analytics course</a>   


Apply the concepts gleaned in this course and get recognized in the knowledge science certification demonstrates your proficiency in advanced drawback fixing with essentially the most sophistical technology out there. Data science is a specialised discipline that includes a number of areas equivalent to arithmetic, statistics, clever knowledge seize techniques, data mining, knowledge cleaning and programming to arrange and align huge knowledge for analysis to extract info and insights.

We are located at : 
Location : 
ExcelR - Data Science, Data Analytics Course Training in Bangalore
49, 1st Cross, 27th Main BTM Layout stage 1 Behind Tata Motors Bengaluru, Karnataka 560068
Phone: 1800-212-2120/ 070224 51093
Hours: Sunday - Saturday 7AM - 11PM
Placeholder title
Tags: gftwhackathon
Published: 2020-06-12 12:36:15


## What I built
GIF gallery for artist that create GIF's.


## Demo
 https://friendly-easley-538121.netlify.app/

## Link to Code
https://github.com/rish18/coil-hackathon


## How I built it 

simple HTML,CSS and Javascript.
gRPC Java Complete Tutorials
Tags: grpc, microservices, protocolbuffers, tutorial
Published: 2020-06-12 12:24:31

✅ gRPC Complete Course of Video Series✅ 

1 ► gRPC Intro: https://youtu.be/TagQoZhMhG8
2 ► API Types in gRPC: https://youtu.be/p-H9T-2lat0
3 ► gRPC Java API Project Setup: https://youtu.be/TR-otP45eYU
4 ► gRPC Service Implementation: https://youtu.be/SV3xgZjiCYI
5 ► gRPC Server Implementation & gRPC Client Implementation:https://youtu.be/J0AMX9YpdLk

✅ Protocol Buffers Videos✅
--------------------------------------------------
► Intro to Protocol Buffers:  https://youtu.be/P5Ynn8stfnc
► Protobuf with Spring Boot : https://youtu.be/OX9YDqu-lbo
Day 1: Data Types
Tags: beginners, python
Published: 2020-06-12 12:18:16

Python datatypes include: str(string), int(integer), float(float) and bool(boolean). Compared to Java they are few and more manageable (in my opinion) so the challenge was testing accepting input of various types and them printing out the sum of the output. For strings we concatenate while for integers and floats, we add the mathematically. All these are done using one operator; the ‘+’ sign.

One tip I learnt to help with knowing the data type in python is:
``` python
name = 'Muna'
type(name) #result = <class 'str'>
```

It saves you a lot of time.
My code was as follows:
```python
i = 4
d = 4.0
s = 'HackerRank '
# Declare second integer, double, and String variables.
i_2 = int(input())
d_2 = float(input())
s_2 = input()
# Read and save an integer, double, and String to your variables.
# Print the sum of both integer variables on a new line.
print(i + i_2)

# Print the sum of the double variables on a new line.

print(d + d_2)
# Concatenate and print the String variables on a new line
# The 's' variable above should be printed first.

print(s + s_2)

# Sample Input: 
# 12
# 4.0
# is the best place to learn and practice coding!

# Sample Output
# 16
# 8.0
# HackerRank is the best place to learn and practice coding!
```
This challenge was testing one's skills on input and output, data types and also how to use the '+' operator for mathematical operations as well as concatenating strings.
Road to Genius: beginner #10
Tags: javascript, beginners, computerscience
Published: 2020-06-12 12:10:08

Each day I solve several challenges and puzzles from Codr's ranked mode. The goal is to reach genius rank, along the way I explain how I solve them. You do not need any programming background to get started, but you will learn a ton of new and interesting things as you go.

![programming challenge](https://dev-to-uploads.s3.amazonaws.com/i/3aceuzbn00z86828pulb.png)

This challenge starts with the declaration of a function `mystery`, with one parameter `arr` which is likely an array. After the function it creates an array, then calls the function, whose result goes into variable `A`. Fortunately we don't have to calculate everything this code does, but only have to fix two bugs (😈 and 🚀). To find 🚀 you can analyze the first three lines of code of the function, it starts with initializing variable `S=0`, then later we see `🚀 += i`, so 🚀 is likely going to be `S`. Then the next line is `S /= arr.😈;`, 😈 seems to be a property of the array object, the only valid property from the answers seems to be `length`.

![programming challenge answer](https://dev-to-uploads.s3.amazonaws.com/i/op8mj1kiam6p1qh4ju6h.png)

If you analyze more closely at what `mystery` actually does: it's summing all values from `arr` into `S`, and then it divides this sum by the length of the array. In other words it's computing the average value of all the numbers in `arr`.

---

If you feel inspired and motivated to upgrade your coding + debugging skills, join me on the Road to Genius at https://nevolin.be/codr/
TerminusDB Webinar - TerminusDB Roadmap
Tags: database, product, development, agile
Published: 2020-06-12 12:09:24

---
title: TerminusDB Webinar - TerminusDB Roadmap
published: true
description: Have you seen our videos about our roadmap? It's cute and informative about how our personal experienced using TerminusDB. Do you want to know the making of it? How it guided us in our development? And maybe how to apply this in your team as well? This week we will have our Director Of Services talking about how to make all these "episodes" to guide development and why is it good practice.
tags: database, product, development, agile
---
Have you seen our videos about our roadmap? It's cute and informative about how our personal experienced using TerminusDB. Do you want to know the making of it? How it guided us in our development? And maybe how to apply this in your team as well? This week we will have our Director Of Services talking about how to make all these "episodes" to guide development and why is it good practice.
Daily Developer Jokes - Friday, Jun 12, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-06-12 12:00:28

---
title: "Daily Developer Jokes - Friday, Jun 12, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Friday%2C%20Jun%2012%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258c4f0d26.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What is a computer virus?

___A:___ A terminal illness!
 -->
CodepenChallenge GSAP Bubbling: Bubble Launcher
Tags: codepen, vue, javascript, showdev
Published: 2020-06-12 11:38:43

<p>Click on the screen to launch bubbles.</p>

<p>There are 4 steps in launching, just hold the mouse on the screen, then the bubble will charge.</p>

<p>Step 1 has only 1 bubble to release.</p>

<p>Step 2 has 4 to 8 bubbles.</p>

<p>Step 3 has 8 to 16 bubbles.</p>

<p>Step 4 has 32 to 64  bubbles.</p>

<p>Speed and angle of release will also vary on how you charged it. Of course full charge should be the most satisfying (in my opinion).</p>

<p>I used VueJS in javascript codes. GSAP and plain CSS for animations.</p>

<p>Although I have't fully tested it yet, I believe this will also work on mobile devices.</p>

{% codepen https://codepen.io/takaneichinose/pen/XWXXMwZ %}
Algorithms Problem Solving: Destination City
Tags: algorithms, python, computerscience, interview
Published: 2020-06-12 11:28:00

---
title: Algorithms Problem Solving: Destination City
published: true
description: Solving algorithms problems with TK
tags: algorithms, python, computerscience, interview
cover_image: https://raw.githubusercontent.com/leandrotk/tk/master/series/algorithms-problem-solving/assets/tokyo-city.jpg
canonical_url: https://leandrotk.github.io/tk/series/algorithms-problem-solving/destination-city.html
series: Algorithms Problem Solving Series
---

This post is part of the [Algorithms Problem Solving](https://leandrotk.github.io/tk/series/algorithms-problem-solving/index.html) series.

## Problem description

This is the [Destination City](https://leetcode.com/problems/destination-city/) problem. The description looks like this:

You are given the array `paths`, where `paths[i] = [cityAi, cityBi]` means there exists a direct path going from `cityAi` to `cityBi`. *Return the destination city, that is, the city without any path outgoing to another city.*

It is guaranteed that the graph of paths forms a line without any loop, therefore, there will be exactly one destination city.

## Examples

```python
Input: paths = [["London","New York"],["New York","Lima"],["Lima","Sao Paulo"]]
Output: "Sao Paulo"

Input: paths = [["B","C"],["D","B"],["C","A"]]
Output: "A"

Input: paths = [["A","Z"]]
Output: "Z"
```

## Solution

My first approach is to get all the origins and destinations in different lists and the get the first difference between the lists.

```python
def dest_city(paths):
    all_origins = []
    all_destinations = []

    for [city1, city2] in paths:
        all_origins.append(city1)
        all_destinations.append(city2)

    return [d for d in all_destinations if d not in all_origins][0]
```

We can also use the `set` data structure to use the difference operation:

```python
def dest_city(paths):
    all_origins = set()
    all_destinations = set()

    for [city1, city2] in paths:
        all_origins.add(city1)
        all_destinations.add(city2)

    return (all_destinations - all_origins).pop()
```

## Resources

- [Learning Python: From Zero to Hero](https://leandrotk.github.io/tk/2017/09/learning-python-from-zero-to-hero/index.html)
- [Algorithms Problem Solving Series](https://leandrotk.github.io/tk/series/algorithms-problem-solving/index.html)
- [Stack Data Structure](https://leandrotk.github.io/tk/2020/01/stack-data-structure/index.html)
- [Queue Data Structure](https://leandrotk.github.io/tk/2020/01/queue-data-structure/index.html)
- [Linked List](https://leandrotk.github.io/tk/2020/02/linked-list/index.html)
- [Tree Data Structure](https://leandrotk.github.io/tk/2020/02/tree-data-structure/index.html)
What's your ideal job / who is your ideal employer?
Tags: career
Published: 2020-06-12 11:26:23

Ok so let's count out the big software companies.  As an employer it's always hard to find great talent in software development. And so I'd like to take an opportunity to sample this much larger pool of motivated individuals to get some insight.  I know what I like and the kind of organisation I try to build, but I'd like to know what it is that you are looking for in an employer!

Is it the culture?  The technology?  The purpose of the business of the employer?  The pay?  The flexibility of the working environment? Really great linting? TDD approach?

Let me know your top drivers and what questions you are looking to have answered when you interview.

For kicks, also choose the top three of the following you are looking for:

1. The technology being used
2. The amount of new code versus legacy being implemented
3. The security of the business, is it robust
4. The vision of the business, is it trying to change the world or has a "noble purpose"
5. The quality of the software and code
6. A larger team and lots of coaching
7. The career prospects, a ladder to climb
8. Variety of projects on offer
9. Flexibility in working from home and hours of work
10. The architecture of the software solutions being built
Error 'GoogleMaps' not a directory
Tags: xcode, objectivec, swift
Published: 2020-06-12 11:06:44



Hi !!
I opened an existing project on xcode 8.2.1, when I build it it gives me an error: **Opening import file for module'GooleMaps':Not a directory**

I already clean it with cmd + opt + shift + K but it's the same thing

I also check
pod outdated -> **GoogleMaps 2.2.0 -> 2.7.0 (latest version 3.9.0)**

I don't think that even if i convert it to swift 3, it won't change the problem

NB: about the googleplacePicker which is deprecated, is there a solution also on this

thanks for those who help me
The impostor inside
Tags: womenintech, career
Published: 2020-06-12 10:30:17

There is no news here: most women suffer from impostor syndrome. If you have never heard of the term before, it refers to that weird gutsy feeling you get once you get a job, a promotion, or stands out in any way. You can recognize it in that little voice that tells you you are not enough and that sooner or later someone will discover you are a fraud. It is a crippling feeling that makes a lot of things in our career harder than they should be. 

I believe that impostor syndrome plays a big role in the gender gap that undoubtedly exists in tech nowadays. As a woman and a programmer, I have identified on myself and my colleagues how this feeling damages our mental health and career progression. It makes us afraid of trying and unsure of our potential. Because programming is an art of practice much more than a skill you can acquire just by reading about it, insecurity and the fear of being discovered as a fraud hinders many women from daring and taking risks, which ultimately affects women's presence on the tech market. 

I understand that feeling insecure is not a women's prerogative, there are many men out there that can relate to that. However,  the impostor syndrome thing goes deeper than insecurity and it plays a structural role in gender inequality in the market place, especially in the programming sector because of its particular characteristics.

As I said in the beginning, this is no news. Actually, it is a very old discussion, so why write about it again? Because I believe that only when we address this dark brain pattern, call it by its name and recognize who it is affecting the most, then we can start making real change in tech. As someone that is in the job market and lives it on a daily basis, I know that the change we need isn't here yet. And, I believe that it is women's prerogative to talk about their own experience in the area, so we can push for change. 

Besides boosting the discussion around it, I believe that we also need to unite. I have been quite the nomad for the last few years and I lived in different countries. However, one thing that has grounded me during all these changes is finding women in tech groups. It is a powerful and revolutionary thing when we help one another. By talking and recognizing the common struggles we can be each other's counterpart to impostor syndrome. When we help another woman overcome its fear of failure, her success becomes a flash of hope that someday reality can be different for ourselves and others like us.
Anniversary Photo Frames
Published: 2020-06-12 10:28:43



A wide range of Wedding Anniversary Photo Frames

If you're probing for anniversary gifts, our anniversary frames make wondrous gifts for all anniversaries. Whether you're probing for romantic heart photo frames, photo frames designed concretely with key anniversaries in mind, or even framed photo prints, you'll find the gift you're probing for in our fabulous array of anniversary frames.
Whatever anniversary you're celebrating, our Frame is a beautiful gift that any couple are sure to love. Featuring a photograph of the couple, a special message, and a record disc featuring the name of the couple's first dance, this is a beautiful memento that's perfect for any anniversary from the 1st to 3rd. 

for 3rd anniversary gift please visit: https://leatherportrait.com/3rd-anniversary-gift/


Precursor technologies


A camera obscura utilized for drawing
Photography is the result of coalescing several technical revelations, relating to optically discerning an image and capturing the image. The revelation of the camera obscura ("dark chamber" in Latin) that provides an image of a scene dates back to archaic China. Greek mathematicians Aristotle and Euclid independently described a camera obscura in the 5th and 4th centuries BCE. In the 6th century CE, Byzantine mathematician Anthemius of Tralles utilized a type of camera obscura in his experiments.

The Arab physicist Ibn al-Haytham (Alhazen) (965–1040) additionally invented a camera obscura as well as the first true pinhole camera. The invention of the camera has been traced back to the work of Ibn al-Haytham.[16] While the effects of a single light passing through a pinhole had been described earlier, Ibn al-Haytham gave the first correct analysis of the camera obscura, including the first geometrical and quantitative descriptions of the phenomenon,[18] and was the first to utilize a screen in a dark room so that an image from one side of an aperture in the surface could be projected onto a screen on the other side. He withal first understood the relationship between the focal point and the pinhole, and performed early experiments with afterimages, laying the substrata for the invention of photography in the 19th century.

Leonardo da Vinci mentions natural camera obscura that are composed by dark caves on the edge of a sunlit valley. An aperture in the cave wall will act as a pinhole camera and project a laterally inverted, upside down image on a piece of paper. Renaissance painters utilized the camera obscura which, in fact, gives the optical rendering in color that dominates Western Art. It is a box with an aperture in it which sanctions light to go through and engender an image onto the piece of paper.