teleren/devto huggingface dataset:
Self-Taught Developer Journal, Day 27: TOP JavaScript Fundamentals Part 2 - Data Types Overview cont. and Comparisons
Tags: webdev, beginners, codenewbie, devjournal
Published: 2021-12-29 03:05:24

Today I learned...
### Boolean
- true or false values
- values can also be a result of comparisons, ex. `let isGreater = 5 > 2; \\true`


### null value
- a special value that represents "nothing", "empty", or "value unknown" 

### undefined value
- represents a value not assigned
- can explicitly assign `undefined` value to a variable but this is not recommended. Instead, use the `null` to assigning a "nothing" or an "empty" value.

### Objects
- object type is special
- not a primitive value
- represents more complex data structures

### Symbols
- used to create unique identifiers for objects

### typeof operator
- returns the type of argument
- `typeof x` is equivalent to `typeof(x)`
- `typeof null` returns object which is incorrect and an error of JS
- `typeof alert` will return function but functions are technically an object data type

## Conditionals
### String Comparison
* strings are compared letter by letter
* longer strings are greater
* uses Unicode

### Comparison of Different Types
* converts values to numbers

### Comparison with null and undefined
* `null` === `undefined` is false (strict equality)
* `null` == `undefined` is true (loose equality)

#### For math and comparisons (<,>,>=,<=)
* `null` becomes 0
* `undefined` becomes `NaN`.

#### Strange Result: null vs 0
1. `null > 0` is false, null becomes 0 with the comparison operator, 0 is not greater than 0.
2. `null == 0` is false, the == equality does not convert null and null does not equal 0.
3. `null >= 0` is true, null is converted to 0 and fulfills one of the operator condition (0 equals 0)

#### An incomparable undefined
* shouldn't be compared to other values
1. `undefined > 0` is false
2. `undefined < 0` is false, examples 1 and 2 show undefined converted to NaN by the comparison operators and NaN is a numeric value and returns false for all comparisons.
3. `undefined == 0` is false, returns false because the undefined only equals `undefined` or `null`.

Treat comparisons with undefined\null with care.

