teleren/devto huggingface dataset:
Study materials for getting started as a freelance web developer?
Tags: webdev, beginners, freelance
Published: 2021-12-22 01:07:35

Hello, i am a computer science university graduate and i have decided on becoming a full stack freelance web developer. Which would be the best courses or books to get me started on landing small web development jobs and going from there? Stefan Mischook seemed trustworthy to me and his course seems to be what i m looking for, do you think it would be a good idea to embark on the journey by picking this one up? Otherwise, is there any other course that you would suggest that could cover me for the fundamentals and for popular freelance gigs on web development? I am also open to reading books, however, i m mostly seeing people suggest books on learning specific languages and i m not sure about how much these would cover me considering i need knowledge of different programming languages, tools and also some guidance on non-programming skills and knowledge useful to get succesful as a freelancer.

Which bring me to my secondary request, aside from a course/book on the practical programming skills, i would also like to learn about stuff like how to present my portofolio and my self in general in ways that will draw clients to me, along with other strategies concerning useful soft skills and whatnot. After i ve prepared myself, i ll probably go to upwork or a similar site and start there, so knowledge about how to efficiently maneuvre such a site could also prove useful.
When is 95% test coverage worse than 5%
Tags: unittests, tdd, codequality
Published: 2022-01-31 20:34:42

---
title: When is 95% test coverage worse than 5%
published: true
date: 2021-12-22 00:00:00 UTC
tags: unittests,tdd,codequality
canonical_url: https://jhall.io/archive/2021/12/22/when-is-95-test-coverage-worse-than-5/
---

Test coverage. What a hot topic.

What’s the ideal percentage?

100% maybe?

Maybe that’s unrealistic. How about 80%?

Here’s the part where you expect me to say “It depends”, right?

I’m not gonna.

Instead, I’ll tell you a story.

Bob joined a project that had a measly 5% test coverage. He recognized that this was a really low number, so he spent a three months refactoring the code to add tests. He had no other goal in mind except to get the code testable, and under test. A laudible goal, surely.

At the end, he had indeed achieved his 95% test coverage goal. And they were all REALLY GOOD tests. Not assertion-less tests that just executed code, or any other shennanigans. They were GOOD tests.

The problem? He broke production two dozen times in the process. For example, when he added tests to the inventory component, he unwittingly broke the checkout component, which had been reading some global state from the inventory component. Since the checkout component wasn’t yet under test, this problem wasn’t discovered until it was in production, and customers had to call customer service to complain.

In a parallel universe, Alice was hired instead of Bob.

She also noticed that the 5% test coverage seemed really low, but she took a different approach. She recognized that although 95% of the code wasn’t covered by formal tests, it was effectively tested by virtue of the fact that customers were happily using it. So rather than a large scale refactoring, she convinced the team to adopt a simple policy: **Henceforth, all behavior changes will be accompanied by tests.**

Three months later, the project had reached 15% test coverage, compared to Bob’s 95%. But here’s the beautiful thing: Production didn’t go down a single time as the result of adding tests.

Not only that, but the 10% of tests that were added were of much higher strategic value than Bob’s, since they were testing volatile portions of the code.

The moral of the story?

Test coverage for its own sake is dangerous. It leads to foolish technical choices.

If you can achieve 95% test coverage naturally and organically, that’s great. If you have to force it, you’re likely to introduce more pain than you’re saving.

* * *

