teleren/devto huggingface dataset:
JavaScript labels (a better way to break out of nested loops)
Tags: javascript, break, webdev, programming
Published: 2022-03-09 11:33:12

A common problem developers will face is that of how to escape from nested loops. In this post, I’ll be using JavaScript labels to demonstrate how this can be done with a little more control.

For starters, I’ll be using this data set for the various examples, if you want to follow along:

{% embed https://gist.github.com/DuncanMcArdle/efba847310624416dbf3cea917b727f6 %}

Now, if I set you the task of finding out whether “Jack” exists in each row of the data set, you might use a crude nested loop to check all records. In addition, you’d probably add a break when you find “Jack” to prevent unnecessary checks, something like this:

{% embed https://gist.github.com/DuncanMcArdle/c44eebd369da64b9bf29a997abb40d17 %}

And this works fine! The `break;` stops the inner loop, continues the outer one, and later continues code execution after the outer loop’s end, giving you an output like this:

```
Found a Jack in data set row 0, position 1!  
Found a Jack in data set row 2, position 0!  
The loops have finished!
```

However, what if you wanted to stop both loops upon finding the first “Jack”, rather than continuing on with the code? Many developers would swap that `break` for a `return`, which _will_ cause both loops to end. But that will also stop the code _after_ the end of the loop from running, so we need something else.

Enter, **JavaScript labels**.

JavaScript Labels can be used to break and continue a specific loop, even if it isn’t the one currently being executed. The first step is to assign a label to a specific loop, and then we can reference it from within using `continue` or `break`, like so:

{%embed https://gist.github.com/DuncanMcArdle/5e112d197f64cf4ffce2968da967b4b6 %}

What this now does, is to say “Okay, I’ve got what I needed, now let’s end the outer loop”, which will in turn continue code execution _after_ the loop is closed. The results now look more like what we wanted:

```
Found a Jack in data set row 0, position 1!  
The loops have finished!
```

On top of the functionality provided by labels, I also feel they add a good amount of clarity to the code. If (god forbid) you have multiple nested loops, being able to label them accordingly (think `schoolLoop` , `classLoop` and `studentLoop`) would be a great way of keeping code understandable, without the need for additional comments at every stage.

Labels can also be used for breaking out of code blocks, but as that’s beyond the scope of this post, I’ll just leave you in the wonderful hands of Mozilla by linking to [their page on JavaScript labels](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label).
Terminal komandalar | Part 2
Tags: beginners, uzbek, terminal, productivity
Published: 2022-03-09 11:31:18

## 1. `build-essential`
`sudo apt-get install build-essential` komandasi **ubuntu** uchun **C/C++** va boshqa tillar kompilyatorlarini o'rnatadi

## 2. `VSCODE`
Ubuntu sistemasida `vscode` dasturini o'rnatish uchun quyidagilarni bajaring
- ushbu [link](https://code.visualstudio.com/docs/?dv=linux64_deb)dan `vscode` faylni yuklab oling
- yuqorida yuklangan `*.deb` nomli fayl turgan papkaga terminal orqali boring *(odatda `cd ~/Downloads`)*
- endi yuqoridagi faylni o'rnatish kerak:
`sudo dpkg -i <file_nomi>.deb`
6 Awesome JavaScript Conferences To Attend in 2022
Tags: javascript, webdev, node, programming
Published: 2022-03-09 11:21:57

**Conferences are ordered by date.**

# 1. CityJs
Link: https://cityjsconf.org
Date: London March 23-25, Sao Paulo 28-30, Athens 25-27, Singapore 22-24
Where: London, Sao Paulo, Athens, Singapore
Speakers: 15+
Themes: JS Frameworks, NodeJS, TypeScript, Testing, IoT, and more
Remote also: Yes
Price: From £200
Tickets: https://cityjsconf.org/buytickets/


# 2. International Javascript Conference
Link: https://javascript-conference.com
Date: London April 25-28, New York September 26-29, Munich October 17-21
Where: London, New York, Munich
Speakers: 40+
Themes: Fullstack conference — React, Angular, WebAssembly, PWA, JAMstack and more
Remote also: No (pre-remote event available for free)
Price: From £1106, Remote From £791
Tickets: https://javascript-conference.com/london/tickets-london/?go=ok


# 3. Reactahon
Link: https://www.reactathon.com
Date: May 2-5
Where: Berkeley
Speakers: 15+
Themes: React
Remote also: Yes
Price: From $599
Tickets: https://ti.to/real-world-react/reactathon-2022/


# 4. NODE JS Global Summit
Link: https://events.geekle.us/nodejs/
When: May 18–19
Where: Remote only
Themes: Node.js
Speakers: 25+
Remote also: ONLY REMOTE TICKETS
Price: Free Track or Paid $49
Tickets: https://events.geekle.us/nodejs/#tickets


# 5. JSWorld Conference
Link: https://www.frontenddeveloperlove.com
Date: June 1–3
Where: Amsterdam
Speakers: 40+
Themes: Typescript, Web3, Vue.js and more
Remote also: Yes
Price: From €377,46
Tickets: https://www.eventbrite.co.uk/e/tickets-jsworld-conference-5-year-anniversary-174258159847#tickets


# 6. OpenJs World
Link: https://events.linuxfoundation.org/openjs-world/
Date: June 6-10
Where: Austin/Texas
Speakers: 13+
Themes: AMP, Appium, Electron, and Node.js
Remote also: Yes
Price: From $350, Remote is Free
Tickets: https://events.linuxfoundation.org/openjs-world/register/


------------

Hopefully, these resources will help you. If you have any tips, feel free to contribute them.

Writing has always been my passion and it gives me pleasure to help and inspire people. If you have any questions, feel free to reach out!

Connect me on <a href='https://www.twitter.com/paulknulst' target="_blank">Twitter</a>, <a href='https://www.linkedin.com/in/paulknulst/' target="_blank">LinkedIn</a> and <a href='https://github.com/paulknulst' target="_blank">GitHub</a>!

Visit my <a href='https://medium.knulst.de' target="_blank">Medium Blog</a> for more articles like this.

---


Photo by <a href="https://unsplash.com/@oskaryil?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Oskar Yildiz</a> on <a href="https://unsplash.com/s/photos/javascript?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
How can I solve Visual Studio code collapse Problem?
Tags: vscode, flutter
Published: 2022-03-09 10:58:02

In Visual Studio Code, what to do to make the ending point of the code visible when the codes collapse

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

problem video link:) https://www.awesomescreenshot.com/video/7797016?key=a1eadee6ccbfdf816a0d9aaa2dfb7a25
WikiMap — a live map view of Wikipedia edits
Tags: javascript, maps, wikipedia, programming
Published: 2022-03-09 10:41:30

A few months back I stumbled across Hatnote’s Listen to Wikpedia project, a wonderful little tool that emits gentle tones and sounds every time someone edits a page on Wikipedia, as well as outputting some basic information onto the screen. I came across the project from a Reddit post that mentioned its use as background music to put you to sleep, but personally I actually found it better to use whilst working. In any case, the biggest takeaway from the project for me personally was the discovery that a feed for all Wikipedia edits existed, and better yet, Hatnote actually open it up for public use.

Almost immediately I saw the opportunity for a cool little webpage; a visual representation of every Wikipedia edit, live, plotted onto a map of the world (shortly before writing this article I decided to google the concept, only to find that it has actually been done by a couple of people, but no matter, this was only ever a programming exercise).

So a little while back I embarked upon the journey. I created a page containing a nice big Google Map, I attached a listener to Hatnote’s WebSocket, and I began parsing edits.

**Check it out here:** [wikimap.duncanmcardle.com](wikimap.duncanmcardle.com)

<figure>
  <img
  src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z1heojccsfrvmlkiot7x.png">
  <figcaption>Screenshot of a running WikiMap</figcaption>
</figure>

If you’re interested in how it works, or want to make improvements, you can check out the [GitHub page](https://github.com/DuncanMcArdle/WikiMap) for the project.

Special thanks goes out to the Hatnote team, not only for enabling tools like this to exist using their WebSocket, but also for their fantastic original idea, which I thoroughly recommend you go and check out!

_Before you go, a quick story for you: Whilst creating this project, I was watching Wikipedia edits roll in when a particular edit stuck right out at me; it was a Wikipedia page with the same name as my brother, being edited from our home city of Liverpool! After investigating, it turned out to be a page unrelated to my brother, but was nevertheless an incredible coincidence, given the millions of Wikipedia articles that exist, the thousands of locations the edit could have come from, and the incredible timing that it just so happened to occur while I was sitting there watching!_
Another API Test Automation tool
Tags: security, api, testing, openapi
Published: 2022-03-09 10:26:00

As I was writing APIs one day at work, I realized that I wasn't too sure whether those APIs were secure. So I started looking for simple GUI tools that can be used by teams to evaluate their API security posture.

And in this process I found 3 categories of tools:

1. Penetration-as-a-service vendors  
I wasn't too keen on black-box testing techniques as they come late into the development life-cycle and don't offer much transparency with respect to tests

2. Open-source API fuzzers  
There are quiet a few robust tools out there. But again these require some time and effort to setup and get going.

3. Paid tools  
Again I could find a bunch of platforms that run 100s of tests but were expensive.


And so I set forth to writing one by myself. As part of my research, I found out that OpenAPI specification is a good starting point at describing APIs since it's an industry standard and that lot of tooling is available around it.

Also took the same approach as the other paid and free/open-source tools to finding API security flaws.

However, I have attempted the following:  
1. To keep the UI simple (easy to navigate)
2. Maintain OpenAPI Spec validation errors at a minimal so that developers can quickly get documentation out of their way

Finding Schema validation errors is simple:   
1. Upload a spec or Postman Collection or start with a `petstore` template
2. Fix validation errors and get to a RUN_API status
3. Go the Run Tab, select API Endpoint URL and hit Run to find schema validation errors

Although it's still work in progress, would love for you guys to check it out and share feedback.

For more information, do check out: https://cymitra.com or head directly to https://apihome.io

Thank you
Shamazing
Tags: go, programming
Published: 2022-03-10 07:10:58

---
title: Shamazing
published: true
date: 2022-03-09 10:20:00 UTC
tags: Go, programming
canonical_url: https://defer.cc/b/shamazing/
---

Find the longest string or integer in a SHA1 Hash (or whatever). It’s just sha-mazing and without any sense :)

```go
package shamazing
import (
   "regexp"
   "strconv"
)

// FindLongestString will retrieve a string like a SHA1, MD5 or whatever
// and return the longest string (first one)
func FindLongestString(str string) string {
   var re = regexp.MustCompile("[a-zA-Z]+")
   var values = re.FindAll([]byte(str), -1)
   return string(findLongest(values))
}
// FindLongestInteger will retrieve a string like a SHA1, MD5 or whatever
// and return longest integer (first one)
func FindLongestInteger(str string) (int64, error) {
   var re = regexp.MustCompile("[0-9]+")
   var values = re.FindAll([]byte(str), -1)
   var max = findLongest(values)
   var a, err = strconv.Atoi(string(max))
   if err != nil {
      return 0, err
   }
   return int64(a), nil
}
func findLongest(values [][]byte) []byte {
   var max []byte
   for _, value := range values {
      if len(value) > len(max) {
         max = value
      }
   }
   return max
}

```

[shamazing on GitHub](https://github.com/mnlwldr/shamazing/)
Noktadan-Noktaya ve Çok Noktalı İletişim Arasındaki Farklar
Tags: beginners, tutorial, computerscience, programming
Published: 2022-03-09 10:06:18

Noktadan noktaya iletişimde, iki düğüm arasında özel bir bağlantı vardır. Çok noktalı iletişimde [noktadan-çok-noktaya olarakta bilinir.], bağlantının düğümler arasında paylaşılması için her zaman bağlantı[_link_] sağlanır. 

## Noktadan Noktaya

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

- Kanalın iki cihaz arasında paylaşıldığı anlamına gelir.
- İki düğüm arasında özel bir bağlantı vardır.
- Tüm kapasite, ağ bant genişliği/kaynak israfı olasılığı ile bu bağlı iki cihaz arasında rezerve edilir.
- Bu iletişimde bir verici ve bir alıcı vardır.
- Alıcıya ulaşmak için en küçük mesafe çok önemlidir.
- İletişim kanalı paylaşılmadığı için güvenlik ve gizlilik sağlar.

## Çok Noktalı İletişim

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

- Kanalın birden fazla cihaz veya düğüm arasında paylaşıldığı anlamına gelir.
- Bağlantının düğümler arasında paylaşılması için her zaman bağlantı sağlanır.
- Tüm kapasite herhangi iki düğüm tarafından rezerve edilmez ve ağ bant genişliği maksimum kullanılır.
- Bir verici ve çok sayıda alıcı vardır.
- Alıcıya ulaşmak için en küçük mesafe önemli değildir.
- İletişim kanalı paylaşıldığı için güvenlik ve gizlilik sağlamaz.
Do you know what the concat() is used for?
Published: 2022-03-09 09:55:04

Hi folks 👋! 

Trust you are well. I'm here again to show you an easy way of adding arrays.

>I am Akande Olalekan Toheeb, a Nigerian self-taught developer who is passionate about solving problems and helping others with the easiest way in problem solving.

## overview
Every beginner is exposed to the concatenation `+` when it comes to adding variables, arrays and even strings in JavaScript. Such that when you want to add an array to a predefined array, you do it this way:

```

 var array1= ["Akande", 22];
 var array2 = ["Olalekan", 25];

 array1 += array2;

console.log(array1);

```

The console looks like this: 

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

Every beginner are exposed to this because that's what they learn.

Here I provide you with a very easy way to do this.
 
The `concat()` is a method of adding arrays. 

## Let me show how it is done. 

Suppose you want to add an array `array_2` to another array `array_1`. All you need to is add `.concat()` to the first array and input the array you wish to add, `array_2`  inside the bracket. 

This way : 

```

var myConcat = (arr1, arr2) => arr1.concat(arr2);
console.log(myConcat(["Akande", 22], ["Olalekan", 25]));

```

This prints `['Akande', 22, 'Olalekan', 25]` to the console:


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

Using this method will save a lot of time and energy. Make use of it for best practice.

Thank you for reading, have a nice day!

Your appreciation is my motivation 😊 - Give it a like

Follow me on [Twitter](https://twitter.com/devtoheeb).
Click [here ](https://www.linkedin.com/in/akande-olalekan-toheeb-2a69a0221/)to connect on Linkedln.
Hey Everyone CheckOut The Project I am Working ON
Tags: programming, python, github, showdev
Published: 2022-03-09 09:54:14

# HoverAssist #
[{ Github Repo Url }](https://github.com/SaiSaaketh/HoverAssist)
## About Hover ##
The Github Link Below 👇
[{ Github Repo Url }](https://github.com/SaiSaaketh/HoverAssist)
HoverAssist Is a voice Assistant 👨‍🏭 Which help to to do tasks and Many things Easily Just With Your Voice
HoverAssist is Here To manage Your Tasks, Play Music 🎼 , Shutdown your System 💻,take screnshot 💻, Switch Windows, Searh Stuff on the Internet 🕸, Keep Your Device secure using secure cam while you are AFK 🔐 ,Automate Your Desktop 💻 As you like Just with your voice 🎙
Join Now Discord Hover Community:-https://discord.gg/G4g7CA8Es8
## Features ##
1. Hover Can Search The Web 🕸
2. Take ScreenShots 
3. Shutdown Your PC
4. Play Youtube Videos
5. Take Notes 📝📒
6. Switch Windows 💻
7. Keep Your Device Secure Usinng Secure Cam 
8. Open Youtube 🎞
9. Wikipedia 📔
10. Open Youtube
11. Open Stack Overflow
12. Open Camera 📷
## Features Going To be Added ##
- [ ] Open Any App Installed On your pc
- [ ] Open Any Websites 
- [ ] WikiHow searches 
- [ ] Google webscraping search results
- [ ] Android and IOS Support
# License And Copyrights #
*© HoverAssist is Licensed to SaiSaaketh Under MIT License*
[{ Github Repo Url }](https://github.com/SaiSaaketh/HoverAssist)
Day-23 Training at cognizant
Published: 2022-03-09 09:48:26

- Date:9/03/2022
- Day:Wednesday

Today I started at about 9 am as I was having a Bheverioul session from 9 am to 11 am after this at 11 am
we were having a conceptual facilitation session from 11am to 1pm and after this we had a lunch break and after this we we having session on critical thinking in which we were divided into teams of 10-10 students and we were to design ppt which would consist of only images and we were to guess the image concept and after this we were to do our task at tech stack portal so, this way my day ended up at about 7 pm.
Testing modern ReactJS Application: Introduction
Tags: react, testing, webdev, javascript
Published: 2022-03-09 09:48:15

Hello everyone! In this series I'm going to share with you my experience and knowledge in testing ReactJS-based applications using modern libraries such as [`jest`](https://jestjs.io/), [`@testing-library/react`](https://testing-library.com/docs/react-testing-library/intro/), [`@testing-library/user-event`](https://testing-library.com/docs/ecosystem-user-event/) and [`react-test-renderer`](https://reactjs.org/docs/test-renderer.html) using both JavaScript and [`TypeScript`](https://www.typescriptlang.org/)
#smartsm.link smart way to share your social media profile....
Tags: javascript, challenge, webdev, react
Published: 2022-03-09 09:43:44

Welcome all to my new Project called "smartsm.link"

Where you can showcase your social media accounts through a **_Single Link_** or **_QR code_**.

This is similar to linktree but the basic version with good ui 
design.

I build this project using ReactJs and tailwind CSS. I used pre generated layouts from [tailwinduikit](https://app.tailwinduikit.com/).

This is the live stie which is deployed in netlify: https://smartsm-link.netlify.app

These are the screenshots of the website
This is the landing Page:
![Landing page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u7k4a8pjase8qavqkseb.png)

This is Login Page:
![Login Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q3682b1ejgfjfp46lf3j.png)
 
This is the Home Page:
![Home Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fugod5jpfijolzgw0zmi.png)

This is for creating project:
![Project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6rzr00yhbsi0vlir7r59.png)

This is to view the project:
![View Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5d1tyx22c9ytapwj0g4u.png)

Here you can all the users projects:
![Projects](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cy7yqo8khtjkjn5mdene.png)

After trying this application can you post your review on this project and your profile links (optional).

I will be waiting for your Feedback and if you find bugs comment it down.

Thanks for reading this post.

![gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cux1j8k169qz4v4kibc7.png)
Wednesday Links - Edition 2022-03-09 💙💛
Tags: java, jvm, lombok, spring
Published: 2022-03-09 09:39:56

Alternatives to DTO (3 min)🚡
https://blog.frankel.ch/alternatives-dto/

Garbage Collection tuning success story – reducing young gen size (5 min)🗑️
https://blog.ycrash.io/2022/03/04/garbage-collection-tuning-success-story-reducing-young-gen-size/

Lombok — the wrong way (6 min)✋
https://blog.softwaremill.com/lombok-the-wrong-way-fd1da147ee60

Create Command-line Applications with Spring Shell (7 min)🐚
https://reflectoring.io/spring-shell/

Finding Permitted Subclasses (5 min)🚉
https://www.javaspecialists.eu/archive/Issue298-Finding-Permitted-Subclasses.html

Reducing mammoth gradle caches (3 min)🦣
https://crushingcode.nisrulz.com/posts/reducing-mammoth-gradle-caches/

Encoding, Encryption, and Hashing (7 min)#️⃣
https://auth0.com/blog/encoding-encryption-hashing/

Why Vim (2 min)🖥️
https://www.jakeworth.com/why-vim/
`git pull` and `git fetch`, a subtle difference
Tags: beginners, git, devops, productivity
Published: 2022-03-09 09:38:15

## Let's start with a primer on both commands

How would you evaluate the usage of those commands if you were tasked to do some commits in a team?

Which of those commands is more _destructive_ than the other?

Read on to discover and if you enjoyed this article, leave a _like_ or a _unicorn_ or whatever makes you happier and it will surely make me happy aswell!

Also, you can find similar blogposts in my main blog [404answernotfound.eu](https://404answernotfound.eu) where I write about **technology, innovation, programming and most importantly, memes**.


![Git pull and star wars](https://cdn.hashnode.com/res/hashnode/image/upload/v1646817965959/RSuqRY6cb.jpeg)

## `git pull`

In it's simplest usage, `git pull` just wants you to be happy and up-to-date with whatever changes occurred to the remote repository. _Any changes_, _anything at all_ will be **pulled** from the remote repo and automatically _merged_ into your cloned local repository.

See where I'm getting at? It can be problematic, especially the automatic part.

## `git fetch`

To make sure that we are up-to-date with remote changes but without the fear of destroying the subtle existence of our local changes we can do `git fetch` which will (you guessed it!) _fetch_ any commits that were done remotely and do not exist on your local repo, keeping you repo up-to-date **without** merging the new changes with your current branch, making it safer to update without worrying too much about disruption brought by merging conflicts and so on.

## The difference between pull and fetch

So, what's the big time difference between those two commands? Usage and timing.


![git pull or git fetch](https://cdn.hashnode.com/res/hashnode/image/upload/v1646818291522/WC3QyJYW_.jpeg)

 `git pull` actually does a `git fetch` followed by a `git merge`, so, if you just want to keep your repository updated while working on your own local commits, make sure you do a lot of `git fetch(es)` to avoid changes in your `refs/heads` (where you are working) but still keeping your  `refs/remotes` up-to-date.

## Goodbyes

I hope you enjoyed this content and found it useful for your daily activities at work or for your hobbies. If you have any requests, drop a message on one of my social media accounts or open an issue/start a discussion on github, on this [repository](https://github.com/404answernotfound/community/discussions)!

As always you can find me on [Twitter](https://twitter.com/404answnotfound), listen to my [Podcast on Spotify](https://open.spotify.com/show/0d3hBsVITjcFRxPRqvNtCQ?si=e060235591d54152) and add me on [LinkedIn](https://www.linkedin.com/in/lorenzopieri/) to talk professionally (_yeah, right_)