teleren/devto huggingface dataset:
What is the difference between ‘for’ loop and other iterations in JavaScript
Tags: javascript, iteration, programming, tutorial
Published: 2023-01-01 07:03:14

There are several ways to iterate over items in JavaScript. One of the most used is `for` loop. It’s an essential method, and most teach in the university if you are a computer science student.

The concept of `for` loop is easy to understand. It iterates item through item, and we can control when to stop(with break), or continue(with continue), or how many times the loop should run, and get index easily, Which means you can manipulate some data or set a special condition as you need. For example, you get a bunch of news and want to render ads after the third.

`for` loop is faster than other iteration methods because they are implemented using a lower-level approach, as you see the result in this image below.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dhfnvfr9whn5n1iaph1g.png)
source: https://jsben.ch/wY5fo

Compared with other iteration methods like `forEach` or `map` function, They are higher-order functions that are implemented for easy access to the item when iterating, which means this should make a slight overhead and affect the performance.

However, If you have a small number in the array, The performance of for loop or other iteration methods does not matter. The `map` function or `forEach` would be preferred because it easy to access the object and easy to read more than for loop method. Here, take the example:

```
const arr = [1, 2, 3, 4, 5];
arr.forEach(function(element) {
  console.log(element);
});
```

```
arr.map(function(element){
  console.log(element)
});
```

Compare to for loop. You have to define which item or index you want to access, which should cause a problem `for` the newbie programmer.

```
for (let i = 0; i < arr.length; i++) {
  console.log(arr[i]);
}
```

It is generally best to choose the iteration method that is most appropriate for your task rather than trying to optimize for performance. In most cases, the performance difference between the different iteration methods will not be significant.
A 30-Day challenge in backend web development
Tags: webdev, javascript, beginners, programming
Published: 2023-01-01 23:23:29

As you begin your journey into web development, you will often encounter the terms front end and back end. When it comes down to it, what does it really mean?

A typical web app can be segmented into two: Frontend and backend.

The front-end focuses on the visual aspect of the web app, the part the user sees and interacts with.

The back end is the part of the web app the user does not see and interact with. It is the server, application, and databases working behind the scenes to deliver the information requested by the user.

It is an exciting challenge for me to learn and share knowledge, insights, and thoughts about backend development for the next 30 days.

Let's walk this journey together, and at the end of the month, we'll be able to build robust web apps with the ExpressJS framework. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u7dig676ihwyaalm4gs3.jpg)
😅 スクロールで動かなくなります！ をどうやってchrome dev tool使用してfrontの問題を解決したのか
Tags: javascript
Published: 2023-01-02 05:45:22

