teleren/devto huggingface dataset:
Sailing Towards Sustainability: How Shipping Companies are Going Green!
Tags: shipping, logistics, sustainablity, greenshipping
Published: 2024-03-06 14:17:20


The maritime sector is going through a significant transition to sustainability. Shipping firms, which have long been seen as vital participants in global trade, are currently traversing the oceans with a redoubled dedication to environmental stewardship. This blog encourages you to explore the revolutionary projects that these businesses are pursuing as they head toward a more sustainable and environmentally friendly future.A crucial aspect of this metamorphosis involves investigating substitute fuel sources. As environmental concerns grow, maritime corporations are adopting greener energy sources like hydrogen, biofuels, and liquefied natural gas (LNG) more and more. This change is expected to result in a more ecologically responsible approach to maritime activities, in addition to changing the energy picture within the sector. 

The adoption of environmentally friendly shipping designs is at the forefront of this sustainability trend. Modern vessel construction prioritizes lower emissions, more fuel economy, and creative hull designs. This emphasis on green architecture highlights the shipbuilding industry's aim to lower its carbon footprint by bringing about a fundamental change in the way ships traverse the world's waters.  


Using solar and wind power is another important step toward sustainability. Solar panels and wind-assisted propulsion technologies are being actively added by shipping companies to their fleets. This shift from traditional fossil fuels to renewable energy sources demonstrates a dedication to eco-friendly practices and lessens the industry's overall impact on the environment. 

As technology progresses, smart shipping is becoming a vital component of effective operations. The industry is using data-driven decisions to reduce fuel consumption and environmental effect and improve operational efficiency through route optimization and predictive maintenance.  

 

