teleren/devto huggingface dataset:
When you suffer from the "API: s3:PutBucketPolicy Access Denied" error while creating a new S3 bucket, how can we resolve it?
Tags: aws, cdk, typescript
Published: 2023-09-05 14:29:07

<p>
Due to changing the default configuration of Amazon S3, we need to add the <code>blockPublicAccess</code> attribute to the CDK project.
</p>
</p>
<h2>What error did I see?</h2>
</p>
<p>
When I tried to create a new Amazon S3 bucket for hosting a new website:
</p>
</p>
<pre class="wp-block-code"><code>    const websiteBucket = new Bucket(this, 'SonikStaticAssets', {
      websiteIndexDocument: 'index.html',
      publicReadAccess: true,
    });</code></pre>
</p>
<p>
I met the following CloudFormation error.
</p>
</p>
<pre class="wp-block-code"><code>CdkSonikAppStack: deploying... &#91;1/1]
CdkSonikAppStack: creating CloudFormation changeset...
10:08:29 PM | CREATE_FAILED        | AWS::S3::BucketPolicy       | SonikStaticAssetsPolicy8AA45F84
API: s3:PutBucketPolicy Access Denied


 &#x274c;  CdkSonikAppStack failed: Error: The stack named CdkSonikAppStack failed to deploy: UPDATE_ROLLBACK_COMPLETE: API: s3:PutBucketPolicy Access Denied</code></pre>
</p>
<h2>Add the <code>blockPublicAccess</code> attributes to resolve this issue.</h2>
</p>
<p>
To avoid this error, we need to add the <code>blockPublicAccess: BlockPublicAccess.BLOCK_ACLS</code> attributes.
</p>
</p>
<pre class="wp-block-code"><code>    const websiteBucket = new Bucket(this, 'SonikStaticAssets', {
      websiteIndexDocument: 'index.html',
      publicReadAccess: true,
      blockPublicAccess: BlockPublicAccess.BLOCK_ACLS,
    });</code></pre>
</p>
<h2>Referenced</h2>
</p>
<ul>
<li><a rel="noreferrer noopener" href="https://zenn.dev/shimo_s3/articles/d5f104ff3bac1f" target="_blank">https://zenn.dev/shimo_s3/articles/d5f104ff3bac1f</a></li>
<li><a href="https://aws.amazon.com/jp/blogs/aws/heads-up-amazon-s3-security-changes-are-coming-in-april-of-2023/" target="_blank" rel="noreferrer noopener">https://aws.amazon.com/jp/blogs/aws/heads-up-amazon-s3-security-changes-are-coming-in-april-of-2023/</a></li>
</ul>
Hello, World! - HackerRank Python Solution
Tags: python, beginners, algorithms, programming
Published: 2023-09-05 14:15:52

In this tutorial, we will guide you through the process of solving the **Hello, World** programming problem from HackerRank’s “ **Python** ” domain.

**Disclaimer:** We encourage you to solve this challenge yourself before reading our tutorial. We have provided a detailed explanation of the problem and our solutions to help you check your work.

## What is “Hello, World” Problem?

The “Hello, World” problem is a simple coding challenge that is often used to introduce beginners to a new programming language. It is a simple exercise that involves printing a string to the console.

## Problem Statement

Store the string “Hello, World!” in a variable named `input_string` and print it using `print()`.

## Hello World Solution in Python

