teleren/devto huggingface dataset:
2095. Leetcode Solution in javascript
Tags: chiki1601, challenges, javascript, beginners
Published: 2022-10-14 04:09:28

```js
/**
 * Definition for singly-linked list.
 * function ListNode(val, next) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.next = (next===undefined ? null : next)
 * }
 */
/**
 * @param {ListNode} head
 * @return {ListNode}
 */
const deleteMiddle = function(head) {
  if(head == null) return head
  const dummy = new ListNode(null, head)
  let n = 0, cur = head
  while(cur) {
    n++
    cur = cur.next
  }
  if(n === 1) return null
  const mid = Math.floor(n / 2)
  cur = dummy.next
  let pre = dummy 
  for(let i = 0; i < n; i++) {
    if(i === mid - 1) {
      pre = cur
      // pre.next = cur.next.next
    }
    if(i === mid) {
      pre.next = cur.next
    }
    if(i > mid) break
    cur = cur.next
  }
  return dummy.next
};
```
#challenge
#leetcode
Here is the link for the probelm:
https://leetcode.com/problems/delete-the-middle-node-of-a-linked-list/
E-Commerce & Media Automation Virtual Hackathon
Tags: hacktoberfest, webdev, programming, beginners
Published: 2022-10-14 04:04:14

Join us this Hacktober in our [E-commerce Media Automation Hackathon ](https://shotstack.io/learn/shotstack-october-ecommerce-hackathon/?utm_campaign=hackathon_blog_distribution) to build the future of for the eCommerce  industry. 

Over the past decade, we’ve witnessed a rapid digital transformation in online commerce. Digital content like videos and designs have been a crucial part of marketing for brands to communicate with their customers. Companies like Amazon, Shopify, Ebay, Wix, etc have thousands of brands selling millions of products.

But how are we making sure brands are efficiently marketing them? Do we have the right tools? How can the latest technologies like AI and automation help? That's exactly what this hackathon aims to solve - **to develop creative applications that helps eCommerce  product marketing content through automated media generation.**

Shotstack's cloud based [video editing API](https://shotstack.io/product/video-editing-api/?utm_campaign=hackathon_blog_distribution) and infrastructure makes it easy, fast, and seamless for developers to build media applications. Visit [Shotstack Documentation](https://shotstack.io/docs/guide/getting-started/core-concepts/?utm_campaign=hackathon_blog_distribution) to learn more.

### What can you build for this hackathon?
You can build anything that automates media generation for the eCommerce industry using the Shotstack API. Some examples are plugins for platforms like Shopify, Amazon, Wix, WooCommerce, Ebay, etc. Other few examples are web apps, mobile apps, APIs, etc.

### Prizes
As Halloween is almost here, we wanted to help you prepare for it with awesome costume prizes.

**First prize:** CORSAIR gaming keyboard and mouse bundle - CH-9226965-NA K55 Pro + Katar Pro

![Corsair bundle](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/98vbi0iurt6h8nwl2v19.jpg)

**Second prize:** A Halo Master Chief helmet

![HALO Helmet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rdgon54z8j5a954fuxjo.jpg)

**Third prize:** The iconic Doge mask

![Doge mask](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kf4kkg988d84oefhi6iy.jpg)

### How does the hackathon work?
- Submit [hackathon entry form](https://forms.gle/Fik7gpk2Qi81mrqe7)
- Sign up for a free [Shotstack developer account](https://dashboard.shotstack.io/register?utm_campaign=hackathon_blog_distribution) to get your API key
- Build an eCommerce media app using the Shotstack API
- **[Submit your project](url)** before 11:59 pm PT 20th October 2022

Visit [Shotstack website](https://shotstack.io/learn/shotstack-october-ecommerce-hackathon/) for more information.
Rethinking Rooms
Tags: gamedev, godot
Published: 2022-10-14 03:49:30

The problem described in my last post with loosing floors and ceilings on the "boxes" that I was using with rooms was due to my misunderstanding of culling. Instead of boxes, I'm going to just create the rooms in blender with 5 faces (left/right/back/floor/ceiling) and then unwrap and make the PNG textures.

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

I think this will work better for everything. Since there will be 3 room sizes, I will create 3 models. I'm still planning on making a level/room editor that will generate PNGs for each of the 3 model textures based on uploaded images, but for testing purposes I'm using these letters to help me recognize the areas in the PNG for each face.

I've also started to consider and implement how I'll be loading the room positions and generated textures from the web based level editor. I like the way Godot lets me create an "object" that can be setup from the main script that I'll pass the parameters for each room to via their own functions.

Doing stuff in Godot:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/353zlggqjd56kpbfplyk.png)

Running the "game":
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gzvgafwp13e8szvdqems.gif)
Authoring NPM Packages with Monorepos
Tags: javascript, npm, development, webdev
Published: 2022-10-14 03:49:03

Suppose that you run a software development agency and you want to enforce a common linting rule set and formatting guidelines for all of your JavaScript projects. You could install ESLint and Prettier in each of your projects. However, your company manages more than a hundred different projects, with custom rules for both ESLint and Prettier. So, if you decide to add or deprecate some rules, you'll have to update the rule sets in all of those projects.

A monorepo can help solve this issue. You can put all of your configuration code in a master repository, publish it as an npm package, and then import the npm package into your projects. Next time you want to change the rules, you only need to alter the monorepo project and the change will be reflected in all of your projects, as they're dependent on the monorepo project.

If you follow the steps in this tutorial, you’ll see how you can publish NPM packages using Lerna and keep your packages’ code in a monorepo.

Read the full blog on [Fusebit](https://fusebit.io/blog/npm-packages-with-monorepos/).

Thanks for reading 💜

---

I publish a [monthly newsletter](https://www.ravsam.in/newsletter/) in which I share personal stories, things that I am working on, what is happening in the world of tech, and some interesting dev-related posts which I come across while surfing the web.

Connect with me through [Twitter](https://twitter.com/ravgeetdhillon) • [LinkedIn](https://linkedin.com/in/ravgeetdhillon) • [GitHub](https://github.com/ravgeetdhillon) or send me an [Email](mailto:ravgeetdhillon@gmail.com).

— [Ravgeet](https://www.ravgeet.in/), *Full Stack Developer and Technical Content Writer*
3 ways to display content on hovering over an element using only CSS
Tags: html, css, webdev, news
Published: 2022-10-14 03:44:05

## <u>Method 1</u> : Using `<dfn>..</dfn>` Tag in HTML with the `title` attribute and styling the `title` attribute with CSS

#### HTML

```
<dfn title="Official website is dev.to">Dev</dfn> is a community 
of software developers getting together to help one another out.
```

The text(Here Dev) within the `<dfn>` tag will be in italic by default.
We will style `title="Official website is dev.to"` attribute to our requirements.

#### CSS

```
dfn[title] {
    position: relative;
}
dfn[title]::after {
    content: attr(title);
    position: absolute;
    display: block;
    background-color: #121b22;
    color: #c8cccf;
    font-size: 16px;
    bottom: 100%;
    white-space: nowrap;
    padding: 10px;
    border-radius: 6px;
    left: 30%;
    transform: scale(0);
    transition: ease-out 300ms;
}
dfn[title]:hover::after {
    transform: scale(1);
}
```

---

## <u>Method 2</u> : Using Only Pseudo Elements `::before` or  `::after` with Pseudo class `:hover`

We will display a text over the word dev.

#### HTML

```
<span id="dev-describe">Dev</span> is a community of software developers getting together to help one another out.
```

We will use this sequence -
**element** --> **on hover** --> **display** `::before` or `::after`

#### CSS

```
#dev-describe:hover::before {
    content: "Official website is dev.to";
    background-color: #ff746b;
    color: #ffffff;
    position: absolute;
    bottom: 10px;
    padding: 6px 12px;
    border-radius: 6px;
}
```
_And then position your content as per your requirements!_

---

## <u>Method 3</u> : Using the attribute `data-*` for the element

#### HTML

```
<a  href="https://dev.to/"  data-explain="A community of software developers getting together to help one another out">Dev</a>
```

#### CSS 

```
a[data-explain] {
    position: relative;
}
a[data-explain]::after {
    content: attr(data-explain);
    position: absolute;
    display: block;
    background-color: #121b22;
    color: #c8cccf;
    font-size: 16px;
    bottom: 100%;
    white-space: nowrap;
    padding: 10px;
    border-radius: 6px;
    left: 30%;
    transform: scale(0);
    transition: ease-out 300ms;
}
a[data-explain]:hover::after {
    transform: scale(1);
}
```

---

Check out the **whole series**!
**Share it**💚 with someone who may benefit from this
❤️ _Happy Coding!_
Follow for more!
What is Hyper-V?
Tags: virtualization, beginners
Published: 2022-10-14 03:40:45

## Pre-study image

Virtualization application-like?

## Investigation

### What is Hyper-V?

Read as Hyper-V, it refers to Microsoft's hypervisor virtualization software.
It refers to a method of running virtualization software by installing it directly on a server.
On a virtual machine, there are Windows Server systems, Windows for clients, some linux, etc.

### Are there other hypervisor virtualization software besides Hyper-V?

The following are the most commonly used

- VMware ESXi
- Hyper-V
- Xen

## Image after study

Xen's friends?
I'm starting to understand what kind of grouping it is.
279CharsOrLess - Before deploying your React app
Tags: webdev, beginners, react
Published: 2022-10-14 03:30:44

## If you can read a tweet...
 
_Check these simple yet key things_

![Prepare for launch](https://i.imgur.com/NhPn9jJ.gif)

### 1. Title
Unless the name of your app is "React App"

### 2. Favicon
Please not the React logo again

### 3. Links
Do they all work?

### 4. homepage
You know the one in the package.json

What's on your deployment checklist? 
Comment below!
_-KJ_
CTF Competition|Prize money worth 300USD
Tags: ctf
Published: 2022-10-14 03:28:16

An exhilarating puzzle; a quirky game; or a platform to learn- CTF is everything here all at once. Operate that geeky cyber brain to capture the flag and set it down.
Join us to compete amidst the ingenious minds of the field. Expand the horizons of coding to unravel the knots, complete the tasks and master the domain of cyber security.

Reg fee:- 5 USD

Registration link:- 

https://www.tathva.org/competitions/tathva22ctf

https://www.instagram.com/p/CjKdLmKP5EB/?igshid=MDJmNzVkMjY=
Appwrite Loves Open Source: Why I Chose To Support Key Promoter X
Tags: opensource, appwrite
Published: 2022-10-14 02:49:33

Open-source is at the ❤️ of everything we do at Appwrite, and we want to enable and foster the open-source community that helped us grow to nearly 25,000 stars on [GitHub](https://github.com/appwrite/appwrite). Open-source projects, though, require a great deal of effort to maintain and grow. We use open-source tools every day to build Appwrite, and we want to help our community. To give back, each Appwrite engineer gets to pick an open-source project for Appwrite to sponsor for one year.

## Shortcuts Save Time

I am a big fan of efficiency as a developer; I like concise variable names, shorthand syntax and keyboard shortcuts wherever possible. The problem with keyboard shortcuts is that they are not always intuitive and can be hard to remember. I prefer JetBrains IDEs for development and there are **a lot** of shortcuts available, trying to learn them by referencing a list is futile.

Enter [**Key Promoter X**](https://github.com/halirutan/IntelliJ-Key-Promoter-X): A plugin for JetBrains IDEs that helps to learn keyboard shortcuts from mouse actions while you are working. When you use the mouse on a button inside the IDE, Key Promoter X shows you the keyboard shortcut that you could have used instead. 

This provides an easy way to learn how to replace tedious mouse work with keyboard keys and helps to transition to faster, mouse-free development.

I even learned a **new shortcut** for markdown context while writing this article!


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

There is also a separate pane provided to show you a list of your top missed shortcuts to help you learn which ones you may want to focus on:

![IDE Pane](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9iro0048f0n0jsdjc53o.png)

Having these reminders that reinforce the shortcut could dramatically improve the amount of shortcut combinations you can retain.

## Learn More About Appwrite

Appwrite is an open-source Backend-as-a-Service (BaaS), packaged as a set of Docker micro-services, to give developers of any background the tools necessary to build modern apps quickly and securely.

Chat with us on Discord, or, Learn more about Appwrite:

Check out Appwrite as the backend for your next web, Flutter, or server-side application. Here are some handy links for more information:

 - [Appwrite Contribution Guide](https://github.com/appwrite/appwrite/blob/master/CONTRIBUTING.md)
 - [Appwrite Discord](https://appwrite.io/discord)
 - [Appwrite GitHub](https://github.com/appwrite)
 - [Appwrite Documentation](https://appwrite.io/docs)
Second Minimum Node In a Binary Tree
Tags: javascript, leetcode
Published: 2022-10-14 02:40:51

 Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. If the node has two sub-nodes, then this node's value is the smaller value among its two sub-nodes. More formally, the property root.val = min(root.left.val, root.right.val) always holds.

Given such a binary tree, you need to output the second minimum value in the set made of all the nodes' value in the whole tree.

If no such second minimum value exists, output -1 instead.

Example 1:
Input: root = [2,2,5,null,null,5,7]
Output: 5
Explanation: The smallest value is 2, the second smallest value is 5.

Example 2:
Input: root = [2,2,2]
Output: -1
Explanation: The smallest value is 2, but there isn't any second smallest value.
```
/**
 * Definition for a binary tree node.
 * function TreeNode(val, left, right) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.left = (left===undefined ? null : left)
 *     this.right = (right===undefined ? null : right)
 * }
 */
/**
 * @param {TreeNode} root
 * @return {number}
 */
var findSecondMinimumValue = function(root) {
 let firstMin = root.val;
  let secondMin = Infinity;

  const dfs = (node) => {
    if (node === null) {
      return;
    }
    if (firstMin < node.val && node.val < secondMin) {
      secondMin = Math.min(node.val, secondMin);
    }
    dfs(node.left);
    dfs(node.right);
  };
  dfs(root);
  return secondMin === Infinity ? -1 : secondMin;
};
```
Day 635 : Bother Me
Tags: hiphop, code, coding, lifelongdev
Published: 2022-10-14 02:38:35

_liner notes_:
- Professional : Holy crap! What a week. I'm kind of annoyed so I'm going to write it out because it will probably won't bother me as much. My job brought me on a project that needed to be done "ASAP"! It's so urgent that they don't really know what they want and are still figuring it out, but I need to drop what I'm doing to work on it. Awesome. It's not the first time this has happened so I'm used to it. What I'm not used to is people keep questioning me. One, you are asking me to stop what I've planned for to work on a thing that no one can tell me exactly what it is that they want. If I tell you when I can get my part done and I'm giving updates on my progress, don't ask me if I can get it done in time. Especially don't dump some random person on me to "help" when there is nothing to help with. Then I have to explain to this person I have no clue why someone told them to contact me. Time I could be working on the project. Then there's all these notifications of people asking questions that I cover in the updates I give. It's like people have way too much time on their hands and they spend it questioning me and waste my time when I'm trying to work on a thing that is already under a tight deadline. Because of all the time wasting, I had to stay late finishing up one last feature. So, I'm basically done with my part unless there's feedback to some questions I asked in my latest update. And a day earlier than when I initially said!

- Personal : Last night, I finally watched "Chainsaw Man". I was pretty good. Looking forward to seeing more episodes. Also caught up with "The Walking Dead". Even did a little coding.

![Mountain range at sunset with the sun going behind some mountains in the distance in Blue Mountains Nat'l Park, Australia](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h8lxfk3qlecf09rucenx.png)

I'm definitely going to call it early tomorrow from work with all the extra work I've been putting in. Going to see how much stuff I can get done for the radio show. Also going to watch "Atlanta" and "She-Hulk". I've been thinking about rewatching "Bleach" since the new episodes. There's a function that I want to test in the side project I've been working on. See if I can sneak that in before I go to bed.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube DXgZ8CWzaI8 %}
Top Eight Engineering Fields in Demand in Australia for 2022
Tags: javascript, gamedev, beginners, programming
Published: 2022-10-14 01:57:36

If you are wondering about which field is in the highest demand in Australia for 2022, I have the top eight engineering fields you might consider pursuing in Australia. So, let’s get started!

    1. Software Engineering
    2. Civil Engineering
    3. Mining Engineering
    4. Biomedical Engineering
    5. Agriculture Engineering
    6. Marine Engineering
    7. Aerospace Engineering
    8. Chemical Engineering

**## Verdict 
**
These are the top eight highly demanded engineering disciplines in Australia. If you are an engineer looking forward to migrating and working in Australia, you can choose [CDRskillassessment.com ](https://www.cdrskillassessment.com/)to write a CDR report for civil engineering. CDR skill assessment has been established as one of the top providers of [CDR writing services for engineers in Australia](https://www.cdrskillassessment.com/services/cdr-writing-service-australia) offering our clients the best CDR services through our highly skilled writing experts in engineering.
Learn JSON from Scratch
Tags: beginners, tutorial, programming, javascript
Published: 2022-10-14 01:17:06

## What is JSON?🤔



* JSON (JavaScript Object Notation) is a lightweight data-interchange format.

* JSON is easy for humans to read and write, yet it is efficient enough for computers to handle.

* JSON is commonly used  for transmitting data in web applications (e.g., sending some data from the server to the client, or passing state information between the two) and for serializing structured data into a string representation.

*  It can be used to represent numbers, strings, booleans, arrays, objects, and raw bytes in a standardized way.

* JSON is often used to output data in the Web API's response body.

#### Advantages of using JSON

- JSON is an open standard that enables data to be exchanged between applications without the need for a middleman.

- JSON is easy for humans to read and write, which makes it ideal for data exchange between different applications.

- JSON is more compact than XML, and therefore easier to transmit.

- It is supported by all programming languages.

- It can be used on all platforms.

- It is a light weight database standard, so data transmission is fast. 


#### Where JSON is used? 

- JSON is used as the data format for many web services and APIs, such as GitHub, Netflix, Twitter and Facebook

- Mobile Applications 

- Gaming API's
 

#### Data types supported

1. String
2. Number
3. Arrays
4. Null
5. Boolean
6. Object


#### JSON methods in JavaScript

1. JSON.parse(): Takes JSON string and convert into JavaScript object.

2. JSON.stringify(): Convert JavaScript object JSON into JSON string *useful while sending over the network*.


#### Syntax and Example

```
{
  "squadName": "Super hero squad",
  "homeTown": "Metro City",
  "formed": 2016,
  "secretBase": "Super tower",
  "active": true,
  "members": [
    {
      "name": "Molecule Man",
      "age": 29,
      "secretIdentity": "Dan Jukes",
      "powers": ["Radiation resistance", "Turning tiny", "Radiation blast"]
    },
    {
      "name": "Madame Uppercut",
      "age": 39,
      "secretIdentity": "Jane Wilson",
      "powers": [
        "Million tonne punch",
        "Damage resistance",
        "Superhuman reflexes"
      ]
    },
    {
      "name": "Eternal Flame",
      "age": 1000000,
      "secretIdentity": "Unknown",
      "powers": [
        "Immortality",
        "Heat Immunity",
        "Inferno",
        "Teleportation",
        "Interdimensional travel"
      ]
    }
  ]
}

```

### Connect with Me 😊

#### 🔗 Links

[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/mahmoud-el-kariouny-822719149/)

[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/Mahmoud42275)
Maven: สร้างไฟล์ war แบบไม่เอาเวอร์ชันมาด้วย
Published: 2022-10-14 00:44:23

อ้างอิง: https://stackoverflow.com/a/9593611

เพิ่มใน pom.xml
```
<project>
    ...
    <build>
        ...
        <finalName>${project.artifactId}</finalName>
        ...
    </build>
    ...
</project>
```
Java: Skip checking DataSource
Published: 2022-10-14 00:40:03

ถ้าไม่ต้องการให้ Spring Application ตรวจสอบการเชื่อมต่อฐานข้อมูลตอนเริ่มรันโปรแกรม ให้เพิ่มการตั้งค่านี้ใน  application.properties

```
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
```

ที่มา: https://www.baeldung.com/spring-boot-failed-to-configure-data-source
Minha primeira postagem
Published: 2022-10-14 00:21:43

“Depois desse momento, terá outro momento. Sem barreiras. Permita sua mente viver outras experiências, antigas realidades ficaram confinadas em um braço espiral, te levando a outras existências de consciência; ela será pontilhada de novas realidades. E depois desse momento, tem outro momento. Sem limites.”