teleren/devto huggingface dataset:
Managers, don’t work overtime
Tags: management, leadership, culture, overtime
Published: 2021-12-19 21:46:07

I already wrote a post on [dangers of working overtime](https://dev.to/aismagulov/dangers-or-working-extra-hours-50m0), but this time I'm looking from the manager's perspective. It's a story about overtime, but more generally, I would call it "Don't show behaviour that you disapprove of". 

### Management changes habits

One of my strongest opinions is that no one should work more than your contract specifies. The reasons behind it are:
* working overtime is not heroic; it's a management failure;
* the person who works overtime pays for it with their mental health;
* unpaid overtime breaks the contract between the employee and the company, then breaking the contract breaks the trust. If that paragraph can be violated, what else can the employee or the company violate? What is such a contract worth?

When I was an individual contributor, I would never open my mailbox or chat after working hours. But as a manager, I never have enough time to do everything I planned (at least, to my quality standards). Also, I feel responsible both for the project and for my team. Suddenly, I found myself checking my mailbox in the evening or on a day off. And one day, I felt tempted to answer a question in the chat because I knew the answer, which would help the team. But I had to stop myself.

Okay, maybe, it is acceptable to check your emails - if it helps you cope with the anxiety. But you certainly cannot let your team know that you do it. When you are a manager, people pay more attention to what you do. Your actions have more weight. If your teammates notice that you work on your day off, they might think this is expected from everyone. But when you do that - you normalize such behaviour, you add it to the work culture.

Sometimes you feel down, you are out of time, and it seems like an extra couple of hours of work can fix everything. It makes you feel good about yourself - selfless, dedicated, sacrificing your free time for the greater good. But no one benefits from it in the end; actually, both you and the company lose in the long term. (Unless you are a co-founder and a stakeholder and receive 30% of the company's income.) And when you are a manager, your team joins the group of losers. So - don't work overtime.

### Matters of culture

It is a part of the manager's responsibility to form the work culture in the team. The same applies to questionable humour, gossiping, talking behind someone's back, handling critical situations, asking for help and giving feedback. Everything you do might be an example to someone else. Do you apologize when you lose your temper? If nine people interrupted you asking for help, how do you answer to the tenth person? When someone makes a discriminating joke, how do you react?

Photo by <a href="https://unsplash.com/@hassanein?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Abdelrahman Hassanein</a> on <a href="https://unsplash.com/s/photos/bird-sleeping?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Some Quick Thoughts on Seven Languages in Seven Weeks - Part 2
Published: 2021-12-19 21:40:11

---
title: Some Quick Thoughts on Seven Languages in Seven Weeks - Part 2
published: true
description: 
tags: 
---

This is a continuation of my thoughts on Seven Languages in Seven Weeks by Bruce Tate.

The Scala chapter of the book so far seems the most familiar to me. I have a pretty good understanding of Java, so I naturally leaned into this language quite a bit more than the others. This is the first time I saw traits outside of a Rust context (another language I’ve been trying to learn on the side). Traits are basically interfaces with implementation.

There are distinct and explicit ways to declare mutable and immutable variables i.e. use val for immutable values and var for mutable variables.

A similar approach is used for static classes. Instead of adding the static keyword in front of the class declaration (like in Java), Scala uses the keyword object.

One interesting bit in Scala is that XML is valid syntax. This reminded me a lot of React and JSX.

The pattern matching with conditions look like a really powerful tool over your basic switch/case statements.

Example:
```
def factorial(n: Int): Int = n match {
    case 0 => 1
    case x if x > 0 => factorial(n - 1) * n
}
```

The author’s conclusion for Scala is mixed, but I like how you are able to start with object oriented programs and ease your way into functional paradigms. Perhaps this allows too much of an escape hatch for a functional programmer’s taste?

**The next chapter is on Erlang.**

A few of my notes:

Statements end in period.
* There is no type coercion. Example: 1 + "2" does not work.
* Variables begin with capital letter and immutable.
* Functions use fun keyword.
* There is a prolog-based syntax.
* Use the keyword spawn to spawn a process.
* Send messages to threads with Pid ! "message".
* Interprocess communication is REALLY easy.

I enjoyed reading about Erlang and doing some of the exercises but I found the syntax to be a little awkward. My first impression is it is not something I would want to work in on a daily basis. The author seemed to really like Erlang which makes me want to give it another try.

So far, Scala seems the most promising in terms of professional development. I’ve seen a few companies that use Scala though it is not widespread in the industry. I am looking forward to finishing up the book with the next 2 chapters and see where it takes me.
Some Quick Thoughts on Seven Languages in Seven Weeks - Part 1
Published: 2021-12-19 21:34:04

---
title: Some Quick Thoughts on Seven Languages in Seven Weeks - Part 1
published: true
description: "Some quick thoughts as I work through Seven Languages in Seven Weeks by Bruce Tate."
tags: 
---

I recently discovered the [Corecursive](https://corecursive.com/) Podcast and love it! In particular, I really enjoyed [this interview](https://corecursive.com/051-bruce-tate-language-learning/) with Bruce Tate, the author of Seven Languages in Seven Weeks. The book surveys 7 different languages: Ruby, Io, Prolog, Scala, Erlang, Clojure and Haskell. I only had familiarity with Ruby, so I decided to pick it up. I have completed 3 of the 7 languages and I thought I would take some time to jot down my thoughts about the book so far.

Although the book is slightly dated (2011), it reads really well and is very digestible. I’ve done a couple of projects in Ruby in the past, but found that the chapter opened my eyes to why Ruby was designed the way it was. For example, it really was designed with the developer’s experience in mind as oppose to performance. All the code samples work (though some of the output might be slightly different) and it’s a great introduction to this language.

I found this to be less true with the Io chapter. Most of the trivial code samples worked, but unfortunately, none of the ones that involved http request did. This was a bit disappointing. I use JavaScript in my day to day work. Io is a prototypal language and I was hoping it would help me understand JavaScript (also a prototypal language) more. I believe it did accomplish this.

The Prolog chapter was very interesting. The code almost seemed like axioms from which you derived your proofs. The language is rule based and is very different from how I think of programming. This chapter probably stretched my brain the most, but is so far the most disappointing in terms of getting the code samples to work.

Overall, I still enjoyed going through these first 3 languages and look forward to the remaining 4.
The Calm Before The Storm
Tags: flatiron, ruby, javascript, react
Published: 2021-12-19 21:18:29

I'm not sure where to start, what a long journey it has been. 

The past 10 months have been the most challenging, stressful, and exhausting time of my life. However, it's also been the most rewarding and fulfilling. I joined Flatiron with the goal that I've had since my teenage years, and that is to be a Software Engineer.
I am happy to say that I have submitted my final project, I haven't taken my assessment yet but the last year of my life has proven that I **can** and **will** accomplish anything I put my mind to.

Over the course of the last 10 months, I've learned an incredible amount of knowledge and skills in the programming field. 
From Ruby, Html & CSS, to JavaScript and React, a crazy amount of information in such a short time, it truly is like learning a foreign language, but I was never good at French.

The first phase in my eyes was the most challenging, no it wasn't the most complex, but it was the first dive into the programming world that proved to be the most difficult.
Starting with procedural Ruby, I quickly understood the meaning of object-oriented programming. From variables & arrays, to booleans & iterations followed by scraping and API's, it all came together in a very logical and to the point manner.

Next came the Sinatra and Rails phases. In Sinatra I was introduced to SQL, Active Record, HTML & CSS, Sessions and MVC. With those utilities put together, I could then make an applications and deploy it to a browser page. It was exciting to see each skill build the framework of an application.
Next came Rails, at this point setting up the database was easily implemented from memory. With associations, forms, nested routes and the useful CRUD actions (create, read, update, & delete). The first three phases came together harmoniously, creating the framework of future languages I would learn and applications I would create in the future.

The last two phases were JavaScript and React. In JavaScript the DOM was introduced. With little client side manipulation in the previous phases, it was a huge leap in learning by adding new skillsets to my repertoire. With JavaScript, I learned everything from functions, to fetch requests and event listeners, adding more functionality and fun features to my learning and projects.
With React, adding in props and components, and the declarative writing that in turn defined actions, reducers, components and containers, it compacted every element of learning up until this point into a nice logical package.

Everything that I have learned so far has been a wild ride, but it's only just begun! I plan to continuously learn each and every day, master new skills, and tackle new projects.
Thank you Flatiron, my cohort members and my amazing teacher Candice Peters, this opportunity has given me a new outlook on life and abilities that I've always sought after. 

In reference to my Final Fantasy image and title, I have only reached the Calm Lands, I still have a long journey ahead of me.
VIM - commenting using visual block
Published: 2021-12-19 21:05:33

Wow I haven't been on here for a long time. Actually, I haven't been using my linux OS for a while due to work.

It has been so long that I forgot how to use certain functions in Vim that would make a world of difference.

So I switched from Urxvt to Alacritty (terminal emulator)

I wanted to comment multiple things in the config file and didn't want to go through multiple lines

So if you have 10 or 20 lines and you need them all to be commented out, simply do the following in

Ctrl-v and press j until you want all the lines are selected to be commented out

then press Shift-i

this will allow you to insert something, but it will be for the first line. Once you are done inserting just press ESC and it will autofill.

Try it out and let me know.

[Click here on how to uncomment using visual-block](https://dev.to/haxnet/vim-uncommenting-using-visual-block-56eo)
Renaming a Rails app
Tags: ruby, rails, beginners, tutorial
Published: 2021-12-19 20:38:14

Have you ever began a project without having a solid name picked out? I'm sure all of us have at least once. This is completely ok, we shouldn't just let inspiration fade because we can't think of a application name. Once an appropriate name sticks with you, it's time to rename your application. When trying you do this manually, you'll find that this really isn't an easy thing to do. However, thanks to [Morshed Alam's "rename" gem](https://github.com/morshedalam/rename) , all the dirty work is done for us. This gem goes through your application and relabels where appropriate.
**HOW TO:**

1. Add this to your gemfile

`gem "rename"`
2. Rename your app

`rails g rename:app_to updated_name`
3. _Optional_ Rename your Database
(in order to do this, you must be logged into Postgresql)

`ALTER DATABASE db_name RENAME TO new_db_name`

And Voila, you're done. Please note that the app you're currently in will no longer be useable. Navigate to the directory this file is in and your newly named app should be there!

_Is there anything that you would do differently? Did this work for you? Open to feedback Devs!_
The Love between Coffee and Code
Tags: programming, career, productivity
Published: 2021-12-19 20:19:48

> “Why do you programmers fetishize drinking coffee?”

A question most friends have been asking me. I believe the biggest reason is that coffee is a symbol of concentration. And coders need to concentrate to get any meaningful work done. A coding session can be intense and a boost to focus and concentration is a big plus since you want to write good clean code and avoid the dreaded "bugs" while running that session's code.
It is a widespread concept that drinking coffee can benefit work that relies on productivity and steady brain function—easy to see, then, why it is a preferred beverage for people who need just that.

Having a cup of coffee by your side when you dive into some complicated code is part of a habit. It’s almost like a trigger for me when I’m pondering a complicated problem: As soon as I sit down with a cup of coffee in my hand I know the ideas will start flowing.

It’s also a signal to my coworkers and the people around me that says “Leave me alone, I need to get stuff done now.” It’s definitely a ritual for the other developers I spoke with.

## The programmer's Coffee Culture

Coffee culture plays a big role, too. Visit the office of any tech company and you’ll see there are coffee machines everywhere. People will congregate around them to chat or have impromptu meetings. And if there aren’t any coffee machines visible then people will flock to nearby cafes to get out for a bit and have “walk and talk” meetings to grab a cup of coffee or tea.

I wouldn’t underestimate the bonding effect this has. A lot of programmers are quite introverted and this might also mean that going out for a cup of coffee with a coworker gets associated with feeling good quickly.

There’s no denying, programmers all around the world seem to love their coffee. They love it so much they named a programming language after it. James Gosling named the Java programming language after coffee.

What’s great about drinking coffee is that programmers then also get to show off their coffee mugs. I noticed developers seem quite buzzed to get a cool or funny coffee mug to show their love for a certain programming language or technology stack. Every software engineer wants a nice coffee mug on their desk. Any hacker worth their salt will most likely have a fun and geeky coffee mug on their desk. Some coders even use their coffee mugs as collectibles.


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

Read More at [The Morning Beans](https://themorningbeans.com/the-love-between-coffee-and-code/)
🚀 MiroTalk - WebRTC - P2P - Open Source - Video Calls - Chat - Screen Sharing Up to 4k & 60 FPS
Tags: webrtc, showdev, javascript, opensource
Published: 2021-12-19 19:41:00


**GitHub**: https://github.com/miroslavpejic85/mirotalk
**Demo**: https://p2p.mirotalk.com

![MiroTalk P2P](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/smn28nkknfv714xkww3l.png)

_Nothing is really ours until we share it.
(C.S. Lewis)_
How to get your First Client as a Developer ?
Tags: webdev, javascript, client, freelance
Published: 2021-12-19 19:31:55

Getting your First client is always a tough work. You have skills and knowledge but still not getting clients? Yeah that's a common problem among freelancer beginners, specially in Developer field as competition is too high.

Having skills and knowledge is not enough, You have to learn how to Market your skills and services in public.

### There are 2 ways to get your first client.

- Facebook Community (Most common)

- LinkedIn (Yeah the pool of professionals)

``
## 1. Facebook Community  
This is the most common method for getting clients. You must have already seen this method in many posts, right? 
Well let's cut to the chase, Facebook is a huge community of people and professionals looking for work and having fun time. One of the main point of Facebook is it's Groups, Facebook offers multiple groups and community for different target audience. To get your perfect lead you have to join groups related to your niche.

In these groups, people post their requirements for freelancers, and all you have to do is convert that lead into sales. Now converting that lead into sales take a lot more than HTML and CSS. It is a total matter of your communication skills and how you treat the person or potential client.


## 2. LinkedIn 
Now for some folks or beginners, that's a scary name, right? 

> " It is full of professionals, how can I ever get a lead in such a huge competition?"

That's a pretty **common myth**. Surely LinkedIn is a place full of working professionals and there is huge competition there. But if you know how to play your cards right, you can steal a quite good gig there. 

After all ,**That's How I got my First Client !**.

Yeah, that's right. I got my first ever App Development client from LinkedIn, a pool full of scary professionals.

Getting your client from LinkedIn is quite different from Facebook, You don't have to join some groups or communities here, instead, you have to make connections. 

Connections are friend requests but for professional reasons and works. But that's not enough to get started, you have to build an attractive and solid profile first. Full of your experiences and works. 

Now by Experience, I am not referring to Actual work. Experience includes any personal project you worked on to learn those awesome skills you have. 

**Make any 3 next-level projects you are proud of and share them on LinkedIn as a Post and in profile so that your potential client or lead can have a hint of what you are capable of.**

Well, there is a whole method for How to get started on Linkedin, You can find my Blog for that [here](https://dev.to/suyashvash/how-to-get-freelance-clients-from-linkedin--2j49). 

But this is enough to get started in your Freelance Career.
 
### Bonus Tip 
It will be a great advantage if you have a Live Portfolio site with a list of all your Top 3 Projects.


Well, that's it for this Blog, Let me know in the comments if I missed something or if you have anything to add value to this post. I would love to hear that.
Reverse an Inner Linked List
Tags: 100daysofcode, java, algorithms, programming
Published: 2021-12-19 19:17:53

# [Description](https://binarysearch.com/problems/Reverse-an-Inner-Linked-List/solutions/7078107)

Given a singly linked list `node`, and integers `i` and `j`, reverse the linked list from `i` to `j`th nodes, `0` indexed and inclusive.

You should return the head of the reversed list.

This should be done in `O(1)` space.

**Constraints:** 

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

## Example 1

### Input

```
node = [0, 1, 3, 4]
i = 1
j = 2
```

### Output

```
[0, 3, 1, 4]
```

---

# Intuition

**Intuition**

Divided into three parts

1. (0,i)
2. [i,j]
3. (j, length)

# Implementation

```java
import java.util.*;

/**
 * class LLNode {
 *   int val;
 *   LLNode next;
 * }
 */
class Solution {
    public LLNode solve(LLNode node, int i, int j) {
        LLNode prev = null, curr = node, next;
        for (int index = 0; curr != null && index < i; index++) {
            prev = curr;
            curr = curr.next;
        }

        LLNode firstEnd = prev;
        LLNode secondEnd = curr;
        for (int index = 0; curr != null && index < j - i + 1; index++) {
            next = curr.next;
            curr.next = prev;
            prev = curr;
            curr = next;
        }
        if (firstEnd == null) {
            node = prev;
        } else {
            firstEnd.next = prev;
        }
        secondEnd.next = curr;
        return node;
    }
}
```

## Time Complexity

- Time: O(N)
- Space: O(1)
Trust No One - Be Warned!
Tags: 100daysofcode, security, webdev, beginners
Published: 2021-12-19 19:11:20

---
title: Trust No One - Be Warned!
published: true
description: You can't trust anyone. you are the developer and you are responsible!
tags: 100daysofcode, security,webdev,beginners
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zico3oizvsfpchqy1uvu.png
---

The Log4j debacle has once again brought into focus an old mantra of web development: 

> Trust no one! 

As a developer, **you are responsible** for the data you retrieve from various sources. Especially for data that comes from a context you can't control.      

Then, first of all, for data coming through the Web API, but also for data coming from a database or data coming from the file system.

But if the data ....   **NO!**
But the operating system has validated the data ...   **NO!**
But my users are sweet ...  **NO!**




![](https://media.giphy.com/media/d1E1msx7Yw5Ne1Fe/giphy.gif)





**All data** must be validated and it must be ensured that these inputs are not malicious. 

And when we talk about data, we mean all kinds of data. That includes metadata like the headers as well as environment variables of the operating system.


You also never know what will happen to the data later (see Log4j).


Anyone who continues to use unverified data is on a path to hell.

![](https://media.giphy.com/media/PPmHsxVG53YKT9N8C7/giphy-downsized-large.gif)


**Therefore: Validate your data!**

You can't trust anyone. You are the developer and you are **responsible!**


## References

* [Hackers Target Real Estate Websites with Skimmer in Latest Supply Chain Attack](https://thehackernews.com/2022/01/hackers-target-real-estate-websites.html)
* [Apache Log4j Vulnerability Guidance](https://www.cisa.gov/uscert/apache-log4j-vulnerability-guidance)
* [STATEMENT FROM CISA DIRECTOR EASTERLY ON “LOG4J” VULNERABILITY](https://www.cisa.gov/news/2021/12/11/statement-cisa-director-easterly-log4j-vulnerability)
* [lunasec.io/docs/blog/log4j-zero-day/](https://www.lunasec.io/docs/blog/log4j-zero-day/)
* [issues.apache.org/jira/browse/LOG4J2-905](https://issues.apache.org/jira/browse/LOG4J2-905)
* [Computer security](https://en.wikipedia.org/wiki/Computer_security)
* [CVE-2021-44228](https://nvd.nist.gov/vuln/detail/CVE-2021-44228)