{% gist https://gist.github.com/codeperfectplus/d7b8455c64ee92c1af850324ca939e8d.js %}

## Explanation

In the above code, we have stored the string “Hello, World!” in a variable named `input_string` and printed it using `print()`. In Python, we can use the `print()` function to print a string to the console.

## Test Case of Hello World Solution

![Hello world ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zx9pfwv3uz3us893ibhz.jpg)

_Problem statement is taken from [Hackerrank](https://www.hackerrank.com/domains/python), and the solutions are implemented by CodePerfectPlus team_

## Other Article By Author

- [HackerRank Solve Python Algorithm Series](https://codeperfectplus.com/category/Solve-python)
- [HackerRank Problem Solving Algorithm Series](https://codeperfectplus.com/category/Problem-solving)
- [30 Days of Code HackerRank](https://codeperfectplus.com/category/Hackerank-30-days-of-code)
- [10 Days of JavaScript HackerRank](https://codeperfectplus.com/category/10-days-of-javascript)

### [30 Days of Code SubReddit](https://www.reddit.com/r/30daysofcode)
What Is HTML? | Introduction by @incoderweb | HTML Series Part 1
Tags: incoderweb, html, css, javascript
Published: 2023-09-05 14:07:38

Hello friends, today we are going to start an HTML series in this series you will learn about HTML from basic to advanced. In our previous blog, we saw [how to create a stunning tourist agency landing page with HTML and CSS](https://incoderweb.blogspot.com/2023/05/tourist-agency-landing-page.html). You can check my other [javascript projects](https://incoderweb.blogspot.com/search/label/Javascript) after reading this blog.

In this inaugural installment of our HTML Series, presented by @incoderweb, we delve headfirst into the essentials of HTML (Hypertext Markup Language).

Have you ever pondered the process of crafting web pages or comprehending the structural composition of the content displayed on your preferred websites? HTML serves as the foundation of the internet, and gaining a profound comprehension of it constitutes the initial stride on your path to becoming a web developer.

In this introductory video, @incoderweb will elucidate the fundamentals of HTML, underscore its significance in web development, and illustrate how to construct your very first HTML document. Whether you are a complete novice or an individual seeking to refresh your expertise, this series is meticulously designed to aid you in establishing a robust foundation in web development.

Stay attuned for forthcoming episodes where we shall delve into HTML tags, attributes, and more advanced principles. Do not overlook the opportunity to express your appreciation, subscribe, and activate the notification bell so that you remain informed about all the tutorials within our HTML Series. Embark on this exhilarating journey into the realm of web development with @incoderweb!

## What is HTML?

HTML stands for Hypertext Markup Language, it was created by Sir "Tim Berners-Lee". He is called the father of the Internet and HTML. It is used to create the basic structure of a web page. using the predefined HTML tags we create a basic structure of a web page. Let's take an example of a house and try to understand how websites are made:-

![stages of webside development](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1iba4jlzashosypapgnj.png)

As you can see in the image above, in the first stage we create a basic structure of a web page using HTML, using CSS we decorate the web page and add colors to the walls, and at the last stage, we use javascript to build the logic how the website function.

**Unable to understand, Watch the [Video tutorial](https://youtu.be/SdOvnxHVXBU)**
Solo, pair program, or mob ?
Tags: discuss, programming, career
Published: 2023-09-05 13:57:28

Do you program, as a duo, a mob or by yourself?

When I worked at marketing companies, I usually programmed by myself. I've seen others try pair programming and at times programming as a mob. Either of these could work, but I am curious to have you tried or disliked any in particular.

What do you think? Would you try pair programming or mobbing, or would you rather work by yourself?
Day 41: Type Guards
Tags: javascript, typescript, day41, 100daysofcode
Published: 2023-09-05 13:40:00

### What Are Type Guards?

Type Guards are TypeScript constructs that allow you to refine or narrow down the type of a value within a certain code block. They are especially useful when dealing with union types or unknown values.

#### The `typeof` 

The simplest Type Guard in TypeScript is the `typeof` check. You've likely used it to differentiate between primitive types.

```typescript
function logValue(value: string | number) {
  if (typeof value === 'string') {
    console.log('This is a string:', value);
  } else {
    console.log('This is a number:', value);
  }
}
```


### The `instanceof` 
When working with classes and inheritance, `instanceof` is your go-to Type Guard.

```typescript
class Animal {
  move() {
    console.log('Moving... 🚶‍♂️');
  }
}

class Bird extends Animal {
  fly() {
    console.log('Flying... 🦅');
  }
}

function moveAnimal(animal: Animal) {
  if (animal instanceof Bird) {
    animal.fly();
  } else {
    animal.move();
  }
}
```

### Type Guards and Unions

Unions are a common source of type-related issues. Type Guards can help ensure that your code handles union types gracefully.

```typescript
type Result = { success: true; value: number } | { success: false; error: string };

function processResult(result: Result) {
  if (result.success) {
    console.log('Value is', result.value);
  } else {
    console.error('Error:', result.error);
  }
}
```

### With Custom Properties

The `in` operator is handy when dealing with objects that might have specific properties.

```typescript
interface Car {
  brand: string;
  speed: number;
}

function isFast(car: Car | { name: string }): car is Car {
  return 'speed' in car;
}
```

### With `typeof` and `instanceof`

Type Guards can be combined to handle complex situations effectively.

```typescript
function processInput(input: string | number | Animal) {
  if (input instanceof Animal) {
    input.move();
  } else if (typeof input === 'string') {
    console.log('You entered a string:', input.toUpperCase());
  } else {
    console.log('You entered a number:', input.toFixed(2));
  }
}
```
Personal note: Dokerize Elixir App
Tags: docker, elixir, webdev, beginners
Published: 2023-09-05 13:39:19

After we have completed creating our Elixir CRUD app, now we want to wrap it into a container. We will use Docker which is a popular tool to container the app.

To container it, we need to create a `dockerfile` in root app.

We can add `.dockerignore`. It's optional but ok if we have it.

`.dockerignore`
```
# Elixir Artifacts
/_build/
/deps/
/doc/
/cover/
/.fetch
*.ez
APPNAME-*.tar
erl_crash.dump


# Node Artifacts
npm-debug.log
/assets/node_modules/
/priv/static/


# File uploads
/uploads
/test/uploads


# Docker only
/test/
/.iex.exs
```

OK, after we add it now we can add dockerfile.

`dockerfile`
```
FROM elixir:1.15.1 as builder
WORKDIR /app
COPY . .
ENV MIX_ENV=prod
COPY lib ./lib
COPY mix.exs .
COPY mix.lock .
COPY config/prod.env.exs config/

RUN mix local.rebar --force \
    && mix local.hex --force \
    && mix deps.get \
    && mix release

EXPOSE 8081

CMD ["_build/prod/rel/todo_app/bin/todo_app", "start"]
```

If we want more advanced dockerfile, we can use multi-stage build dockerfile. By using multi-stage build we can have lighter image because it will only contain Elixir distribution file.

But in this post, We will only provide single-stage build for more simplicity.

Happy Coding!!! 🍻
👏🚀 We've got some fantastic news to share!
Tags: webdev, news, ceo
Published: 2023-09-05 13:31:38

👏🚀 We've got some fantastic news to share! 📢 @Yuriy Dobrianskyi, our visionary leader and CEO of the Devler.io has been nominated as one of the "Top 100 USA Entrepreneurs with Ukrainian Origins". 🇺🇸🇺🇦 
🏆 His pioneering work in revolutionizing the #hiring landscape through Devler #platform has earned him a spot in  "Top USA Awards" prestigious list. 🚀 
[Dive into the CEO Weekly news to learn more about his journey and contributions](https://ceoweekly.com/from-startup-to-acclaimed-entrepreneur-devler-io-ceo-yurii-dobrianskyi-nominated-as-top-100-usa-entrepreneur-with-ukrainian-origins/ )! 📖

https://ceoweekly.com/from-startup-to-acclaimed-entrepreneur-devler-io-ceo-yurii-dobrianskyi-nominated-as-top-100-usa-entrepreneur-with-ukrainian-origins/
ABEND dump #6
Tags: news
Published: 2023-09-05 13:10:47

Hi there 👋

The ABEND dump is the issue where I share the most interesting content I’ve been reading, listening to, and watching lately.

Want to check the previous issue? Read it here: [ABEND dump #5](https://dev.to/bitmaybewise/abend-dump-5-8a8)

---

## [Have you played Terraria? What if I tell you this guy built a computer inside the game?!](https://youtu.be/zXPiqk0-zDY?si=zVMgT1b6Mnzv9MnS)

How crazy genius is that?!

{% embed https://youtu.be/zXPiqk0-zDY?si=zVMgT1b6Mnzv9MnS %}

## [Rich Hickey is retiring](https://clojure.org/news/2023/08/04/next-rich)

The creator of Clojure and Datomic is retiring. But don’t run so fast with conclusions, he’s now dedicating full time to Clojure.

Though I’ve never been a Clojure developer myself, Rich is full of wisdom that can be applied to software engineering in general. My favorite talk from him is “Simple Made Easy”, where he talks about fighting against complexity:

{% embed https://youtu.be/LKtk3HCgTa8?si=ZCRSz9_InXqK54xC %}

## [Advice From the Creator of C++](https://youtu.be/-QxI-RP6-HM?si=u33nYxhtMRx_dfeU)

I stumbled upon this short video of Bjarne Stroustroup on YouTube, where he gives advice to young programmers, and digresses about the importance of staying open and flexible for what life throws your way, and how it can be beneficial to avoid frustrations throughout your career.

{% embed https://youtu.be/-QxI-RP6-HM?si=u33nYxhtMRx_dfeU %}

[“Be water, my friend.”](https://bitmaybewise.substack.com/p/dont-obsess-on-choosing-a-programming)

---

If you liked this post, consider subscribing to my newsletter [Bit Maybe Wise](http://bitmaybewise.com/).

You can also follow me on [Twitter/X](https://twitter.com/bitmaybewise) and [Mastodon](https://mastodon.online/@bitmaybewise).
Using Yaws with PHP
Tags: php, webdev, docker, erlang
Published: 2023-09-05 13:04:44

Hello I created a simple project that showcase how to configure [YAWS](https://github.com/erlyaws/yaws) with a PHP application (ProcessWire).

{% github https://github.com/joyofpw/pwyaws %}

Mixing Erlang and PHP is a powerful combination. PHP has a vast web development ecosystem and Erlang has more than 30 years of production ready concurrency solutions that scale well.
Matplotlib Tutorial #4: Plot With Default X-Points
Tags: datascience, python, beginners, tutorial
Published: 2023-09-05 12:57:55

{% embed https://youtu.be/2yHHcgsDsGc %}

You actually don't have to pass x-points as an argument in the `plot` method. If the value of x-points is a sequential increment starting from 0 for example 1, 2, 3, .. and you just don't care about the values, you just need to only pass the y-points.

---

## Default X-Points
Let's say that you want to plot the following points: (0, 1), (1, 5), (2, 10), (3, 8), (4, 11). You can do that by typing the following code
```python
import matplotlib.pyplot as plt
import numpy as np

xpoints = np.array([0, 1, 2, 3, 4])
ypoints = np.array([1, 5, 10, 8, 11])

plt.plot(xpoints, ypoints)
plt.show()
```
Which produces the following output

![Plot 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yc55klr6g2kms27t8cv0.png)

But notice that `xpoints` values are a sequential of 1 through 5 with the increment of 1 each step. In this case, you actually don't have to pass `xpoints`, therefore the code will look like this
```python
import matplotlib.pyplot as plt
import numpy as np

ypoints = np.array([1, 5, 10, 8, 11])

plt.plot(ypoints)
plt.show()
```
The output will be the same as the previous code output

![Plot 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kgjxv38mkjhkywx5i5cs.png)

---

There you go, that is how you can create a plot by only passing the y-points. Thank you for reading this article and have a great day!
User-Centric Fintech App Development
Published: 2023-09-05 12:56:41

In the dynamic world of fintech, user-centricity has become a pivotal factor for success. Fintech app development, at its core, is about creating solutions that cater to users' needs seamlessly. In this article, we will explore the essence of user-centric fintech app development and how it can positively impact your [app development cost](https://digimonksolutions.com/fintech-app-development-cost/).

**

## Understanding the Fintech User

**
Understanding your users is where it all begins. Demographics, behaviors, and pain points should be on your radar. User research is your compass in this journey, helping you navigate toward a more cost-effective app development process.

**

## Designing an Intuitive User Interface (UI)

**
A clean, user-friendly UI is the storefront of your [fintech](https://www.cfainstitute.org/en/research/fintech) app. An intuitive design reduces user confusion and support requests, ultimately saving on app development cost by streamlining user interactions.

**

## Enhancing User Experience (UX)

**
Personalization, streamlined onboarding, and frictionless transactions are the keystones of a remarkable UX. When users have a smooth experience, they are more likely to stay, reducing churn and the need for costly marketing efforts.

**

## Data-Driven Decision Making

**
Data is your secret weapon. Analyzing user behavior and preferences can guide you in making informed decisions about app features and updates, potentially saving on unnecessary app development cost.

**

## Cross-Platform Compatibility

**
Making your fintech app work seamlessly across various devices and operating systems ensures a broader user reach. This may require extra effort initially but can lead to substantial savings in the long run by reducing the need for extensive app adaptations.

**

## User-Centric Security Measures

**
Prioritizing user security not only protects your users but also safeguards your reputation and financial interests. While it may add to the app development cost, it's a wise investment in the long-term viability of your fintech app.

**

## Continuous Improvement and User Feedback

**
Establish channels for user feedback and engage with your user community. Iterative development based on feedback keeps your app relevant and reduces the need for costly overhauls down the road.

In conclusion, user-centric fintech app development isn't just a trend; it's a strategic approach that can positively impact your app development cost. By understanding your users, delivering an exceptional UX, and leveraging data, you can create a fintech app that not only attracts users but also retains them, ultimately leading to a more cost-effective and successful journey in the competitive fintech landscape.
A New Fusion of Language Models and Recommender Systems – InteRecAgent
Tags: llm, ai, machinelearning
Published: 2023-09-05 12:51:22

Researchers from the University of Science and Technology of China and Microsoft Research Asia have introduced InteRecAgent, a cutting-edge framework that combines Large Language Models (LLMs) with traditional recommender systems. The goal is to enhance the interactive capabilities of recommender systems by leveraging LLMs' conversational strengths. 

Read more - https://news.superagi.com/2023/09/05/a-new-fusion-of-language-models-and-recommender-systems-interecagent/
The Sparkling Water Trend in India
Tags: juice, sparklink, water, fressjuice
Published: 2023-09-05 12:48:08

Growing Health Consciousness: One of the primary drivers behind the surge in sparkling water consumption is the increasing health consciousness among Indians. With concerns about sugar-laden soft drinks and the desire [polka pop](https://polkapop.in/) to make healthier beverage choices, sparkling water has emerged as a viable alternative. It offers the fizzy sensation people crave without the added sugars or calories.

Variety of Flavors: The Indian market has witnessed a proliferation of sparkling water brands offering a wide array of flavors. From classic soda water to fruit-infused options like lemon, lime, and berry, there is a flavor for every palate. This variety has attracted consumers who seek both refreshment and taste.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7iu5rdl3v42ywqe4lj26.jpeg)
Rise of Premium Brands: Premium brands of sparkling water have entered the Indian market, catering to a discerning consumer base. These brands often promote the purity of their water sources and the quality of their carbonation processes, appealing to those who value a premium drinking experience.

Sparkling Water vs. Regular Soda

Consumers in India are increasingly opting for sparkling water over traditional sugary sodas for several reasons:

Zero Sugar and Calories: Sparkling water contains no added sugars or calories, making it a guilt-free option for those looking to reduce their sugar intake.

Hydration with a Twist: It offers a refreshing alternative to plain water, making hydration more enjoyable, especially for those who find regular water boring.

Versatility: Sparkling water is versatile and can be used as a mixer in cocktails or mocktails, adding an effervescent twist to your favorite beverages.

Challenges and Concerns

While sparkling water has gained popularity, there are some challenges and concerns to consider:

Environmental Impact: The production and packaging of sparkling water can have environmental consequences, particularly if it involves single-use plastic bottles. Consumers are increasingly looking for sustainable packaging options.

Perceived Cost: Some consumers perceive sparkling water as more expensive compared to regular tap water or traditional sodas, which can deter price-sensitive consumers.

Taste Preference: While many people enjoy the taste of sparkling water, it's not for everyone. Some find it too bubbly or prefer the sweetness of traditional sodas.

Sparkling water has become a refreshing and healthier alternative to sugary sodas in India. With a variety of flavors and growing health consciousness, it has found a strong foothold in the beverage market. However, addressing environmental concerns and price perceptions will be crucial for its continued success. Whether you're sipping it as a standalone refreshment or mixing it into your favorite beverages, sparkling water's effervescence is here to stay in India's evolving beverage landscape.
Abacus.AI Introduces Advanced Platform to Develop AI Agents for Complex Task Automation
Tags: ai, agents, automation
Published: 2023-09-05 12:46:54

Abacus.AI introduces a cutting-edge platform to develop AI agents for complex task automation. The platform integrates with diverse data sources and offers a variety of machine learning models, including Large Language Models like GPT3.5 and GPT4. It enables the creation of AI agents for tasks like precise knowledge retrieval, contract analysis, and improved customer support, etc. Showcasing AI's transformative role in reshaping automation.

Read more  - https://news.superagi.com/2023/09/05/abacus-ai-introduces-advanced-platform-to-develop-ai-agents-for-complex-task-automation/
ガントチャートを楽に管理したい
Tags: markdown, management
Published: 2023-09-05 12:42:29

Excel でのガントチャート管理に疲れた。
宗教的な理由からも Excel は嫌。

Backlog とか Jira とか、タスク管理アプリでも WBS 作れるけど正直そんなに便利ではない。
タスクの期限が変わったりすると、他タスクの期限全部調整するハメになったりするし。

---

## 目次

- [なんかいい案ないのかな](#なんかいい案ないのかな)
- [お試し](#お試し)
- [実際に使ってみた感想](#実際に使ってみた感想)

---

## なんかいい案ないのかな

あった
[PlantUML におけるガントチャートの書き方](https://qiita.com/asobinin_kinsan/items/e8552dcab508b414a19a)
↑ ふむふむ、なるほど、ふーんて感じ

まあ plantUML なら使ったことある人多いだろうし、コードでガント管理できるのもエンジニアっぽくていい感じな気がする！！

でも生成した画像をぱっとブラウザ上で見たりしたいけどできるのかな？
↓
多分できない

---

他にもないかなと探していたら、こんなのもあるぽい
[Mermaid を使ってガントチャートを書こう。](https://blog.picocake.com/index.php/2023/05/18/draw_gantt_with_mermaid/)

・・・こっちのが主流ぽい？

[GitHub で Mermaid 構文の表示機能が強化されていました](https://dev.classmethod.jp/articles/github-mermaid-markdown-cntrol/)
Github でもサポートしてる。

・・・Mermaid 試してみるか

---

## お試し

まずはセットアップ。以下の記事を参考にする。
[VSCode で Mermaid を扱う為の便利な拡張機能あれこれ](https://qiita.com/sato_kana/items/2a13f19017576488f017)

とりあえず以下を VScode の拡張機能としてインストールした（他は PDF にエクスポートとかする機能だったので、必要になったらでいいかなと）

- [bierner.markdown-mermaid](https://marketplace.visualstudio.com/items?itemName=bierner.markdown-mermaid)
- [mermaid-markdown-syntax-highlighting](https://marketplace.visualstudio.com/items?itemName=bpruitt-goddard.mermaid-markdown-syntax-highlighting)

---

さっそく VScode で qita の記事に書いてあるサンプルを開いてみた。

![VScodeでの表示](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/545y7ke74fatgpunnrbf.PNG)

良い感じやん！！
そしてこれを Github にうｐすると、画像の状態でプレビューできるのかな？

---

とりあえず適当に.md ファイル作ってさっきのコードペタっとして・・・

![Githubにコピペ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hpb4u0aba1qouup4yfcb.PNG)

あら素敵
![Githubでの表示](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8zfzcikhljjk33x9lfqu.PNG)

---

## 実際に使ってみた感想

Github 上だと、画像右上の ⇔ ボタンで拡大プレビューもできて使い勝手もよろしい。
ただ、凝った見た目にはならないので、内々で使うものにとどめておくのがよいかな。

後は、タスク名を変数にして、各タスクの開始日を a タスクの後、みたいにできるので差し込みタスクが来た時などにスケジュールのパズルがしやすい・・かも