teleren/devto huggingface dataset:
Today's Daily Dose of Programming Humor
Tags: jokes, dailydeveloperjokes
Published: 2022-02-20 08:00:15

---
title: "Today's Daily Dose of Programming Humor"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258e86d537.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_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:___ How does a developer make a cheer?

___A:___ ["hip","hip"] // (hip hip array!)
 -->
手を動かしながら学ぶ TypeScript Part 0 -- 実行環境の作成
Tags: typescript
Published: 2022-02-20 07:54:10


## why

tsc と ts-node が毎回ごっちゃになるのでまとめる
tsc でファイル指定すると tsconfig 読み込まない問題で苦戦したので記載しておく

---

## 参考

https://www.amazon.co.jp/%E6%89%8B%E3%82%92%E5%8B%95%E3%81%8B%E3%81%97%E3%81%AA%E3%81%8C%E3%82%89%E5%AD%A6%E3%81%B6-TypeScript-%E6%B8%A1%E9%82%89%E6%AF%94%E5%91%82%E6%A8%B9-ebook/dp/B09KZJXDN1

手を動かしながら学ぶ TypeScript
by 株式会社 SmartHR

---

# インストールと動作テスト

## グローバルインストール

```
npm i -g typescript@4.3.5

added 1 package, and audited 2 packages in 885ms

found 0 vulnerabilities
```

npm i -g で ts の 4.3.5 をグローバルインストール

===

## 数値限定の足し算の ts ファイルを作成する

```ts
function sum(a:number, b: number) {
  return a + b
}

console.log(sum(1, 2));
```

sum.ts というシンプルな数値限定の足し算の ts ファイルを作成

---

## tsc コマンドでコンパイルして js ファイルに変換。

```
tsc sum.ts
```

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

```ts
function sum(a, b) {
    return a + b;
}
console.log(sum(1, 2));
```

tsc コマンドを ts ファイルに対してかけると js ファイルにコンパイルされる。型の情報が消えて出力される。

その js ファイルを VSCode で開くと同じディレクトリにコンパイルすると同じ名前の関数が複数あるとみなされてエラーメッセージが出るが、無視して OK。

https://js.studio-kingdom.com/typescript/project_configuration/tsconfig_json

なお、tsc hoge.ts のようにファイルを指定してコンパイルをすると、strict: true のような tsconfig の内容が無視されてしまうので注意。

後述の ts-node コマンドでは tsconfig の内容が適用される。

---

## node コマンドで先ほど変換された js ファイルを実行

```
node sum.js
3
```

node コマンドでできた js ファイルを実行する。
tsc コマンドは js ファイルへの変換（コンパイル）のみで
ts ファイルを直接実行することはできない。

---

## 型情報が間違っている ts ファイルを作成して vscode のエディタ上でエラーをチェックする

```
function sum(a:string, b: number) {
  return a + b
}

console.log(sum(1, 2));
```

文字列と数値を引数に取るのに
数値と数値を渡してしまっている、間違っている ts ファイルを作る



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

vscode で書いていれば
書いた瞬間にエラーが出てくれる。優秀。

---

## tsc でコンパイルした時のエラーを確認する

```
tsc sum.ts
sum.ts:5:17 - error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.

5 console.log(sum(1, 2));
                  ~
Found 1 error.
```

先ほどの型が間違っているまま tsc コマンドでコンパイルしようとすると
どこが間違っているのか教えて、コンパイルに失敗してくれる。

優秀。
なお、strict:true は反映されないので注意。

---

## ts-node で ts ファイルを直接実行する

```
npm i -g ts-node

added 17 packages, and audited 18 packages in 2s

found 0 vulnerabilities
```

ts-node をグローバルにインストール

```
ts-node sum.ts
11
```

ts-node コマンドで直接 ts ファイルを実行することもできる。
手軽。もちろん間違っていればエラーが出る。

こちらは tsconfig に書いた strict:true などの設定も反映される。

---

## まとめ

TypeScript を実行するには、tsc コマンドで JavaScript に変換して node コマンドで実行する方法と
ts-node コマンドで直接 TypeScript を実行する方法がある。

