teleren/devto huggingface dataset:
Taking Better Debugging Notes
Tags: productivity, programming, debugging
Published: 2020-12-01 02:32:14

---
title: Taking Better Debugging Notes
published: true
description: Keeping track of solutions to old bugs can be hard. This is how I do it.
tags: productivity, programming, debugging
//cover_image: https://direct_url_to_image.jpg
---

I've been a software developer for a long time. A core activity is encountering a strange error and the searching around the internet for hints on the cause. Sometimes I get lucky and the answer is in the first result on Google (which is probably a link to Stack Overflow). In many cases, I actually have to spend hours tweaking search terms and combing through dozens of search results. 

Eventually I find the answer though! It may not be clear cut and I have to adapt the information for the system I am working with, but the answer is found anyway. Problem solved.

6 months later... I encounter the same problem again. What search term did I use to find the answer? Even if I remember, dozens of links on the search results page are all clicked so I have to dig through them all again to find the one that I need.

<img src="https://www.dynomantle.com/images/debugging/search_results.png" alt="">

It kills me. Every. Single. Time.

Why can't I remember the solutions? Part of the problem is that these errors are one offs. I don't have to deal with them very often and 6 months is plenty of time to forget anything.

The other part of the problem is that I encounter so many errors like these! Software development is complex and the more technologies you work with, the more complex it becomes. Can't just bookmark the solutions because browser bookmarks work great if you have say three bookmarks, not three hundred or three thousand.

I could take notes in a note taking app. I've certainly tried. They all treat links like second class citizens though. The search feature will index my notes, but it will at best only index the link preview for a web page. That means I have to manually copy and paste the web page's content and html doesn't always paste nicely.

And so I've fallen back on the tried and true programmer's tactic: I built my own solution. At the forefront, it scrapes bookmarks so that both web pages and my note show up in search.

<img src="https://www.dynomantle.com/images/debugging/search_result.png" alt=""/>

It also doesn't require any note taking. Bookmarks can just be added to the app.

<img src="https://www.dynomantle.com/images/debugging/flexbox.png" alt="" />

Though oftentimes I do want to write a summary of the solution and tie it to a bookmark.

<img src="https://www.dynomantle.com/images/debugging/building_from_source.png" alt=""/>

And then there are really complex issues that require stitching together a solution from several links.

<img src="https://www.dynomantle.com/images/debugging/pdf_parse.png" alt=""/>

