teleren/devto huggingface dataset:
Android Application(Shot badges notification)
Tags: android, javascript, programming
Published: 2023-09-21 12:34:52



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mgt02un9xoerspp1ytya.png)Is there any permission through which I could get shot badge notification permission?

Is there any permission through which I could get shot badge notification permission?

Is there any permission through which I could get shot badge notification permission?

Is there any permission through which I could get shot badge notification permission?
Deploy Strapi trên Centos 7 sử dụng Nginx, PM2
Published: 2023-09-21 12:23:27

##1. Clone repo to VPS

##2. Tạo file ecosystem.config.js trong project
```
module.exports = {
  apps: [
    {
      name: "strapi-app",
      script: "npm",
      args: "run develop",
      exp_backoff_restart_delay: 100,
    },
  ],
};
```
Config domain cho project strapi: `./config/server.ts`
```
export default ({ env }) => ({
  host: env('HOST', '0.0.0.0'),
  port: env.int('PORT', 1337),
  url: 'http://admin.yourdomain.com',
  app: {
    keys: env.array('APP_KEYS'),
  },
  webhooks: {
    populateRelations: env.bool('WEBHOOKS_POPULATE_RELATIONS', false),
  },
});
```

##3. Chạy pm2 service
```
npm i -g pm2
pm2 start ecosystem.config.js
```