In case you missed it, Bryan Finster and I talked about this, among other things, in [a recent episode of the Tiny DevOps podcast](https://share.transistor.fm/s/838ecd77).

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
فصل php منتديات عالم بخصائص git يمنحك حزم بطريقة احسن بيانات xml
Published: 2021-12-21 22:43:25

<Html>
<head>
"Php"{<php>
<title>this is my favorite files Nam. Kgitlab=link; <title/>
<ci>Web. To get a chance /#977 <ci/>
<php/>}
<head/>
<Html/>
Pick a genre, many genres?
Tags: datascience, firstyearincode
Published: 2021-12-05 21:38:41

My first performance task in my data science program with Flatiron School has been to produce recommendations for the theoretical Microsoft Studios about their first movie.  After looking through the data, I decided to explore genre first, to see if I noticed any trends.

As I was joining genre to the movie titles in a separate csv, I was surprised to see that some genre pairings were more common than others.  For example, adventure, the most popular genre in the top 50 grossing movies, is most often paired with action.  I can remember my father talking about which movies he liked when I was a kid, and his descriptions often involved action and adventure.  When he dragged me to Disney's Pocahontas, I was pleasantly surprised with action and adventure, despite my preconception of it being a romance.

However, counting movies by genre pairs or combinations didn't give me enough reliable information to make recommendations to theoretical Microsoft Studios, as you can see in this histogram.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sql1y8kf6jyc7j2qvc8f.png)

Thinking of a movie as one particular genre can be rather limiting. I think this is why we are currently observing the trend that Jourdan Alderidge describes in The Beat.  They write, "The majority of content produced in the last several decades are often genre hybrids, using the rules of genre theory to produce new, unique, and different stories" ([The Beat](https://www.premiumbeat.com/blog/guide-to-basic-film-genres/))

However, I was determined to pull individual genres because understanding the pattern of individual genres would be important when theoretical Microsoft Studios is planning their first movie.  This resulted in some difficulty, as the genres were saved in the object data type, and to explode them into distinct rows, I would need them in a list.

This [resource](https://towardsdatascience.com/how-to-quickly-create-and-unpack-lists-with-pandas-d0e78e487c75) was invaluable and provided me with the code needed to convert the string into a list, based on the location of each comma. Without the comma indicator, split(), will split a string on whitespace, but we do not have whitespace in our string, so we specify for it to split(',') on the comma.

```
df3['Genre'] = df3['Genre'].str.split(',')
```
I was then able to use the explode method and pull each genre into a new row.

```
df2 = df2.explode('Genre')
```
Once all the genre's were in separate rows, I was able to produce a histogram of the genres of the top 50 grossing movies.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pj0wfmo0ufzenre2w7hc.png)

This made me happy and seemed to give me more relevant information to make recommendations to Microsoft.  And, going back to my Dad's preferences, it seems action/adventure is a good place to start.
Log4j Exploit Pattern Detection Using ColdFusion/CFML
Tags: log4j, java, cfml, coldfusion
Published: 2021-12-21 22:16:16

Here are my initial attempts at trying to detect Log4j exploit attempts that may make it past our WAF/service provider protections. While our WAF stopped requests from Trend Micro's [Log4j Tester](https://log4j-tester.trendmicro.com/), obfuscated requests made it through. At time of testing, Azure wasn't blocking requests. I had to be a little careful with the script as Windows kept instantly quarantining the CFM files and prevented ColdFusion from executing the template.

**2021-12-29:** Updated rules based on [Google Cloud article](https://cloud.google.com/blog/products/identity-security/recommendations-for-apache-log4j2-vulnerability) to additionally block `rmi`, `ldaps` & `dns` (in addition to stripping whitespace.)

Sample CFML code available at https://gist.github.com/JamoCA/6a8c612645b1b7c47eba8e317ad51d23

{% gist https://gist.github.com/JamoCA/6a8c612645b1b7c47eba8e317ad51d23 %}
Create a Real-Time digital clock with node and socket.io..
Tags: node, socketio, html, clock
Published: 2021-12-21 22:09:39

At first setup your nodejs project.Then install `socket.io and express`.
This is going to be our folder structure...

![folder structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kzmuyuyuzc6ra00vzus5.png)

In `index.js` our `nodejs+socket.io+express` code is going to be ...

```javascript
import express from 'express';
import http from 'http';
import { Server } from 'socket.io';

const app = express();
const expressServer = http.createServer(app);

app.use(express.json());
app.use(express.static('public'));

const io = new Server(expressServer);

io.on('connect', function (socket) {
    console.log('a user is connected');

    setInterval(function () {
        let date = new Date().toLocaleTimeString()
        socket.send(date)
    }, 1000)

    socket.on('disconnect', () => {
        console.log('user disconnected.')
    })

})

app.get('/', (req, res, next) => {
    res.render('index.html');
})

expressServer.listen(4000, () => {
    console.log('server is listening.')
})
```

and in `index.html` html code is going to be..

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Socket</title>
  </head>
  <body>
    <h1 id="time"></h1>
  </body>
  <script src="/socket.io/socket.io.js"></script>
  <script>
    let socket = io();
    socket.on("message", function (msg) {
      document.getElementById("time").innerHTML = "";
      document.getElementById("time").innerHTML = msg;
    });
  </script>
</html>

```

Now use should see your rea-time running clock in browser..


![clock](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wha3av6wk694al77jpr8.png)

Thanks!❤
Linked List Delete Last Occurrence of Value
Tags: programming, java, algorithms, 100daysofcode
Published: 2021-12-21 22:08:12

# [Description](https://binarysearch.com/problems/Linked-List-Delete-Last-Occurrence-of-Value)

Given a singly linked list `node`, and an integer `target`, delete the last occurrence of `target` in `node`.

**Constraints:** 

- `0 ≤ n ≤ 100,000` where `n` is the number of nodes in `node`

## Example 1

### Input

```
node = [1, 2, 3, 1]
target = 1
```

### Output

```
[1, 2, 3]
```

## Example 2

### Input

```
node = [1, 2, 3, 1]
target = 3
```

### Output

```
[1, 2, 1]
```

---

# Intuition 1

1. reverse your linked list
2. delete the first target value
3. reverse it again

# Implementation

```java
import java.util.*;

/**
 * class LLNode {
 *   int val;
 *   LLNode next;
 * }
 */
class Solution {
    public LLNode solve(LLNode node, int target) {
        LLNode curr = reverse(node);
        LLNode head = curr;
        if (curr.val == target) {
            head = curr.next;
        } else {
            while (curr.next != null) {
                if (curr.next.val == target) {
                    curr.next = curr.next.next;
                    break;
                }
                curr = curr.next;
            }
        }

        return reverse(head);
    }

    private LLNode reverse(LLNode node) {
        LLNode prev = null, curr = node, next;
        while (curr != null) {
            next = curr.next;
            curr.next = prev;
            prev = curr;
            curr = next;
        }
        return prev;
    }
}
```

## Time Complexity

- Time: O(N)
- Space: O(1)

---

# Intuition 2

1. only one loop
2. using `last` pointer to store the last node before target `prev.next.val == target`
3. and let `last.next = last.next.next`

# Implementation

```java
import java.util.*;

/**
 * class LLNode {
 *   int val;
 *   LLNode next;
 * }
 */
class Solution {
    public LLNode solve(LLNode node, int target) {
        LLNode dummy = new LLNode();
        dummy.next = node;
        LLNode last = null, prev = dummy;

        while (prev != null && prev.next != null) {
            if (prev.next.val == target) {
                last = prev;
            }
            prev = prev.next;
        }
        if (last != null) {
            last.next = last.next.next;
        }
        return dummy.next;
    }
}
```

## Time Complexity

- Time: O(N)
- Space: O(1)[](url)
Feature of ES6
Tags: javascript, beginners, tutorial, programming
Published: 2021-12-21 16:47:56



JavaScript ES6 is also known as ECMAScript 2015 or ECMAScript 6.ECMAScript 2015 or ES2015 is an update to the JavaScript programming language. I provide a brief summary of some features of ES6 to start quickly in ES6.


**JavaScript var:** 
When we declare a variable using the var keyword the scope of the variable is either global or local. If we declare a variable outside of a function, the scope of the variable is global. When we declare a variable inside a function, the scope of the variable is local. For example:
var variable_name;
Here variable_name is a global variable that is accessible by any function.

function increase() {
    var variable_name= 10;
}

In this example, the variable_name variable is local to the increase() function. It cannot be accessible outside of the function.

**JavaScript let:** 
ES6 provides a new way of declaring a variable by using the let keyword. The let keyword is similar to the var keyword, except that these variables are blocked-scope. This means they are only accessible within a particular block. For example:
let variable_name;

**JavaScript const:** 
ES6 provides a new way of declaring a constant by using the const keyword. In ES6 const will have block scoping just like the let keyword. The value of a constant cannot change through re-assignment, and it can’t be redeclared. A constant cannot share its name with a function or a variable in the same scope.  For example:
const CONSTANT_NAME = value;               


**JavaScript Classes:**
JavaScript class is used to create an object. Keyword class is used to create a class. Class is similar to a constructor function.For example:
class Person {
  constructor(name) {
    this.name = name;
  }
}
 **JavaScript Arrow Function:** 
ES6 arrow functions provide us the way to write a shorter syntax compared to the function expression.For example,

// function expression
let x = function(x, y) {
   return x * y;
}
// function expression using arrow function
let x = (x, y) => x * y;
**Default perimeter value:** 
When we do not provide a parameter in a function then it became an undefined value that’s why we specify default parameters to set a default value in the parameters of a function. In the ES6 version, you can pass default values in the function parameters. For example,
function say(message='Hi') {
    console.log(message);
}

say(); // 'Hi'
say('Hello') // 'Hello'

**JavaScript Destructuring:**
 The destructuring syntax makes it easier to assign values to a new variable. For example,
// before you would do something like this
const person = {
    name: 'Marjia',
    age: 23,
    gender: 'female'    
}

let name = person.name;
let age = person.age;
let gender = person.gender;



//now we do something like this
const person = {
    name: 'Marjia',
    age: 23,
    gender: 'female'    
}

let { name, age, gender } = person;
Living in the Shell #21; head (Display File Content From Beginning)
Tags: productivity, linux, bash, devops
Published: 2021-12-21 20:41:12

## `head` 📜

Displays file content from beginning.

## Print first N lines of a file `-n`

```sh
head -n 5 ~/.bashrc
```

## Print all but N last lines `-n -N`

```sh
tail -n -3 ~/.bashrc
```

## Print first N bytes of a file `-c`

```sh
head -c 1k ~/.bashrc
```

> Prints first 1k of file binary content.

## Print all but N last bytes `-c -N`

```sh
tail -c -1k ~/.bashrc
```
Gatsby Build Issues
Tags: help
Published: 2021-12-21 20:34:15

**PROBLEM:** Content renders fine in gatsby develop but no image content is returned with gatsby build. I have tried GatsbyImage, StaticImage, and standard img; all yield no content when build is ran. Additionally, anytime an image is referenced inside of a SwiperJs instance, the swiper fails to return ANY slides at all. Local images (from within src) DO RENDER but any Graph CMS content with image fields OR text fields with urls to third-party images DO NOT render.

**Does anyone have suggestions on how to fix this?**


NOTE: All my data is coming from Graph CMS. They are hosting the images as well.
Dec 21: Dev Holidays Guide ⛄️
Tags: stateofdevs, bahhumbugtip, mentalhealth, tips
Published: 2021-12-21 20:15:40

Bah Humbug Tips are my own way of coping & recovering from burnout & holiday stress.

###🎄  Today's Bah Humbug Tip of the Day. 
{% twitter 1473347584404066308 %}

######🎁 Today's Options 
{% twitter 1473347585200906243 %}

You can find more tips here & on [Twitter](https://twitter.com/stateofdevs). Let me know in the comments if any of these tips helps.

> If you're struggling w/ burnout & open to sharing your story, please [take the State Of Devs survey](https://stateofdevs.com/helps/dev). 🗳 Thanks!
I share my Notion template with over 440 pages of web development content
Tags: javascript, webdev, beginners, programming
Published: 2021-12-21 19:59:58

I guess Santa came a bit early this Christmas! 🎅

<img width="100%" style="width:100%" src="https://media.giphy.com/media/3o6ZtdulyqqoJjWB6U/giphy.gif">

In one of my last posts, [Using Notion to organise programming topics](https://dev.to/colocodes/using-notion-to-organise-programming-topics-4ida), a lot of people asked me to share the Notion template I was using to build my commonplace book about Web Development. So, after spending quite some time removing personal information from it, and polishing it a bit, I would like to share with you a template you can use to create your own commonplace book.

---

👉 You can download the template by clicking [here](https://mailchi.mp/77b7cbf1b03a/web-development-notion-template). 👈

---

![Template](https://cdn.hashnode.com/res/hashnode/image/upload/v1640116402489/fnOA05rjX.png)

In this template, you will find over 440 pages containing:
- Over 270 HTML and CSS related questions to practice your knowledge in a spaced repetition manner.
- Dozens and dozens of useful links.
- Information about CSS, HTML, JavaScript, ReactJS, Ruby on Rails, SQL, and more!
- Cheatsheets.
- Link to free tutorials and courses.
- Mindset (to stay strong in the web development journey).
- Information and links about APIs, tools, libraries, web development resources, etc.
- Resources for code practice.
- Problem-solving strategies.
- Lists of interesting articles.
- Useful blogs, podcasts and newsletters.
- The best YouTube channels I could find.
- And much, much more!

Please, feel free to create a copy of this template and adapt it to your own needs. I found it very useful in my journey of becoming a Web Developer, and I still use it almost every day. It has become an extension of my brain, and I rely on it every time I have a question or doubt.

I did my best to remove any copyrighted or personal content but, if you find any, please let me know so I can delete it.

I would like to know any suggestions on how to improve this template, and I'm even considering uploading it to GitHub so I can transform it into a collaborative commonplace repository. Let me know what you think about that.

I hope you enjoy it!

---

🗞️ **NEWSLETTER -** _If you want to hear about my latest articles and interesting software development content, [subscribe to my newsletter](https://chipper-designer-8106.ck.page/1a819bffe8)._

🐦 **TWITTER -** *Follow me on [Twitter](https://twitter.com/DamianDemasi).*

<a href="https://www.buymeacoffee.com/damiandemasi" target="_blank"><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1641530738382/Wt_2bHGsXK.png" alt="Buy Me A Coffee" style="height: 40px !important;"></a>
Ethereum Account Messaging Idea 
Tags: ethereum, blockchain
Published: 2021-12-21 19:53:45

Should someone create a messaging service for blockchain users?

I don't have the time to do this but thought it would be a good idea.

The user would basically go to the site, authenticate their wallet and then have direct message capabilities from other users that have been authenticated and setup.      

There is no real way to communicate to Ethereum accounts and this could be a good way to do it, or is there?

-Marty
Apama Advent Calendar - 21 Dec 2021 - EPL Stream Listeners
Tags: apama, iot, cumulocity, streaminganalytics
Published: 2021-12-22 10:54:29

---
title: Apama Advent Calendar - 21 Dec 2021 - EPL Stream Listeners
published: true
date: 2021-12-21 19:44:18 UTC
tags: apama, iot, cumulocity, streaminganalytics
canonical_url: https://tech.forums.softwareag.com/t/apama-advent-calendar-21-dec-2021-epl-stream-listeners/254020
---

_This is Day #21_ _of a short series of brief tips, tricks, hints, and reminders of information relating to the Apama Streaming Analytics platform, both from Software AG as well as from the community._ 

When starting with EPL you will often create event listeners with the “on” or “on all” keywords. These listeners are checked and executed on every individual incoming event and provide a simple, yet powerful way of writing your rule logic. But what if you need to keep track of multiple events over time?

Typical questions you might want to answer in Cumulocity include windows or batches of events:

- What is average of this Measurement over the last hour (day)?
- What is the rate of Events coming in from my devices?
- What does the standard deviation over the last 50 Measurements look like and is my last Measurement within the expected range?
- What was the maximum (minimum) value for the Measurements today?

Check today´s original post in the [Software AG Tech Community](https://tech.forums.softwareag.com/t/apama-advent-calendar-21-dec-2021-epl-stream-listeners/254020) to find the best approaches to these questions!
 
_Note that some posts may be published a day or two early or late (e.g. Mon-Fri) so you may find you have bonus days with more than one post!_