Originally, I built the tool just for myself. Some of my friends found it super useful too though so I made it publicly available. You can sign up and get some sample content for Python and Frontend Web Development using [this link.](https://app.dynomantle.com/signup?add_topic_template=1)
In tờ rơi màu giá rẻ TPHCM - Báo giá in tờ rơi màu, địa chỉ in tờ rơi màu giá rẻ có giao hàng tận nơi tại TPHCM
Published: 2020-12-01 01:54:03

Báo giá in tờ rơi màu giá rẻ TPHCM - chia sẻ các yếu tố quyết định đến giá in tờ rơi màu hiện nay

Báo giá tham khảo từ In Kỹ Thuật Số: In tờ rơi chỉ từ 400k/1000 tờ rơi A4.*

Nhận in tờ rơi màu giá rẻ TPHCM tại In Kỹ Thuật Số

*Giá có thể thay đổi tùy theo thời giá của nguyên vật liệu in như: giấy in, mực in, phí gia công in tờ rơi màu giá rẻ TPHCM.

Đối với dịch vụ in tờ rơi giá rẻ TPHCM - loại hình in ấn bằng công nghệ in offset cao cấp, trải qua nhiều công đoạn thực hiện, do đó, việc báo giá in tờ rời màu có thể không cụ thể, đồng nhất như với các loại hình in kỹ thuật số khác như: in hiflex, in PP, in decal, in poster,... do đó, để nhận được báo giá chính xác in tờ rơi, bạn cần liên hệ trực tiếp đến công ty in tờ rơi, xưởng in tờ rơi có cung cấp dịch vụ in này.

Tại In Kỹ Thuật Số, chúng tôi nhận báo giá in tờ rơi màu giá rẻ TPHCM nhanh chóng cho các yếu cầu:

+ In tờ rơi màu lấy liền, 
+ In tờ rơi giá rẻ TP. HCM,
+ Nhận in tờ rơi lấy liền,
+ In tờ rơi quảng cáo giá rẻ,
+ In tờ rơi nhanh chạy chương trình sự kiện,...
+ In nhanh kỹ thuật số tờ rơi

>>> Xem chi tiết: https://intoroi.vn/in-to-roi-mau-gia-re-tphcm-bao-gia-in-to-roi-mau-dia-chi-in-to-roi-mau-gia-re-co-giao-hang-tan-noi-tai-tphcm-386.html

Để nhận báo giá in tờ rơi màu giá rẻ TPHCM - bạn chỉ cần:

+ Gửi yêu cầu báo giá in tờ rơi màu giá rẻ TPHCM về email: innhanh@inkythuatso.com
+ File thiết kế in tờ rơi màu đính kèm
+ In 1 mặt hay in 2 mặt (hầu như hiện nay đều đặt in tờ rơi 2 mặt)
+ Khổ in tờ rơi: A4, A5, A6 (khổ in tờ rơi phổ biến hiện nay là A5_
+ Số lượng in tờ rơi: in 500 tờ rơi, in 1000 tờ rơi, in 2000 tờ rơi, in 10.000 tờ rơi,... (số lượng đặt in tờ rơi càng nhiều, giá thành trên mỗi tờ rơi càng rẻ)
+ Loại giấy muốn in tờ rơi: Couche (không bóng), Couche Matt (bóng),... - nếu tờ rơi phát trong nhà có thể in Couche, nếu tờ rơi phát ngoài trời nên in Couche Matt
+ In tờ rơi thường hay in tờ rơi có nếp gấp (dạng tờ gấp 2, gấp 3...)

Hoặc trực tiếp gọi điện đến hotline của In Kỹ Thuật Số để thông báo yêu cầu đặt in, nhân viên chăm sóc khách hàng của chúng tôi sẽ gọi điện lại cho bạn

Đến đặt in trực tiếp tại văn phòng của chúng tôi tại 365 Lê Quang Định, phường 5, Bình Thạnh, HCM

Phương thức vận chuyển hàng in tờ rơi màu giá rẻ TPHCM từ Công ty In Kỹ Thuật Số

Với thông tin vận chuyển hàng in tờ rơi màu giá rẻ TPHCM rõ ràng, chúng tôi hy vọng quý khách hàng có đầy đủ và chính xác thông tin tham khảo cần thiết cho việc đặt in tờ rơi màu của mình:

Với đơn hàng in tờ rơi màu giá rẻ TPHCM:

+ Miễn phí vận chuyển đơn hàng in tờ rơi màu giá rẻ TPHCM có giá trị từ 1.500.000VNĐ trở lên
+ Các đơn hàng dưới 1.500.000VNĐ - quý khách hàng hỗ trợ phí vận chuyển

Với đơn hàng in tờ rơi màu giá rẻ TPHCM về các tỉnh:

Các đơn hàng ở tỉnh, quý khách hàng vui lòng hỗ trợ phí vận chuyển
In Kỹ Thuật Số hỗ trợ đóng hàng in tờ rơi cẩn thận, giao hàng đến tận bến xe, nhà xe, đơn vị giao nhận hàng toàn quốc cho bạn - lấy hóa đơn vận chuyển hàng - chụp ảnh và gửi thông tin giao nhận đến bạn
THE NEW NORMAL
Tags: wikimedia, outreachy21, internship
Published: 2020-12-01 01:36:56

Hi Everybody ! My name is Ogechi Vivian , I'm an Outreachy Intern with Wikimedia. This will be my first blog post,2020 has been a challenging time for everybody’s mental health, including my own, I had a lot of time this year to sit and do nothing. But you know what? The pandemic has taught us the value of slowing down and some new slogan such as _Trust you are keeping safe_, _keep staying safe_ , _social distancing_ and _lots more_.

Over a period of time, my routine has become so strict that you can set your watch according to my routine and gradually i started making some changes like exercising for more than an hour.

The impact of Technology during the global pandemic can not be over emphasis as this serves as a communication tool(social media, zoom etc) to always check up on friends and family virtually  during the lockdown that was like the only means of keeping up with what is happening with everybody even while isolating.

Like the saying goes when life throws lemon on you make lemonade drink out of it. In one of my chat time with a friend Open Source Contribution and Outreachy Program was mentioned. I can  remember the joy when my first Pull Request(PR) was merged on the first contributions repo on Github it was a win for me.

From the application stage down to the contribution stage where I had to get familiar with some tools(gerrit, phabricator). And here I'm an Outreachy Intern with Wikimedia. I have recorded some wins this year by being adaptable, invincible and formidable. I look forward to making an amazing contribution and better blog post as we progress with the Internship.

A big Congratulation to myself and other outreachy21 interns... Cheers !!!
Semana 2
Tags: test, algorithms
Published: 2020-12-01 01:32:07

Fala pessoal seguindo o desafio de um escrever um post por semana para documentar os conhecimentos adiquiridos durante a semana, mas antes gostaria de me desculpar pelo atraso no desafio, mas não tive tempo de escrever o post e publica-lo à tempo. E seguindo a mesma estrutura do último post, vou separa-lo em dois tópicos: **Hard skills e Soft skills.**

## Hard Skills

### MockImplementationOnce

Essa semana tirei pra escrever os testes da aplicação que estou desenvolvendo para e empresa que estou abrindo com meu irmão. Devo dizer que não tem nada mais prazeroso que garantir que sua aplicação não vai quebrar e que ela está seguindo todas as regras de negócios estabelecidas. E nesse novo projeto, durante os testes tive que usar bastante essa função da biblioteca jest, chamada **mockImplementationOnce** que basicamente serve para fazer o mock uma vez de uma função existente nos meus services, porem, retornando um valor determinado por mim, que é pode ser diferente do que provavelmente a função retornaria. No caso em que usei, tive que retornar um hash com valor activated =true, mesmo sabendo que o valor era false.

### Merge Sort

Sempre me desafio a aprender mais, e essa semana me desafiei a aprender um novo algorítimo de sorting, apesar de trabalhar com linguagens de alto nível é sempre bom aprender esses algotimos para sempre termos cartas na manga. E esse algoritimo pode parecer complexo no começo mas depois de alguma pratica se torna razoavelmente simples. Ele se baseia naquela famosa frase "Dividir para conquistar", onde primeiramente você deve ir dividindo o array ao meio e reorganizando suas metades recursivamente para poder coloca-las em ordem, segue abaixo uam foto ilustrativa de como funciona esse algoritimo.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/h40ke0oc2zpypydk1qm0.png)

## Soft Skills

Como falei no último post estou lendo o livro "Como fazer amigos e influenciar pessoas" e nessa semana retirei um ensimento que vou levar desse livro pra vida, que resumidamente, é: não reprimir alguem por alguma escolha que resultou em um erro. No livro o autor cita vários exemplos de pessoas extremamente bem sucedidas como Lincon ex-presidente que seguiram esse ensinamento, pois isso reflete no comportamental do outro. Segundo o autor se vc agir de forma mais calma e racional com o proximo, evita com que eles não assumam/reconheçam o erro e tentem melhorar, mas ao invés disso, tentem arrumar um jeito de contornar a situação para aliviar a "bronca".
Switching up the switch statement
Tags: javascript, beginners, codenewbie
Published: 2020-12-01 01:06:10

# Let us talk a little about switch statements!

Switch statements can replace multiple if statements. You can compare values against multiple variants in a not as clunky-looking way as if statements.

You don't want to burn yourself out doing this: 
<img src="https://i.redd.it/13j2y2a9it351.png"/>
When you can do this instead:

```
let a = 2 + 2;

switch (a) {
  case 3:
    alert( 'Not enough.' );
  case 4:
    alert( 'Perfect!' );
  case 5:
    alert( 'No more, stop.' );
  default:
    alert( 'What even is this?' );
}
```
* The value of **a** is being checked for strict equality against each case. case 3 would fail because 2 + 2 isn't equal to 4. 
* The switch statement will continue on until it hits a case that matches. Then it will execute the corresponding code until it hits a **break** or until the end of the switch.
* If zero cases match, then the default code is executed instead.



This feels comfortable, _right?_
<img src="https://i.kym-cdn.com/photos/images/newsfeed/000/823/128/22e.png"/>

But did you know you could use objects?

```
let thing = {
    "abc": () => "meow",
    "chonk": () => "very angry",
    "littlecat": (how_many) => {
        if(how_many > 5) { return "MEGAMEOW" }
        else { return `${how_many}x meow/scream` }
    },
};
```
This is an object.

This object is the same as this _switch_ statement.
```
switch("littlecat") {
    case "abc": () => "meow"
    break;

    case "chonk": () => "very angry"
    break;

    case "littlecat": (how_many) => {
        if(how_many > 5) { return "MEGAMEOW" }
        else { return `${how_many}x meow/scream` }
    }
    break;
}()

```

 You can call one of the fields of this object like so. 
`thing.chonk()`

Another way you can access it is by:
`thing["chonk"]()`

Calling `thing["littlecat"](6)` will return you _"MEGAMEOW"_. If you change the input to 3, it will return `"3x meow/scream"`

This is how you can use an object like a switch statement!
Github Action: How to parallelize tests dynamically by folder?
Tags: github, ci
Published: 2020-12-04 22:47:00

---
title: Github Action: How to parallelize tests dynamically by folder?
description: Once again, I play with Github Action to see if it can answer the CI problems I may encounter in my work.
published: true
date: 2020-12-01 00:00:00 UTC
tags: github,ci
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/igwybqt09kluzmecfbuf.jpg
canonical_url: https://slashgear.github.io/how-to-split-test-by-folder-with-github-action/
---

Once again, I gave myself a challenge to learn how to use Github Action. I tried to see if it was possible to dynamically launch a job for each folder in a directory.

We often want to run tests in parallel to reduce the time of continuous integration. Often tools like `Jest` or `CucumberJS` have parallelization features, but these often face the limits of the power available on the machines on which you want to run them.

```
tests/
  user/
    foo.feature
    bar.feature
  account/
    example.feature
  live/
    a.feature
    video.feature
```

I wondered if it wouldn’t be more efficient to run the tests in parallel directly with the CI tool so that only small _runners_ would be needed. In the previous example, I would like to be able to run in parallel on a separate _runner_ for each folder in `test/`.

## A Solution with _Github action_

```yaml
name: CI

on:
  push:
    branches: [main]

jobs:
  directories: # Job that list subdirectories
    runs-on: ubuntu-latest
    outputs:
      dir: ${{ steps.set-dirs.outputs.dir }} # generate output name dir by using inner step output
    steps:
      - uses: actions/checkout@v2
      - id: set-dirs # Give it an id to handle to get step outputs in the outputs key above
        run: echo "::set-output name=dir::$(ls -d */ | jq -R -s -c 'split("\n")[:-1]')"
        # Define step output named dir base on ls command transformed to JSON thanks to jq
  loop:
    runs-on: ubuntu-latest
    needs: [directories] # Depends on previous job
    strategy:
      matrix:
        dir: ${{fromJson(needs.directories.outputs.dir)}} # List matrix strategy from directories dynamically
    steps:
      - run: echo ${{matrix.dir}}
```

It’s up to you to adapt it to your needs!
Git Fundamentals
Tags: git, fundamentals, learning, bash
Published: 2023-01-24 15:12:54

---
title: Git Fundamentals
published: true
date: 2020-12-01 00:00:00 UTC
tags: git, fundamentals, learning, bash
canonical_url: https://www.rocky.dev/blog/git-fundamentals
---

Git can seem overwhelming, but while performing typical day-to-day tasks, you'll use only about ten commands. If you happen to use [Oh My ZSH](https://ohmyz.sh/), the included [`git` plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git) adds many [aliases](https://www.rocky.dev/blog/linux-bash-aliases). Below each command, I've included the corresponding alias.

```bash
# Start a new branch for a new feature
git checkout -b new-feature
gcb new-feature

# Commit as you make changes (the --all adds changed files to
# `staging`)
git commit --all --message "your commit message"
gcam "your commit message"

# Add new or deleted files to `staging` (the `git commit
# --all` above only adds tracked files)
git add --all
gaa

# Check the status of your branch/commits
git status
gst

# Switch branches
git checkout branch-name
gco branch-name
# Separate `git` plugin alias to switch back to master
gcm

# See what has changed (maybe done prior to committing, include
# the `--cached` flag to see what has changed in `staging`)
git diff
gd

# Pull new changes down from remote (Github/GitLab/etc.)
git pull
gl

# Push changes to remote
git push --set-upstream origin
gpsup

# Merge changes from another branch into the current one
git merge other-branch-name
gm other-branch-name

# Or, if you prefer rebase,
git rebase -i other-branch-name
grbi other-branch-name
```

And that's it! 95% of the time, you'll use these commands. Google was invented for the remaining 5% 😉
How to measure the running time of a function in JavaScript?
Tags: javascript
Published: 2020-12-01 00:00:00

---
  title: How to measure the running time of a function in JavaScript?
  published: true
  tags: JavaScript
  date: Tue Dec 01 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/measure-running-time-of-function-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-e0741570cc0bf5c66f1441e6130d1231.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/measure-running-time-of-function-javascript)
  
To measure the running time of a function or a task we can use the `console.time()` and `console.timeEnd()` methods in JavaScript.

Let's say we have a function like this which takes some time to complete,

```js
// function which takes some time
function bigTimeFunction() {
  for (let i = 0; i < 1000; i++) {
    console.log("🌟");
  }
}
```

Let's measure the time taken for the `bigTimeFunction()` function to execute.

Here, before invoking the `bigTimeFunction` we need to use the `console.time()` method to start the timer and we need to pass a name for the timer as an argument to the method.

Let's name the timer the same name as the function that is `bigTimeFuction`.

It can be done like this,

```js
// function which takes some time
function bigTimeFunction() {
  for (let i = 0; i < 1000; i++) {
    console.log("🌟");
  }
}

// start the timer using console.time
// pass the name of the timer as an
// argument to the method
console.time("bigTimeFuction");

// invoke the function
bigTimeFunction();
```

Now let's end the timer by using the `console.timeEnd()` method after invoking the `bigTimeFuction()` function and pass the same name of the timer to the method as an argument.

### NOTE: The name should match for both the `console.time()` and `console.timeEnd()` methods to start and stop the timer correctly.

```js
// function which takes some time
function bigTimeFunction() {
  for (let i = 0; i < 1000; i++) {
    console.log("🌟");
  }
}

// start the timer using console.time()
// pass the name of the timer as an
// argument to the method
console.time("bigTimeFuction");

// invoke the function
bigTimeFunction();

// stop the timer using console.timeEnd()
// pass the same name used in console.time() method
// as an argument to the mehtod
console.timeEnd("bigTimeFuction");
```

- The running time will be displayed to the console.

See this example live [repl.it](https://repl.it/@melvin2016/measure-time-taken-for-a-function-javascript).

### Feel free to share if you found this useful 😃.

---
My first blog.
Tags: writing
Published: 2020-12-02 10:23:44

---
title: My first blog.
published: true
date: 2020-12-01 00:00:00 UTC
tags: writing
canonical_url: https://d-fisher.com/blogs/my-first-blog
---

Let me introduce myself, I’m a professional wannabe web developer switching from a career in the movie industry. I’ve been learning to code since April 2020. This blog will document my progress, learnings and thoughts.

Why am I starting a blog?

### BETTER UNDERSTANDING.

Blogging has numerous benefits, but the biggest gain is obtaining a better understanding of the subject that you’re writing about. Being able to explain a technical matter in your own words cements the learning.

### HELPING OTHERS.

Writing out how I’ve overcome obstacles or technical issues will hopefully aid other developers who are facing similar issues.

### ONLINE PRESENCE.

With remote working becoming more popular, competition for jobs is fierce. Having a brand and sticking out from the crowd will be more important than ever in the future.

### BECOMING A BETTER WRITER.

I’ve never been happy with my writing skills and it’s been bugging me for a while. I vaguely remember scoring two C’s in English Literature and English Language at GCSE’s which blew my mind at the time. Although I’ve never been diagnosed, I’m pretty sure I have some form of dyslexia. If there are missing words and grammar mistakes, then you know why!

### NETWORKING

I’m hoping to meet other web developers with a similar attitude and drive who are passionate about coding.

Blogging once a week is my target, so look out for some fresh content.

Please feel free to get in contact if you have any questions, or just want to chat. Interested to hear from all developers at different stages in their careers.
|JavaScript| JavaScript: Strings and More
Tags: javascript, html, css, webdev
Published: 2020-11-30 23:54:38

---
title: |JavaScript| JavaScript: Strings and More
published: true
description: 
tags: javascript, html, css, webdev
//cover_image: https://direct_url_to_image.jpg
---


              -Introducing Strings
              -Indices and Length
              -String Methods
              -String Methods with Arguments
              -String Template Literals
              -Undefined and Null
        
            
###Introducing Strings
Strings are another primitive type in JavaScript. They represent text, and must be wrapped in quotes. 
"String of Characters" 

```javascript 

let firstname = "Tim";

let msg = "Please do not feed the animals";

let animal = 'doggo';

let bad = "this is bad";

```
It is possible to use either single or double quotes. 




###Indices and Length
Strings are indexed meaning that each character has a corresponding number attached to it. 
Chicken 
C = 0
h = 1
i = 2
c = 3
k = 4
e = 5
n = 6




###String Methods
Methods are built-in actions we can perform with individual strings. 
Methods help us do things like searching within a string, replacing part of a string, and changing the casing of a string. 

####method syntax 
thing.method()
msg.toUpperCase



###String Methods with Arguments

```javascript

let tvShow = 'catdog';

tv.Show.indexOf('cat'); 
tv.Show.indexOf('dog'); 
tv.Show.indexOf('z'); 

```

indexOf is going to give us the string index and positional number where a given argument occurs in a string. 

thing.method(arg)
Some methods accept arguments that modify their behavior. 
Think of them as inputs that we can pass in. 
We pass these arguments inside of the parentheses.



###String Template Literals

```javascript 

`I counted ${3 + 4} sheep`; 

```
Template literals are strings that allow embedded expressions, which will be evaluated and then turned into a resulting string. 

Back ticks ` are used for template literals not single quotes '





###Undefined and Null

Null is the intentional absence of any value, must be assigned. 
Undefined variables that do not have an assigned value are undefined.