## Resources
[The Odin Project](https://www.theodinproject.com/paths/foundations/courses/foundations/)
https://javascript.info/types
https://javascript.info/comparison
Buy Screen Printing Machine in India
Published: 2021-12-29 02:21:34

SASG UV Solutions makes a wide range of **[screen printing machine](https://www.sasguv.com/screen-printing-machine/)** in India, including precision screen printing machines, pneumatic screen printing machines and clam shell screen printing machines. These machines are known for their high speed and heavy duty usage. Along with, screen print machines work great with silks, polyesters, jersey fabrics, wool, and acrylics.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e0tkt69y2o84e568otoh.jpeg)
Simple signup function using FP-TS
Tags: functional, typescript
Published: 2021-12-29 01:53:00

I tried to make a simple user signup function using FP-TS.

```typescript
// user-controller.ts
import argon2 from "argon2";
import * as E from "fp-ts/Either";
import { flow, pipe } from "fp-ts/lib/function";
import * as TE from "fp-ts/TaskEither";
import {
    UserProfile,
    UserProfileRepository,
} from "../db/entities/user_profile";

function hashPassword(plainPassword: string) {
    return () => argon2.hash(plainPassword).then(E.right).catch(E.left);
}

export function signup(userName: string, email: string, password: string) {
    const makeUserProfile = (userPassword: string) =>
        new UserProfile({ userName, email, userPassword });
    return pipe(
        password,
        hashPassword,
        TE.chain(flow(makeUserProfile, UserProfileRepository.insertProfile))
    )();
}

```

How to call:

```typescript
// user-router.ts
import express from "express";
import { pipe } from "fp-ts/lib/function";
import { signup } from "../controllers/user-controller";
import * as E from "fp-ts/lib/Either";

router.post("/signup", async (req, res) => {
    const { username, password } = req.body;
    const userE = await signup(username, username, password);
    pipe(
        userE,
        E.bimap(
            (e) => res.send({ ok: false, message: e.message }),
            (user) =>
                res.send({
                    ok: true,
                    message: `user ${user.userName} registered `,
                })
        )
    );
});
```

There must be better ways to compose the functions, will come back to it when I learn more.
Cara membuat proxy middleware untuk cross API.
Tags: node, javascript
Published: 2021-12-29 01:48:12

Ada beberapa hal yang menjadi kendala ketika kita melakukan fetch API dengan backend yang disetup secara strict. Salah satunya adalah `crossOrigin` handling. Maka dari itu terkadang kita perlu menambahkan middleware ketika ingin melakukan komunikasi server to server. Pada umumnya, middleware adalah authentication, untuk mengecek apakah seseorang yang mengakses suatu web sudah log-in dan memiliki hak akses atau belum. Web hanya akan bisa berjalan diatas Web Server. Mari kita coba membuat middleware agar dapat berkomunikasi server-to server.

Berikut tech yang diperlukan :
1. express
2. htt-proxy-middleware

Berikut sample code :

    const express = require("express");
    const { createProxyMiddleware } = require("http-proxy-middleware");

    const app = express();

    const proxy = createProxyMiddleware({
    target: "https://api.dsm-staging.app.dasiot.site",
    changeOrigin: true,
    });

    app.use("/api", proxy);

    app.listen(5000);



Demikian cara untuk melakukan proxy pada server to server communication
Laravel Websockets in valet cURL error 60: SSL certificate problem: unable to get local issuer certificate  
Tags: laravel
Published: 2021-12-29 01:08:14

To fix the above exception you should add the valet certificate to the end of the openssl cert.pem file:

`cat ~/.config/valet/CA/LaravelValetCASelfSigned.pem >> /usr/local/etc/ca-certificates/cert.pem`

You can find the cert.pem location running this `dd(openssl_get_cert_locations());` anywhere in the Laravel app.
C++ Complete Roadmap 2022
Tags: cpp, c, programming, tutorial
Published: 2021-12-29 00:28:33

##C++ Complete Roadmap 2022
In this blog we are going to discuss complete roadmap for c++ in 2022. I will give you only topics and if you like my post then follow my Blogs. Lets Start:-👇

###[C++ Complete Roadmap 2022](https://codexashish.com/2021/12/complete-roadmap-of-c-programming.html)


##New & Trending Topics:👇
[Top 10 Trending Technologies to Learn in 2022](https://codexashish.com/2021/12/top-10-trending-technologies-to-learn.html)
[Top 10 Programming Languages You Must Know In 2022](https://codexashish.com/2021/12/top-10-programming-languages-you-must.html)
[Machine Learning Complete Roadmap 2022](https://codexashish.com/2021/12/complete-roadmap-of-machine-learning.html)

##Complete Roadmap 2022:-👇
[Python Complete Roadmap 2022](https://codexashish.com/2021/12/complete-roadmap-of-python-programming.html)
[Machine Learning Complete Roadmap 2022](https://codexashish.com/2021/12/complete-roadmap-of-machine-learning.html)
[C++ Complete Roadmap 2022](https://codexashish.com/2021/12/complete-roadmap-of-c-programming.html)
[Java Complete Roadmap 2022](https://codexashish.com/2021/12/java-complete-roadmap-2022.html)
[Data Structure Complete Roadmap 2022](https://codexashish.com/2021/12/complete-roadmap-of-data-structure.html)


##Some Laravel Tutorial for developer:👇
[Laravel 8 Interview Questions and Answers in 2022 (Part #1)](https://codexashish.com/2021/12/laravel-8-interview-questions-and.html)
[Laravel 8 Interview Questions and Answers in 2022 (Part #2)](https://codexashish.com/2021/12/laravel-8-interview-questions-and_22.html)
[Advance Laravel 8 Interview Questions and Answers 2022](https://codexashish.com/2021/12/advance-laravel-8-interview-questions.html)
[Everything About Laravel 8 Composer 2022 | Composer in Laravel 8](https://codexashish.com/2021/12/everything-about-laravel-8-composer.html)
[Laravel Jetstream vs Laravel ui  vs Breeze](https://codexashish.com/2021/12/laravel-jetstream-vs-laravel-ui-vs.html)

##Python Concept and Projects:-👇
[10 Best Python Libraries For Machine Learning](https://codexashish.com/2021/12/10-best-python-libraries-for-machine.html)
[Alarm Clock in Python with GUI](https://codexashish.com/2021/07/alarm-clock-in-python-with-gui.html)
[Tic Tac Toe Game Using Pygame in Python](https://codexashish.com/2021/06/tic-tac-toe-game-using-pygame-in-python.html)

**Thankyou for reading my blogs.**
#####My Website:👇
[CodexAshish](https://codexashish.com/)
Why most Agile Transformations fail
Tags: agiletransformation, agile
Published: 2022-02-10 21:05:22

---
title: Why most Agile Transformations fail
published: true
date: 2021-12-29 00:00:00 UTC
tags: agiletransformation,agile
canonical_url: https://jhall.io/archive/2021/12/29/why-most-agile-transformations-fail/
---

“Agile Transformation” is a buzzword almost as popular as “Agile”.

But what does it mean?

Definitions vary, but I particularly like this one from [airfocus.com](https://airfocus.com/glossary/what-is-agile-transformation/):

> Agile transformation refers to a company or organization’s full transition into the agile mindset.

I like this one because it really highlights the contradiction I believe is inherent in the term “Agile Transformation” which I want to talk about today.

Let’s continue by defining “transformation”, which is a bit easier, since we can consult a standard [dictionary](https://www.merriam-webster.com/dictionary/transformation):

> an act, process, or instance of transforming or being transformed

Built into this definition is an implicit sense of achieving completeness. We also see this in the airfocus definition above.

Here’s the key: **Transformation implies an end state.**

And the contradition: [Agile is about](https://agilemanifesto.org/) **responding to change**

If we’re responding to change, it means we recognize there is no end state.

“Yeah, but the end state we’re looking for is one in which we can respond to change,” you may say. And to that extent you would be absolutely spot-on. That type of “transformation” is not a problem. But is that what everyone else in your company means? I doubt it. But here are some clues to look for:

- Is there an end date on your company’s “Agile Transformation”?
- Is your “Agile Transformation” being lead by outside talent? That is, consultants or freelancers brought in as Agile Coaches or other expert titles, on a short-term basis?
- Is the focus on implementing new policies and procedures, or on addressing bottlenecks that prevent responding to change?

If you answer “yes” to any of these, it’s an indication that your “Agile Transformation” is seen as a temporary state, with an end date, and as such is _not_ actually an Agile Transformation. It’s “Agile in a box” snakeoil.

The sad irony is that a successful agile transformation starts with a change of mindset. And with that new mindset in place, you’ll see through any “transformation” that is ostensibly about giving you that change of mindset.

True agility is a never-ending journey. To paraphrase Ralph Waldo Emmerson:

> Agile is a journey, not a destination.

If you really want to lead your organization to agility, do it by making one change today that allows for faster response to change. Then repeat. Every day. Forever.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Next.js on Azure with Sitecore JSS
Tags: nextjs, azure, sitecore, jss
Published: 2021-12-29 00:00:00

---
title: Next.js on Azure with Sitecore JSS
published: true
date: '2021-12-29'
spoiler: Running Sitecore JSS headless frontend with Next.js on Azure with all its CSR, SSR, SSG, and ISG goodness could look like this...
description: Running Sitecore JSS headless frontend with Next.js on Azure with all its CSR, SSR, SSG, and ISG goodness could look like this...
tags: nextjs, azure, sitecore, jss
canonical_url: https://www.sergevandenoever.nl/nextjs-on-azure-with-sitecore-jss
cover_image:
series: nextjs-on-azure
---

With the Next.js on Azure solution as can be found in the open-source GitHub repository https://github.com/macaw-cad/nextjs-on-azure, we see the implementation of a Next.js solution connected to Sitecore JSS and all the future goodness as follows:

![Next.js on Azure - Sitecore JSS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/chavy7xbj6cldpe01t7p.png)

Core web trafic is handled by Azure CDN, which supports the required expiration headers for Next.js. When Incremental Static Regeneration (ISG) is needed for a specific page, this is handled by a consumption-based Azure function. Assets like images are currently streamed through Azure functions as well, and are cached in the Azure CDN. When Experience Edge is used, the CDN of Experience Edge will fullfill this function for assets.

For more information see my blog post [Next.js on Azure, and an example on how to use it for Sitecore JSS](https://www.sergevandenoever.nl/nextjs-on-azure-and-sitecore).
Python: How To Make A Letter Counter
Tags: programming
Published: 2021-12-31 08:56:52

---
title: Python: How To Make A Letter Counter
published: false
date: 2021-12-29 00:00:00 UTC
tags: Programming
canonical_url: https://www.Kudadam.com/blog/letter-counter-python
published: true
---

<nav><p>Table Of Contents</p>
<ol>
<li><a href="#the-code">The code</a></li>
<li><a href="#testing-the-fuction">Testing the fuction</a></li>
<li><a href="#modified-code">Modified Code</a></li>
</ol></nav>

So this blog post is about a problem which I found in Sololearn where you are to make a simple program that takes a group of text and then returns a dictionary showing the occurence of each letter

So a letter counter is simply a program which takes a text or string and returns the number of occurrence of each letter. We are going to make a python function which takes a string and returns a dictionary with the number of occurence of each letter
## The code

```python
def letter_counter(text):
    dict = {}
    for i in text:
        dict[i] = text.count(i)
    return dict
```

So a function called `letter_counter` was created and it takes text as parameter. Then inside the function, we create an empty dictionary called `dict`. Then on the next line, we iterate through all the characters in the `text` variable, we then include the current letter inside the `dict` dictionary. Then we use the `.count` method of the string class to find the number of occurrence of the current letter and assign it as the value of the letter in the dictionary. Then finally, we return the `dict` variable.

## Testing the fuction

So let’s text the fuction we just created with this string “Lucretius is a great developer”.

```python
text = "Lucretius is a great developer"
print(letter_counter(text))
```

```
{'L': 1, 'u': 2, 'c': 1, 'r': 3, 'e': 5, 't': 2, 'i': 2, 's': 2, ' ': 4, 'a': 2, 'g': 1, 'd': 1, 'v': 1, 'l': 1, 'o': 1, 'p': 1}

[Program finished]
```

Well, the fuction works alright but there is a slight problem.  
If you are to check the output carefully, you can see the fuction found the number of occurrence for whitespaces as well but whitespaces are not letters so let’s modify our fuction to exclude whitespaces.

## Modified Code

```python
from string import ascii_letters
def letter_counter(text):
    dict = {}
    for i in text:
        if i in ascii_letters:
            dict[i] = text.count(i)
    return dict
```

Now if you are to run the fuction, you will realize that it excludes all non-letters from the dictionary.

What we did was to import the `ascii_letters` constant from the string module, then before adding a character to the `dict` variable, we check if the current character is included in the letters constant, if it is, we add it; meaning it’s a letter, else, we exclude it.  
Happy Coding :smile:
Log4j 2.17.0 に関わる新たな RCE 脆弱性 (CVE-2021-4483)
Tags: log4j, security, vulnerability, cve
Published: 2021-12-28 22:40:42

[Log4j](https://logging.apache.org/log4j/2.x/) 2.17.1 がリリースされました。新たな RCE 脆弱性が発見されたためです。([CVE-2021-4483](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44832))

[Apache ソフトウェア財団 によると](https://logging.apache.org/log4j/2.x/security.html)、CVSS は 6.6 で深刻度は中程度です。

攻撃者がログ設定ファイルの編集権限を有する場合に、危険があります。

---

本記事は[小社のツイート](https://twitter.com/scqrinc/status/1475957703545856001)をもとにしています。
We need more games that make us think
Tags: discuss, improvement, dailythoughts, nft
Published: 2021-12-28 22:37:16

---
title: We need more games that make us think
published: true
description: We need more games that make us think
tags: discuss, improvement, dailythoughts, nft
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q1he7dt23a9o1nu63lv8.jpg
---

_Originally posted on [my blog](https://www.nikola-breznjak.com/blog/daily-thoughts/we-need-more-games-that-make-us-think/)._

> We need more games that make us think instead of those that dumb us down. Video games are not bad (in moderation). Boardgames are better. Puzzle games are great.

I used to love [hacker challenge games](https://www.nikola-breznjak.com/blog/miscellaneou/hacker-games/help-create-list-hacker-challenge-games/), and recently I stumbled upon one on iOS called [63](https://solve63.com/).

As a testament that I didn't lose my mojo completely 😏, I finished on the Leader board.

Great game, check it out, and please recommend any other that you may know that's similar.

Oh, and BTW, because why not, you can get one of the 62 images (I kept one for myself) above as an NFT on [OpenSea](https://opensea.io/assets/matic/0x2953399124f0cbb46d2cbacd8a89cf0599974963/104453672621605352725909998208286431899952527322523624220236451257668721442879)

---

⚠️ In this new "Daily Thoughts" series, I'm just scratching my own itch. For too long now I've been reading and consuming. Not that there's something inherently wrong with that, but if one doesn't offset that with his own producing, one often falls into the trap of staying a consumer. If you think you know something, or want to learn something about yourself, try to explain it 'on paper'.

Personally, I think best 'on paper', and it's been a while since a wrote a post. So, I'll start small (and build up a habit of daily writing again) by sharing a thought daily. I'll use this as a retrospective a year from now.

Dear readers, feel free to chime in with your thoughts on my thoughts (so Meta; which is popular in its own right these days).
A new RCE vulnerability on Log4j 2.17.0 (CVE-2021-4483)
Tags: log4j, security, vulnerability, cve
Published: 2021-12-28 22:36:48

[Log4j](https://logging.apache.org/log4j/2.x/) 2.17.1 was released because a new vulnerability on RCE (Remote Code Execution) had been found in 2.17.0. ([CVE-2021-4483](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44832))

[According to The Apache Software Founndation](https://logging.apache.org/log4j/2.x/security.html), CVSS is 6.6 and the severity is moderate.

There is the risk when an attacker has the permission to modify the logging configuration file.

---

This post is based on [the tweet by my company](https://twitter.com/scqrinc/status/1475957089738850309).
Serve html from your command line
Tags: vim, linux, todayilearned
Published: 2021-12-28 21:50:07

---
canonical_url: https://waylonwalker.com/til/serve-html-command-line/
tags:
- vim
- linux
- til
title: Serve html from your command line
series: til
published: true
---

When I first moved to vim from and ide like vscode or sublime text one of my very first issues was trying to preview my website at `localhost:8000`.  There had always just been a button there to do it in all of my other editors, not vim.  There are not many buttons for anything in vim.  While there is probably a plugin that can run a webserver for me in vim, it's not necessary, we just need the command line we are already in.

## running a separate process

You will need a way to run another process alongside vim, here are a couple ideas to get you going that are not the focus here.style

* use background jobs
  * c-z to send a job to the background
  * fg to bring it back
* use a second terminal
* use a second tab
* use tmux and run it in a separate split/window
* use an embeded nvim terminal

## running a development webserver from the command line

Python already exists on most linux systems by default, and most are now on python3.  If you are on windows typing python will take you directly to the windows store to install it, or you can also use wsl.

``` bash
# python3
python -m http.server

# running on port 5000
python -m http.server --directory markout 5000
```

```
# for the low chance you are on python2
python -m SimpleHTTPServer

# running on port 5000
python -m SimpleHTTPServer 5000
python -m SimpleHTTPServer --directory markout 5000

```

![running a python static webserver from the command line](https://images.waylonwalker.com/python-m-http-server.png)

## using nodejs

If you are a web developer it's likely that you need nodejs and npm on your system anyways and may want to use one of the servers from npm.  I'll admit with these not being tied to the long term support of a language they are much more feature rich with things like compression out of the box.  In my opinion they are nice things that you would want out of a production server, but may not be necessary for development.

### installing npx

``` bash
# if you don't alredy have npx
npm i -g npx
```

> npx is a handy tool that lets you run command line applications straight from npm without installing them.  It pulls the latest version every time you want to run, then executes it without it being installed.

### running the http-server with npx

``` bash
npx http-server

# running on port 5000
npx http-server -p 5000
npx http-server markout -p 5000

```

![running a nodejs static webserver from the command line](https://images.waylonwalker.com/npx-http-server.png)


---

## TIL

I am shortening up my content pipeline by releasing short #til articles The full list of them is posted on my website.

https://waylonwalker.com/til

## connect

twitter: https://twitter.com/_WaylonWalker
twitch: https://www.twitch.tv/waylonwalker
github: https://github.com/waylonwalker/
Please stop doing stupidly complex technical interviews!
Tags: management
Published: 2021-12-28 20:47:09

---
title: "Please stop doing stupidly complex technical interviews!"
published: true
description: 
tags:
  - management
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gtbxzu5iqvglban30gye.png
---

![Please stop stupidly complex interviews?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gtbxzu5iqvglban30gye.png)

Oh the technical interviews, I am a 15 years experienced software engineer and I'm still afraid of them!. So we as human beings fear the unknown, but a good interview should be more like a conversation instead of a police interrogation.

Interviewers have asked me if I know S.O.L.I.D. principles, unit testing in deep and even I've been asked to use graph theory to solve a problem. When I got the job, there is a high dependency on a specific dll that do a lot of different things (This by it's own violates all SOLID principles), I never used anything they asked me, so what's the need to make the technical interview unnecessarily complex and tedious?. When I am interviewing a candidate I try to make a conversation like: Tell me about your experience, the latest project you are working on, what technology you like the most, and why. I guess that they are trying to emulate top-tech companies like GAFAM, what I have heard about these companies is that the technical interviews are very focused on data structures and problem-solving (not sure if they are used in daily work).

My point is: if your company focuses on a specific product, ask what you're looking for, ask for the technologies you are currently using, please stop doing stupidly complex technical tests unless your company is currently using these techniques to solve complex problems.

And as always, happy coding!.