teleren/devto huggingface dataset:
If , else , else if .
Tags: beginners, programming, tutorial, cpp
Published: 2023-03-24 09:20:41

Salom dasturchi bugun siz bilan dasturlashda if else va else if dan foydalanishni ko'rib chiqamiz . Bugun siz u nima , nimaga kerak , qanday vaziyatlarda kerak bo'lishi haqida bilib olasiz va bularni ko'd orqali ko'rib chiqamiz . 

C ++ da  if - tarjimasi agar . Agar nimadir qilish kerak bo'lganda ishlatamiz . Buni ko'd orqali ko'rib chiqamiz . 



```
#include iostream 
using name space std ;
int main() {
int M , N ;
cin >> M >> N ;
if ( M > N ) {
cout << M ; 

}
return 0 ;
```


// Bu yerda biz kiritgan ikta sonni kattasini aniqlab chiqarish dasturi tuzilgan . 

Biz if ni o'zini emas else bilan yoki else if bilan ishlatishimiz mumkin . 
Aslida else - tarjimasi aks holda buni ko'd orqali ko'rishingiz mumkin . 

```
#include iostream 
using name space std ;
int main() {
int M , N ;
cin >> M >> N ;
if ( M > N ) {
cout << M ; 
else cout << N ;
```
 // Bundan oldingi ko'dda faqat birinchisi katta mi yo'qmi tekshiradi . Bunda esa qaysi biri katta bo'lsa o'shani chiqaradi . 

if else shart berayotganda juda ham ko'p kerak bo'ladi . Masalan shu shu ish bo'lganda shu ishni bajar unday bo'lmasa buni chiqar kabi narsalarda ishlatishimiz mumkin bo'ladi . 

Bugun if else haqida ko'p narsalarni bilib oldingiz degan umiddaman . Keyingi maqolalarimizgacha ko'rishguncha dasturchi .
What is Security Awareness Training?
Tags: security, securityawareness, tutorial
Published: 2023-03-24 09:17:49

Let’s start with a clear understanding of the three different types of learning activities that organizations use, whether for information security or for any other purpose:

Education: The overall goal of education is to help learners improve their understanding of these ideas and their ability to relate them to their own experiences and apply that learning in useful ways.
Training: Focuses on building proficiency in a specific set of skills or actions, including sharpening the perception and judgment needed to make decisions as to which skill to use, when to use it and how to apply it. Training can focus on low-level skills, an entire task or complex workflows consisting of many tasks.
Awareness: These are activities that attract and engage the learner’s attention by acquainting them with aspects of an issue, concern, problem or need.
You’ll notice that none of these have an expressed or implied degree of formality, location or target audience. (Think of a newly hired senior executive with little or no exposure to the specific compliance needs your organization faces; first, someone has to get their attention and make them aware of the need to understand. The rest can follow.)
How to Apply Stroke Effects to Text in Jetpack Compose
Tags: programming, android, mobile, beginners
Published: 2023-03-24 09:17:42

Jetpack Compose recently added many new customization options to TextStyle and **TextStyle.drawStyle** is one of them. Using this, we can apply stunning stroke effects to text in Jetpack Compose.

In this blog post, we’ll explore how to use **DrawStyle API **to create unique and creative stroke effects for texts.

## Table of Contents

- Draw Simple outlined text
- Draw round-corner outlined text
- Draw dash stroke
- Draw the outline with multiple path effects
- Draw the double outlines
- Draw Gradient outline
- Draw outlines with shapes
- Example 1 - Curved outline
- Example 2 - Heart shaped outline
- Conclusion

Let's get started.

We’ll use **Stroke** drawStyle, which provides information for drawing content with a stroke.
Let’s first look at what we have in **Stroke** API,

```
class Stroke(
    val width: Float = 0.0f,
    val miter: Float = DefaultMiter,
    val cap: StrokeCap = DefaultCap,
    val join: StrokeJoin = DefaultJoin,
    val pathEffect: PathEffect? = null
) : DrawStyle() { }
```

- **width** — Configure the width of the stroke in pixels
- **miter** — Set the stroke miter value. This is used to control the behavior of miter joins when the joins angle is sharp. This value **must be >= 0**
- **cap** — Return the paint’s Cap, controlling how the start and end of stroked lines and paths are treated. The default is **StrokeCap.Butt**
- **join** — Set the treatment where lines and curve segments join on a stroked path. The default is **StrokeJoin.Miter**
- **pathEffect** — Effect to apply to the stroke, null indicates a solid stroke line is to be drawn

