teleren/devto huggingface dataset:
How Do You Deal with Presentation Anxiety?
Tags: discuss, beginners, codenewbie, career
Published: 2023-06-06 07:00:00

Do you you get the shakes, sweaty palms, and a racing heart when it's time to present your work in front of others? You're not alone! Let's exchange practical tips, proven techniques, and personal anecdotes that have helped us tame those butterflies and deliver engaging (or at least cohesive) presentations. 

Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more awesome discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*
What Are Your Strategies for Enhancing Code Reusability & Maintainability?
Tags: discuss
Published: 2023-06-06 07:00:00

What are your approaches to writing modular and well-structured code, utilizing design patterns, and implementing effective documentation and testing practices to ensure code longevity and ease of maintenance?

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}

[Image by pch.vector on Freepik](https://www.freepik.com/author/pch-vector)
Apa itu airdrop crypto?
Tags: webdev, cryptocurrency, airdrop
Published: 2023-06-06 06:56:31

[Airdrop crypto](https://www.portalcrypto.xyz/2023/05/apa-itu-airdrop-crypto-dan-bagaimana-cara-kerjanya.html) adalah suatu metode di mana proyek atau perusahaan blockchain atau kriptocurrency membagikan secara gratis token kripto kepada pemegang atau pemilik kriptocurrency yang sudah ada. Airdrop sering kali digunakan sebagai strategi pemasaran untuk meningkatkan kesadaran, memperluas jangkauan, atau memperkenalkan proyek kriptocurrency baru kepada komunitas kripto yang lebih luas.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s7snpf4o708aggc85ydo.jpg)
Biasanya, airdrop dilakukan dengan beberapa persyaratan yang harus dipenuhi oleh peserta. Persyaratan tersebut dapat berupa memegang jumlah tertentu dari kriptocurrency yang sudah ada, mem-follow akun media sosial proyek, atau melakukan tugas tertentu seperti membagikan konten proyek atau mengundang teman untuk bergabung.

Airdrop dapat memberikan manfaat kepada peserta dengan memberikan token kripto secara gratis. Jika nilai token kripto yang di-airdropkan naik setelah distribusi, peserta dapat menghasilkan keuntungan dengan menjual atau menukarkannya. Namun, perlu diingat bahwa tidak semua airdrop memiliki nilai yang signifikan, dan beberapa airdrop mungkin hanya memiliki nilai nominal atau kurang bernilai.

Penting untuk mencermati dan memeriksa keaslian airdrop, karena terdapat juga penipuan atau airdrop palsu yang bertujuan untuk mencuri data pribadi atau informasi keuangan. Pastikan untuk selalu melakukan riset yang cermat sebelum berpartisipasi dalam airdrop dan hanya bergabung dengan airdrop resmi yang dikonfirmasi oleh proyek atau tim yang dapat dipercaya.

Source/Sumber: [https://www.portalcrypto.xyz](https://www.portalcrypto.xyz)
How can i add share button in php website product page only?
Published: 2023-06-06 06:55:53

Hello everyone, 

I'm working on my project, [Bhansali Fasteners](https://bhansalibolt.com/), and I'd like to add a share button to all of my product pages, such as [bolts](https://bhansalibolt.com/bolts-manufacturer-india.php), [nuts](https://bhansalibolt.com/nuts-manufacturer-india.php), and other products. If anyone has the code or source, please let me know.
Performance issue in Angular 15/16 Form Fields
Tags: angular, javascript, ui
Published: 2023-06-06 05:38:59

Getting performance issue in Angular 15/16 post mdc migration. It's happening on other browsers as well but is more clear on Chrome(Version 113.0.5672.126 (Official Build) (x86_64)).

I have a page full of form fields (using material inputs, autocomplete, mat select, checkboxes etc).

While scrolling and some times intermittently the form fields repaints. It's only happening with Form Fields. Tried replicating same in stackblitz and it's happening for a simple input field as well, if the number of fields exeeds say 60-70. Same thing was working fine with Angular 13/14 with even 1000 input fields added.
Here is the stackblitz instance for Angular 15:
1. **Code base**: https://stackblitz.com/edit/angular-ivy-qayt3s?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.module.ts,src%2Fmain.ts,src%2Fapp%2Fapp.component.css
2. **App URL**: https://angular-ivy-qayt3s.stackblitz.io


Here is the stackblitz instance for Angular 13:
1. **Code base**: https://stackblitz.com/edit/angular-material-13-starter-x1xj4z-yyhktq?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.module.ts,src%2Findex.html
2.** App URL**: https://angular-material-13-starter-x1xj4z-yyhktq.stackblitz.io

Let me know incase anyone else facing this and has a resolution.
Javascript & Question Marks (?)
Tags: javascript, tutorial, beginners
Published: 2023-06-06 05:12:14

Let's learn how we can use question marks in javascript to make our code simpler and more readable.

I am going to list down 3 most common used of question marks in js.

## Ternary Operator (?)
Most usual use of question mark `?` in javascript is Ternary Operator. It is a shorter way of writing condition(if/else). It is applicable in some other languages too.

**Syntax:**
`<condition> ? <if condition satisfies> : <else>`

**Example:**

![Application of Ternary Operator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vak3cftfu5n9p5b9u7is.jpeg)

## Nullish Coalescing Operator (??)
It returns the value written before `??` only if that value is not null.
If that value is null, it returns the value written after `??`

**Syntax:**
`<value> ?? <value>`

**Example:**

![Application of Nullish Coalescing Operator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nu0xs4t3fqdjh7277ly0.jpeg)

![Application of Nullish Coalescing Operator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c80hzoy6inrjfrisw4m4.jpeg)

## Optional Chaining (?.)
It is same as chaining objects using dot `.` but with an exception that if object is undefined, it will not chain further and returns undefined.
It is useful to avoid errors.
It can also be used with arrays

**Syntax:**

Object:
`<identifier>?.<identifier>`

Array:
`<identifier>?.[<index>]`

**Example:**

Object: 
![Application of Optional Chaining Operator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ca1w4mssxw2ougehn4z5.jpeg)

Array:
![Application of Optional Chaining Operator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ybar26qjz7i9w56ss6j9.png)


---

That's all. Hope it would help you.
Happy coding.
What is Data source filters in Tableau?
Tags: tutorial
Published: 2023-06-06 05:01:38

Data source filters in Tableau refer to the filters applied directly to the data source before it is loaded into a Tableau workbook. These filters limit the data that Tableau retrieves from the source, allowing users to focus on specific subsets of data during analysis and visualization.

When creating a Tableau workbook, connecting to a data source is one of the initial steps. After connecting to the data source, users can apply data source filters to refine the dataset that Tableau will work with. Data source filters are different from the filters applied within individual worksheets or dashboards. They act as a global filter for the entire workbook, affecting all visualizations that use the data source.

Data source filters can be set based on specific criteria, such as date ranges, categories, numeric values, or any other field present in the data source. These filters allow users to reduce the volume of data being processed, enabling faster performance and focusing analysis on relevant subsets of the data.

By applying data source filters, users can improve the efficiency of their Tableau workbooks, particularly when dealing with large datasets. Filtering the data at the source level ensures that only the necessary data is brought into memory, optimizing the performance of visualizations and calculations.

To demonstrate expertise in Tableau and its various functionalities, you can pursue [Tableau Certification](https://www.edureka.co/tableau-certification-training). The Tableau certification program includes multiple certification levels, such as Tableau Desktop Specialist, Tableau Desktop Certified Associate, and Tableau Desktop Certified Professional.

Tableau Certifications validate your proficiency in using Tableau for data visualization and analysis. They cover a range of topics, including data connection and preparation, creating visualizations, applying filters and calculations, building interactive dashboards, and advanced analytics techniques.

By earning a Tableau certification, you demonstrate your skills in utilizing Tableau's features effectively and showcase your ability to design and deliver meaningful insights through visualizations. It signifies your competence in using Tableau's tools, including data source filters, to extract actionable insights from data and create impactful visualizations.
Interactive vs Service in Self-Hosted Devops Agent
Tags: devops
Published: 2023-06-06 04:55:17

Hello,
can I have one question?
What are the differences between the interactive mode and the service mode in a self-hosted DevOps agent, and what potential issues and consequences can arise when using the interactive mode? I specifically need to utilize the interactive mode for a use case where I want to open Power BI Desktop using a DevOps pipeline. When the agent runs as a service, the application starts and immediately closes, without creating the Analysis Services workspace in the background, which is what I need. I have discovered that when I run it through the interactive mode, it performs the required actions.
Thank you.
Intro to blog
Tags: beginners
Published: 2023-06-06 04:09:58

At this point in time, the only way I'm going to be actually working on projects and completing them in a manner which can be physically seen is if I redirect my thought process over to the internet where I'm essentially making promises to the void and thinking that it will eventually be able to force me to keep them.

Right now, It feels like I've been programming at a distance. 10 feet away from the screen where every concept that's thrown at me somehow ends up there but I tend to believe that no real word is written by me because that degree of investment is scary. It's that idea of perfectionism that I've heard so much about that kind of keeps me from even attempting to fail because it is just too scary.

The idea of starting to build a website from scratch and not knowing exactly where I'm gonna find the resources and exactly what steps I'll need to follow to proceed is terrifying even though I know that learning on the job has pretty much been the only way that I've actually absorbed concepts so I want to start doing a bit more of that intentionally.

There are a few series that I hope to be beginning and trying to make a deeper dive on:

* Starting Rust and basically looking at learning a low level language to more deeply understand the computing that happens behind the insane level of abstractions needed to be using technology as we do right now
* Go through the pennylane library and the rabbithole of quantum computing after having taken a surface-level course in it to actually use concepts
* Make an application for drawabox to automate the grading of homeworks to make feedback turnover faster
* Redesign my portfolio website from scratch and make it more unique
* Joining a coding community and essentially making a how-to after I figure it out myself
* Complete the fastai course alongside working on Andrej Karpathy's GPT from scratch series
* Make a pokemon clone with self-defined routing in the gba style
Day 45: Beginner FastAPI Series - Part 2
Tags: beginners, programming, python
Published: 2023-06-06 04:00:00

It's time to add the routes I listed in Part 1 to our FastAPI application and associating them with functions. This is just the initial setup to keep this project moving forward and this is far from the final product. At this time, all these methods will simply return a string of text, but they will eventually be modified to perform specific actions on the 'Person' entity.

These routes should be appended to the main.py file in the app folder:

```
@app.get("/api/persons")
def get_persons():
    return "read persons list"

@app.post("/api/persons")
def create_person():
    return "create person item"

@app.get("/api/persons/{id}")
def get_person(id: int):
    return f"read persons item id: {id}"

@app.put("/api/persons/{id}")
def update_person(id: int):
    return f"update persons item id: {id}"

@app.delete("/api/persons/{id}")
def delete_person(id: int):
    return f"delete persons item id: {id}"
```

Just in case the application isn't running here is how to run it:

`uvicorn app.main:app --host localhost --port 8000 --reload`

With these routes implemented, you can turn your browser to `http://localhost:8000/api/persons`. The application will then respond with the text "read persons list".

The dynamic routes will also work. Try visiting `http://localhost:8000/api/persons/1`. The number '1' at the end of the URL will be recognized as the person's ID. FastAPI's routing feature will match the URL with the specified route and will replace `{id}` with '1'.

One of the really cool features of FastAPI is its built-in support for OpenAPI and JSON Schema. What this means is that it will automatically generate API documentation. We don't need to manually create an API documentation! 

To see this firsthand, just type `http://localhost:8000/docs` into your browser's address bar.

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

The interactive documentation that is displayed can be used to test all the routes in your application. Just expand 'GET /api/persons' and click the 'Try it out' button. Then, click the blue 'Execute' button to call the `get_persons` method, just like you would from the browser.

I know I'm moving a little bit slower that I wanted but I also need to pace myself as there are other things I'm simultaneously studying at the moment (hint: 2 things and they both start with 'T').

Nevertheless, we have only scratched the surface but have already seen sparks of FastAPI's brilliance. I really like what I'm seeing and think FastAPI is coherent and well-structured.

The next installment of this series will go deeper into developing our 'Person' entity and making our methods work with it.

Note: In the next post, I will put the code in a public repo at Github
JDBC program for Delete operation
Tags: jdbc, java, advancedjava, sql
Published: 2023-06-06 03:59:29

{% embed https://youtu.be/AcTA_i-tmGk %}

Create Table::

SQL> create table test1(eid int,ename varchar2(10));

Table created.

SQL> insert into test1 values(1,’vijay’);

1 row created.

SQL> insert into test1 values(2,’rajesh’);

1 row created.

SQL> select * from test1;

EID ENAME

— — — — — — — — — —

1 vijay

2 rajesh

SQL> commit;

Commit complete.

```

import java.sql.*;
class Test {
    public static void main(String[] args) throws Exception {
        //load JDBC driver
        //get connection
        Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl", "system", "tiger");
        //create statement obj
        Statement st = con.createStatement();
        //prepare and execute query
        String query = "delete from test1 where eid=2";
        int count = st.executeUpdate(query);
        if (count == 0) {
            System.out.println("No Row is deleted");
        } else {
            System.out.println(count + "Row are deleted");
        }
        con.close();
    }
}
```

After Code execution

SQL> select * from test1;

EID ENAME

— — — — — — — — — —

1 vijay
Editing/Viewing the data of the File in angular
Tags: angular, ngxeditor, viewing, editing
Published: 2023-06-06 03:37:31

Viewing the file in the angular. 
 
When we are listing the files in the angular using some transfer protocols like the sftp and ftp, sometimes there is even possibility that we want to see the data of that file. it’s a bit challenging work, but there is a library which would help us in this so that we can see the content of that file and along with that we can even edit it. 
The library I'm talking about is ngx-editor.  
to install the ngx-editor and add it in to your project, [https://www.npmjs.com/package/ngx-editor](https://www.npmjs.com/package/ngx-editor) this link can be visited. 
to add the ngx-editor post installing into the project add the below line in the app. module.ts 

```
import { NgxEditorModule } from 'ngx-editor'; 
```
 
post this we need to fetch the data of the file which we want to read it and then decode it. 
 
**_The ts file data_**
 

```
_export class texteditor test implements OnInit { 
 
  editor!: Editor;  //a variable for the editor  
   
  html: string="<html>"; a string which contains the data, it is used to read and write the data 
  fileName:string=""; 
  constructor() 
{ 
      this.fileName=test”; 
    } 
 
  ngOnInit(): void { 
       
        var enc = new TextDecoder("utf-8"); //using a particular decoder 
        var arr = new Uint8Array([“filedata”]||[]); 
        this.html=enc.decode(arr);		// adding data to the html so it can be displayed 
     this.editor = new Editor(); // creating the instance of the editor 
      
  } 
 
  // make sure to destory the editor 
  ngOnDestroy(): void { 
    this.editor.destroy(); 
  } 
}_ 
```
 
**_The html file contains this data_** 
 
```
<div id="main"> 
    
<ngx-editor-menu [editor]="editor" *ngIf="true"> </ngx-editor-menu> // its used to display the menu of the editor which kind of has bold, italic, heading, images, link, adding colours to background and letters 
    
<ngx-editor [editor]="editor" [(ngModel)]="html" [disabled]="false"  ></ngx-editor> // editor means which editor to be used, the ngModel is the data to be displayed or to be edited, if disabled is true then the data would not be editable and if its false then the data can be altered  
 
</div> 
 
```

**_The box looks like how its shown below_** 
   
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40a1239q5wpwm8jckcna.png)
This is one of the way by which we can view the data which is present in the file, after editing the data the altered data is present in the ngModel variable.
JavaScript Array.at() method
Tags: javascript, programming, tutorial
Published: 2023-06-06 03:25:43

Before the arrival of Array.at() method, JavaScript developers have used many and different ways to return items from an array but there was still need to use negative indexing to get the last item. Array[0] will return the first item but to return the last item you would use Array[ Array.length - 1 ] as described below;

```
const names = [ 'Billy', 'Tony', 'Peter', 'Timothy', 'Andrew']

const getFirstName = names[0]
console.log(getFirstName)  // Billy

const getLastName = names[names.length - 1]
console.log(getLastName)  // Andrew

```

This has been one of the ways to achieve this. You can also do this with other methods like pop, slice and splice. See below;

```
// pop
const names = [ 'Billy', 'Tony', 'Peter', 'Timothy', 'Andrew']
const getLastName = names.pop()
console.log(getLastName)  // Andrew


// slice
const names = [ 'Billy', 'Tony', 'Peter', 'Timothy', 'Andrew']
const getLastName = names.slice(-1)
console.log(getLastName)  // ['Andrew']


// splice
const names = [ 'Billy', 'Tony', 'Peter', 'Timothy', 'Andrew']
const getLastName = names.splice(-1)
console.log(getLastName)  // ['Andrew']

```
All the above methods returns the last item but one thing to note; the splice method modifies the array unlike the others. That means it overwrites the original array and returns a new array after the splice method has been performed.

```
// splice
const names = [ 'Billy', 'Tony', 'Peter', 'Timothy', 'Andrew']
const getLastName = names.splice(-1)

console.log(getLastName)  // ['Andrew']
console.log(names)  // [ 'Billy', 'Tony', 'Peter', 'Timothy' ]

```


**Using Array.at() method**
Array.at() method makes it very easy to return the last item. With the Array.at(), you can now easily get the last item using negative indexing. This method takes an integer value and returns the item at that index, allowing for positive and negative integers.

```
const names = [ 'Billy', 'Tony', 'Peter', 'Timothy', 'Andrew']
const getLastName = names.at(-1)
console.log(getLastName) // Andrew

const names = [ 'Billy', 'Tony', 'Peter', 'Timothy', 'Andrew']
const getSecondLastName = names.at(-2)
console.log(getSecondLastName) // Timothy

const names = [ 'Billy', 'Tony', 'Peter', 'Timothy', 'Andrew']
const getFirstName = names.at(0)
console.log(getFirstName) // Billy

```

Array.at() method also works on strings too

```
const myName = 'Chimezie Innocent'
const getFirstLetter = myName.at(0)
console.log(getFirstLetter) // C

const myName = 'Chimezie Innocent'
const getLastLetter = myName.at(-1)
console.log(getLastLetter) // t

```
252. Meeting Rooms
Tags: leetcode, easy
Published: 2023-06-06 03:25:15

Problem Source: [252. Meeting Rooms](https://leetcode.com/problems/meeting-rooms/description/)

<strong>1. Understand the problem</strong>
We need to determine whether the user could attend all meetings without any conflict or not.
2 meeting `a` and `b` will conflict with each other if there is any overlap between `a` and `b`.

Here are 2 valid situation that `a` and `b` do not conflict each other:
- a.start >= b.end
- b.start >= a.end
(this means that one meeting start after the other ends)

Other situations will resolved in an overlap situation.

<strong>2. Solution</strong>
When dealing with interval problems, we need to sort the meeting times in ascending order of start time followed by the ascending order of end time.

With this, when consider 2 interval `I1` and `I2`, if `I2.start` is less than `I1.end`, they overlap.

Here is the code:
```java
class Solution {
    public boolean canAttendMeetings(int[][] intervals) {
        /**
        If the meetings time overlapped, return no.
        */
        if (intervals.length <= 1) {
            return true;
        }

        Arrays.sort(intervals, (a, b) -> a[0] == b[0]? a[1] - b[1]: a[0] - b[0]);

        for (int i = 0; i < intervals.length - 1; i++) {
            int[] interval1 = intervals[i];
            int[] interval2 = intervals[i + 1];
            if (interval2[0] < interval1[1]) {
                return false;
            }
           
        }

        return true;
    }
}
```