##4. Cài đặt Nginx 
[Hướng dẫn](https://dev.to/huylv/cai-dat-cong-cu-tren-centos-7-4goa)

##5. Tạo file config nginx:
Tạo file `/etc/nginx/con.f/loyalty-strapi.conf` (thường sẽ đặt tên file theo tên app)
```
upstream strapi {
    server 127.0.0.1:1337;
}

server {
    # Listen HTTP
    listen 80;
    listen [::]:80;
    server_name admin.yourdomain.com; 

        client_max_body_size 100M;

location / {
        proxy_pass http://strapi;

        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_pass_request_headers on;
    }
}
```
Bạn cần thay thế các thông tin domain của bạn vào field `server_name` 

##6. Chạy nginx dưới user root: 

mở file `/etc/nginx/nginx.conf`
```
//change this
user nginx;

//to this
user root;
```
##7. Restart nginx: 

`sudo systemctl restart nginx`

##8. Troubleshoot

####1. Permission denied
```
 connect() to 127.0.0.1:1337 failed (13: Permission denied) while connecting to upstream, client: 42.114.89.25, server: admin.yourdomain.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:1337/favicon.ico", host: "103.185.184.216", referrer: "http://103.185.184.216/"
```
→ chạy lệnh

`setsebool -P httpd_can_network_connect 1`
The Cathedral and the Bazaar
Tags: opensource, webdev, javascript, react
Published: 2023-09-21 12:05:23

Today, I'm diving into the iconic essay **"The Cathedral and the Bazaar"** by Eric S. Raymond. This piece isn't just about software development; it's a deep reflection on community, collaboration, and the spirit of open-source. Let's unravel it!

### The Core Analogy

Raymond draws a vivid comparison between two development models:

1. **The Cathedral**: Software meticulously built behind closed doors until its grand unveiling.
2. **The Bazaar**: An open-source style where everyone can see, modify, and enhance the code transparently.

### Key Rules from the Essay

- **Personal Itch**: Every good work of software starts by scratching a developer's personal itch.
- **Art of Rewriting**: Good programmers know what to write. Great ones know what to rewrite (and reuse).
- **Initial Sacrifices**: Plan to throw one away; you will, anyhow.
- **Passion-Driven Development**: If you have the right attitude, interesting problems will find you.
- **Passing the Torch**: When you lose interest in a program, your last duty is to hand it off to a competent successor.
- **User as Co-developers**: Treating your users as co-developers leads to rapid code improvement and effective debugging.
- **Frequent Releases**: Release early. Release often. And listen to your customers.
- **Community Strength**: Given enough eyeballs, all bugs are shallow.
- **Simplicity Over Complexity**: Smart data structures and dumb code works better than the other way around.
- **Valuing Beta-testers**: If you treat your beta-testers as if they're your most valuable resource, they will become just that.
- **Embracing User Ideas**: The most striking and innovative solutions often come from user insights.
- **Design Perfection**: Perfection (in design) is achieved not when there is nothing more to add, but when there's nothing left to take away.
- **Tool Flexibility**: Any tool should be useful in the expected way, but a truly great tool lends itself to uses you never expected.

### Merging Past and Present

Drawing a bridge to today's open-source landscape, check out [Webcrumbs](https://github.com/webcrumbs-community/webcrumbs) - a project that's like if WordPress met React. Embodying the bazaar spirit:

- 🌟 Show appreciation with a [star on GitHub](https://github.com/webcrumbs-community/webcrumbs).
- 💬 Join the [discussions](https://github.com/webcrumbs-community/webcrumbs/discussions) and share your insights.
- 🛠 Feel the open-source pull? Check out the [open tasks](https://github.com/webcrumbs-community/webcrumbs/issues) and contribute.

### Closing Thoughts

"The Cathedral and the Bazaar" isn't just a piece of tech literature. It's a manifesto for collaborative creation in our digital age. Dive into it, and perhaps, immerse yourself in a modern-day bazaar like Webcrumbs. Cheers to open source! 🚀
Vou explicar o HashMap em Java de forma simples, pode ser?
Tags: java, beginners, hashmap, braziliandevs
Published: 2023-09-21 11:58:35

## O que é um HashMap?
Um HashMap em Java é uma estrutura de dados que permite armazenar pares chave-valor. Cada chave é única e mapeada para um valor correspondente. Isso permite que você associe dados (valores) a identificadores (chaves) de maneira eficiente, permitindo recuperação rápida dos valores com base nas chaves.

**Exemplo de HashMap em Java:**



![Image Map HashMap](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x8ubcsjdr31d8lh4h5vz.png)

**Neste exemplo**:

1. 
Criamos um HashMap chamado mapaDeIdades que mapeia nomes (chaves) para idades (valores).

2. 
Usamos put para adicionar pares chave-valor ao HashMap.

3. 
Usamos get para acessar um valor com base em uma chave.

4. 
Usamos containsKey para verificar se uma chave existe no HashMap.

5. 
Usamos remove para remover um par chave-valor do HashMap.

Espero que este exemplo simples ajude você a entender o básico de como usar um HashMap em Java para armazenar e recuperar dados de forma eficiente.

Repositório com a trilha de java: https://github.com/antoniorws/basic-java

Linkedin: https://www.linkedin.com/in/antonio-rodrigo-wanderley-serra/
GitHub: https://github.com/antoniorws
How Does Odoo Security Secure Data?
Tags: odoo, scan, odoosecurity, security
Published: 2023-09-21 11:57:30

Odoo security is used for the purposes of protecting business processes and the data that is being processed. Odoo Security was designed with the idea of being an easy-to-use, highly scalable, and affordable solution for all small and medium-sized businesses. Today's major concern is hacking and cyber-attacks. Hacking and cyber attacks can cause severe losses to businesses, as personal data, spoofing, phishing, and financial malpractices can occur after hacking. 



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

## Why do We Need Odoo Security?


We are noticing an increase in unauthorised attacks and internet attacks with advanced technology. Odoo Security reduces the unauthorized process. Odoo Security helps protect employee details, client information, payments, and other documents that improve the trust of customers and reduce financial loss.

## Steps For Secure Data With Odoo Security-

**1. Access Contol:**

Odoo Security allows you to set up role-based access control and define what users and groups of users can do within the system. You can specify which modules, records, and fields are accessible to different roles.

**2. Data Encryption:**

Odoo uses secure protocols like HTTPS to encrypt data in transit. Data encryption ensures that information exchanged between the server and clients is encrypted and protected from interception.

**3. Inspect Your Domain:**

Odoo Security scans and inspects the domain for HTTPS security. It can also inspect whether you have set the master password. It defines access rules and security checks for all objects created on the server.

**4. Monitoring and Intrusion Detection:**

With Odoo Security, you can monitor and check system activity and set up intrusion detection to alert you to suspicious behavior.

## Conclusion:

As we discuss the many steps to secure data with Odoo Security, Odoo provides many security features and the responsibility for securing them. [Odoo Security](https://store.webkul.com/Odoo-Security-Scan.html) includes ensuring that the server, network, and configurations are appropriately set up for security.
Install NVM, Nodejs, Yarn, Python3, GCC, Nginx, Postgres on Centos 7
Published: 2023-09-21 11:57:23

These are the quick commands to install NVM, Nodejs, Yarn, Python3, Gcc, Nginx on Centos 7

##1. NVM
```
sudo yum install curl nano -y 
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash   
source ~/.bashrc
nvm install 16
```
##2. Yarn
```
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg
sudo yum install yarn -y
```
##3. Python 3

If you want to install sqlite on Centos7, you will need python3 and gcc
```
sudo yum install -y python3
```
##4. GCC
```
yum install gcc-c++ -y
yum install cmake -y
yum install centos-release-scl -y
yum install devtoolset-9 -y

scl enable devtoolset-9 bash
```
If you restart the shell, it will revert to GCC 4.8.5.
You can add `source /opt/rh/devtoolset-9/enable` into you bashrc file to set GCC 9 as the default.

##5. Nginx
```
sudo yum install -y epel-release
sudo yum install -y nginx
sudo systemctl start nginx
```
Config firewall
```
sudo yum install firewalld -y
sudo systemctl enable firewalld
sudo reboot
sudo firewall-cmd --state // check the firewall state
firewall-cmd --get-active-zones //check active zones

sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
sudo systemctl enable nginx
```

##6. PostgreSQL
Download:
```
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql15-server
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
sudo systemctl start postgresql-15
sudo systemctl enable postgresql-15
```

Setup password for user `postgres`
```
sudo passwd postgres
```
Open port 5432 to connect database from remote:
`nano /var/lib/pgsql/15/data/postgresql.conf`
```
listen_addresses = '*'
port = 5432	
```

Open firewall port:
```
firewall-cmd --zone=public --add-port=5432/tcp --permanent
firewall-cmd --reload
```

Open this file: `nano /var/lib/pgsql/data/pg_hba.conf` and add this line to end of file:
```
host  all  all 0.0.0.0/0 md5
```

Restart postgres
```
sudo systemctl restart postgresql-15
```
##7. Unzip
```
yum install -y unzip
```
পৃথিবীর সবচেয়ে সুন্দর ফুলের নামের তালিকা
Published: 2023-09-21 11:55:38

পৃথিবীর সবচেয়ে সুন্দর ফুলের নামের একটি তালিকা নিচে দেওয়া হল:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dz7646z06qr9fpaubfjx.png)
গাঁদা: গাঁদা একটি জনপ্রিয় ফুল। এর রঙের বৈচিত্র্যতা একে আরও আকর্ষণীয় করে তোলে।
গোলাপ: গোলাপকে ফুলের রানী বলা হয়। এর লাল রঙের ফুল সৌন্দর্যের প্রতীক হিসেবে পরিচিত।
পদ্ম: পদ্ম একটি পবিত্র ফুল। এর উজ্জ্বল রঙ ও সুগন্ধ মনকে শান্ত করে।
অর্কিড: অর্কিড তার বৈচিত্র্যময় রঙ ও আকার-আকৃতির জন্য বিখ্যাত।
বাগদাদী লিলি: বাগদাদী লিলির সুগন্ধ অনন্য। এর হলুদ রঙের ফুল মনকে আনন্দিত করে।
রজনীগন্ধা: রজনীগন্ধার সুগন্ধ রাতের বেলায় মনকে মাতাল করে তোলে।
চাঁপা: চাঁপার সুগন্ধ অতুলনীয়। এর সাদা রঙের ফুল সৌন্দর্যের প্রতীক হিসেবে পরিচিত।
জারবেরা: জারবেরা তার বৈচিত্র্যময় রঙের জন্য জনপ্রিয়।
এই সব [ফুলের ছবি](https://www.neotericit.com/2022/05/fuler-chobi.html) অনেক ওয়েবসাইটে পাওয়া যায় । 
এই তালিকায় শুধুমাত্র কিছু ফুলের নাম উল্লেখ করা হয়েছে। পৃথিবীতে আরও অনেক সুন্দর ফুল রয়েছে। মানুষের ব্যক্তিগত পছন্দের উপর ভিত্তি করে যেকোনো ফুলকেই বিশ্বের সবচেয়ে সুন্দর ফুল হিসেবে বিবেচনা করা যেতে পারে।
Cài đặt alias trong dự án React Native
Published: 2023-09-21 11:54:31

Alias là dạng import rút gọn trong các dự án React, giúp chúng ta có code nhìn đẹp hơn. Bạn có thể import dạng @components/Button thay vì ../../components/Button. Các bước để cài đặt alias trong ứng dụng React Native khá đơn giản.

##1. Cài đặt

```
yarn add --dev babel-plugin-module-resolver
```

##2. Setup babel.config.js

Định nghĩa các alias mà bạn sẽ sử dụng trong project, cái này sẽ giúp babel khi thông dịch code ts ra js thì sẽ hiểu dc các import alias.

```
module.exports = function (api) {
  api.cache(true);
  return {
    presets: ["babel-preset-expo"],
    plugins: [
      [
        "module-resolver",
        {
          alias: {
            utils: "./src/utils",
            screens: "./src/screens",
            components: "./src/components",
            recoilStates: "./src/recoil",
            navigator: "./src/navigator",
          },
        },
      ],
    ],
  };
};
```

##3. Setup tsconfig.json

Định nghĩa lại 1 lần nữa ở bên tsconfig.json, cái này giúp typescript server hiểu được các import alias khi development.

```
{
  "extends": "expo/tsconfig.base",
  "compilerOptions": {
    "strict": true,
    "baseUrl": "src",
    "paths": {
      "utils/*": [
        "utils/*"
      ],
      "components/*": [
        "components/*"
      ],
      "screens/*": [
        "screens/*"
      ],
      "recoilStates/*": [
        "recoil/*"
      ],
      "navigator/*": [
        "navigator/*"
      ]
    }
  }
}
```
##4. Done 😄

Hãy thử rebuild project của bạn và trải nghiệm, nhớ là mỗi khi thay đổi file babel.config.js thì bạn phải restart metro server nhé (react-native start —reset-cache hoặc expo start -c).
Global Presence with Strategic Data Centers
Tags: cloudcomputing, cloud, serverspace, cloudstorage
Published: 2023-09-21 11:52:46

As our global dependency on digital platforms continues to grow, the imperative for a resilient and strategically positioned data infrastructure is undeniable. At the forefront of this movement is Serverspace showcasing its commitment through its array of data centers located in key regions [around the globe](https://serverspace.us/about/blog/global-presence-with-five-strategic-data-centers/).

With [data centers](https://serverspace.us/about/blog/global-presence-with-five-strategic-data-centers/) spread across diverse geographical locations, data latency is significantly reduced, facilitating faster access and enhancing overall user interaction. Additionally, each geographical region possesses its unique data management regulations and standards.

[Serverspace’s](https://serverspace.us) wide-reaching footprint ensures meticulous compliance with regional norms, further cementing their position as a global leader. We created an article, where we unravel the intricacies of Serverspace’s data center network, located from New Jersey to Amsterdam and beyond. 


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

Discover the unique features, strategic benefits, and the advanced technologies that underscore our commitment to [global excellence](https://serverspace.us/about/blog/global-presence-with-five-strategic-data-centers/).

Read the full article now on [our website](https://serverspace.us/about/blog/global-presence-with-five-strategic-data-centers/)! 🔗
A simple trick to check how much Tailwind impacts the HTML size
Published: 2023-09-21 11:45:37

Follow these steps.

1. Go to any page that uses Tailwind.
2. Open the developer console.
3. Execute code `new Blob([document.documentElement.outerHTML]);`. Notice the returned number. It represents approximately the HTML size.
3. Execute code `Array.from(document.getElementsByTagName('*')).forEach((el) => { el.className = ''; })`. This removes all CSS classes.
4. Execute code `new Blob([document.documentElement.outerHTML])`. The number represents the HTML size after all CSS classes were removed.

[Calculate how much](https://www.calculatorsoup.com/calculators/algebra/percentage-increase-calculator.php) (%) the HTML size has increased.
Graphic Designing Courses in Multan
Published: 2023-09-21 11:24:45

Explore Graphic Designing Courses in Multan to unleash your creative potential. Learn design principles, master industry-standard software, and launch your career in this dynamic field. Join us to turn your passion for design into a profession.

For More Information Click Here:
**[Graphic Designing Courses in Multan](https://www.pnytrainings.com/graphic-design-courses-in-lahore)**
Effortless Project Discovery: Automating Jest Multi-Project Runs in Monorepos
Tags: jest, monorepo, automation
Published: 2023-09-21 11:22:21

At Woovi we have more than 6k automated tests.
We have 2 monorepos: one for the backend and another for frontend, just for historical reasons. We are going to merge them in the future.

Each package in a monorepo can have different test infrastructure requirements.
To make this possible we use Jest Multi-Project-Runner feature, which enables each package to define its own test configuration.
We can have a package that needs to use Node runtime, another that needs to run using jsdom, some packages that use elasticsearch.

## Automating the discovery of projects in a monorepo

Before automating the discovery of projects for Jest, we had something like this:

```jsx
module.exports = {
  projects: [
   '<rootDir>/packages/a/jest.config.js',
    '<rootDir>/packages/b/jest.config.js',
    '<rootDir>/packages/c/jest.config.js',
     ...
    '<rootDir>/packages/z/jest.config.js',
   ],
}
```

Our codebase and package number are growing fast.
To make sure we are testing every package, we decided to automate the project discovered based on our monorepo pattern

```jsx
const getWorkspaces = require('get-yarn-workspaces');

const cwd = process.cwd();
const pkg = require('./package.json');

const cleanWorkspaces = (workspace) => {
  const workspaces = pkg.workspaces || [];

  return workspaces.reduce((acc, w) => {
    const packagesPath = `${cwd}/${w.replace(/\/\*/g, '')}/`;

    return acc.replace(packagesPath, '');
  }, workspace);
};

const getProjects = () => {
  const workspaces = getWorkspaces();

  const pkgNames = workspaces.map((pkg) => cleanWorkspaces(pkg));

  return pkgNames.reduce(
    (acc, pkgName) => [...acc, `<rootDir>/packages/${pkgName}/jest.config.js`],
    [],
  );
};

module.exports = {
  projects: [...getProjects()],
}
```

The code above will find all packages in our monorepo, and automatically add them to our jest multi-project-runner configuration.
When a new package is added to our monorepo, we ensure they are part of our test suite.


## To Sum Up

When you have fewer packages or a small monorepo, this kind of automation or optimization does not make sense.
However, as you scale you need to add these to reduce the entropy to work in your codebase.

This simple optimization catch a few packages that had no tests at all, and we also make the template to create a new package to always contain a basic test setup.

---
Woovi
[Woovi](https://www.woovi.com) is a Startup that enables shoppers to pay as they like. To make this possible, Woovi provides instant payment solutions for merchants to accept orders.

If you want to work with us, we are [hiring](https://woovi.com/jobs/)!

---
Photo by <a href="https://unsplash.com/@yuyeunglau?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Yuyang Liu</a> on <a href="https://unsplash.com/photos/dp9Jrww_BRs?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Oulu University and Futurewei Technologies Unveil Algorithm for Optimizing 6G Communications in Dynamic Metaverse Environments
Tags: ai, machinelearning, metaver, news
Published: 2023-09-21 11:17:26

Researchers from Oulu University and Futurewei Technologies have unveiled CL-DDQL, an Adaptive AI algorithm designed to optimize 6G communications within the rapidly changing Metaverse. Utilizing Deep Reinforcement Learning (DRL) and Continual Learning (CL), the algorithm outperforms existing technologies in multi-channel environments by making real-time decisions that maximize throughput and reduce convergence times. Tested extensively through numerical simulations, CL-DDQL showed improvements in throughput, collision rate, and adaptability to frequent context changes, making it ideal for dynamic Metaverse applications. The team’s future work aims to extend the algorithm’s capabilities to non-stationary channels and semantically-aware scenarios.

Read the full story — https://news.superagi.com/2023/09/21/oulu-university-and-futurewei-technologies-unveil-algorithm-for-optimizing-6g-communications-in-dynamic-metaverse-environments/
Reinforcement Learning with TEXT2REWARD’s Automated Reward Function Design Using Advanced Language Models
Tags: llm, news, ai, machinelearning
Published: 2023-09-21 11:14:04

Researchers have developed TEXT2REWARD, a groundbreaking framework that uses large language models (LLMs) to automate the design of reward functions in reinforcement learning (RL). The framework takes a natural language description of a goal and generates an executable program to interpret that goal, offering a convenient alternative to traditional, domain-specific methods. Tested on robotic manipulation and locomotion benchmarks, TEXT2REWARD consistently outperformed or matched expert-designed reward functions. The framework also emphasizes iterative refinement through human feedback and has been successfully deployed in real-world robotic simulations. Despite a 10% error rate, largely due to syntax or shape mismatches, TEXT2REWARD signals promising advancements in the intersection of RL and LLMs.

Read the full story — https://news.superagi.com/2023/09/21/reinforcement-learning-with-text2rewards-automated-reward-function-design-using-advanced-language-models-2/
Breakthrough ‘Retrieve-Rewrite-Answer’ Framework Enhances Question Answering in Large Language Models
Tags: llm, ai, machinr, chatgpt
Published: 2023-09-21 11:10:44

Researchers have developed a novel “Retrieve-Rewrite-Answer” framework to improve the performance of large language models (LLMs) in Knowledge Graph Question Answering (KGQA). The three-stage approach first fetches pertinent Knowledge Graph (KG) data, then converts it into well-textualized statements, which are finally used for answering complex questions. Unique features include an “answer-sensitive” KG-to-Text methodology and an automatic corpus generation method using ChatGPT, addressing issues like data scarcity. Rigorous testing against various benchmarks and existing LLMs revealed that the framework consistently outperforms existing methods, particularly excelling with the T5 model.

Read the full story — https://news.superagi.com/2023/09/21/breakthrough-retrieve-rewrite-answer-framework-enhances-question-answering-in-large-language-models/