Furthermore, shore power options and green ports are becoming more and more popular. [Shipping companies](https://www.clarionshipping.com/shipping-companies-in-dubai/) are addressing the wider environmental impact of port operations, reducing emissions, and improving port ecosystems by permitting ships to connect to onshore power sources while docked. 

Sustainable practices are being implemented throughout the supply chain, not just on the ocean's surface. Transport firms are promoting environmentally friendly packaging and implementing eco-friendly procedures. Comprehensive recycling programs and efforts to decrease the usage of single-use plastics show a commitment to environmental responsibility.  

 

To sum up, this blog explored how businesses are adopting sustainability while navigating the oceans of change within the maritime sector. A future where trade and environmental responsibility coexist peacefully on the world's oceans is something that the maritime industry is actively striving towards, from eco-friendly designs and smart shipping to alternative fuels.
Zed Editor - Fast code editor built in Rust
Tags: zed, codeeditor, newcodeeditor, zedonmac
Published: 2024-03-06 14:16:30

Zed is a new code editor created by Nathan Sobo and a team who worked on Atom previously. It is a fast, collaborative and customizable code editor. Recently, it was made open-source by the creators and it is licensed under _MIT license(open to change and share)_. It is built in a new programming language, Rust, making it speedy and offers good performance.

![Zed code editor image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q51porppydj2gakelxd3.png)

**Salient features of Zed:**

- **Collaborative Environment**: Work together with team on real time.

- **Customization and Plugins**: Make it a full fledged IDE with extensions, plugins and other customizations.

- **Open Source**: Recently turned open-source, with availability of full codebase.

- **Support**: Available for Mac only, Windows release in pipeline.

- **Extensive support of numerous languages**: 
Supports numerous programming languages including: Python, Java, Javascript

**Installation**

This is a simple guide in installing Zed into your machine.

**Mac**
Go to the official website 'https://zed.dev/download' and download the .dmg file and install the file to start using Zed.
Beginner's Guide to "Introduction to Algorithms"
Tags: dsa, beginners, programming, discuss
Published: 2024-03-06 14:11:07

_While practical knowledge is undoubtedly essential in the field of computer science, reading books such as "Introduction to Algorithms" can provide several significant benefits to individuals_


## Introduction:

"Introduction to Algorithms" is a foundational textbook in the field of computer science authored by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein.

## Overview of the Book:

The book is structured into chapters, each focusing on a specific aspect of algorithms and data structures. It begins with fundamental concepts such as algorithm analysis and introduces various algorithm design techniques. It covers a wide range of topics including sorting algorithms, data structures like trees and graphs, and advanced algorithmic techniques like dynamic programming and greedy algorithms.

## Significance for Beginners:

For beginners in _**computer science**_, "Introduction to Algorithms" serves as an indispensable resource for understanding the fundamental principles of algorithms and data structures. It provides a solid foundation upon which to build more advanced knowledge and skills in the field. By working through the exercises and problems, beginners can develop problem-solving abilities and gain confidence in algorithmic thinking.

For students with a background in _**mathematics**_ like me, "Introduction to Algorithms" offers a seamless transition into computer science by leveraging our existing skills. 

- **Translating Mathematical Concepts**: 
Students can easily understand and apply mathematical concepts in algorithms and data structures, bridging theory with practical applications.

- **Algorithmic Thinking**: 
With strong analytical and problem-solving skills, students can excel in algorithmic thinking, honing their abilities through the book's exercises.

- **Formal Analysis Techniques**: 
Familiarity with mathematical proofs and techniques aids in grasping algorithm analysis methods, ensuring thorough understanding of algorithmic efficiency.

- **Graph Theory and Discrete Mathematics**: 
Topics like graph algorithms align with students' knowledge of graph theory and discrete mathematics, offering deeper insights into their applications.

- **Advanced Topics**: 
Advanced topics such as dynamic programming and linear programming provide opportunities for students to explore extensions of mathematical concepts in computer science.


## **Conclusion:**
"Introduction to Algorithms" is an essential book for beginners embarking on their journey into the computer science community. Its comprehensive coverage, clear explanations, and emphasis on problem-solving make it a valuable resource for students and aspiring computer scientists alike. By referencing this book, beginners can lay a strong foundation for their future endeavors in algorithm design and analysis.
Objective-based penetration testing
Published: 2024-03-06 14:10:49

The main objective of a pentest  is to identify the actual risk, distinguishing it from the risk rating provided by the scanner and providing a firm with a risk value for each asset as well as the risk to the organization's reputation. It matters more how exposed people are and how simple it is to take advantage of that exposure than it does how much risk they actually have.

An identified danger does not actually represent a risk and does not require proof; one such threat is Cross-Site Scripting (XSS), a script injection vulnerability that allows for the theft of user credentials. It might not have a big effect on the business if a client who runs a trading company's brochure website—which offers static information to its clients—was susceptible to cross-site scripting attacks (XSS). In this scenario, a client may choose to take the risk and implement a Web Application Firewall (WAF)-based mitigation strategy in order to stop XSS assaults.

However, if the same weakness was found on their primary trading website, it would be a serious problem that needed to be fixed right away because the business would run the danger of customers losing faith in it if hackers were able to obtain their login credentials. 


**Objective-based penetration testing** is time-based, depending on the specific problem that an organization faces. An example of an objective is: 

>  We are most worried about our data being stolen and the regulatory fines incurred as a consequence of these breaches
> .
 So, the objective now is to compromise the data either by exploiting a system flaw or by manipulating the employees through phishing; sometimes it will be a surprise to see some of their data is already available on the dark web. Every objective comes with its own Tactics, Techniques, and Procedures (TTP) that will support the primary goal of the penetration test activity.
Goal-Based Penetration Testing
Tags: cybersecurity, career, security, linux
Published: 2024-03-06 14:02:23

The COVID-19 pandemic has altered global dynamics. All employees at companies of all sizes now work remotely, having transitioned from having none or only some of them do so. The new normal has made distant and accessible technology crucial for both personal and professional life. We may categorically refer to this as a virtual world since private conversations that once took place in closed rooms now take place online. As a result, there are now at least five times as many cyberthreats. Threat actors take advantage of this digital revolution to leverage user and company errors as a point of entry for monetary gain, reputational harm, or other objectives. This occurs in the form of ransomware, phishing, and data breaches.
Api-platform3 Boilerplate
Tags: symfony, api
Published: 2024-03-06 13:55:44

I made a boilerplate available at this [address](https://github.com/aratinau/api-platform3-boilerplate) which includes

- symfony
- api-platform
- doctrine (of course)
- fixtures and factory
- codeception for functionnals tests

There is one entity `Todo`

```php
<?php

namespace App\Entity;

use ApiPlatform\Metadata\ApiResource;
use App\Repository\TodoRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass: TodoRepository::class)]
#[ApiResource]
class Todo
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[ORM\Column(type: Types::TEXT)]
    private ?string $description = null;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getDescription(): ?string
    {
        return $this->description;
    }

    public function setDescription(string $description): static
    {
        $this->description = $description;

        return $this;
    }
}
```

How tests the GET of the collection :

```php
<?php


namespace App\tests\Api\todos;

use App\Factory\TodoFactory;
use App\Tests\Support\ApiTester;
use App\Tests\Support\Step\Api\Anonymous;

class getTodosCest
{
    public function _before(ApiTester $I)
    {
    }

    /**
     * @param Anonymous $I
     * @return void
     */
    public function tryToGetAllTodosAsAnonymous(Anonymous $I)
    {
        TodoFactory::createMany(30);

        $I->am('an anonymous user');
        $I->wantTo('list all todos');

        $I->haveHttpHeader("accept", "application/ld+json");
        $I->haveHttpHeader("Content-Type", "application/json");
        $I->sendGet('todos');

        $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK);
        $I->seeResponseIsJson();
        $I->seeResponseContainsJson([
            "@context" => "/api/contexts/Todo",
            "@type" => "hydra:Collection",
            "hydra:totalItems" => 30
        ]);
    }
}
```
How to earn (passively) with the click of a button
Tags: web3, cryptocurrency, earn, blockchain
Published: 2024-03-06 13:39:40

Imagine waking up to money flowing into your bank account while you sip your morning coffee. Sounds like a dream, right? Well, it’s not as far-fetched as you might think. Welcome to the realm of passive income, where a few strategic clicks can set the wheels in motion for financial independence.
![Earn $14+ a day](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ay28ul8gpvlco5tm9ffb.png)
## What is JumpTask?
JumpTask is a free app that rewards you with JumpTokens for simple microtasks. It's a global gig marketplace accessible to anyone, requiring no special skills. With minimal requirements, it aims to become the largest microtask marketplace, offering passive income opportunities for everyone. Lets jump into how we can earn through this!
## How can we earn?
There are several ways you can earn from JumpTask. Some of the easiest ways are to complete microtasks (watching youtube videos, installing opera browser, etc.), complete offers from partner offers (by playing games, partners are: Torox, Monlix, lootably etc.), you can also earn passively using honeygain, you can complete various surveys (from Inbrain, Bitlabs etc), also you can stake some $JMPT!

First thing first is we need to create a JumpTask account you can create one by clicking here: https://app.jumptask.io/?coupon_code=toxujazihyje.
* Complete offers

![Binance offer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vi0q0wgukqcq8j4nep39.png)


* Complete offers from partner offers (Sweet one is playing game)

![Game to earn](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qtkp9cjl827wep73hohd.png)


* Complete Surveys

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


* Stake $JMPT

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


* Earn passively with Honeygain


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


## How to withdraw?
To withdraw JumpTokens (JMPT) from your account, follow these steps:
* **Accumulate JMPT**: You need to have accumulated enough JMPT in your account. The minimum withdrawal threshold is 0.5 JMPT.
* **Connect Wallet**: Connect your cryptocurrency wallet. This can be MetaMask or any other WalletConnect-compatible wallet.
Click Withdraw: Click on the "Withdraw" button to initiate the withdrawal.
* **Choose Network**: You'll be presented with the task of selecting a withdrawal network from the available options: Binance Smart Chain, Celo, and Polygon1. Each network operates uniquely, so it's important to choose the one that is compatible with your wallet and meets your needs.
* **Confirm Transfer**: The transfer should be processed within a few seconds, but it can take up to 1 hour.

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

Join me and get +20% Bonus Earnings on your 1st task on JumpTask! Sign up with my link: https://www.jumptask.io/r/toxujazihyje
1732. Find the Highest Altitude
Tags: dsa, java, leetcode, learninpublic
Published: 2024-03-06 13:38:28

##INTRODUCTION

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

The problem statement says, we are given an array of altitudes of a rider. Now we have to sum them up and in the end check it with max value. If the sum value is larger than the max value then set the max value and return the value. But when adding the values we have to add the altitudes value with the previous value and the starting value is 0.


##Examples

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

##HINTS

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

##STEPS
1. take 2 variable, arr = 0 and max = 0;
2. Run a for loop and set, arr += gain[i];
3. Check if (max < arr), set max = arr;
4. return max.


##JavaCode

```
class Solution {
    public int largestAltitude(int[] gain) {
        int max = 0;
        int arr;
        arr= 0;
        for(int i = 0; i < gain.length; i++){
                arr += gain[i];
            if(max < arr){
                max = arr;
            }
        }
        return max;
    }
}
```

##OUTPUT

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e0itvkk7bygpb99xuecw.png)
Useful Global Git Configurations
Tags: git, productivity, tutorial
Published: 2024-03-06 13:31:00

In this post, I'm going to share with you six global Git configurations that I use and find incredibly useful.

Global Git configurations are settings that apply to all your local repositories. They are stored in a file called `.gitconfig` in your home directory. You can view and edit this file, or you can use the `git config` command to modify it from the terminal.

To see the global configurations through the terminal, you can run:

```bash
git config --global --list
```

Let's get to it!

### 1. `git config --global init.defaultBranch main`

This sets the default branch name to `main` instead of `master` when creating a new repository using `git init`.

### 2. `git config --global help.autoCorrect prompt`

By default, Git checks for spelling errors and suggests corrections, but it doesn’t automatically apply them. After configuring this setting, Git will prompt you to run the suggested correction.

```git
$ git pusj
WARNING: You called a Git command named 'pusj', which does not exist.
Run 'push' instead [y/N]?
```

To allow git to run corrections automatically, you can use `help.autoCorrect 1` (runs after 0.1 seconds), `help.autoCorrect 10` (runs after 10 seconds), or `help.autoCorrect immediate` (runs immediately).

I prefer using `help.autoCorrect prompt` to ensure that I will run the command that I intend to.

### 3. `git config --global branch.sort -committerdate`

This makes `git branch` sort the branches by the most recently used branches instead of alphabetically. This helps you to quickly find the branches that you are working on.

### 4. `git config --global fetch.prune true`

When you run `git fetch`, any branches that have been deleted on the remote repository will automatically be deleted from your local repository.

### 5. `git config --global log.date iso`

When you run `git log`, dates will be displayed in ISO format for better readability.

For example, `2024-03-16 05:30:02` instead of `Sun Mar 16 05:30:02 2024`.

### 6. `git config --global push.autoSetupRemote true`

This makes `git push` automatically set up the remote branch. Otherwise, you'd need to do it manually like so:

```bash
git push --set-upstream origin <branch-name>
```

## Conclusion

I hope you found these configurations helpful. Please feel free to share yours!

You can find more on [Git documentation](https://git-scm.com/docs/git-config).
How to Get the First Element of a Set in JavaScript
Tags: javascript
Published: 2024-03-06 13:05:59

Title : How to [Get the First Element of a Set in JavaScript](https://askyt.info/how-to-get-the-first-element-of-a-set-in-javascript/)

### 1. Get the First Element of a Set in [JavaScript](https://askyt.info/category/javascript/) Using Destructuring:

```javascript
const set = new Set([1, 2, 3]);
const [first] = set;
console.log(first); // Output: 1
```

Explanation:
- Here, we create a new Set called `set` with elements `[1, 2, 3]`.
- We use array destructuring to extract the first element of the Set and assign it to the variable `first`.
- `console.log(first)` prints the value of the variable `first`, which is the first element of the Set.

### 2. Get the First Element of a Set in JavaScript Using Spread Syntax (...):

```javascript
const set = new Set([1, 2, 3]);
const firstElement = [...set][0];
console.log(firstElement); // Output: 1
```

Explanation:
- `[...set]` spreads the elements of the Set into an array.
- `[0]` accesses the first element of the resulting array.
- `console.log(firstElement)` prints the value of the variable `firstElement`, which is the first element of the Set.

### 3. Get the First Element of a Set in JavaScript Using Set.values():

```javascript
const set = new Set([1, 2, 3]);
const firstElement = set.values().next().value;
console.log(firstElement); // Output: 1
```

Explanation:
- `set.values()` returns an iterator object containing the values of the Set in insertion order.
- `.next()` method is used to advance the iterator.
- `.value` retrieves the value of the current element in the iteration.
- `console.log(firstElement)` prints the value of the variable `firstElement`, which is the first element of the Set.

### 4. Get the First Element of a Set in JavaScript Using for...of Loop:

```javascript
const set = new Set([1, 2, 3]);
let firstElement;
for (const element of set) {
    firstElement = element;
    break;
}
console.log(firstElement); // Output: 1
```

Explanation:
- `for...of` loop iterates over the elements of the Set.
- Inside the loop, we assign each element to the variable `firstElement`.
- `break` statement is used to exit the loop after processing the first element.
- `console.log(firstElement)` prints the value of the variable `firstElement`, which is the first element of the Set.

Each of these methods achieves the same result, which is obtaining the first element of the Set.
Navyug Multispeciality Physiotherapy Centre in Bopal
Published: 2024-03-06 13:22:54

"At Navyug Multispeciality Physiotherapy Centre in Bopal, we are dedicated to providing compassionate and personalized care to help you achieve optimal health and wellness. Our team of highly skilled physiotherapists is committed to helping you recover from injury, manage chronic conditions, and enhance your overall quality of life. Our Mission Our mission is to empower our patients to reach their full potential by offering evidence-based physiotherapy services tailored to their individual needs. We strive to create a supportive and healing environment where patients feel valued, understood, and empowered on their journey to recovery."
JavaScript - Difference between map() and forEach()
Tags: javascript, programming, webdev
Published: 2024-03-06 13:22:08

<h3><u>Introduction</u></h3>

If you are a Javascript Developer, you probably use `map()` and `forEach()` method, but do you really know the difference between both of them ?

We will see how they works and in which case it is useful to use them. 

<h3><u>map()</u></h3>

The `map()` method is used when you want to create a new array and modify elements in it. <u>A new array will be returned with his new values (or not).</u>

__Exemple :__

```JavaScript
const array = [1, 2, 3, 4, 5];

const newArray = array.map(item => item * 5);

console.log(array);
//Output : [1, 2, 3, 4, 5];
console.log(newArray);
//Output : [5, 10, 15, 20, 25];
```
Here, in this example we can see that we have `array` which has not changed, and the `newArray` which contains the new array with the new values.

We can also attach an other method after `map()`.

__Exemple :__

```JavaScript
const array = [1, 2, 3, 4, 5];

const newArray = array.map(item => item * 5).sort((a, b) => b - a);

console.log(newArray);
//Output : [25, 20, 15, 10, 5];
```

<h3><u>forEach()</u></h3>


The `forEach()` method is used when you want edit an element in an existing array. <u>But unlike `map()`, `forEach()` do not return a new array.

__Exemple :__
```JavaScript
const array = [1, 2, 3, 4, 5];

const newArray = array.forEach((item, index, arr) => arr[index] = item * 5);

console.log(array);
//Output : [5, 10, 15, 20, 25];
console.log(newArray);
//Output : undefined;
```
Here, `array` contain the new values, and `newArray` is undefined because `forEach` do not return an array like `map()`.

<h3><u>Conclusion</u></h3>

So, the main diffenrence between both of them is that `map()` method return a new array with the new values and we can attach another method to it, while forEach() return nothing and we cannot attach any other method to it.