teleren/devto huggingface dataset:
How to fix Converting circular structure to JSON
Tags: webpack, node, javascript, tutorial
Published: 2022-12-16 12:31:34

Oftentimes while fine-tuning building process you need to output lots of data. 

Common case scenario is when you track the process of [SplitChunksPlugin](https://webpack.js.org/plugins/split-chunks-plugin/) in Webpack and you want to see what module goes in what place, whats in the module, in what chunks it was required etc.
So you use 
`const data = { module, ...chunks };`
`fs.writeFileSync('report', JSON.stringify(data))`

This will emit error 
>  "Converting circular structure to JSON"

thats bc module is has nesting and cross-references on itself in its structure.

JSON.stringify can accept 3 arguments, 1st is data 2nd is a replacer and 3d is a spacer for formatting stuff.

So there a function to avoid error, this function should be used as  a replacer.

```
const getCircularReplacer = () => {
  const seen = new WeakSet();
  return (key, value) => {
    if (typeof value === "object" && value !== null) {
      if (seen.has(value)) {
        return;
      }
      seen.add(value);
    }
    return value;
  };
};

```

And this will work:
`fs.writeFileSync('report', JSON.stringify(data, getCircularReplacer(), 2))`
Biz spp organishni boshladik
Tags: cpp, programming, discuss, productivity
Published: 2022-12-16 12:22:17

```

```
 
Bugun biz spp faundation yani dasturlash kursini organishni noshladik.
Bu kursda siz tog'ri yozishni organasiz.
Bu kersda har hil buyruqlar va kutubhonalar bor ularni qanday qilib chaqirishni yani elon qilishni organasiz.
Bu dasturlashda har hil masalalar ishlashniham organasiz.
masalan 

```


#include <iostream>
using namespace std;

int main4(){
int son,son1,son2;
  son1=10;
  son2=20;
  son=son1+son2;

  cout << son << endl;// 40
  string ism,a,b,c;
  ism = "ABDULAZIZ";
  a="salom ";
  b=" nima gap";
  cout << a <<ism << b << endl;

  a= "qalaysan";
  cout << a;

  return 0;
  }
```
va boshqa masalalarniham ishlashni organasiz.

```
  
 int a; 
 cin >> a;
  
  cout << a << a << a << a << a << a << endl;
  cout << a << "    " << a << endl;
  cout << a << "    " << a << endl;
  cout << a << a << a << a << a << a;

  return 0;
}
```
  @dawroun
Capture VLAN tag with wireshark
Published: 2022-12-16 11:59:31

Wireshark is widely used for Ethernet communication development.I have some projects need testing the Ethernet packets with & without VLAN tag.  In this case, we need consider the following conditions for validation.
1. The publisher send the packets with/without VLAN tag
2. The Ethernet Switch can be setup to keep/remove the VLAN tag
3. The subscriber may see / not see the VLAN tag depend on the OS and driver configuration.

Typically wireshark is used as a validation tool. Here is the link from wireshark
https://wiki.wireshark.org/CaptureSetup/VLAN

My environment is windows + USB3 Ethernet Adapter (ASIX AX88179), there is an solution from the vendor to capture/keep VLAN tag in the driver:


Please set the "Packet Priority & VLAN" parameter of ASIX USB to LAN Windows drivers to "Packet Priority & VLAN Disable" to capture the VLAN tagged packets on WireShark.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8m8gjdj4rorpkdi2dxox.png)
InnerHTML vs InnerText
Tags: html, javascript, codenewbie, webdev
Published: 2022-12-16 11:51:49

When trying to set the property of elements in Javascript, there are several similar ways of doing it, in this article I will explain what `innerHTML` and `innerText` are all about and their differences. Let's get started!!!

**What's InnerHTML ?**
`innerHTML` is the property of an element that set or get the `HTML` markup contained within an element. It contains `HTML` tags like `<li>` ,`<span>`, spacing and formatting. Let's create a `p` element with some content as shown below

**HTML**

` <p id="p"> This is an example of <strong>innerHTMl  
 </strong>text </p> `

**Javascript**

```
let element = document.getElementById("p").innerHTML;

```
if we `log` the value to `console` we have 

` "This is an example of <strong>innerHTMl  </strong> text"  `

Everything in between the `p` element is shown without formatting and spacing.

Setting the value of an element's `innerHTML` removes all of its descendants and replaces them with `elements` constructed by parsing the `HTML` given in the string. 