For all the examples with source code, check out [canopas blog](https://blog.canopas.com/how-to-apply-stroke-effects-to-text-in-jetpack-compose-b1c02c9907bd).
Millions record query - with and without index
Tags: postgres, sql
Published: 2023-03-24 09:11:54

Just found out the movie page imdb database on [imdb](https://www.imdb.com/interfaces/)
It's a large dataset that contains Movie information use PosgresSQL

Quickly import the name_basics table, curious about what it looks like

![image](https://pdminhdev.s3.ap-southeast-1.amazonaws.com/blog/Screenshot%202023-03-24%20at%2015_1679644541254.07.32.png)

A simple table with People's names and some other information

Count the table return **12.382.531** records, but what makes me surprise is table has no primary key or index

Wow, it will take a long time to search...

Right away try to search for my favorite actor [Jean Reno](https://www.imdb.com/name/nm0000606/?ref_=nv_sr_srsg_0), think about taking a coffee in the waiting time (find one in 12 million)

```sql
SELECT *
    FROM name_basics
WHERE "primaryName" = 'Jean Reno'
  AND "primaryProfession" = 'actor';
```

The result is another surprise
> 1 row retrieved starting from 1 in 923 ms (execution: **908 ms**, fetching: 15 ms)

Is it because the table is simple? Or postgres has some cache?
Query a non-index text field in 12 million just take 1 second

What do we need index for? This is a really good performance

But I also want to see how performance go with index, so I add a simple index on **primaryName** field

```sql
create index "primaryName_index" on name_basics ("primaryName");
```

And re-try the select query
> 1 row retrieved starting from 1 in 34 ms (execution: **6 ms**, fetching: 28 ms)

![image](https://media.giphy.com/media/d4blalI6x2oc4xAA/giphy.gif)

It's a huge different 900ms vs 6ms (for SQL execute), **150 times faster without index**

#### Conclusion
The Index is magic! but it is not free, when query for index size
```sql
SELECT i.relname "Table Name",indexrelname "Index Name",
 pg_size_pretty(pg_total_relation_size(relid)) As "Total Size",
 pg_size_pretty(pg_relation_size(relid)) as "Table Size",
 pg_size_pretty(pg_indexes_size(relid)) as "Index Size",
 reltuples::bigint "Estimated table row count"
 FROM pg_stat_all_indexes i JOIN pg_class c ON i.relid=c.oid
 WHERE i.relname='name_basics'
```

![image](https://pdminhdev.s3.ap-southeast-1.amazonaws.com/blog/Screenshot%202023-03-24%20at%2015_1679647135965.51.01.png)

It takes ~ 400MB storage (a single-column index)
 and also memory when processing.

Anyway, the performance it brings is no doubt.

**[UPDATE]**
After some research, I found some tips about performance

>What is a good latency for API?
Generally, APIs that are considered high-performing have an average response time **between 0.1 and one second**. At this speed, end users will likely not experience any interruption. **At around one to two seconds, users begin to notice some delay**.

So take one second only for query database is a **need to improve**

My machine: Apple M1, Postgres 11 on docker
IF
Tags: beginners, programming, cpp, aboba
Published: 2023-03-24 09:09:11


Tabii, C++ dasturlash tilida "if" nuqtai nazaridan nima deyilishini tushunish uchun quyidagi misollarga e'tibor bering:

C++ tilida "if" yordamni shart operatori bilan (Boolean logic operators) ishlatish mumkin. Quyidagi shart operatorlari ishlatiladi:

< (kichikcha)
(kattacha)

<= (kichik yoki teng)
= (katta yoki teng)

== (teng)
!= (teng emas)
"If" operatori bir vaqtning o'zida, "else" operatori bilan birga ishlatiladi. "If" operatori ko'rsatilgan shartga to'g'ri kelganda, kod to'g'ri qismiga o'tadi. Aks holda, "else" qismiga o'tadi. Misol uchun:

#include <iostream>

using namespace std;

int main() {
   int a = 10;  // O'zgaruvchi a qiymati 10 ga teng.
 
   // "if" operatori bilan shart tekshiriladi
   if( a < 20 ) {
      // Agar shart to'g'ri kelganda, ushbu qism ishga solinadi
      cout << "a 20 dan kichik\n";
   } else {
      // Aks holda, ushbu qism ishga solinadi
      cout << "a 20 dan katta yoki teng\n";
   }

   cout << "a ning qiymati " << a << " ga teng\n";

   return 0;
}
Ushbu kod davomida, "a" o'zgaruvchisining qiymati 20 dan kichik o'lganligi tekshiriladi. Agar bu shart to'g'ri bo'lsa, konsolga "a 20 dan kichik" matnini chiqaradi; aks holda "a 20 dan katta yoki teng" deb yoziladi. İkkinchi qismida esa, "a" o'zgaruvchinining qiymati konsolga chiqariladi.

Umid qilamiz, bu yordamli bo'lib sizga C++ dasturlash tilida "if" ni qanday ishlatish kerakligini tushuntirgan bo'lishimiz.
CHATBOT Built with Nodejs and Telegram as the user interface
Published: 2023-03-24 09:08:48

This chatbot was created with Node.js and is intended to have conversations with users. Users must provide particular input in order for it to function.

##Prerequisites
You will be required to have Node JS and npm before starting. Make sure you already have them installed. If not you can find them here: https://nodejs.org. Additional tools like Mongodb and Render(for deployment), were utilized. If you'd want more specific instructions on how to use these tools, please refer to their documentation.


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

##Packages and Tools

To get started you will need to Register a Bot Account

You'll need a Telegram user account before you can create a Telegram bot. Head over to https://telegram.org/ and create an account if you don't already have one.

When you've signed in to Telegram, search for "BotFather" (a bot for managing all other Telegram bots) and start a new chat with it. Follow the steps below to register a new bot with the BotFather:



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



The BotFather will respond with a message containing an access token for your newly created bot. This access token will allow our application to access the Telegram API and tell our bot what to do when receiving different messages from users.

To confirm that your bot was created successfully, search for the bot's username. You should be able to see it and start a conversation with it, although it won't respond as we haven't written the bot's logic yet.

Refer to the readme file to set up the development environment https://github.com/dhamolahedonist/Jumia-Food-Telegram-Bot


The application makes use of a number of packages, including Mongoose and Telegraf. Please refer to the documentation provided with these packages for specific usage instructions.

Telegraf as a library  was adopted to be able to develop our own app using javascript.refer to the documentation https://telegraf.js.org/#features

Mongoose is the preferred ORM to communicate with the database because we are using MongoDB

##Folder Structure
##Controller

1. The stepsControllers.js file handles all the responses based on the user input
2. The userControllers.js file look for the user; if none was found, a new user is created and the step the user is currently on is updated.
3. Both the stepsControllers and the userControllers file are complied in the webhookController.js file which is now compiled in the index.js file

##db.js
All user and blog data is kept in the mongdb database, which is connected to using db.js.

##.env.example
environment variable offers all the configuration-related data needed.

##index.js
All of the application's files are combined into one file called index.js.

##Deployement on Render.
Refer to the documentation on how to deploy on ##Render
https://render.com/docs
10- A detailed tutorial on improving the visual representation of vector layers in PyQGIS
Tags: programming, python, pyqgi
Published: 2023-03-24 09:05:28

--- series: A beginner's guide to using Python with QGIS ---
Tired of dull and unattractive vector layers in PyQGIS? Look no further! In this step-by-step guide, we'll show you how to enhance the appearance of your vector layers using simple markers. From adjusting the size of the circles to changing the color of the symbols, you'll be able to create visually stunning maps in no time. So grab your data and let's get started! And don't forget to subscribe to our channel for more helpful content.

To begin, you'll need to download the data that we'll be using from this link: [**data**](https://github.com/Azad77/Python_qgis/blob/main/Data/KRG_Cities.zip).

Next, you'll need to load the point type shapefile. To change the size of the circle, use the following code:

```python
uri = "D:/Python_QGIS/data/KRG_Cities.shp"
vlayer = iface.addVectorLayer(uri, "KRG_Cities", "ogr")
```

Change the size of the circle:

```python
>>> vlayer.renderer().symbol().setSize(8)
>>> vlayer.triggerRepaint()
```

To change the color of the symbol, use the following code:

```python
>>> vlayer.renderer().symbol().setColor(QColor("green"))
>>> vlayer.triggerRepaint()
```

To change the circles to other symbols, use this code:

```python
>>> vlayer.renderer().symbol().symbolLayer(0).setShape(QgsSimpleMarkerSymbolLayerBase.Pentagon)

>>> vlayer.triggerRepaint()
```

The overall code is:

```python
# Load the point type shapefile
uri = "D:/Python_QGIS/data/KRG_Cities.shp"
vlayer = iface.addVectorLayer(uri, "KRG_Cities", "ogr")

# Change the size of the circle
vlayer.renderer().symbol().setSize(8)
vlayer.triggerRepaint()

# Change the color of the symbol
vlayer.renderer().symbol().setColor(QColor("green"))
vlayer.triggerRepaint()

# Change the circles to other symbols
vlayer.renderer().symbol().symbolLayer(0).setShape(QgsSimpleMarkerSymbolLayerBase.Pentagon)
vlayer.triggerRepaint()
```

In summary, this step-by-step guide provides a simple yet effective way to enhance the appearance of vector layers in PyQGIS using markers. By following the instructions provided, users can easily change the size and color of symbols to create visually stunning maps.

> If you like the content, please [SUBSCRIBE](https://www.youtube.com/channel/UCpbWlHEqBSnJb6i4UemXQpA?sub_confirmation=1) to my channel for the future content
位置情報連動型ゲームRebase（リベース）の始め方等に関する解説記事を公開しました
Published: 2023-03-24 09:02:33

fillメディア編集部では、位置情報連動型ゲームとして話題のRebase（リベース）に関して、簡単な解説記事を公開致しました。

[Rebase（リベース）の始め方－ルートボックス収集が楽しい位置情報連動型のNFTゲーム](https://social-lending.online/nft-games/rebase/how-to-start-rebase/)

以下、記事全文をお読み頂くお時間の無い方に向けて、記事内容の一部要約をお届けいたします。

## ■Rebase（リベース）アプリの入手
Rebase（リベース）のアプリは、ios版（テストフライト）、アンドロイド版、それぞれ、記事内に掲載してあるURLから入手することが可能です。
なお、ios版の利用に先立っては、テストフライトアプリの入手が必要です。

## ■アクティベーション・コードの入力
fillメディア編集部にてRebaseアプリを入手した際には、アカウント作成にあたり、アクティベーション・コードの入力が必要でした。

アクティベーション・コードの入手方法等については、Rebaseの公式チャンネル等をご確認下さい。

## ■Rebaseアプリのホーム画面
Rebaseのホーム画面中央には、ゲーム内で使用する「バックパック」が表示されています。
このバックパックが、

・STEPNの「スニーカー」
・（同じような位置情報連動ゲームの）ユリバースの「Yuli」

のようなもの（※ディテールは異なります）に相当します。
※バックパックのレベル上げ等が可

## ■レーダー起動で位置情報連動ゲーム（エクスプローラ）開始
ホーム画面下部の「Explore」をタップし、レーダーを起動することで、位置情報連動型ゲームを始めることが出来ます。

「Battery」は、1つで5分間の探索活動に相当します。
バッテリー回復は結構速く、数時間で全回復するようです。

## ■まずは、地図上の「六角形」を目指す
ひとまず最初は、地図上で、自分の近くに表示されている「六角形」を目指します。
※周辺の環境や交通には、十分な注意が必要です。

六角形をレーダーの範囲内に収めると、「アイテム」アイコン等に変化します。

## ■破線円にアイコンを収めると獲得可
アイテムに近づいていき、自分の周囲に表示された、「破線」で描かれた円の中に、アイコンを収めることが出来れば、アイテムをタップで獲得できます。

そうして収集したアイテム等を利用して、前述の「バックパック」の強化等を行うことが出来る仕組みです。

まだまだ初見に近い状態ですが、プレイしてみた感じとしては、ユリバースと似ている印象です。
現状、アクティベーション・コードを入手出来れば、アプリ内でNFT等を購入せずとも、プレイが出来る模様です。

引き続き、バックパックのレベル上げ等、プレイを継続してみたうえで、続報お知らせします。
The place where you can create your Own NFT Game development services
Tags: nft, game, nftgame
Published: 2023-03-24 09:02:08

Our NFT gaming development services assist you in creating your own NFT game and providing your players with an immersive gaming experience. We specialize in developing one-of-a-kind and engaging NFT games in which players can buy, sell, and trade digital assets. Contact us today to find out more about our [NFT gaming development](https://shamlatech.com/nft-gaming-platform-development/) services and how we can assist you in creating your own NFT game.
IF OPERATOR
Published: 2023-03-24 09:01:39

#include <iostream>
using namespace std;

int main() {
    int a = 5;
    if(a == 5) {
        cout << "Bu mening birinchi maqolam.";
    }
    return 0;
}
Bu dastur "a" o'zgaruvchisi "5" ga teng bo'lganda "Bu mening birinchi maqolam." matnini chiqaradi. Shuningdek, siz "else" qismida yoki "else if" qismiga foydalanib, boshqa shartlar uchun boshqa maqolalar yozishingiz mumkin.
Universe - The Ultimate Mobile Website Builder
Tags: programming, tutorial, nocode, universe
Published: 2023-03-24 08:53:36

Nothing beats doing things far away from the norm and doing well while at it. How would you feel if you were able to create a complete functional website on your phone without having to write any code. 

Introducing **UNIVERSE**- a no-code website builder. 

So I came across Universe while doing my usual surfing through the internet. It was incredible what I saw. 

Tested and Trusted! 

I built a complete website in less than a minute on my mobile phone, without writing any code and guess what, it comes with a free domain name. 

**PREREQUISITES** 

- Have a Mobile Phone, lol 

- Nothing else 🤷‍♂️, just with your mobile phone you already have a website on Universe 

**GETTING STARTED** 

Log on to [universe](https://onuniverse.com/), you will be required to create an account. Creating an account is very seamless too, you don’t have to go through the hurdles of signing up, signing in and all what nots. Just input your email address and desired password and you are in. 


![Universe Login Page ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u138vlelu5sadoxf8tjp.jpeg)


Using Universe on WebApp 

After successfully signing in to the universe homepage, you will be prompted to choose between trying universe on a Web App, or downloading the application on the App Store for users with iOS operating systems. 

Anyone including Android users and Personal Computers can use the Web App.

I tried the option of Web Application, and was immediately directed to the domain page. 

**Creating a Domain**

Next, you are asked to create a unique website address on the search bar. As you type your desired domain name, the boxes indicates addresses that are free, unavailable and others that are to be paid for. Universe free domains are usually in “.uni.ver.se” sounds cool right… 

Well for mine, I chose “techg.uni.ver.se”. 

**Templates**.

Next, you are directed to a list of web templates available to choose for… Some are important for Portfolios, others for listing websites, e-commerce and whatever you like. Choose your desired Template. 

**Edit Templates**

All that is required here is to edit the text, background colours, text colours, add/delete images, add links, add/delete rows to what you desire your web page to look like. With just a tap on the text or row, you can simply edit your universe project to your desired taste. 

**Publish** 
Tap on the publish button to make your site live. As simple as that.

**Edit Page**
If you want to edit your site, you can do that [here](https://web.univer.se/sites)

Universe is perfect for portfolios, e-commerce website and generally static website. 

However, I hope Universe can roll out more features including making this amazing product available on the Google play store.

Here’s [something](https://techg.univer.se/) I created with Universe.
Building a Better Future with FusionHit's Software Development in Costa Rica
Published: 2023-03-24 08:50:16

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

FusionHit is a **[software development company in Costa Rica](https://www.fusionhit.com/)** dedicated to building a better future for businesses worldwide. Their team of expert developers, designers, and project managers work tirelessly to create custom software solutions that help businesses streamline their operations, improve productivity, and stay ahead of the competition.

At FusionHit, they understand that technology is a key driver of innovation and growth in today's business landscape. That is why they focus on delivering high-quality software solutions to impact their client's business processes significantly. They use the latest development tools and techniques to ensure their software products are up-to-date, secure, and efficient.

FusionHit's team is committed to providing exceptional service to its clients. They take the time to understand their client's needs and work closely with them to develop software solutions that meet their specific requirements. They provide various software development services, including web development, mobile app development, integration, and testing. They also offer post-launch support and maintenance to ensure their clients' software products are always up and running.

In addition to its software development services, FusionHit is dedicated to promoting innovation and technology in Costa Rica. They actively participate in local tech events and offer internships and training programs to aspiring developers and designers.

In summary, FusionHit is a software development company in Costa Rica committed to building a better future for businesses worldwide. With their focus on quality, customer satisfaction, and technological innovation, they are a trusted partner for businesses looking to leverage the power of technology to achieve their goals.
NEW: Manage your developers' wellbeing better
Published: 2023-03-24 08:40:09

In recent years, I noticed a silent and often neglected trend taking root at many startups and tech companies — software developer burnout. 

I personally witnessed its effects with resignations caused by stress and overwork. I never really knew how to start the conversation to find out how I could help. So, I created ‘hay for Slack’, a simple and unintrusive way to check up on your developers’ happiness and job satisfaction.

I’m thrilled to share my creation with you on Product Hunt today and would greatly appreciate your support with an upvote and your feedback here 👉🏽 https://www.producthunt.com/posts/hay-for-slack 👈🏽

Here are ‘hay for Slack’s’ benefits: 

✅ Run short wellbeing surveys in Slack. Only 5 seconds to fill out. No need to switch contexts.
✅ Get automated alerts about your developers’ wellbeing.
✅ Foster a culture of honesty, engagement, and open communication.
✅ Detect burnout before it impacts productivity, or you lose your best coders.
✅ Have meaningful conversations that help your developers stay balanced, focused, and happy.

You can also check out hay for Slack here: https://howareyou.work/slack/