前者はファイル指定で動かすと tsconfig.json の内容を無視して実行してしまう。

なので tsconfig.json に null を許容しない strict:true などの設定を書いている場合は tsc をファイル指定で書けると間違っている結果が出てしまう。
Lighthouse: Full marks got our website hosted on OpenBSD server (on 2022-02-20)
Tags: lighthouse, seo, openbsd, cloudflare
Published: 2022-02-20 07:50:00

Yay, our website, [obsd.solutions](https://obsd.solutions/en/), on [OpenBSD](https://www.openbsd.org/) server got full marks on [Lighthouse](https://web.dev/measure/) !!!

It is hosted on our OpenBSD server with [httpd](https://man.openbsd.org/httpd.8), their default web server. We deeply appreciate them for their solid [OS](https://www.openbsd.org/faq/faq4.html#Download), and also [Cloudflare](https://www.cloudflare.com/) for their fast and flexible network. Also, their great mind on security.

![obsd.solutions landing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4z8d7f2g2xedz6wbcdes.jpg)

![obsd.solutions 404 error returned by OpenBSD httpd](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ybxg3xeul4btsl4zrtmv.jpg)

![Lighthouse gave perfect scores to us](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zu4nlo6mh7affhngn215.jpg)
TypeScript utility types: Pick and Omit
Tags: typescript, javascript, beginners
Published: 2022-02-20 07:20:38

In the previous article, we first looked at [TypeScript utility types: Partial and Required](https://daily-dev-tips.com/posts/typescript-utility-types-partial-and-required/).
We'll dive into `Pick` and `Omit` in this article.

These are both used to create a new type with only a set of options from the original type.

However, they both work slightly differently. Let's take a look at the high-level difference.

- `Pick` only take the items you define you want
- `Omit` will pick every item you don't define to omit

So the result of both is very similar, it depends on your needs which one you might like.

## The TypeScript Pick utility type

I'll be sticking to the same example we used before: a user interface.

```js
interface User {
  id?: number;
  firstname: string;
  lastname?: string;
  age: number;
  telephone?: number;
  twitter?: string;
}
```

Now let's say we want to have a separate type that can pass around only the full name, so it doesn't need any other fields?

We can define a new type in which we can define the fields we would like to use.

```js
type UserFullname = Pick<User, 'firstname' | 'lastname'>;

const userName: UserFullname = {
  firstname: 'Chris',
  lastname: 'Bongers',
};
```

Our username variable is now used to ensure only those two fields are set.
You might have spotted the delimiter `|`. It's used as a separator, and it will select both fields.

You'll often need this kind of type manipulation when using different return types, where you might want to exclude specific fields.
But you can also think about child components that only take specific fields from a bigger object.

## The TypeScript Omit utility type

Like the `Pick` type, the `Omit` can be used to modify an existing interface or type.
However, this one works the other way around.

It will remove the fields you defined.
We want to remove the `id` field from our user object when we want to create a user.

```js
type UserPost = Omit<User, 'id'>;

const updateUser: UserPost = {
  firstname: 'Chris',
  lastname: 'Bongers',
  age: 32,
};
```

Even though our `id` was already a conditional field, it's now fully removed from the type, so we can't even pass it along!

![TypeScript Omit utility type](https://cdn.hashnode.com/res/hashnode/image/upload/v1644556786814/XEgUklhHB.png)

And there you have it, the use cases for `Pick` and `Omit` in the following article. We'll go more in detail on how powerful they are when combined.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
CONFLICT OF INTEREST
Tags: taskforce, codeofafrica, awesomitylab
Published: 2022-02-20 07:02:00

Life has its ups and downs and in every one of these scenarios, there is an opportunity underneath if you are prepared just enough to receive it. I had a share of mine when I got admitted into the task force 5.0 which prompted me to request for a leave from my other workplace in order to pursue my goals. 

I work as a network engineer where I monitor institution servers to ensure they are always on and accessible all the time. My passion lies in software development and I’ve been doing it as a hobby for a while and I was not ready to let this opportunity slip by.

![stressed out](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3sm25dv4nosup2m02lrk.jpeg)

> Courage is resistance to fear, mastery of fear, not absence of fear - Mark Twain

In the first days, it was really hard to cope up as I had to be available for the program during the day and work at night and the stress was mounting which degraded my performance in everything I participated in except eating.

I kept on questioning my choice whether it was worth it or not. While I continued to question what I was doing, I realized that there were two options, to continue doing things the same way which would limit my learning progress or to man up and change the course of my learning curve to improve my skills in what I consider my passion.
Later on I realized if I kept on stressing in the first week, I was never going to be able to finish the program, so I started taking everything simple and one at a time.

As days went by, I started settling in with others, enjoyed the environment and their company which kept me motivated to be available everyday regardless.

I was introduced to different concepts like Miro, an online collaboration whiteboard, agile approach in project management, online meeting ethics and the egg challenge was the first teamwork test that made everything fun.
The whole experience was awesome and can't wait for the upcoming weeks.
Introduction to Blockchain
Published: 2022-02-20 06:46:01

## Cryptocurrency Programming

In this article, we're going to take a look at the cryptocurrency programming market, which is a bustling marketplace of ideas and innovation. In recent years, there has been an increase in demand for people with skills in the programming involved with digital wallets, payments, and other areas of cryptocurrency.

## Introduction To Cryptocurrency Programming

Cryptocurrency has become a popular topic in the past few years. This blog post aims to introduce you to cryptocurrency programming by explaining some of the common problems programmers face when working with this type of code.

## How To Generate Your Wallet Address

You will need a wallet to store your coins. A cryptocurrency wallet is a software program that stores private and public keys and interacts with various blockchain to enable users to send and receive digital currency and monitor their balance.

## How To Use And Send Cryptocurrency

A crypto wallet is a digital wallet that stores the public and private keys which you use to send, receive, and store digital currency. You can get a crypto wallet from an exchange platform or create your own using open-source software such as Bitcoin Core.

Conclusion

The goal of this blog is to teach the basics of programming in order to be able to develop and deploy a cryptocurrency. There are 4 principles that one needs to take into consideration: First, a working blockchain must be created. Second, there must be an incentive for miners (but not the general population) to work on the blockchain. Third, tokens need to be generated and distributed as rewards so people can get paid for their work. And finally, the system needs a way to make sure that transactions are valid and legitimate. In order, these four principles will enable anyone with basic programming skills to successfully design and deploy their own cryptocurrency.
Developer Portfolios To Check out
Tags: portfolio, webdev, portfoliowebsite, webdesign
Published: 2022-02-20 06:43:34

A Portfolio website is a necessary for every Web developer and when you don't have a portfolio website it's a good idea to get some inspiriation from other's websites to help create your own.

Here are some of my favourite protfolio websites from awesome Web Developers.

## [Verse](verse.sh)
![Website screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aqkdy2anzcfhqcmoa76p.png)
 
He is a full stack developer and what I like most about his website is how minimal and starightforward it is.

## [Rafael Caferati](caferati.me)
![website screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nfcspxr6clgwc8zqx030.png)

He is an award-winning full-stack web developer and UI/UX javascript specialist. His website is has lots of cool animataions and a built in game that destroys his website, it's pretty cool.

## [Pierre Nel](pierre.io)
![website screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r0hvt51fr7bj0fineg6y.png)

An another straightforward minimalistic website but has a 3D interactive element that looks nice.

## [Jack Jeznach](jacekjeznach.com)
![website screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g5l0nv3niy7kwmb1p9sd.png)

You probably know about this one but I still included in just In case someone didn't know, his website is very popular and the animation on his home page is so freaking cool, he also changes it to something new every once in a while.

## [Brittany Chiang](brittanychiang.com)
![website screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/44bahruor01za5pyq72z.png)
 
Coolest looking website in this list, her website looks futuristic like Cyberpunk except it dosn't have a lot of bugs unlike the game, the website is also Opensource so you can clone it and use it for your own portfolio if you add the attribution.

## [Seyi](seyi.dev)
![website screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/at5k4wpywfdr054h3zsv.png)

The most unique looking website is the list, I haven't seen any website like this before, her website is full of big text with on scroll animations which looks pretty neat ngl.

## [Anurag Hazra](anuraghazra.dev/)
![website screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9mxex8bn754ofkfpn7b4.png)

He is a frontend developer and has been coding since 6th grade just like me, his website has this cool material design look that I like a lot.

## [Adenekan](codewonders.dev)
![website screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bocmsydoobyhn8nvpiye.png)

He is a Frontend developer, UX architect and Javascript engineer, his website is also very straightforward but has really cool animations, especially that glitch animation on his header text so freaking cool, I like that a lot.

---
Hope you like this list, if you know some more awesome portfolio websites share them in comments.
---
Best Resources listed for beginners or Job seekers.
Tags: beginners, developers, job, career
Published: 2022-02-20 06:35:49

## 10 Sites for Interview Preparation

1. Ambitionbox
2. AceThelnterview
3. Geeksforgeeks
4. Leetcode
5. Gainlo
6. Careercup
7. Codercareer
8. InterviewUp
9. InterviewBest
10. Indiabix

## Top 10 Sites for your career

1. Linkedin
2. Indeed
3. Naukri
4. Monster
5. JobBait
6. Careercloud
7. Dice
8. CareerBuilder
9. Jibberjobber
10. Glassdoor

## 10 Tech Skills in demand

1. Machine Learning
2. Mobile Development
3. SEO/SEM Marketing
4. Data Visualisation
5. Data Engineering
6. UI/UX Design
7. Cyber-security
8. Cloud Computing/AWS
9. Blockchain
10. IOT

## 10 Sites to review your resume for free

1. Zety Resume Builder
2. Resumonk
3. Resume dot com
4. VisualCV
5. Cvmaker
6. ResumUP
7. Resume Genius
8. Resumebuilder
9. Resume Baking
10. Enhancy

## 10 Sites to learn Excel for free

1. Microsoft Excel Help Center
2. Excel Exposure
3. Chandoo
4. Excel Central
5. Contextures
6. Excel Hero b.
7. Mr. Excel
8. Improve Your Excel
9. Excel Easy
10. Excel Jet

## 11 Sites for Free Online Education

1. Coursera
2. edX
3. Khan Academy
4. Udemy
5. iTunesU Free Courses
6. MIT OpenCourseWare
7. Stanford Online
8. Codecademy
9. ict iitr
10 ict iitk
11 NPTEL
Task-Force Pilot Week
Tags: beginners, taskforce, bootcamp
Published: 2022-02-20 06:13:47

**What is Task-Force**
Task force is a program aiming to bridge the knowledge gap of software developers either university graduates or self-taught developers with profound previous knowledge of programming or designing. 

> find more about taskforce [here](https://codeofafrica.com/EN/blog/Life%20After-Taskforce)

**1. Team Building**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/co2r94pyfcastc1o8afu.jpeg)
We started off, with a team-building session. we started with a game of picking an egg and putting it on top of a bottle, which involved all 5 members of the group at once.

one of many lessons I learned from that game is; to listen more to what my team members, before deciding on the action to be taken, for the treasure lies in details.

later we were randomly picked, and assigned several assignments, which helped us put to use the skills we gained from the team building session.

**2. Project Management**


We had the opportunity to learn Project Management skills from Yves Ndejuru, where we took a deep dive into waterfall and Agile (project management methodologies).

#### Agile

This can be described as an iterative approach to delivering a project throughout its life cycle. This methodology breaks down large tasks to be completed in specific time frames called sprints.
In my point of view, it's used to promote flexibility, velocity (delivering pieces of the project to the user to ensure customer needs are met and get his/her product to the market in time with the best quality) and adaptability (enhance your product with the latest client needs). the methodology breaks down large tasks to be completed in specific time frames.

#### Waterfall

unlike Agile, waterfall is best suited for projects with a clear picture of the final product, it only works if a client doesn’t expect to make changes to the scope of the project after it has commenced.

some areas that waterfall works well are; construction, Manufacturing, repeated services, and many more.

in concluding there's more to come, in the 5 remaing weeks ahead, and i can't wait
Password and Confirm Password Validation in Laravel
Tags: laravel, webdev, beginners, tutorial
Published: 2022-02-20 06:07:46

## Introduction
Laravel form requests are special classes that extend the functionality of regular request classes, enabling advanced validation features. Form requests also help to keep your controller actions a lot cleaner, because you can move all your validation logic to the form request class. Another benefit is that it allows you to filter requests before they reach your controller actions.

It’s always a good idea to put a password confirmation field in your forms since the password is a masked field and the user would never know if they made a typing mistake while filling out the password.

On the backend validation, you just need to use the confirmed validation rule for your password field.
```
$request->validate([
    'password' => 'required|confirmed|min:6'
]);
```
Also in your HTML, you need to make sure the password field used to input confirmation from the user must be named password_confirmation.

## Bootstrap FrontEnd Code for Laravel Password and Confirm Password Validation

Here is the bootstrap form code that includes both the fields and also displays an error when the validation fails.


![Password and Confirm Password Validation in Laravel - TechvBlogs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hmdn6pqnn80gnpap7jgk.png)

```
<div class="form-group row">
    <label for="password" class="col-md-4 col-form-label text-md-right">Password</label>

    <div class="col-md-6">
        <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">

        @error('password')
            <span class="invalid-feedback" role="alert">
                <strong>{{ $message }}</strong>
            </span>
        @enderror
    </div>
</div>

<div class="form-group row">
    <label for="password" class="col-md-4 col-form-label text-md-right">Confirm Password</label>

    <div class="col-md-6">
        <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password_confirmation" required autocomplete="current-password">
    </div>
</div>
```
**Thank you** for reading this blog.
Nested Resource Routing
Tags: rails, nestedresources, routing
Published: 2022-02-09 21:09:35

Nested resources give us a way to document the parent/child relationship in our routes and URLs. 

As an example, let's says we're planning a wedding and looking at venues so we create a Rails app with a `venues` resource and a `reviews` resource where you can display all venues in an area and each venue has many reviews. What we would like to end up with is a path like `/venues/1/reviews` to see all the reviews for a particular venue or `/venues/1/reviews/2` to read a particular individual reviews for a venue. 

A normal but rather cumbersome way to achieve these results would be to write some routes with dynamic segments and telling them exactly which controller will handle the actions. Then write the code for the actions in the `venue_controller` to do the work. The routes would look like this: 

```
get '/venues/:venue_id/reviews', to: 'venues#index'
get '/venues/:venues_id/reviews/:id', to: 'venues#review'
```
And the actions like this: 

```
def index
  venue = Venue.find(params[:venue_id])
  reviews = venue.reviews
  render json: reviews, include: :venue
end

def review
  review = Review.find(params[:id])
  render json: review, include: :venue
end
```
Although this way works, it violates Separation of Concerns because the responsibility of rendering reviews is now under the `venues_controller`, and not only that it violates Don't Repeat Yourself (DRY) because the same code is essentially repeated in the `reviews_controller`.

Thankfully Rails has an easier way to do this but we need to utilize the ActiveRecord associations between our venues and our reviews. A venue `has_many :reviews` and a review `belongs_to :venue`. Because of this we can consider reviews to be a child of a venue. This allows Rails to consider it a nested resource of a venue for routing purposes. Our new routes will look like:

```
resources :venues, only: [:show] do
   resources :reviews, only: [:show, :index]
end

resources :reviews, only: [:show, :index, :create]
```
Now rather than dealing with the `venues_controller` we are instead dealing with the `reviews_controller` for the nested routes, so we are no longer violating Separation of Concerns. Not only that, but we only need the code for the `:show` and `:index` actions that is already in the `reviews_controller`, rather than redoing it in the `venues_controller`, so no more repeating code!

The last step is updating the `:index` action in the `reviews_controller` to handle the nested resource. 

```
def index
   if params[:venue_id]
      venue = Venue.find(params[:venue_id])
      reviews = venue.reviews
   else
      reviews = Review.all
   end
   render json: reviews, include: :venue
end
```
The conditional is used to differentiate if a wedding planner is trying to access all reviews of all the venues or if they are trying to access all reviews of a specific venue. Hopefully this quick lesson allows you to keep your routes clean without any violations of Separation of Concerns or Dry!