` element = "This has been changed"  ` 

**Note**: Whenever you add, append, delete or modify contents on a webpage using `innerHTML`, all contents are replaced, also all the DOM nodes inside that element are reparsed and recreated, thereby making the process slow.

The use of `innerHTML` also creates a potential security risk for your website. Malicious users can use `cross-site scripting (XSS)` to add malicious client-side scripts that steal private user information stored in session cookies.

**innerText**

The `innerText` property returns the rendered text content of an element that is visible in the browser. It doesn't return the content of  `<script>` and `<style>` elements, It also neglects the spacing unlike `innerHTML`. `innerText` cannot access elements If elements are hidden by CSS properties like visibility and display.

**HTML**

`<p id="p"> This is an example of <strong>innerText  
 </strong>text </p>`

**Javascript**

```
let element = document.getElementById("p").innerText;

```
in the console, we have `This is an example of innerText text ` in the log.

When you set the `innerText` property, all child `nodes` are removed and replaced by only one new text node. `innerText` is what you get when a user copies and pastes the content of an element. `innerText` is best used when you need to retrieve the content of an element in plain text.



**Thanks for Reading.**
How to print your log in VxWorks 6.x
Published: 2022-12-16 11:36:59

## Issue:
For embedded software developer using printf  is the most used debug method on target. But in vxworks6.x, it start to change because the default stdout/stderr is redirected. If you connect to device by shell/telnet, printf in the code will not put to the stdout/stderr in the current shell.

## Solution:
You can put a the following code in the debug version. Once you have connect to target by shell/telnet, call the function to redirect some task /all task io to the current shell.



```
void ioRedirect(void)
{
    int shellTid = 0;
    int shellOpFd = 0;
    int globalStdFd = 0;

    shellTid = taskIdSelf();
    shellOpFd = ioTaskStdGet(shellTid, 1);
    globalStdFd = ioGlobalStdGet(1);

    (void)logMsg("LM:Initial task output.shellFd %d, GlobalFd %d.\n", shellOpFd, globalStdFd, 0, 0, 0, 0);

    printf("p:Initial task output.shellFd %d, GlobalFd %d.\n", shellOpFd, globalStdFd);

    /*you can specify the task who need printf*/
    /*ioTaskStdSet(GSETaskId,1,shellOpFd);
    ioTaskStdSet(mstEvtId,1,shellOpFd);*/

    /*or set the global io*/
    ioGlobalStdSet(1, shellOpFd);
    globalStdFd = ioGlobalStdGet(1);

    logMsg("LM:Initial task output.shellFd %d, GlobalFd change to %d.\n", shellOpFd, globalStdFd, 0, 0, 0, 0);

    printf("p:Initial task output to globalStdFd %d.\n", globalStdFd);
}
```
c++ga kirish
Tags: beginners, webdev, programming, tutorial
Published: 2022-12-16 11:36:52

Biz 1darsda c ++ ni qanday dasturlashni o'rgandik.
#`include <iostream>
using namespace std;
int main(){

cout << "salom qizla";
/*cout << "salom qizlar";
 cout << "salom nima" ;*/
  

_`c++ ni qanday ishlatishni o'rgandik.
c++ da `include``<iostream>``using namespace 
std`int main(){ 
_
```
`<iostream>`Kutubxona nomi.
`using namespace`uzun kodlarda hadeb `std`ni, qo'ymalik.
`std` Bu biz foylanishimz kerak bo'lgan buyruq.
std::cout <<`"salom"`
`cout`-To'liq etilishi `console`tarjimasi ekranga chiqarish.
`""`qo'shtirnoq ochimizdan maqsad agar uni qo'ymasek yozgan tekstimzni ekranga chiqarb bermaydi.
Tekstmiz tugagach `;` bu belgini qo'ymasek ekranga chiqan paytda xato qib beradi. 

```

**Biz c++ da o'zgaruvcilar turlarini o'rgandik.**

```
----- o'zgaruvchilar turlarini------; 
masalan;
 int => faqat  tekstla uchun saqlash uchun; 4byte.
 char => faqat bitta belgi saqlash uchun; 1byte.
 float=> faqat kasr son saqlash uchun; 1byte.
  
 **Tekst oldidan sonini qo'yishni o'rganamiz.
     **

```
```
cout << "1!=" << 1*1 << endl;
     cout << "2!=" << 2*1 << endl;
     cout << "3!=" << 3*2 << endl;
     cout << "4!=" << 4*6 << endl;
     cout << "5!=" << 5*24 << endl;
```
**Bu kodda esa tortburchakni eni bilan boyini  o'rganamiz.**
   

```
 int eni,boyi;
   cout << "To'rtbirchakninig enini kiriting: ";
   cin >> eni;
   cout << "To'rtburchakninig Bo'yini kiriting: ";
   cin >> boyi;

   cout << "To'rtburchakninig yuzi: " << eni *boyi;
  
return 0;
}
 
