teleren/devto huggingface dataset:
What is Web Browser.?
Tags: webdev, beginners, opensource, programming
Published: 2024-02-04 17:32:54

**Web Browser** is an Application Software is used to explore _<u>World Wide Web</u>_. It provides an interface between the client and the server. It requests the server for Web Documents and Services. It works as a Compiler to render the HTML which is used to design Web Pages. Google Chrome, Mozilla Firefox, Microsoft Edge and Safari are the Examples of Web Browser.
Docker Management Tools That's Save Time & Effort
Tags: webdev, docker, monitoring, management
Published: 2024-02-04 16:59:32

_LazyDocker is a simple command line interface (CLI) tool that simplifies the management of Docker. LazyDocker allows you to execute regular Docker actions like initiating, halting, restarting, and eliminating containers using just one instruction. LazyDocker also simplifies the process of checking logs, removing containers and images that are not being used, and customize metrics._

**Bootup In Docker:**

```
$ docker run --rm -it -v \
/var/run/docker.sock:/var/run/docker.sock \
-v /yourpath:/.config/jesseduffield/lazydocker \
lazyteam/lazydocker

Don't forget to change /yourpath to an actual path you created to store lazydocker's config

$ lazydocker [ launch lazy ]

```

_## Don’t Like To Be Lazy Try This One:_

_CTOP gives a brief and compressed summary of up-to-date measurements for multiple containers._

**Debian/Ubuntu Installations:**

```
sudo apt-get install ca-certificates curl gnupg lsb-release
curl -fsSL https://azlux.fr/repo.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/azlux-archive-keyring.gpg
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] http://packages.azlux.fr/debian \
  $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/azlux.list >/dev/null
sudo apt-get update
sudo apt-get install docker-ctop
```

```
$ ctop [ launch command  ]
```

_If you’re looking for a way to save time and effort managing Docker these tools's for you._
#2 Pure NodeJs: simple server (Part 2)
Tags: webdev, node, tutorial, beginners
Published: 2024-02-04 16:50:46

