teleren/devto huggingface dataset:
How to reverse a string in java
Tags: programming, java, develpor
Published: 2022-05-05 09:32:28

mark:reverse a string by build-in function chartAt
```
private String reverseString2(String str) {
    if (str == null) {
        return null;
    }
    String result = "";
    for (int i = str.length() - 1; i >= 0; i--) {
        result = result + str.charAt(i);
    }
    return result;
}

public void test(){
    System.out.println(reverseString2("abcd"));
}
```
also can see [reverse-a-string-in-java](https://www.asenview.com/reverse-a-string-in-java/)
Yes, It's Real. Here's how to deal with imposter syndrome
Tags: discuss, career, challenge, mentalhealth
Published: 2022-05-05 09:19:01

Have you ever experienced a nagging doubt that you just can be found out not to be good enough? Or have you ever put your success all the way down to luck or timing?

Have you noticed a necessity to be perfect, and an intense desire to avoid making mistakes because they'd ‘prove’ you're not up to the job?

Would you wish to feel more confident, and put yourself forward for new projects, opportunities or promotion?

In this article, we are going to take a look at 5 strategies that are designed to assist you at work. 

**1. Fake It Until You Make It**

Faking it until you make it can help to build your confidence over time and eventually make the emotions of insecurity go away. When starting a new role, make an effort to go through the motions and hopefully people will believe you until you really gain the experience you need. 

**2. Honour Your Success Rather Than Failure**

The tendency to downplay success and discount it's marked in those with imposter syndrome. They may attribute their success to it being an easy task or having support and often have a hard time accepting compliments. Again, they think their success is right down to luck, good timing, or having fooled others.

In those moments when you feel like an imposter at work, remind yourself that you are good at what you do by focusing on your successes rather than your failures. This can help to give you a more positive outlook and provide you with a boost in morale and self-esteem.

**3. Don't Compare Yourself To Others**

Give yourself the time you need to grow into your role by setting [SMART goals](https://www.mindtools.com/pages/article/smart-goals.htm) for yourself that are actually achievable. This can enable you to gain much-needed confidence boosts every time you hit one of your goals and help you to feel like you are the right person for the job. 

**4. Ask For Help & Be Yourself**

When you are feeling unsure about yourself, especially if you are in a new role or company, it can be easy to become negative or self-critical.

By talking to people who are good at what they do, you will be able to take advantage of their knowledge and experience to further your career.

**5. Reward Yourself**

Have a reward system in place or create one to help you stay motivated. Whatever works for you, make sure that you are regularly rewarding yourself for all the hard work that you are doing. This will help to keep your morale high and prevent you from feeling like a fraud.

**Final Thoughts**

Remember these 5 strategies and you should feel more confident and perform at your best. 

The opportunities are waiting for you!
My Keypoints that Makes Articles easy to understand
Tags: writing, tip
Published: 2022-05-05 09:15:20

1. The Chain of Knowledge / Prerequisite
2. Give them example (example better than 1000 words)
3. Give them an illustration / Pictures
4. See from perspective who invented tech
5. Case studies
6. Always start with 5w + 1h
     - What ?
     - Why ?
     - Who ?
     - Where ?
     - When ?
     - How ?
operators__c++
Published: 2022-05-05 09:02:25

##`Binary` 
 - operator deb 2ta obyekt qabul qiluvchi operatorlarga aytiladi. 
  - Masalan: + operatori ikkita obyekt ustida ishlatiladi a + b

##`Unary` 
 - operator deb 1ta obyekt qabul qiluvchi operatorlarga aytiladi. 
  - Masalan: ! operatori 1ta obyekt ustida ishlatiladi !true

 - Modulus
  - A%B is to calculate the remainder of A / B.
  -  Only integer type

##Relational operator
 - relationship between left and right sides
 - result is always either True(1) or False(0)
 - operators-- <, <=, ==, >=, >, !=

##Arifmetik operatorlar
 - / amalini bajarayotganda, ma'lumotni turi muhim bo'lib, kasr son kasr songa, butun son butun songa bo'linayotganini bilish kerak, yo'qsa misolni javobida o'zgarish bo'ladi.

 - modulus faqat butun sonlar ustida amallarni bajaradi.

 - amallar matematika bn bir xildek ketma ketlikda bajariladi.
Creating a list with Native Component in React Native for android
Tags: reactnative, nativecomponent, performance
Published: 2022-05-05 08:45:36

List’s performance is one of the challenges in react native. 
Many solutions may be suggested but if we don’t limit ourselves to react-native, we can use native components. 
If implementing a list by native components with react native lures you, feel free to read my article. 
Hope you enjoy it! 
Please let me know your thoughts regarding this article 👇

https://medium.com/@seyedmostafahassani/creating-a-list-with-native-component-in-react-native-for-android-57e2be9cb043
Javascript Animation 6
Tags: javascript, webdev, css
Published: 2022-05-05 08:29:50

Whatever you do on Javascript, you have to understand the roots and focus on the basic knowledge.
# 1. File not found  
{% codepen https://codepen.io/php-hacker/pen/NWaYYre %}
# 2. Firework 1  
{% codepen https://codepen.io/php-hacker/pen/dyVmmGW %}
# 3. Firework 2
{% codepen https://codepen.io/php-hacker/pen/Yzraaqr %}
# 4. Map marker 
{% codepen https://codepen.io/php-hacker/pen/vYeRROe %}
# 5. Galaxy 
{% codepen https://codepen.io/php-hacker/pen/MWEVVYM %}
Javascript Animation 3
Tags: javascript, css, webdev
Published: 2022-05-05 08:07:06

Whatever you do on Javascript, you have to understand the roots and focus on the basic knowledge.
# 1. 3D Statistics
{% codepen https://codepen.io/php-hacker/pen/yLzKqEN %}
# 2. Moon rainbow animation 
{% codepen https://codepen.io/php-hacker/pen/vYeRajj %}
# 3. Select Item
{% codepen https://codepen.io/php-hacker/pen/LYzdBdz %}
# 4. Border Animation
{% codepen https://codepen.io/php-hacker/pen/xxXWJYq %}
# 5. Atome 
{% codepen https://codepen.io/php-hacker/pen/gOGejod %}
Javascript Animation 5
Tags: javascript, css, webdev
Published: 2022-05-05 08:22:56

Whatever you do on Javascript, you have to understand the roots and focus on the basic knowledge.
# 1. Peas Kid 
{% codepen https://codepen.io/php-hacker/pen/VwMXXpM %}
# 2. Tilt effect  
{% codepen https://codepen.io/php-hacker/pen/wvrmmgQ %}
# 3. Cat
{% codepen https://codepen.io/php-hacker/pen/qBPooRr %}
# 4. Prometheus 
{% codepen https://codepen.io/php-hacker/pen/WNZzzom %}
# 5. Colour Wars 
{% codepen https://codepen.io/php-hacker/pen/YzraapE %}
Starting a SvelteKit project with TailwindCSS
Tags: tailwindcss, svelte, webdev, tutorial
Published: 2022-05-05 08:21:53

Lately, I heard more and more about [Svelte](https://svelte.dev/) being "the next big thing" in the JavaScript world and I decided to give it a shot. Being a huge fan of [TailwindCSS](https://tailwindcss.com/), I wanted to share the setup procedure to get both those tools into your next project.

## Creating the SvelteKit project

Nothing fancy here, just follow [the instructions](https://kit.svelte.dev/docs/introduction#getting-started) written on the SvelteKit documentation:

```bash
npm init svelte my-app
cd my-app
```

## Installing TailwindCSS

For the next part, everything is pretty standard and explained in [the TailwindCSS documentation](https://tailwindcss.com/docs/installation):

```bash
# Add TailwindCSS as a dev dependency
npm install -D tailwindcss postcss autoprefixer

# Initialize the tailwind and postcss configuration files
npx tailwindcss init tailwind.config.cjs -p
mv postcss.config.js postcss.config.cjs
```

## Configuring TailwindCSS

Once the dependencies have been installed, you can configure them.

In the newly created `tailwind.config.js` file, change the `content`:

```diff
module.exports = {
-  content: [],
+  content: ['./src/**/*.{html,js,svelte,ts}'],
  theme: {
    extend: {},
  },
  plugins: [],
}
```

> If you do not plan on using TypeScript you can remove `ts` from the array. Same goes for any other option.

Considering that SvelteKit does not generate an `app.css` file by default (at the time I am writing this article), create it next to `app.html` and add the TailwindCSS directives in it:

```css
@tailwind base;
@tailwind components;
@tailwind utilities;
```

Then, create the root layout of your application at`./src/routes/__layout.svelte` and reference the newly created `app.css`:

```html
<script>
  import '../app.css';
</script>

<slot />
```

> If this syntax does not look familiar to you, you can learn more about layouts on [the official documentation](https://kit.svelte.dev/docs/layouts)

## Assessing that everything works fine

Last but not least, change the `index.svelte` file content to the following, to test our configuration:

```html
<h1 class="flex h-screen justify-center items-center text-5xl animate-bounce">
    It works!
</h1>
```

If you see your text bouncing on the screen, it means that you are good to go to develop your next project!
Javascript Animation 4
Tags: javascript, webdev, css
Published: 2022-05-05 08:16:40

Whatever you do on Javascript, you have to understand the roots and focus on the basic knowledge.
# 1. Monkey Animation 
{% codepen https://codepen.io/php-hacker/pen/JjrLBrW %}
# 2. Toggle Button  
{% codepen https://codepen.io/php-hacker/pen/GRMxBvG %}
# 3. Jellyfish
{% codepen https://codepen.io/php-hacker/pen/JjrLByW %}
# 4. Game with Matter.js
{% codepen https://codepen.io/php-hacker/pen/PoJRRBX %}
# 5. Delete copy share 
{% codepen https://codepen.io/php-hacker/pen/eYGMMWp %}
Migrate EC2-Classic RDS to a VPC - Step 2 - DNS
Tags: devops, aws, cloud, database
Published: 2022-05-05 08:04:55

In [the plan blog post](https://brightinventions.pl/blog/migrate-ec2-classic-rds-to-a-vpc-planning/) I sketched a plan to migrate an EC2-Classic RDS database to a VPC. Now we can perform the 2nd step of the plan. This is a simple step. Albeit, we have to understand what are the consequences. In your case, this approach might need adjustments!

## The RDS endpoint DNS

When you create an RDS database instance or RDS database cluster AWS provides you with endpoint addresses. The addresses can be used to connect to the database. You cannot change the endpoint address of the RDS database. It is something generated by AWS that you have no influence over.

As planned we want to update the DNS entry when migrating to VPC based RDS instance. For this to work, we need a custom DNS entry. One that we can control.

## Private hosted zone

Often, when deploying services inside a VPC it makes sense to use a private DNS hosted zone. Such an approach allows us to define e.g.`internal` DNS space which we can freely use. With AWS-CDK defining such hosted zone is simple:

```
class NetworkStack extends Stack {
  readonly privateHostedZone: IPrivateHostedZone
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);
    
    const vpc = new Vpc(this, 'vpc', {
      ...
    })

    this.privateHostedZone = new PrivateHostedZone(this, 'internal', {
      vpc: vpc,
      zoneName: 'internal',
      comment: 'private DNS space for registering services'
    });
  }
}
```

## Custom DNS record for database endpoint

Now that we have a private hosted zone we can define a custom DNS record for the database. The record should be used to connect to the database from our service(s). This way once we change the record the application will establish connections to a new database running inside VPC.

```
new CnameRecord(this, 'database cname record', {
  domainName: 'current-classical-database-endpoint',
  zone: this.privateHostedZone,
  recordName: 'database'
})
```

With the above configuration deployed all that is left to do is to update our service configuration. The database hostname that we set should now look like `database.internal`. Please note that we are still connected to the non-VPC, classical RDS instance.

## Important considerations

The approach that we have selected is simple. However, it is not without downsides. The main issue is that the DNS update will not immediately cause all services to connect to the new database. In many cases this is fine. Moreover, we need to make sure that our database clients do not cache DNS entries for too long.

If you need the connections to be moved to a new database instance in a more controllable fashion it is still possible. A deployment with an update of the database configuration of services might be enough. If such a deployment is not an option we can introduce a network proxy e.g. using a network load balancer, ProxySQL or HAProxy.

By Piotr Mionskowski, Team Leader, Technology Evangelist @ Bright Inventions
Javascript Animation 2
Tags: css, javascript, webdev
Published: 2022-05-05 08:03:33

Whatever you do on Javascript, you have to understand the roots and focus on the basic knowledge.
# 1. Curled smoke
{% codepen https://codepen.io/php-hacker/pen/QWqmBoW %}
# 2. Chart 
{% codepen https://codepen.io/php-hacker/pen/gOGejBQ %}
# 3. Loading Animation 1
{% codepen https://codepen.io/php-hacker/pen/OJxvwwd %}
# 4. Loading Animation 2
{% codepen https://codepen.io/php-hacker/pen/eYGMjjz %}
# 5. Heart Animation 
{% codepen https://codepen.io/php-hacker/pen/gOGejKB %}
A Fun Programming Joke To Start Your Day
Tags: jokes, dailydeveloperjokes
Published: 2022-05-05 08:00:05

---
title: "A Fun Programming Joke To Start Your Day"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e125999cc4b1.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q___: What are clouds made of?

___A___: Mostly linux servers.
 -->
Javascript Animation 1
Tags: css, javascript
Published: 2022-05-05 07:57:19

Whatever you do on Javascript, you have to understand the roots and focus on the basic knowledge.
# 1. Five-pointed star
{% codepen https://codepen.io/php-hacker/pen/xxXWgVR %}
# 2. Change lines 
{% codepen https://codepen.io/php-hacker/pen/wvrmowd %}
# 3. Tree branches grow automatically
{% codepen https://codepen.io/php-hacker/pen/poWLEma %}
# 4. Particle effect
{% codepen https://codepen.io/php-hacker/pen/BawrpQG %}
# 5. Android Logo
{% codepen https://codepen.io/php-hacker/pen/oNGqMVq %}
Introduction to Cloud
Tags: beginners, cloud, aws, cloudskills
Published: 2022-05-05 07:43:08

## What is the cloud?

*“Cloud computing is the on-demand delivery of IT resources over the Internet with pay-as-you-go pricing. Instead of buying, owning, and maintaining physical data centres and servers, you can access technology services, such as computing power, storage, and databases, on an as-needed basis from a cloud provider like Amazon Web Services (AWS)”*

>> In a layman's language “Not your server but someone else server”.


## Why Cloud?

- **Cost Optimisation**: Cloud is cost-efficient. You won’t be paying for the initial setup of server(s) at your own premises or pay-as-you-go.

- **Reducing Complexity**: Reduce the developer and company's effort. There are a lot of services, and resources the cloud provides. This helps developers to not to handle the complex tasks and just use cloud.

- **Time-efficient**: Cloud manages/provides a lot of work such as Infra, licences etc. It saves developers time and they can focus on core business.

- **Scalable**: Cloud helps in easy scaling applications on-demand.

- **Secure**: Cloud is secure and the cloud companies are betting a lot of security. Security on cloud is dual responsibility between cloud providers and users.

- **Availability**: Guaranteed availability. Cloud providers guarantee the availability of the environment, resources, and infra.

- **Pay-as-you-go:** You will only pay for what you are using.

- **Deploy globally in minutes:** Cloud helps you to deploy globally in minutes with ease. Instead of waiting to get artifactes to be uploaded in hours, or any service to be get up in hours. Cloud ease in using services and doing deployment. 

# Cloud Participants

Cloud has different participants as consumers, providers, and users:

- cloud providers: Eg: AWS, Azure, etc.

- cloud users: Eg: Companies using any cloud providers to build their solution

- end-users: End-users who are using the solutions based on cloud

## Cloud providers

- Google - [GCP](https://cloud.google.com/)
- Amazon - [AWS](https://aws.amazon.com/)
- Microsoft - [Azure](https://azure.microsoft.com/en-gb/)
- and a few more

## **Parts of the cloud:**

- Hardware
- Network
- Storage
- Virtualisation
- and a few more part

## Services

Cloud is a big ocean of services. It is impossible for one person to know each and every services. Especially, a lot of new services/features keeping getting added every year. To give you an idea here are a few:

- Hosting
- CI/CD
- Lambda
- Storage
- Routing
- Domain
- SSL
- Notifications
- and a lot more

Happy Learning!!
We will OSS the Next.js + web3 starter kit
Tags: javascript, web3, nextjs, blockchain
Published: 2022-05-05 07:41:42



# overview
This source code can be used universally when creating web3 related services such as NFT Market and DeFi.

We have packed Next.js + Web3 with the tools you need to get started on your project.

We created Next.js + web3 starter kit because We want to contribute to the development of web3 in the world.

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

## source code
https://github.com/Foxlottery/nextjs-web3-starterkit

## demo site
https://nextjs-web3-starterkit.vercel.app


# Configured Tools

- Sentry
- Jest test
- Tailwind.css
- Vscode initialization
- PR and Issue template
- Seo module
- Husky
- Lingui
- DeepL automatic translation
- Google Tag Manager
- Redux
- Eslint
- Prettier
- Github workflow


## Sentry

https://sentry.io/
Application Monitoring and Error Tracking Software

## Jest test

https://jestjs.io/ja/

javascript unit test tool

## Tailwind.css

https://tailwindcss.com/

css framework

## Vscode initialization

https://code.visualstudio.com/

Initial setup for vscode support

## PR and Issue template

github pr and issue template

## Seo module

Initial setup for SEO measures with Nextjs

## Husky

https://www.npmjs.com/package/husky

Automatically execute commands when committed.

## Lingui

https://lingui.js.org/

Seamless internationalization in Javascript

## DeepL automatic translation
https://www.deepl.com/translator
Translate the json files generated by lingui with deepl.

You can translate by executing this command.
Please get the API KEY at the deepl website.

```js
npx cross-env DEEPL_AUTH_KEY=XXXXX ts-node lingui-deepl.js
```

## Google Tag Manager

https://tagmanager.google.com/

Google Analytics lets you measure your advertising ROI as well as track your Flash, video, and social networking sites and applications.

## Redux

https://redux.js.org/

A Predictable State Container for JS Apps

## Eslint

https://eslint.org/

code-checking tool

## Prettier

https://prettier.io/

An opinionated code formatter

## Github workflow

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions

CI/CD tool
Github workflow deploys and runs tests when commits and merges are made

## Commitlint

https://commitlint.js.org/#/

commit linter

# License

MIT
Don't use underscores in your HTTP headers
Tags: nginx, aws, heroku, node
Published: 2022-05-05 06:54:25

Recently, I've been working on an API server built with Node.js and hosted on AWS Elastic Beanstalk.

The server manages resources for organisations. Apart from the Authorisation token, which tells us who the user is, we added another token which identifies the organisational resources he wants to access. A user can be part of multiple organisations, so we decided to follow this approach.

The header was named **ORG_API_KEY**. The staging environment was Heroku; everything worked perfectly until deployed to the AWS Elastic Beanstalk production server. We kept getting 401 error (missing api_key).

After hours of debugging, I found out that Elastic Beanstalk running Nginx as a reverse proxy by default has the Nginx option `underscores_in_headers` turned off (That is the default for Nginx). Somehow Heroku and other servers I've worked with have this option turned on, so I never noticed.

It was now a matter of preference to either turn on this option using our `.ebextensions` config or modify our headers and change the underscores to dash. Just to be sure, I tried both approaches, which worked.

```bash
curl --HEADER "ORG_API_KEY: some-random-token" # won't work
curl --HEADER "ORG-API-KEY: some-random-token" # works fine
```
To enable this option using Nginx config, you'll have to navigate to the following folder or create one if it does not exit `.ebextensions > nginx > conf.d` in this folder you should have a configuration file or create one (myconfig.conf or any other name with .conf extension). I already have a config file which I use to increase the size of a request so I added a new line. My config now looks like this;

```bash
client_max_body_size 20M;
underscores_in_headers on;
```
Using underscore is valid according to HTTP standards, in their defence, they (Nginx) said:

> This is done in order to prevent ambiguities when mapping headers to CGI variables as both dashes and underscores are mapped to underscores during that process.

The reason is valid, so instead of turning on the option of allowing underscores, we modified the headers changing underscores to dash. I didn't like the bug, but I enjoyed the learning. What other server configurations have you learnt about?
The Big O of Objects
Tags: javascript, webdev, algorithms, wecoded
Published: 2022-05-05 06:46:28

Let's start with understanding what is an object. 

> An object is a collection of properties, and a property is an association between a name (or key) and a value.

In real Life a car is an Object with properties like model, color etc. Objects are variables with a bunch of values assigned to them. It is a common practice to declare objects with the const keyword.

Let's see an example of an Object

```
const student = {firstName:"Arya", lastName:"Krishna", language:Javascript};
```
In short objects are unordered data structures and everything is stored in key value pairs.

In the example above the variable student has 3 key value pairs. 

When should you be using Objects in your code?
Objects works well when you don't need a specific order to work with and also when you want fast access and insertion and removal.

Insertion, Removal and Access are constant time in Objects. Searching however is linear time. Here searching doesn't means looking for a key, that comes under access and we have already mentioned it as constant time. Searching here is checking to see if a given piece of information is a value somewhere. As the object grows the number of operations also keep on increasing. 

```
Object.keys = O(n)
Object.values = O(n)
Object.entries = O(n)
hasOwnProperty :O(1)

```