teleren/devto huggingface dataset:
Issue 41 of AWS Cloud Security Weekly
Tags: security, aws, newsletter, iam
Published: 2024-04-23 00:03:29

(This is just the summary of Issue 41 of AWS Cloud Security weekly @ https://aws-cloudsec.com/p/issue-41 << Subscribe for FREE to receive the full version in your inbox weekly).

**What happened in AWS CloudSecurity & CyberSecurity last week April 15-April 22, 2024?**


- AWS IAM Identity Center administrators can now set session durations for Amazon CodeWhisperer independently from other IAM Identity Center-integrated applications and the AWS access portal. This allows users of Amazon CodeWhisperer to work in their integrated development environments (IDEs) for up to 90 days without the need to re-authenticate. Previously, the session durations for CodeWhisperer in the IDE had to match those of other IAM Identity Center-integrated applications and the AWS access portal, typically ranging from 15 minutes to 90 days.
- AWS Identity and Access Management (IAM) Roles Anywhere now lets you set up mapping rules to define which information is extracted from your X.509 end-entity certificates. These mapped details, known as attributes, are used as session tags in IAM policy conditions to allow or deny permissions. Attributes can be extracted from the subject, issuer, or subject alternative name (SAN) fields in the X.509 certificate. By default, all relative distinguished names (RDNs) from the certificate's subject and issuer are mapped, along with the first value of the domain name system (DNS), directory name (DN), and uniform resource identifier (URI) from the certificate's SAN. This new feature allows you to create a custom set of mapping rules and select only a subset of these certificate attributes that suit your business needs. This customization reduces the size and complexity of the tags used in authorization policies. The mapped attributes are linked to your profile. You can define these mapping rules using the put-attribute-mapping or delete-attribute-mapping APIs via the IAM Roles Anywhere console, AWS SDKs, or AWS CLI.


**Trending on the news & advisories (Subscribe to the newsletter for details):**

- SEC Consult SA-20240411-0 :: Database Passwords in Server Response in Amazon AWS Glue.
- PuTTY SSH client flaw allows recovery of cryptographic private keys. Link.
- Orca- LeakyCLI: AWS and Google Cloud Command-Line Tools Can Expose Sensitive Credentials in Build Logs. 
- Lacework, last valued at $8.3B, is in talks to sell for just $150M to $200M, say sources. 
- UnitedHealth to take up to $1.6 billion hit this year from Change hack.
- MITRE Response to Cyber Attack in One of Its R&D Networks.
- CISA Announces Winners of the 5th Annual President’s Cup Cybersecurity Competition. Link.
Input field validation for forms: A checklist from a designer to a dev with love
Tags: frontend, testing, design, productivity
Published: 2024-04-23 00:00:35

FORM VALIDATION IS TAKEN FOR GRANTED AND YET IT COULD MAKE OR BREAK THE QUALITY OF WORK YOU PUSH TO STAGING OR PRODUCTION. 
I have created a quick checklist to help your form validation be as sleek as Kim Kardashian's bun. 

**Start here**

1. Identify Required Fields: Clearly mark all mandatory fields (asterisk, bold text) 

2. Define Validation Rules: Document specific requirements for each field (length, format, etc.) 

 

**Validation Checks **

3. Length:  Minimum and maximum characters allowed (e.g., username 6-20 characters) 

4. Data Type: Numbers only, letters only, email format, etc. (use regular expressions if needed) 

5. Range:  For numbers (e.g., age between 18-65) 

6. Selection: Ensure dropdowns or radio buttons have a valid selection 

 

**Error Messages **

7. Clarity: Use clear and concise language (e.g., "Username must be 6-20 characters") 

8. Specificity: Indicate the exact error (e.g., "Invalid email format"). 

9. User-friendliness:  Avoid technical jargon (e.g., "Please enter a valid email" instead of "Invalid email syntax"). 

10. Placement: Display error messages near the associated field. 

 

**Additional Tips**

11. Real-time feedback: Consider inline validation as users type (e.g., color change for invalid input). 

12. Positive reinforcement: Acknowledge successful validation (e.g., green checkmark). 

13. Testing: Thoroughly test all validation scenarios. 


YOU ARE WELCOME 😘😘😘
Info card sharing service (free, no login required)
Tags: infometka, info, sharing, service
Published: 2024-04-22 23:37:02

  Welcome to info card sharing MAP https://infometka.com/
It was never been so simple to state about yourself to everyone. "Hello, i am here.." will be seen by all world, and more importantly will be seen by your neighbors, who are looking for your service or help.
  This is a place to become easily be found by others and start P2P interaction. This service let you add to the map or delete from the map your info card (infometka). Do it in [one click via Telegram Bot.](https://t.me/my1_respond_bot)
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/45lvf4rvlwjz1vxgrczv.jpg)
     There are many ways to create communities. But I got the idea to create a tool for those who provide the service. In short, it's something like an Uber taxi, but for all types of services, and, most importantly, it's free. There is no registration button on the site; the service does not require it. I hope you enjoy using this service, finding each other, making good relationships and maybe making new friends. https://infometka.com/
  I think this service will be useful for all who are waiting for clients or may be for those who are feel along and looking for friends. I am sure this service will help people to find each others. Let's start developing horizontal interactions. Lets start been useful and helpful for each others.

## About App idea
 In short - it is like Uber taxi, but for all services and it is totally free. As you maybe noted, there is no "login" and "Signup" buttons. That was my intention to develop service without neediness to signup and login. Simply open the page and start using it.
Actually the content readers never was needed to signup. And as for the content creators (in this case a map marker creators) I did develop an input via Telegram Bot.

## How to Add your marker on the MAP
[Telegram bot](https://t.me/my1_respond_bot) automaticaly will add your card on the map. Here is the link to Telegram Bot
Then in the Telegram bot:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a6dhm6oxssqw1wejlm7h.jpg)
So i think it is good idea to avoid needness of creating site authorization. My service no need this. All required input you can do via telegram bot. Bot will ask you about you service, you may leave a description, image URL, and a link of your website.

## How to Delete your marker from the MAP
[Telegram bot](https://t.me/my1_respond_bot) will delete your marker in one step, just press /stop. Here is the link to Telegram Bot
Then in the Telegram bot:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/elouhtf4482mkhhcil3l.jpg)
I hope you will enjoy using this service, create a good relations and maybe find a new friends.
I still not implement all ideas, that i have about this service. Please feel free to donate for this service support and development :-)
https://infometka.com/
index.html ( <app-root> tag is not working , giving me blank page with no errors in inspect
Published: 2024-04-22 22:53:23

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>MyAngularProject</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link type="text" rel="icon" type="image/x-icon" href="favicon.ico">
<link  type="text" rel="stylesheet" href="styles-5INURTSO.css"></head>
<body>
  
  <app-root></app-root>

</html>


Q. The <app-root> is not getting invoked when i start in live server but in my local it is working fine.

Also if i type something in the body tag i can see that in my live server page.

please help
12章１３
Published: 2024-04-22 21:56:15

このJavaコードは、`switch`ステートメントを使って文字列`str`の値に基づいて異なる操作をすることを意図しています。しかし、`str`が初期化されていないため、その値は`null`です。`switch`ステートメントは`null`値を扱うことができないため、実行時に`NullPointerException`が発生します。それを踏まえて、コードにコメントを追加して説明します。コメントを追加するには、行に対して直接説明を書きます。以下がその例です：

```java
public class Sample {
  // strはクラスレベルの変数で初期値はnull
  static String str;
  
  public static void main(String[] args) {
    // switch文にはstrが渡されるが、strはnullなのでNullPointerExceptionが投げられる
    switch(str) {
      // このcaseはstrが"10"の時にマッチするが、到達されない
      case "10" : str += "10"; break;
      // defaultケース: strがnullでも他の値でもマッチするが、nullの場合は例外が発生する
      default : str += "def"; break;
      // このcaseはstrが"20"の時にマッチするが、到達されない
      case "20" : str += "20"; break;
    }
    // この出力文もNullPointerExceptionのために到達されない
    System.out.println(str);
  }
}
```

このコードでは、`str`が`null`であるために`switch`文に入ると`NullPointerException`が発生し、プログラムはクラッシュします。その結果、`System.out.println(str);`の行は実行されず、何も出力されません。答えがD、「実行時に例外がスローされる」というのはこのためです。

## 追記

例外を回避するには、`switch`文に渡される`str`の値を`null`でないものに初期化するか、`switch`文の前で`str`の値をチェックして処理を行う必要があります。`str`を適切な値で初期化することは、最も単純な修正の一つです。

例えば、`str`を空文字列で初期化する方法です：

```java
public class Sample {
  static String str = "";
  
  public static void main(String[] args) {
    switch(str) {
      case "10" : str += "10"; break;
      default : str += "def"; break;
      case "20" : str += "20"; break;
    }
    System.out.println(str);  // 出力: def
  }
}
```

この場合、`str`は空文字列で初期化されるため、`default`ブロックが実行され、`"def"`が`str`に連結されます。その結果、`System.out.println(str);`は`"def"`を出力します。

`null`の場合に特別な処理を行いたい場合は、`switch`文に入る前に`null`チェックを行うこともできます：

```java
public class Sample {
  static String str;
  
  public static void main(String[] args) {
    if (str == null) {
      str = "default";
    }
    switch(str) {
      case "10" : str += "10"; break;
      default : str += "def"; break;
      case "20" : str += "20"; break;
    }
    System.out.println(str);  // 出力: defaultdef
  }
}
```

この場合、`str`が`null`の場合は`"default"`で初期化され、その後`switch`文が実行されます。`default`ブロックが実行され、`"def"`が`str`に連結されるため、出力は`"defaultdef"`になります。

これらの修正により、`NullPointerException`を回避し、プログラムが期待通りに実行されます。
1971. Find if Path Exists in Graph
Tags: leetcode, php, programming, algorithms
Published: 2024-04-22 21:54:31

1971\. Find if Path Exists in Graph

Easy

There is a **bi-directional** graph with `n` vertices, where each vertex is labeled from `0` to `n - 1` (**inclusive**). The edges in the graph are represented as a 2D integer array `edges`, where each <code>edges[i] = [u<sub>i</sub>, v<sub>i</sub>]</code> denotes a `bi-directional` edge between vertex <code>u<sub>i</sub></code> and vertex <code>v<sub>i</sub></code>. Every vertex pair is connected by `at most one` edge, and no vertex has an edge to itself.

You want to determine if there is a **valid path** that exists from vertex `source` to vertex `destination`.

Given `edges` and the integers `n`, `source`, and `destination`, return `true` _if there is a **valid path** from `source` to `destination`, or `false` otherwise_.

**Example 1:**

![](https://assets.leetcode.com/uploads/2021/08/14/validpath-ex1.png)

- **Input:** n = 3, edges = [[0,1],[1,2],[2,0]], source = 0, destination = 2
- **Output:** true
- **Explanation:** There are two paths from vertex 0 to vertex 2:
- 0 → 1 → 2
- 0 → 2

**Example 2:**

![](https://assets.leetcode.com/uploads/2021/08/14/validpath-ex2.png)

- **Input:** n = 6, edges = [[0,1],[0,2],[3,5],[5,4],[4,3]], source = 0, destination = 5
- **Output:** false
- **Explanation:** There is no path from vertex 0 to vertex 5.


**Constraints:**

- <code>1 <= n <= 2 * 10<sup>5</sup></code>
- <code>0 <= edges.length <= 2 * 10<sup>5</sup></code>
- <code>edges[i].length == 2</code>
- <code>0 <= u<sub>i</sub>, v<sub>i</sub> <= n - 1</code>
- <code>u<sub>i</sub> != v<sub>i</sub></code>
- <code>0 <= source, destination <= n - 1</code>
- There are no duplicate edges.
- There are no self edges.

```
class Solution {

    public $graph;

    /**
     * @param Integer $n
     * @param Integer[][] $edges
     * @param Integer $source
     * @param Integer $destination
     * @return Boolean
     */

    public function validPath(int $n, array $edges, int $source, int $destination): bool
    {
        $this->graph = array_fill(0, $n, 0);

        for ($i = 1; $i < $n; $i++) {
            $this->graph[$i] = $i;
        }

        foreach ($edges as $edge) {
            $this->merge($this->find($edge[0]), $this->find($edge[1]));
        }

        return $this->find($this->graph[$source]) == $this->find($this->graph[$destination]);
    }

    public function find($a) {
        return $this->graph[$a] == $a ? $a : $this->graph[$a] = $this->find($this->graph[$a]);
    }

    public function merge($a, $b): void
    {
        $this->graph[$a] = $b;
    }
}
```


**Contact Links**

- **[LinkedIn](https://www.linkedin.com/in/arifulhaque/)**
- **[GitHub](https://github.com/mah-shamim)**
DevLog #15 - Sprint Retrospective
Tags: agile
Published: 2024-04-22 21:47:11

Sprint retrospective is a crucial event that is held at the end of every Sprint, in the Scrum Agile methodology and the purpose of this meeting is identifying issues with the process, collaboration and finding solutions for those matters. After the sprint review, team mates including product owner, scrum master and the development team should get together and discuss “what went well”, “what did not go well” topics to identify issues with the process and collaboration separately. After that, the team should discuss “why it happened”, “What actions could be taken” topics to improve the process and collaboration to overcome those identified issues.

According to our project, we could use retrospective meetings to address lots of process and collaboration related matters. In the first sprint we followed the “Mob programming” method as our team collaboration method and at the end of the sprint, we could not complete our sprint backlog. Then in the sprint retrospective meeting we identified that issue and took a decision to change it to pair programming. And in the second sprint also we could not complete our sprint backlog and we identified that our estimations should be improved and we decided to use planning poker in the retrospective meeting and we could succeed in the third sprint. 

According to my reflection, If we did not use the retrospective, I think we would  still be struggling to identify why we could not complete our sprint backlog on time because only we focused on product changes and improvements in sprint review. I think if we can use the sprint retrospective more effectively, we can improve efficiency and can drive projects towards our goal easily.
COO of open source tool chats about his POV
Published: 2024-04-22 21:06:43

Robin Wagner is OpenProject’s Chief Operating Officer. He has been with the company since the early days and is celebrating 10 years this year with OpenProject.

Learn more about his perspective on remote work, AI, and a focus on customers in this [employee spotlight](https://dev.to/openproject/openprojects-coo-on-remote-work-ai-and-a-love-for-customers-jdo).
Getting Started with HTML ep2
Tags: webdev, beginners, tutorial, programming
Published: 2024-04-22 20:40:05

In this episode, we're diving deeper into the world of HTML. As mentioned earlier, HTML utilizes tags to structure content on web pages. Let's break down some common HTML elements:

1. **Headings** (h1, h2, <h3, etc.): Headings are used to define the titles or subtitles of a page. They range from h1 the most important to h6 (the least important).

2. **Paragraphs** p: Paragraph tags are used to separate blocks of text. They are great for organizing content and making it more readable.

3. **Links** a: Links are used to navigate between different web pages. They are created using the anchor tag (a) and specifying the destination URL in the href attribute.

These are just a few examples of the many elements available in HTML. As you continue your journey with HTML, you'll discover even more ways to structure and enhance your web pages.

**Stay tuned for the next episode where we'll explore how to create your first HTML document and bring your web pages to life!**

Don't forget to leave your thoughts and questions in the comments below. Your feedback helps us tailor future episodes to your needs.

_Thanks for tuning in!_
Programming Errors
Tags: java, learning, programming, beginners
Published: 2024-04-22 20:15:19

Programming errors can be categorized into three types: syntax errors, runtime errors, and logic errors.

## Syntax Errors

Errors that are detected by the compiler are called syntax errors or compile errors. Syntax errors result from errors in code construction, such as mistyping a keyword, omitting some necessary punctuation, or using an opening brace without a corresponding closing brace. These errors are usually easy to detect because the compiler tells you where they are and what caused them.

```
public class ShowSyntaxErrors {
 public static main(String[] args) {
 System.out.println("Welcome to Java);
 }
}
```
Four errors are reported, but the program actually has two errors:

- The keyword **void** is missing before **main** in line 2.
- The string **Welcome to Java** should be closed with a closing quotation mark in line 3.

Since a single error will often display many lines of compile errors, it is a good practice to fix errors from the top line and work downward. Fixing errors that occur earlier in the program may also fix additional errors that occur later.

## Runtime Errors

_Runtime errors_ are errors that cause a program to terminate abnormally. They occur while a program is running if the environment detects an operation that is impossible to carry out.
Input mistakes typically cause runtime errors. An _input error_ occurs when the program is waiting for the user to enter a value, but the user enters a value that the program cannot handle. For instance, if the program expects to read in a number, but instead the user enters a string, this causes data-type errors to occur in the program. Another example of runtime errors is division by zero. This happens when the divisor is zero for integer divisions

```
public class ShowRuntimeErrors {
 public static void main(String[] args) {
 System.out.println(1 / 0);
 }
}
```

## Logic Errors

Logic errors occur when a program does not perform the way it was intended to. Errors of this kind occur for many different reasons. For example, suppose you wrote the program to convert Celsius 35 degrees to a Fahrenheit degree:

```
public class ShowLogicErrors {
 public static void main(String[] args) {
 System.out.println("Celsius 35 is Fahrenheit degree ");
 System.out.println((9 / 5) * 35 + 32);
 }
}
```

```
Celsius 35 is Fahrenheit degree
67
```
You will get Fahrenheit **67** degrees, which is wrong. It should be **95.0**. In Java, the division for integers is the quotient—the fractional part is truncated—so in Java **9 / 5** is **1**. To get the correct result, you need to use **9.0 / 5**, which results in **1.8**.

In general, syntax errors are easy to find and easy to correct because the compiler gives indications as to where the errors came from and why they are wrong. Runtime errors are not difficult to find, either, since the reasons and locations for the errors are displayed on the console when the program aborts. Finding logic errors, on the other hand, can be very challenging.
Programming Style and Documentation
Tags: beginners, programming, learning, java
Published: 2024-04-22 20:01:31

Good programming style and proper documentation make a program easy to read and help programmers prevent errors. Programming style deals with what programs look like. A program can compile and run properly even if written on only one line, but writing it all on one line would be bad programming style because it would be hard to read. Documentation is the body of explanatory remarks and comments pertaining to a program. Programming style and  documentation are as important as coding. Good programming style and appropriate documentation reduce the chance of errors and make programs easy to read.

##  Appropriate Comments and Comment Styles

Include a summary at the beginning of the program that explains what the program does, its key features, and any unique techniques it uses. In a long program, you should also include comments that introduce each major step and explain anything that is difficult to read. It is important to make comments concise so that they do not crowd the program or make it difficult to read.

In addition to line comments (beginning with **//**) and block comments (beginning with **/***), Java supports comments of a special type, referred to as _javadoc comments_. javadoc comments begin with **/**** and end with ***/**. They can be extracted into an HTML file using the JDK’s **javadoc** command. Use javadoc comments (/** ... */) for commenting on an entire class or an entire method. These comments must precede the class or the method header in order to be extracted into a javadoc HTML file. For commenting on steps inside a method, use line comments (**//**).

##  Proper Indentation and Spacing

A consistent indentation style makes programs clear and easy to read, debug, and maintain. _Indentation_ is used to illustrate the structural relationships between a program’s components or statements. Java can read the program even if all of the statements are on the same long line, but humans find it easier to read and maintain code that is aligned properly. Indent each subcomponent or statement at least two spaces more than the construct within which it is nested.
A single space should be added on both sides of a binary operator, as shown in the following statement:

```
System.out.println(3+4*4); Bad style
System.out.println(3 + 4 * 4); Good style
```

## Block Styles

A block is a group of statements surrounded by braces. There are two popular styles, next-line style and end-of-line style:

```
public class Test
{
public static void main(String[] args)
 {
 System.out.println("Block Styles");
 }
}
```
_Next-line style_

```
public class Test {
public static void main(String[] args) {
 System.out.println("Block Styles");
 }
}
```
_End-of-line style_

The next-line style aligns braces vertically and makes programs easy to read, whereas the end-of-line style saves space and may help avoid some subtle programming errors. Both are acceptable block styles. The choice depends on personal or organizational preference. You should use a block style consistently—mixing styles is not recommended.