{% link https://dev.to/kaziusan/analyse-ag-grid-performance-problem-in-real-project-318m %}
↑ これの日本語版です (Japanese version of this article)

---


業務で[ag-grid](https://www.ag-grid.com/)というテーブルのライブラリを使っていました

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

ある日同僚のQAの方からこんなタスクが作成されました

> テーブルにデータが500ぐらいあると、スクロールがスムーズに動かないです。またたまに動かなくなります

▼ 調査開始ですが、まずこのprojetでは **tree data grid** と呼ばれるものを使用していました。
[tree-data](https://www.ag-grid.com/javascript-data-grid/tree-data/)

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

しかし他のタスクで既に、Javascriptを使用し画像のような縦線を入れておりました

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

なので直感的に「あ、DOM operationしてるこの線が原因だろうなぁ」と思ってました。

しかしそれは厳禁、前[ここ](https://dev.to/kaziusan/rail-important-way-of-thinking-about-frontend-performance-97i)で書いたように、パフォーマンスに関しては「予測するな、測れ」が基本原則なので、測ることにしました。

**google chrome > Inspect > Performance**

ジャーン
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9l5aysgq47b1854w1x0v.png)

２箇所重い部分が見つかりました(オレンジと青の線)

- オレンジ -> JS scripting
- 青 -> styleの再計算

### 1.オレンジ部分

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

`userComponentFactory.newCellRenderer`というag-gridの関数を見つけました、これはtableのcellをcustomizeするときの関数です

[cell renderer (string以外をcellで使用したい時など)](https://www.ag-grid.com/javascript-data-grid/component-cell-renderer/)

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

これを削除できたらよかったですが、プロジェクトではリンクやhoverでのtooltip表示があり、できませんでした。

### 2.青い部分

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

↑ これが私が直感で思った「Javascriptで縦の線を入れる」部分です。
しかし思っていたよりもかなり軽い。。。
そしてもっと重い処理を見つけました


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

> redrawAfterScroll()

👨‍💻 スクロール後の何か関数。。

> removeRowCompos()
> RowContainerComponent.removeRowElement()

👨‍💻 remove row ...??

最初は意味がわかりませんでしたが、後に`rowBuffer: 100`というag-gridの設定をコード内で見つけました。
[RowBuffer](https://www.ag-grid.com/javascript-data-grid/dom-virtualisation/#row-buffer)

**RowBufferってなに？？**
例えばサーバーから1万データがきたとします、するとDOM作成に時間がかかりすぎてブラウザがcrashするかもしれません。
なのでag-gridはデフォルトで表示以外に上下10列DOMを作成する設定になってます(Row buffer: 10の状態)

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

この数値がプロジェクトでは100になっていました、するとこうなります

> 1, 500データをサーバーから取得
> 2, 100列DOMを作成
> 3, スクロールします
> 4, 新しいDOMを作成し、前のDOMを削除...この繰り返し

この見えない位置の上下100列を保つための関数`RowContainerComponent.removeRowElement()`が重かったのです。

😮 ではどう`RowBuffer`を設定したのか？
[max-rendered-rows](https://www.ag-grid.com/javascript-data-grid/dom-virtualisation/#max-rendered-rows)
ag-gridでは設定をmax 500だと記載があり、450に設定しました。(500だと重すぎた)

もちろん最初のダウンロードで時間はかかりますが、スクロール中のラグやクラッシュよりかは良いので、こうしました。
Events in Solidity.
Tags: blockchain, beginners, webdev, solidit
Published: 2023-01-02 06:43:10

Events in Solidity.
**Events are the way Solidity **and the EVM provides developers with logging functionality used to write information to a data structure on the blockchain that lives outside of smart contracts’ storage variables.

Events are an abstraction on top of the EVM’s low-level logging functionality, opcodes LOG0 to LOG4. The specific opcode used will depend on the number of topics the event declares using the indexed keyword. A topic is just a variable that we want to be included in the event and tells Solidity we want to be able to filter on the variable as well.

The low-level logs are stored in the transaction receipt of the transaction under the transaction receipts trie. Logs are written by the smart contract when the contract emits events, but these logs cannot be ready by the smart contract. The inaccessibility of the logs allows developers to store data on-chain that is more searchable and gas efficient than saving data to the smart contract’s storage variables.

Events are defined in smart contracts using the event keyword. Here is the transfer event from the ERC20 smart contract. It is emitted whenever tokens are transferred from 1 account to another.

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

**Here we can see the different components of an event:**

**the event's name Transfer**

the event's topics from (sender's address), to (the receiver's address), value (the amount transferred).

if a variable in the event is not marked as indexed it will be included when the event is emitted, but code listening on the event will not be ablel to filter on non-indexed varables (aka topics).

Whenever a Transfer event is emitted, the from, to and value data will be contained in the event.

**Emiting Events**


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

Once an event has been defined we can emit the event from the smart contract. Continuing on from the ERC20 smart contract let's see where the Transfer event is emitted.

**Listening to Events**

If you remember the definition of an Event from above, smart contracts can write events, but not read events. So how do we listen/read to data that smart contracts cannot read?

We listen to and read events from code connected to a provider. From what we've learned so far in this course we could do this in JS code using an ethers provider to connect to a contract and listen to transfer events and do something with the event data.
Auto Clicker Installation on Ubuntu Linux
Tags: ubuntu, linux, autoclicker, mouse
Published: 2023-01-02 10:43:13

In this tutorial I will be explaining the installation of Max Auto Clicker on Ubuntu, Linux Mint, and all Debian-based Linux distributions.

![Auto Clicker Ubuntu Linux](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ih4vnyf0o9hzzjr143oi.png)

## Installation Guide

### Step #1
Install the required libraries (dependencies) with this command line:

```
sudo apt update
```
Then:

```
sudo apt install libc6 libgtk2.0-0 libx11-6 libgdk-pixbuf2.0-0 libglib2.0-0 libglib2.0-dev libpango-1.0-0 libcairo2 libatk1.0-0 libxtst6

```
### Step #2
Download the deb package with this command line:

```
wget https://sourceforge.net/projects/maxautoclicker/files/maxautoclicker_1.5_amd64.deb/download -O maxautoclicker_1.5_amd64.deb
```
### Step #3
Install the Max Auto Clicker software with this command line:

```
sudo dpkg -i maxautoclicker_1.5_amd64.deb

```
For **Ubuntu 22 Gnome users** only, execute these lines to disable Wayland.

```
sudo nano /etc/gdm3/custom.conf

```
And add this option after **[daemon]** section line or remove the **#** character from the line that contain it:

```
WaylandEnable=false

```
Press **CTRL+S** (to save changes) and **CTRL+X** (to exit).

Then restart your Gnome Display Manager (GDM) with this command:

```
sudo systemctl restart gdm3
```
{% embed https://www.youtube.com/watch?v=qePXGa0GplA %}
Programmer: The Silent Loner's Dream Job
Tags: career, productivity, beginners, programming
Published: 2023-01-02 11:43:40

[facebook.com/Trinwhocode](https://www.facebook.com/Trinwhocode)

Programmers are often seen as introverts, but why is this the case? The answer may surprise you.

First and foremost, it is important to understand the characteristics of an introvert. An introvert is someone who prefers to work alone, is more comfortable in small groups, and is more introspective than an extrovert. They are often labeled as shy, but this is not necessarily true.

So why are almost all programmers considered introverts? Part of the reason is that coding is a solitary activity. Programmers spend most of their time writing code and debugging. This requires a lot of concentration and focus and can be difficult to do in a loud or crowded environment.

Another reason is that programming requires a lot of problem solving and critical thinking. Programmers must be able to think logically and come up with creative solutions to problems. This requires a great deal of introspection and can be difficult to do in a group setting.

Programming also requires a great deal of patience. Programmers must be able to work through complex problems and be willing to adjust their code as needed. This requires a great deal of patience and discipline, both of which are traits of an introvert.

It is not surprising that almost all programmers are introverts. Coding is a solitary activity that requires problem solving, critical thinking, and patience, all of which are traits of introversion. So the next time someone labels you as an introvert because you are a programmer, you can confidently explain why.

[linkedin.com/in/trinmar](https://www.linkedin.com/in/trinmar)
How does Claims Management Software help in the Healthcare Sector?
Published: 2023-01-02 12:33:30


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

The Claims management softwares aids in handling the insurance claims of those in high-level management, which reduces manual labour and advances automation. In the business sector, claim management systems assist in managing insurance claims, removing the complexity of healthcare legacy concerns, lowering maintenance and training expenses, and streamlining the customer experience. This makes sure that everything goes very smoothly in the healthcare sector. Claims software aids in the deployment, construction, and claiming of efficient, agile, and ROI-maintaining end-to-end business processes.

Automation in claims software management promotes openness, ensures that you don't encounter victims, uncover fraud claims, or run across people who aren't paying their bills on time in a timely manner. This promotes secure claim processing and fosters solid relationships with market-leading insurance providers.


How does Claim management software help to take steps in the future? 


This medical claims software is the internet security measure that guarantees its data is secured on the cloud. Its entire data set is encrypted, thus there is no possibility that it might be stolen by unauthorised users. One advantage of this approach is that it has low effective costs and is lawful. This solution enhances effective healthcare solutions and analyzes data analysis more completely while guaranteeing claims processing effectiveness and efficiency of operations.

Every company will need this data right now, and it won't be permitted to be taken for granted because it will be secure and more accurate. Even if the business doesn't pay the consumers, research indicates that 80% of expenses go toward handling claims. This kind of data guarantees transparency and clarity for a more modern and efficient solution to concerns that are on the rise.


Future for Insurance Companies:- 


In the near future, insurance firms will wish to see more claimed sales. This is due to the many efforts made to get insurance and assure efficient procedures. They do not wish to have to pay more in the end as a result of fraud cases. They are going to work on a dependable server that is routinely reviewed in order to foster positive customer interactions since they want to secure the privacy of user data.

The introduction of cloud-based technologies by healthcare claim management firms will assist them in increasing automation and focus more on what matters. Insurance providers ought to assist customers make fair claims for insurance and balance the motives why they do so.

Source : https://www.osplabs.com/healthcare-payer-software-solutions/medical-claims-management/
URL Decoder/Encoder
Tags: javascript, html, tutorial, beginners
Published: 2023-01-18 05:00:00

Using JavaScript, let's create a URL decoder

## Code 

### HTML

```html
<textarea id="data"></textarea><br />
<button id="encode">Encode</button>
<button id="decode">Decode</button>
```

HTML code is used to create the basic structure of the page, including elements such as text areas and buttons. 

In the given example, a text area with the ID "data" and two buttons with the IDs "encode" and "decode" were created. 

The text area with the ID "data" is where the user can type or paste the text they want to encode or decode, while the "encode" and "decode" buttons are used to indicate the action the user wants to perform.

### JS

```js
const data = document.querySelector("#data");
const encode = document.querySelector("#encode");
const decode = document.querySelector("#decode");

encode.addEventListener('click', encodeURL);
decode.addEventListener('click', decodeURL);

function encodeURL() {
  data.value = encodeURIComponent(data.value);
}

function decodeURL() {
  data.value = decodeURIComponent(data.value);
}
```

JavaScript is used to add functionality to previously created HTML elements. In the given example, the lines of JavaScript code are responsible for selecting the HTML elements, adding event listeners for the "encode" and "decode" buttons and the "encodeURL" and "decodeURL" functions that respectively encode and decode the text contained in the area "date" text icon.

When the user clicks the "encode" button, the "encodeURL" function is called, using the JavaScript "encodeURIComponent" function to encode the text contained in the "data" text area and assigning the result back to the "value" property of the "date" text area. Likewise, when the user clicks the "decode" button, the "decodeURL" function is called, using the JavaScript "decodeURIComponent" function to decode the text contained in the "data" text area and assigning the result back to the property "value" from the "data" text area.

## Demo

See below for the complete working project.

{% codepen https://codepen.io/WalterNascimento/pen/vYJaqzw %}

_if you can't see it [click here](https://codepen.io/WalterNascimento/pen/vYJaqzw) and see the final result_


***

## Thanks for reading!

If you have any questions, complaints or tips, you can leave them here in the comments. I will be happy to answer!

😊😊 See you later! 😊😊

***

## Support Me

[Youtube - WalterNascimentoBarroso](https://www.youtube.com/channel/UCXm0xRtDRrdnvkW24WmkBqA)
[Github - WalterNascimentoBarroso](https://github.com/walternascimentobarroso)
[Codepen - WalterNascimentoBarroso](https://codepen.io)
What are some must-use things for new Angular projects in 2023?
Tags: angular, typescript, testing, tooling
Published: 2023-01-02 13:34:36

So I'm switching jobs soon and will be setting up a few new Angular projects, new libraries and whatnot and am wondering what I might be missing out on and should be implementing in new projects.

The past months I've been working on weird architectures and overly complex systems that made me realize that I might be used to outdated concepts and not been using the latest tools that would make me a happy dev.

I am aware of NX and how things change because of it. Not sure if its usable for every use case I will have but I will keep that in mind. So for folks that have been finding new stuff to use the past 2 years, let me know as I have a few questions:

1. What SCSS framework is currently the most recommended (like Tailwind, Material or something else? Of course "it depends" but whats your favorite right now?)
2. What ESLint rules and extentions would you recommend (over the default ones)
3. What mocking and testing extensions are now recommended? I know of NGMocks and NGSpectator but perhaps there is something else new for speeding up building tests
4. Should I switch Cypress with something else? Or get something to speed up writing E2E tests?
5. Should I switch to Jest and if so what helper libraries are recommended?
6. What other tools have you been using?
7. What other code quality things have you started using?
8. Whats something you didn't use one year ago that you think people should try?

Basically pretend I've been under a rock for 2 years and tell me what you've been using that has improved your Angular project code and made your projects more fun to work on. Aside the blatantly obvious things like migrating to Angular 15 and so on...
Log Forwarding To Linux
Tags: cybersecurity, socananlyst, tech
Published: 2023-01-02 19:25:29


{% embed https://youtu.be/XDs6NCLH6yM %}

In this video:
**- Configure Syslog Monitoring via Palo Alto Firewall**
Syslog is a standard log transport mechanism that enables the aggregation of log data from different network devices - such as routers, firewalls, printers - from different vendors into a central repository for archiving, analysis, and reporting. 
Palo Alto Firewalls can forward every type of log they generate to an external Syslog server. Using TCP or SSL  for reliable and secure log forwarding, or UDP for non-secure forwarding.

**- Verify Syslog Forwarding**
able to connect to the DMZ server and verify that the syslogs are being forwarded. Using Xfce Terminal, I was able to ping the DMZ server address by typing **ping -c4 192.168.50.10.**
Also using **tail -f /var/log/messages** can connect the current file for any changes that are occurring. Which should show the date, source of the syslog data, and information about the traffic.
SABONG INTERNATIONAL ME
Published: 2023-01-03 06:09:10


Sabong International is regulated by PAGCOR, and we are dedicated to providing you with the most legitimate and reputable online Sabong in the Philippines. Watch Premium Live Online Sabong for FREE and take advantage of the plethora of promos that Sabong International Me has to offer, ranging from 1st Time Deposit to rebates and a great deal more.
Strings Formatting in Python
Tags: python, programming, beginners
Published: 2023-01-03 11:54:49

String formatting is the process of infusing things in the string dynamically and presenting the string.

There are 3 different methods to format a string in string

- Old style formatting
- String Format method
- F-string / String interpolation
## Old style formatting technique
In this technique we need percent symbol `%` followed by some characters inside the string as placeholder for the values that will be embedded in string.
There are four placeholder or special symbols:

- `%s` → string
- `%d` → integer
- `%f` → float
- `%.(n)f` → for floating value with n digit precision (n is a positive integer)
These symbols are similar that use in c programming language.

Example 1:

```
a=5
b=3
print(‘%d + %d = %d’%(a,b,a+b))
# 5+ 3 = 8
```
Example 2:
```
name= ‘Anuj’
like=’Bikes’
print(‘My name is %s. I like %s’%(name,like))
# My name is Anuj. I like Bikes.
```


## String format Method
In this technique we use string format method. To use format method we need to use pair of empty curly bracket `{}` for each variable we need to embed in the string at place of brackets

Example 1:

```
a=5
b=3
print(‘{} + {} = {}’.format(a,b,a+b))
# 5+ 3 = 8
```

Example 2:

```
name= ‘Anuj’
like=’Bikes’
print(‘My name is {}. I like {}.’.format(name,like))
# My name is Anuj. I like Bikes.
```

## F-string / Literal string interpolation
To create an f-string, prefix the string with the letter “ f ”. The string itself can be formatted in much the same way that you would with str.format().

Example 1:

```
a=5
b=3
print(f.‘{a} + {b} = {a+b}’)
# 5+ 3 = 8
```

Example 2:

```
name= ‘Anuj’
like=’Bikes’
print(f.‘My name is {name}. I like {like}’)
# My name is Anuj. I like Bikes.
```

If you like my post consider following me I am sharing content on programming and development. Please comment any improvement on this post.
You can contact me on-
`Linkedin: https://www.linkedin.com/in/rhlgt/
Twitter: https://twitter.com/rahulgtst`
The Future of Technology: What's Next for Our World?
Tags: news, future, technology, artificialintelligency
Published: 2023-01-03 13:53:10

Finally, biotechnology is also making amazing advances. Biotechnology can be used to create new medicines and treatments, as well as modify existing organisms to create new products. In the future, biotechnology could be used to create new cures for diseases and even modify the human body itself.

Nanotechnology is also becoming increasingly powerful and widespread. Nanotechnology can be used to create incredibly small machines that can perform complex tasks with incredible precision. In the future, nanotechnology could be used to create new materials and medicines that could revolutionize our world.

These are just a few of the amazing advances in technology that we are seeing today. As technology continues to evolve and become more powerful, the possibilities are endless. In the future, we could see robots that can think and act like humans, new types of materials that could revolutionize our world, and technologies that could help us explore space. The future of technology is truly exciting, and only time will tell what amazing advances are in store for us.

[Visit To Read Full Article Originally Published On:-3/01/2023](https://www.javaoneworld.com/2023/01/the-future-of-technology-whats-next-for.html)