```
 **Bu kodda esa, 2 xonali soni yonma yon yozishni o'rganamiz.
       
**
```
  int kun,oy;
  cin >> kun >> oy;
cout<<"Birthday is ";
  cout << setw(2) << setfill ('0')<< kun << '-';
  cout << setw(2) << setfill ('0') << oy << '.';
```
**Shu dastur tillarini o'rgandik!**

@dawroun
Image Parallex Effect with CSS
Tags: css, webdev, codepen, beginners
Published: 2022-12-16 11:32:03

Hello Everyone today i will show your how to create parallex effect with css.

Let's get started...

* To create a parallex effect, we need to set the container height like 100vh or whatever height you want.
* Then applying the background image using the background-image property.
* To fix the background image on it's position we will use background-attachment property and will set it value to fixed.Example is below
```css
.container{
height:100vh;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
background-size:cover;
}
```
* I didn't applied the background-image property in the container because we will be having multiple container and each container will have different background image,we can create a seperate class for creating unique container like this.
```html
<div class="container container-1"></div>
<div class="container container-2"></div>
<div class="container container-3"></div>
```
* You can set the background image to the containers separately using their second class name like this.
```css
.container-1{
background-image:url("image-1-url")
}
.container-2{
background-image:url("image-2-url")
}
.container-3{
background-image:url("image-3-url")
}
```

## Codepen - 
{% codepen https://codepen.io/shubhamtiwari909/pen/MWBgYYW %}

THANK YOU FOR CHECKING THIS POST
You can contact me on -
Instagram - https://www.instagram.com/supremacism__shubh/
LinkedIn - https://www.linkedin.com/in/shubham-tiwari-b7544b193/
Email - shubhmtiwri00@gmail.com

^^You can help me by some donation at the link below Thank you👇👇 ^^
☕ --> https://www.buymeacoffee.com/waaduheck <--

Also check these posts as well
https://dev.to/shubhamtiwari909/css-iswherehas-and-not-2afd

https://dev.to/shubhamtiwari909/theme-changer-with-html-and-css-only-4144

https://dev.to/shubhamtiwari909/swiperjs-3802

https://dev.to/shubhamtiwari909/going-deep-in-array-sort-js-2n90
What is your take on badges?
Tags: security, discuss, news, proxies
Published: 2022-12-16 11:30:05

**[SOAX](https://soax.com/?utm_source=social&utm_medium=devto) became a leader in [G2's](https://www.g2.com/products/soax/reviews) "Proxy Network" category!** And got a new shiny "Leader" badge.

So yeah, if you need top-notch residential proxies that get shit done, you are always welcomed [here](https://soax.com/?utm_source=social&utm_medium=devto).

But it is actually an intro to the main discussion

## Discussion:
## Do you pay attention to badges when looking for tools?

So this is my attempt to figure out if the promo assets (like G2 badges) that are aimed to reinforce the quality of the product are performing their function.

Are the number of reviews and overall rating on G2 or TrustPilot important? 
When you see badges like "Leader", "Users love Us", "Best Performer", do you have more trust in the product? 

Or maybe all of this does not matter to you? Or even puts you off?

Do not hold back!
c++ 4- dars
Published: 2022-12-16 11:29:30


#Ushbu kodda matematik ishlash o'ganamiz.
```cpp
#include <iostream>
using namespace std;
int main() {
cout << 25 + 5;
return 0;
}
```

#Ushbu kodda int, string o'rganamiz.
```cpp
#include <iostream>
using namespace std;
int main() {

int yosh = 15;
string ism = "Jafar";

cout << "Salom " << ism << endl;
cout << "men " << yosh << "daman.";
  
return 0;  
}
```
#Ushbu kodda son iritish o'rganamiz
``` cpp
#include <iostream>
using namespace std;
int main() {
int son;
  cout << "Sonni kiriting ";
  cin >> son;
  cout << "Siz kiritgan son:" << son;

return 0;  
}
```
@DAWROUN
Minikube on Ubuntu - Could Not Read CA certificate
Published: 2022-12-16 11:25:49

Follow http://computerbryan.com/minikube-on-ubuntu.html

But with minor modifiton to the solution:
Add the following line to file /var/lib/snapd/apparmor/profiles/snap.docker.docker

`owner @{HOME}/.minikube/certs/* r,`
Scale up your Laravel App using Laravel Octane
Tags: laravel, webdev, programming, mobile
Published: 2022-12-16 11:10:04

Laravel is one of the most trending frameworks nowadays, and being a favorite among product owners for small-scale online apps, Laravel has attracted a lot of attention in recent years. Laravel still feels like a tough nut when creating a large-scale application. 

This blog post has discussed Laravel Octane, the newest addition to the Laravel framework, and the hype it has generated in the market for scaling Laravel applications and bridging the scalability gap that Laravel's product owners have been experiencing.

The most recent product offered by the Laravel Team is Laravel Octane. The use of Swoole and RoadRunner gives our Laravel application a speed boost. It creates a dependency container for the Laravel framework during bootstrapping, saves it in RAM, and eliminates the bootstrapping procedure from each request to deliver lightning-fast replies.

**Reasons you should start using Laravel Octane!**
Laravel Octane is a open-source platform which include packages that use by Laravel applications that connect to Swoole and RoadRunner to provides best performance with this. It happen with one request, memory, which is not set with request of subsequaent. 

**These are the major key feature of Laravel octane:**

- It’s give a quick boost of your application.
- Compared to other Laravel applications, it uses fewer resources.

Let’s see how Laravel octane works:
The performance of your Laravel application can be improved by up to 30% thanks to Octane, which keeps your data and objects in memory. Since the Laravel application can manage thousands of connections quickly, it contributes to the increase in traffic or the requirement for high availability. 

This improvement in performance is due to the elimination of disc reads, process forks, and various other overheads that become active whenever the framework is booted up on every request. Additionally, this is a cost-effective and productive strategy.

In certain cases, the codebase only has to be modified slightly or not at all. But it's connected to the organisation of your application.

- Octane Open Swoole
- Octane Roadrunner

**Alright, So Why Laravel Octane?**
We all appreciate performance enhancements, don't we? [Laravel Octane](https://www.bacancytechnology.com/blog/laravel-octane) will unquestionably provide your Laravel application a significant performance boost. Is this performance improvement really necessary? Well, possibly; I believe it depends on the application you are using. However, what matters more to me is that Laravel is once again pushing PHP's capabilities. Not only does Octane push interesting new PHP capabilities like coroutines, ticks, and generally the idea of serving your own application with an artisan command, it also mandates at least PHP 8.
Why Cloud Adoption is the 21st Century Strategy
Tags: cloud, programming, cloudskills
Published: 2022-12-16 11:02:41

The innovations and disruptions that have been witnessed in the world of cloud computing in the 21st century are tremendous to how enterprises maximize the power of cloud-based solutions.

Cloud adoption presents a myriad of advantages that solve the question of accessing technology as a service whilst allowing organizations and enterprises to focus on their core mandate.

In this article, we will look at the advantages that every cloud service consumer reaps by opting for cloud computing services.

### High Accessibility

Cloud computing services provide enterprises with the efficiency of accessing their data at any given location provided there is an internet connection and valid login credentials. Unlike on-premise systems that require human presence, with a cloud strategy, business is bound to not be restricted by a lack of on-site presence. In today's globalized world such a solution guarantees business continuity despite unforeseen circumstances.

### Cost Affordability

Servers and other types of equipment come at largely exorbitant prices. Cloud service providers allow clients to access services based on their unique needs thus making the service affordable to them. This is contrary to the cost clients would be bound to occur from equipment, personnel and time. This model provides access to anyone in need of cloud-based solutions

### Innovative Advantage in a Fast-Evolving World

Embracing a Cloud Service Provider (CSP) means that enterprises can tap into the incoming innovations as technology evolves. This ranges from monitoring trends, speed, analytics, IoT and other app developments. Entreprises can thus focus on their key priorities without the worry of not being at par with technology advancements.

### Cloud Customization Option

Today's CSPs allow clients to customize their cloud solutions based on their own needs. This means they can pick from pre-built features based on what works for them and what their particular need is as well as their budget. Such a need-based selection ensures that no one is left behind or hindered by high upfront costs in accessing cloud solutions.

### Responding to market needs

Adopting cloud solutions also means that organizations can better understand their customers' needs and thus boost customer engagement and experience based on real-time analytics on customer preferences and behavior. This then translates to revenue growth, improved Customer Experience (CX) and higher rankings.

### Conclusion

The onset of the pandemic re-emphasized the need for cloud-first models for enterprises and organizations. Cloud computing in today's fast-paced world is a solution for both small-scale and large-scale enterprises in reaching their clients in innovative ways.

A good outline by the DevSecOps team on what your niche and needs are in a cloud strategy ensures that you can fully tap into the benefits of cloud migration.
RSA ALGO in java
Published: 2022-12-16 10:49:26

```
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {

    public static double gcd(double a, double h)
{
	/*
		* This function returns the gcd or greatest common
		* divisor
		*/
	double temp;
	while (true) {
	temp = a % h;
	if (temp == 0)
		return h;
	a = h;
	h = temp;
	}
}
    public static void main(String args[]) {
       double p = 3;
	double q = 7;

	// Stores the first part of public key:
	double n = p * q;

	// Finding the other part of public key.
	// double e stands for encrypt
	double e = 2;
	double phi = (p - 1) * (q - 1);
	while (e < phi) {
	/*
			* e must be co-prime to phi and
			* smaller than phi.
			*/
	if (gcd(e, phi) == 1)
		break;
	else
		e++;
	}
	int k = 2; // A constant value
	double d = (1 + (k * phi)) / e;

	// Message to be encrypted
	double msg = 12;

	System.out.println("Message data = " + msg);

	// Encryption c = (msg ^ e) % n
	double c = Math.pow(msg, e);
	c = c % n;
	System.out.println("Encrypted data = " + c);

	// Decryption m = (c ^ d) % n
	double m = Math.pow(c, d);
	m = m % n;
	System.out.println("Original Message Sent = " + m);
    }
}
```
An Introduction to HTML: The Programming Language for Creating Web Pages
Tags: webdev, html
Published: 2022-12-16 10:32:09

HTML, which stands for HyperText Markup Language, is a programming language used to create and structure content on the World Wide Web. It is the standard markup language for creating web pages and is used to describe the structure and formatting of a document written in HTML.

HTML consists of a series of elements, or tags, that are used to define the content and structure of a web page. These elements include headings, paragraphs, lists, links, and more. HTML also allows for the use of multimedia, such as images and videos, and can be used to create interactive forms and other interactive elements.

To create an HTML document, you can use a simple text editor like Notepad or TextEdit. The document must be saved with the .html file extension in order for it to be recognized as an HTML document by a web browser.

To add content to an HTML document, you can use various tags, such as the <p> tag to define a paragraph, the <h1> tag to define a heading, and the <a> tag to create a hyperlink. HTML also includes tags for formatting text, such as bold and italic, and for creating lists, tables, and forms.

HTML also allows for the use of Cascading Style Sheets (CSS) to define the style and layout of a web page. By using CSS, you can control the font, color, and layout of your web page, making it easier to create a consistent look and feel across multiple pages.

In addition to being used for creating web pages, HTML is also used to create email messages and mobile applications. It is an essential skill for anyone looking to work in web design or development, and it is a fundamental building block of the World Wide Web.
The Most Comprehensive Rails Course You Will Ever Find
Tags: rails, railscourse
Published: 2022-12-16 10:20:54

If you want to learn Ruby on Rails, this is the course for you. This course is designed for beginners and experienced developers alike. You will learn everything you need to know about Rails, from the basics of installation to building complex applications. 

The course is divided into lectures, with each lecture focusing on a specific topic. In addition, there are quizzes and assignments to test your knowledge. By the end of the course, you will be confident in your ability to build Rails applications from scratch. 

So what are you waiting for? Sign up today and start learning!

If you want to become a web developer, then you need to learn Ruby on Rails. Ruby on Rails is a web development framework that is used by some of the biggest companies in the world, such as Twitter, Airbnb, and Bloomberg. 

Finding a quality Rails course can be difficult, as there are many different options out there. This article will introduce you to the most comprehensive [Rails course](https://www.igmguru.com/digital-marketing-programming/ruby-on-rails-certification-training/) that you will ever find. This course is called ‘The Complete Ruby on Rails Developer Course’.