In this tutorial we will continue the [previews article](https://dev.to/basharosman/1-pure-nodejs-simple-server-3el3) to learn how to create simple Node Js server and show you different between serving plain text and html as response with no packages at all just pure Node Js core modules.

programs and versions: 
nodejs: v18.19.0
npm:    v10.2.3
vscode: v1.85.2

should work on any nodejs > 14

### Lets Start:
I assume that you had read the [simple server (Part 1) article](https://dev.to/basharosman/1-pure-nodejs-simple-server-3el3) if not this the code we used:

```javascript 
const http = require('http');

const server = http.createServer((req, res) => {
  res.end('Hello World!');
});

const PORT = 2121;
server.listen(PORT, 'localhost', () => {
  console.log(`server run on port ${PORT}`);
});

```
we will add this code before the res.end(..): 

```javascript
res.writeHead(200, { 'Content-Type': 'text/plain' });
```

the "res.writeHead"  It is used to write the response header to the request. It takes two arguments: the HTTP status code (like: 200 success, 204 no content, 404 not found etc..) and an object containing the response headers.
so in this example we set the 'Content-Type' to be 'text/plain' but the default  is 'text/html'.
the different between the 'text/plain' and the 'text/html' 'Content-Type' that the 'text/plain' will be wrap it with "pre" html tag so even if we write it like this:

```javascript
res.end('<h1>Hello World!</h1>');
```

and run the server by this command (the file name is server.js):

```shell
node server.js
```

open the browser  you will find the page show the text as it 
```
<h1>Hello World!</h1>
```
but if we don't write the header or if we write it as:

```javascript
res.writeHead(200, { 'Content-Type': 'text/html' });
```

there result in browser will be big bold "Hello World!" as should it be with "h1" html tag

### Most common Content-Type:
* text/plain: Plain text
* text/html: HTML documents
* text/css: Cascading Style Sheets (CSS)
* application/json: JSON data
* application/javascript: JavaScript code
* application/xml: XML data
* image/jpeg: JPEG images
* image/png: PNG images
* image/gif: GIF images
* audio/mpeg: MP3 or other MPEG audio files
* video/mp4: MP4 video files
* application/pdf: PDF documents

### the complete code:
```javascript
const http = require('http');

const server = http.createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/html' });
  res.end('<h1>Hello World!</h1>');
});

const PORT = 2121;
server.listen(PORT, 'localhost', () => {
  console.log(`server run on port ${PORT}`);
});

```

### Conclusion:
In this article we show you the different 'text/plain' and 'text/html' and list most used Content-Type header value.

In the upcoming article I'll guide you through the process of serving HTML file as a response
Dynamic websites with Flask
Tags: discuss, flask, python, webdev
Published: 2024-02-04 16:31:47

I use Python for both work and hobby projects. Some of the projects I create require external access for which I use Flask, for example:
- a minimalistic UI that allows someone to go over some items and give feedback over them (I use Flask to display each in its own page)
- allowing me to call some function on my computer (e.g. play a sound) from my phone (I wrap my function in a Flask route)
- etc.

Flask seems great for when each of these pages is static. However, if some need arises and I need to make them dynamic (e.g. checking some checkbox makes some component visible), I'm not sure what today's best practice is. Flask does give me the option to use javascript as part of the templates it displays, but using plain javascript seems outdated - the proper way to build reactive pages is using React/Angular etc. But when these are combined with Flask, tutorials I've seen suddenly assume you only use Flask as an API (just returning JSON data) and not as a proper server, which seems like a small addition requiring a large overhaul.

Which setups work for you for making Flask pages display dynamic pages?
789bet
Published: 2024-02-04 16:26:13

789bet (789bet tech) là nhà cái và sòng bạc trực tuyến được cấp phép hoạt động hợp pháp tại thị trường Việt Nam bởi Isle of Man và đặc khu kinh tế Cagayan and Freeport. Do đó, hệ thống sản phẩm & chế độ thưởng tại vn789bet đều được kiểm soát chặt chẽ, đảm bảo các khách hàng được cá cược trong môi trường công bằng, minh bạch, sòng phẳng. Đăng ký ngay hôm nay bạn sẽ nhận được 299k tại địa chỉ 6789bet.tech
Thông tin nhà cái: 
Hotline: 0941014537
Email: 6789bettech@gmail.com
Website: https://6789bet.tech/
Địa chỉ : 12 Phan Ngọc Tòng, Phường An Hội, Bến Tre, Việt Nam
#789bet #6789bettech #789betcasino #nhacai789bet
BakaLLM part NaN and general shenanigans
Published: 2024-02-04 16:07:15

Hello, fairy dairy diary~. 

No Cirno picture today as not much interesting was accomplished.

This week I tried to integrate mamba into BakaLLM by 
adding it alongside MLP and ATTN.

Unfortunately it increased number of parameters to unreasonable amount, so I then added it to each 4th layer.

Didn't go well with the loss function, so I think I'll try to move it into attn layer as MEGA does (where it affects QK).

Other things tried: "MoE"ficatotion of layers. Each "big"-layer splitted in two normal layer, then little softmax here, little addition there and we got the result. Didn't work well, and passing state around was pita, so I think I return to Mamba experiments.


Also for fun played around with very simple wav-generator:
took 3 youtube videos of touhou, converted them into 1024 dimensional tensors where `X=[[sample at time point 0, sample at time point 1,... sample at time point 1023], [sample at time point 1, sample at time point 1,... sample at time point 1024]]` and passed it through 1 layer of mamba with loss=simple MSE. It learned to produce nice "pluck" but that's it. Not unexpected, but still fun.

I'll try to play around music next time maybe by cutting off first and last 15 seconds, as I think it learned silence.
This is a post for newbies to ask for help
Tags: beginners, ai, learning, security
Published: 2024-02-04 15:50:06

I currently have a lot of time and want to learn programming knowledge. 
I have no previous experience and hope to find a teacher to have a pleasant learning experience. 
I want to learn and understand through AI first, and then learn the knowledge   related to penetration and security 
If you happen to have time, I look forward to your message.
Thank you for reading.
Rufus Bootable USB to install Ubuntu 22.04 LTS
Tags: programming, ubuntu, tutorial, productivity
Published: 2024-02-04 15:21:50

Creating a bootable USB for Ubuntu 22.04 LTS using Rufus is a straightforward process. Rufus is a free, open-source software for Windows that helps format and create bootable USB flash drives. Here's a step-by-step guide:

1. **Download Required Files**:
   - Download the Ubuntu 22.04 LTS ISO file from the official Ubuntu website.

[install ubuntu](https://ubuntu.com/download/desktop)
![install ubuntu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5wjpjmc8pb0qts283936.png)
   - Download Rufus from its official website.

[rufus](https://rufus.ie/en/)
![rufus](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2qh09q6soh9z0u9dh5e5.png)


2. **Prepare the USB Drive**:
   - Insert your USB drive into the computer.
   - Make sure to backup any important data on the USB drive, as the process will erase all data on it.

3. **Open Rufus**:
   - Launch Rufus after it's been downloaded and installed.
   - Rufus should automatically detect your USB drive. If not, select it manually from the Device dropdown.

4. **Configure Rufus Settings**:
   - In the "Boot selection" section, click on "SELECT" and browse to the location of your downloaded Ubuntu ISO file.
   - Partition scheme: Choose "GPT" if your computer uses UEFI, or "MBR" if it uses Legacy BIOS.
   - File system: Select "FAT32".

5. **Start the Process**:
   - Once everything is set, click "START".
   - A prompt may appear, warning that all data on the USB drive will be destroyed. Click "OK" to proceed.
   - Rufus will start creating the bootable USB. This process might take a few minutes.

6. **Finalize and Eject**:
   - After the process completes, close Rufus.
   - Eject the USB drive safely from your computer.

7. **Boot from USB**:
   - Insert the USB drive into the computer where you want to install Ubuntu.
   - Restart the computer and enter the BIOS/UEFI settings. This is usually done by pressing a key like F2, F12, Delete, or Esc immediately after you turn on the computer.
   - Change the boot order to boot from the USB drive.
   - Save changes and exit the BIOS/UEFI.

8. **Install Ubuntu**:
   - The computer should now boot from the USB drive, and you will see the Ubuntu installation menu.
   - Follow the on-screen instructions to install Ubuntu 22.04 LTS.

Remember, these instructions are based on a general approach and might slightly vary depending on your computer's specific hardware and BIOS/UEFI configuration.
Most Asked JavaScript Interview Questions & Answers
Tags: javascript, webdev, programming
Published: 2024-02-04 15:11:43


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r9dm1t4vu1m83lokcubr.png)](https://codescript.in/2024/02/02/20-most-asked-javascript-interview-questions-answers/)
**1. What is JavaScript, and how does it differ from Java?**
JavaScript is a lightweight, interpreted programming language primarily used for web development. Unlike Java, which is a full-fledged, object-oriented programming language, JavaScript is a scripting language embedded within HTML pages to enhance interactivity.

**2. Explain the concept of closures in JavaScript.**
Closures occur when a function retains access to variables from its outer scope, even after the outer function has finished executing. This allows for the creation of private variables and encapsulation of functionality.

```
function outerFunction() {
  let outerVariable = 10;

  function innerFunction() {
    console.log(outerVariable);
  }

  return innerFunction;
}

const closureExample = outerFunction();
closureExample(); // Outputs: 10
```

**3. What is the event loop in JavaScript?**
The event loop manages the execution of code, handling events and executing callbacks. It consists of a message queue, an event loop, and a callback or “message handler.”

**4. Describe the differences between let, const, and var.**
var is function-scoped and hoisted.
let and const are block-scoped, and const does not allow reassignment.

```
function example() {
  if (true) {
    var x = 5; // Function-scoped
    let y = 10; // Block-scoped
    const z = 15; // Block-scoped and cannot be reassigned
  }

  console.log(x); // Outputs: 5
  console.log(y); // Error: y is not defined
  console.log(z); // Error: z is not defined
}
```
**5. How does prototypal inheritance work in JavaScript?**
JavaScript uses prototypal inheritance, where objects can inherit properties and methods from other objects. Each object has a prototype chain, and if a property or method is not found in the object, JavaScript looks up the chain until it finds it.

```
function Animal(name) {
  this.name = name;
}

Animal.prototype.sound = function () {
  console.log("Some generic sound");
};

function Dog(name, breed) {
  Animal.call(this, name);
  this.breed = breed;
}

Dog.prototype = Object.create(Animal.prototype);
Dog.prototype.constructor = Dog;

Dog.prototype.sound = function () {
  console.log("Bark!");
};

const myDog = new Dog("Buddy", "Labrador");
myDog.sound(); // Outputs: Bark!```
```

## [20 Most Asked JavaScript Interview Questions & Answers](https://codescript.in/2024/02/02/20-most-asked-javascript-interview-questions-answers)
Make followers count available publicly
Tags: discuss, devdiscuss, public, views
Published: 2024-02-04 14:54:19

I'm about to achieve 3k followers on the Dev.to platform, and one thing I really want is for Dev.to to make the follower count public so that if someone wants to suggest or propose a gig for technical writing, he or she has an idea about the follower count and content type of that Dev.to writer. 

What about other's thoughts on this point ?
@thepracticaldev
How I Raised My ML Skills Using This Simple Project
Tags: machinelearning, ai, programming, python
Published: 2024-02-04 14:50:15

## Struggles in Learning ML
Do you spend hours of your day in front of large textbooks to learn mathematical concepts of machine learning such as linear algebra, calculus, or statistics? Learning Machine learning concept is highly challenging and time-consuming. But there is no need to worry. I will explain an easy solution to overcome the fear of learning large, tougher concepts of machine learning in less than an hour. Get ready to raise your ML skills.

## Discovering an Easy and Relevant Path

I spent a long time browsing the web to figure out the easiest way to enhance my machine learning skills. I found lots of articles and YouTube videos, but most of them were too technical and challenging to understand without a solid foundation in ML-related mathematics. 

I was looking for hands-on projects, so I could experiment and learn theoretical concepts simultaneously. Finally, I decided to build a spam-detection machine learning model, which doesn't require much deeper ML knowledge and serves as a real-world problem for learning each step in training a model in machine learning. Our model will predict whether an email is spam or not.

During this journey, we uncover the secrets behind each stage of machine learning model training and testing, including visualizing result using a confusion matrix.

## How to Train a Simple ML Model

Training a machine learning model involves multiple steps, such as  

- collecting the appropriate data
- preprocessing or cleaning the data
- choosing the best algorithm for our model
- evaluating and visualizing the results. 

After completing the fourth step, we will get a solid idea of how machine learning models are trained to predict information.


![stages](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fdcgaygm5ci7mg5eeols.png)


## Collecting Data for our ML Model

Continue reading the full article at https://journal.hexmos.com/spam-detection-ml/
What is Passive Optical Networking? | Benefits and How PON work
Tags: passiveopticalnetworking, passiveopticalnetworkingwork, networkbulls
Published: 2024-02-04 14:18:38

Explore the transformative capabilities of Passive Optical Networking (PON) 🚀 and its role in revolutionizing modern communication infrastructures. Discover its efficiency, scalability, and benefits in delivering high-speed data transmission. 

📶 Click to read more : [https://blog.networkbulls.com/what-is-passive-optical-networking](https://blog.networkbulls.com/what-is-passive-optical-networking)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zmtmxpbelwwkelcyuh22.png)
Yet Another Newsletter LOL: February already?!
Tags: react, astro, webcomponents
Published: 2024-02-04 14:18:35

Another week, another newsletter. Let's get to it!

## Around the Web

- Jack Herrington has a great [deep dive into RSCs and Next.js](https://www.youtube.com/watch?v=u0OMdWJfdhg) which is worth a watch.
  
- Brian Vaughn, former React core team member, drop a really great package this week, [react-resizable-panels](https://react-resizable-panels.vercel.app/). I might look into incorporating this into [OpenSauced](https://opensauced.pizza/). 👀
  
- My old co-worker Zach Leatherman has a great write up on web components. Check out [The good, the bad, the web components](https://www.zachleat.com/web/good-bad-web-components/).
  
- This was a great Podrocket episode with Dan Abramov on [React, RSCs, and the future](https://podrocket.logrocket.com/dan-abramov-react-rscs-future). Definitely worth a listen.
  

## Fun Stuff

This was technical and hilarious. Definitely worth a watch.

{% embed https://www.youtube.com/watch?v=64Hq1bZfhVs %}

## Shameless Plugs

This week was a double header in terms of live streaming. Monday, I got to hang with Atila from CrabNebula where we dug into Tauri and SolidJS & Solid Start.

{% embed https://www.youtube.com/watch?v=AUKNSCXybeY %}

Wednesday, I was on my monthly 2 Full 2 Stack show on the [CFE.DEV](http://CFE.DEV) YouTube channel where we dug into the Astro Framework.

{% embed https://www.youtube.com/watch?v=Ghgn5V27i1I %}

That's a wrap! Until the next one.

Here’s all the places you can find me on the web:

- 🌐 [My Website](https://nickyt.co)
  
- 🎬 [YouTube](https://nickyt.tube)
  
- 👾 [Twitch](https://twitch.tv/nickytonline)
  
- 👨‍💼 [LinkedIn](https://www.linkedin.com/in/nickytonline/)
  
- 💻 [GitHub](https://github.com/nickytonline)
  
- 🐦 [X/Twitter](https://twitter.com/nickytonline)
  
- 🧵 [Threads](https://www.threads.net/@nickytonline)
  
- 📸 [Instagram](https://instagram.com/nickytonline)
  
- ✍️ [dev.to](https://dev.to/nickytonline)
  
- 🎙 [Podcast](https://pod.nickyt.co)
  
- 🤝 [iamdeveloper.com Community](https://iamdeveloper.discord.com)
<!-- my newsletter -->
Transformers: The Architecture of AI
Tags: tutorial, webdev, beginners, ai
Published: 2024-02-04 14:00:54

> **Pre-requisite:**
What is neural networks?: https://dev.to/ajaykrupalk/neural-networks-the-artificial-brain-behind-ai-115p

ChatGPT's GPT-3 and GPT-4 and Google Bard's BERT are a few examples of Transformers. But what are transformers and how are they helping the most used chat models?

## What are transformers?
Transformers are something that transforms from one sequence into another. Each transformer has two parts: an **Encoder** and a **Decoder**. The encoder is associated with the input and the decoder with the output. 

![Transformers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pfje8yvmz6cm4jd3fx8j.png)

## How do Transformers work?
Transformers work through **sequence-to-sequence** learning. That means, they take a sequence of tokens (e.g., words in a sentence) and predict the next token. This is done by iterating through encoder layers. 

![Working of Transformers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0af86kpue7xe7apjznog.png)

The **encoder** generates encodings that define which parts of the input sequence are relevant to each other and passes these encodings to the next encoder layer. 

The **decoder** takes all of the encodings and uses their derived context to generate the output sequence.

Transformers are a form of **semi-supervised learning** i.e. they are pre-trained in an unsupervised manner with a large, unlabelled data set, whereafter they are fine-tuned through supervised learning to improve performance.

## Attention Mechanism
Transformers are different from other architectures in that they do not necessarily process data in order. Transformers use something called an Attention Mechanism which **provides context around items in the input sequence**. This makes them more efficient, for example, for tasks like translation, where the meaning of text is considered rather than the order of words.
survey: 大規模言語モデルを用いた事業文書からESG指標への影響推論及び統計的因果推論との関係の検証
Tags: gpt3
Published: 2024-02-04 13:46:29

## 選定理由

ESG + LLM + 因果推論と流行りもの組み合わせ、日立中央研究所。内容としてはまだまだ萌芽的な印象。

Paper: https://www.jstage.jst.go.jp/article/pjsai/JSAI2023/0/JSAI2023_3Xin429/_pdf
Code: N/A

## 概要

【社会課題】
経営者は自らの事業が ESG 指標に与える影響力を把握したい。投資家等のステークホルダーにとっても重要な情報である。

【技術課題】
事業文書のテキストから企業活動のESG指標への因果関係を交絡因子の影響を排除した状態で捉える必要があるが、従来の現代統計学と機械学習の理論では擬似相関や擬似無相関を切り分けることができない[[Ref](https://web.cs.ucla.edu/~kaoru/3-layer-causal-hierarchy.pdf)]。

【検証目的】
機械学習の範疇ではあるが、大規模言語モデルが事業文書などのテキストから因果関係を捉えられるか検証した。因果モデルや介入操作はテキスト形式で与え、介入を行うようなプロンプトを入力した(本来の介入操作になってるか要検討である)。

【結果】
現状のLLMは統計的因果推論における因果関係を捉えてはいない。観測と介入の区別はできていないが、CoT を利用することでその識別能力が16.1%向上した。この向上は与えられたプロンプトと同一のコンセプトに限定され、GPT-3の正答率がChatGPTを上回ることから、LLMのモデルサイズと学習データ数が因果推論タスクにおいても大きな影響を持つことが示された。

## 検証

事業文書からESGへの影響を示す独自のデータセットを作成し、Q&Aタスクにて評価を行った。又、因果関係において論理飛躍のある公開データセット ANLG [Bhagavatula 19] のサブクエスチョンを推定できるか実験を行った。

![tb1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ml1bwfk5pcsvajklluny.png)

![tb2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rybcjjv52kidds1bi3hb.png)

事業文書からESG評価指標への影響評価実験では推論方法に関してほぼ差は見られなかった。一方でサブクエスチョンを推定する実験では推論方法によって差が見られ、CoTによる推論が最も性能がよかった。(ただこの実験は因果関係が推定できているかどうかを示す実験ではない)

さらなる検証として三種類のトイ因果モデルを作成し、因果推論における介入操作が行えるかの実験を行った。以下がプロンプトの例である：

head-to-tail model (X → Y → Z)は以下のプロンプトを与えた。”Coin X is tossed, and if it turns up, bell Y rings; if it turns down, bell Y does not ring. If bell Y rings, bell Z rings. If bell Y does not ring, bell Z does not ring. ”

tail-to-tail model (Y ← X → Z) では ”Coin X is tossed. If the coin X turns up, bell Y rings, and if it turns down, bell Y does not ring. If the coin X turns up, bell Z rings, and if it turns down, bell Z does not rings. ”
head-to-head model (X → Y ← Z) では ”Coin X and coin Z are tossed. If coin X turns up, or if coin Z turns up, bell Y rings. Otherwise, bell Y does not ring. ”

観測と介入操作のプロンプトは以下である。

> 観察: Coin X is tossed and if it comes up, bell Y and
bell Z ring. In this situation we want to know if the ringing
of bell Y can make bell Z ring. We observe that when bell
Y rings, bell Z rings more often. We observe that when bell
Y does not ring, bell Z rings less often. Can we say that
ringing bell Y causes bell Z to ring?
介入: Coin X is tossed and if it turns up, bell Y and
bell Z ring. In this situation we want to know if the ringing
of bell Y can make bell Z ring. If we force bell Y to ring,
bell Z rings more often. If we force bell Y not to ring, bell
Z rings less often. Can we say that the ringing of bell Y
causes bell Z to ring?

![tb5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8wc1z0zzto59en1w7a9p.png)

表５はLLMが観察と介入を区別できているかどうかを示す対照実験であるが、CoTのみ介入時の正解率が高くなった。又、バックドアパスの認識はできておらず、LLMは因果推論を捉えられていないが、推論方法を工夫することで因果関係の認識能力は改善するといえる。