teleren/devto huggingface dataset:
Top Spoken English Apps in India: Enhance Your English Speaking Skills !
Published: 2024-05-08 17:36:45

[TreeEng](https://www.treeeng.com) stands as a leading choice for learners seeking a comprehensive, effective, and free [English speaking course](https://www.treeeng.com/blog/english-speaking-course-online-free.html) in India. Designed to accommodate both beginners and advanced learners, TreeEng enhances [English speaking](https://www.treeeng.com/blog/best-english-speaking-practice-app-for-2024.html) proficiency through a dynamic and engaging platform that promotes fluency in real-world conversations.

**Explore TreeEng’s Exceptional Features.**

- Unlimited Free English Speaking with Strangers: Engage in spontaneous spoken English conversation to improve fluency and basic English conversation skills.
- Free Peer-to-Peer Conversation: Learn and grow with learners from around the globe, practicing basic English speaking through buddy talk and conversation in English for speaking.
- Free Real Conversation Practice: Mimic real-life interactions to boost your confidence, perfect for those seeking [spoken English for beginners](https://www.treeeng.com/blog/best-free-spoken-english-for-beginners.html) and advanced learners alike.
- Expert English Coaching: Receive personalized guidance to refine your speaking abilities, utilizing English speaking practice exercises and targeted feedback to help you speak English conversation more fluently.

**Why TreeEng is the Best Choice for Learning English?
**
- All-Inclusive Learning: From basic English conversation for beginners to advanced spoken English practices, TreeEng covers all aspects of language learning.
- Interactive Speaking Practice: Engage with native speakers and learners globally, improving your spoken English through [real English conversations](https://www.treeeng.com/blog/ultimate-guide-to-mastering-english-conversation-for-business-success.html).
- Customizable Learning Experience: The app adapts to your learning style with tailored exercises and feedback to help you speak English fluently.
- Expert Coaching: Get live feedback from English speaking experts, allowing you to refine your speaking skills effectively.

**Conclusion**
TreeEng is equipped with state-of-the-art features designed to make [learning English](https://www.treeeng.com/blog/best-english-learning-app.html) as easy and enjoyable as possible.
Join thousands of learners who have chosen TreeEng to enhance their English speaking skills. [Download TreeEng](https://play.google.com/store/apps/details?id=com.treeeng) now and start your journey to fluency with the [best English speaking practice app](https://www.treeeng.com/blog/how-to-practice-english-speaking-at-home.html) in India!
1. Two Sum
Tags: php, leetcode, algorithms, programming
Published: 2024-05-08 17:25:15

1\. Two Sum

Easy

Given an array of integers `nums` and an integer `target`, return _indices of the two numbers such that they add up to `target`_.

You may assume that each input would have **_exactly_ one solution**, and you may not use the _same_ element twice.

You can return the answer in any order.

**Example 1:**

- **Input:** nums = [2,7,11,15], target = 9
- **Output:** [0,1]
- **Explanation:** Because nums[0] + nums[1] == 9, we return [0, 1]. 

**Example 2:**

- **Input:** nums = [3,2,4], target = 6
- **Output:** [1,2] 

**Example 3:**

- **Input:** nums = [3,3], target = 6
- **Output:** [0,1] 

**Constraints:**

- <code>2 <= nums.length <= 10<sup>4</sup></code>
- <code>-10<sup>9</sup> <= nums[i] <= 10<sup>9</sup></code>
- <code>-10<sup>9</sup> <= target <= 10<sup>9</sup></code>
- **Only one valid answer exists.**

**Follow-up:** Can you come up with an algorithm that is less than <code>O(n<sup>2</sup>)</code> time complexity?

**Solution:**

```
class Solution {

    /**
     * @param Integer[] $nums
     * @param Integer $target
     * @return Integer[]
     */
    function twoSum($nums, $target) {
        $ind = [];
        for ($i = 0; $i < count($nums); ++$i) {
            $complement = $target - $nums[$i];
            if (array_key_exists($complement, $ind)) {
                return [$ind[$complement], $i];
            }
            $ind[$nums[$i]] = $i;
        }
        return [-1, -1];
    }
}
```


**Contact Links**

- **[LinkedIn](https://www.linkedin.com/in/arifulhaque/)**
- **[GitHub](https://github.com/mah-shamim)**
506. Relative Ranks
Tags: php, leetcode, algorithms, programming
Published: 2024-05-08 17:24:58

506\. Relative Ranks

Easy

You are given an integer array `score` of size `n`, where `score[i]` is the score of the <code>i<sup>th</sup></code> athlete in a competition. All the scores are guaranteed to be **unique**.

The athletes are **placed** based on their scores, where the <code>1<sup>st</sup></code> place athlete has the highest score, the <code>2<sup>nd</sup></code> place athlete has the <code>2<sup>nd</sup></code> highest score, and so on. The placement of each athlete determines their rank:

- The <code>1<sup>st</sup></code> place athlete's rank is `"Gold Medal"`.
- The <code>2<sup>nd</sup></code> place athlete's rank is `"Silver Medal"`.
- The <code>3<sup>rd</sup></code> place athlete's rank is `"Bronze Medal"`.
- For the <code>4<sup>th</sup></code> place to the <code>n<sup>th</sup></code> place athlete, their rank is their placement number (i.e., the <code>x<sup>th</sup></code> place athlete's rank is <code>"x"</code>).

Return an array `answer` of size `n` where `answer[i]` is the rank of the <code>i<sup>th</sup></code> athlete.

**Example 1:**

- **Input:** score = [5,4,3,2,1]
- **Output:** ["Gold Medal","Silver Medal","Bronze Medal","4","5"]
- **Explanation:** The placements are [1<sup>st</sup>, 2<sup>nd</sup>, 3<sup>rd</sup>, 4<sup>th</sup>, 5<sup>th</sup>]. 

**Example 2:**

- **Input:** score = [10,3,8,9,4]
- **Output:** ["Gold Medal","5","Bronze Medal","Silver Medal","4"]
- **Explanation:** The placements are [1<sup>st</sup>, 5<sup>th</sup>, 3<sup>rd</sup>, 2<sup>nd</sup>, 4<sup>th</sup>].

**Constraints:**

- <code>n == score.length</code>
- <code>1 <= n <= 10<sup>4</sup></code>
- <code>0 <= score[i] <= 106<sup>6</sup></code>
- All the values in `score` are **unique**.

**Solution:**

```
class Solution {

    /**
     * @param Integer[] $score
     * @return String[]
     */
    function findRelativeRanks($score) {
        $n = count($score);
        $ans = array_fill(0, $n, "");
        $indices = range(0, $n - 1);

        usort($indices, function($a, $b) use ($score) {
            return $score[$a] > $score[$b] ? -1 : 1;
        });

        for ($i = 0; $i < $n; $i++) {
            if ($i == 0) {
                $ans[$indices[0]] = "Gold Medal";
            } elseif ($i == 1) {
                $ans[$indices[1]] = "Silver Medal";
            } elseif ($i == 2) {
                $ans[$indices[2]] = "Bronze Medal";
            } else {
                $ans[$indices[$i]] = strval($i + 1);
            }
        }

        return $ans;
    }
}
```


**Contact Links**

- **[LinkedIn](https://www.linkedin.com/in/arifulhaque/)**
- **[GitHub](https://github.com/mah-shamim)**
RECOVER LOST INVESTMENT WITH TRUST GEEK HACK EXPERT
Tags: webdev, professional, hackers
Published: 2024-05-08 17:22:02

Hats off to the amazing success of (TRUSTGEEK HACK EXPERT)  in recovering my lost Bitcoin fortune worth $45,000! I had made some poor security decisions early on as a cryptocurrency investor and ended up losing the keys to my Bitcoin wallet, locking myself out with no way to access my funds. I was devastated thinking my money was gone forever. Out of desperation, I started looking into data recovery services and found (TRUSTGEEK HACK EXPERT)  which specializes in retrieving lost cryptocurrency wallets. Their experts fully explained the process and risks to me upfront, and thanks to their sophisticated techniques and perseverance, they were miraculously able to recover my lost Bitcoin wallet!  I am still in disbelief that I have full access to my Bitcoin again after accepting it was gone. The relief I feel having this life-changing amount of money back is indescribable.(TRUSTGEEK HACK EXPERT)  went above and beyond to crack my case. Their custom decryption methods and refusal to give up are truly remarkable. I cannot give enough praise to the dedicated team that worked diligently on extracting my lost wallet. The whole experience was handled so professionally and their customer service was exemplary. I now have my substantial Bitcoin investment back under my control thanks to their expertise. Contact  To learn more about (TRUSTGEEK HACK EXPERT) communicate through Web https-trustgeekshackexpert.com/  -  ID Telegram: Trustgeekshackexpert ? (TRUSTGEEK HACK EXPERT)  has my highest recommendation for their unprecedented success at the extremely challenging task of resurrecting lost cryptocurrency wallets. Their services are unmatched and well worth the fees. I will be forever grateful to them. The journey from loss to recovery is a testament to resilience and redemption. Reflecting on this experience can provide valuable insights and inspire a renewed approach to managing digital assets. Do not let time go any further, 

Greetings to everyone reading this article.
![Uploading image](...)
C# dasturlash tilining umumiy ko'rinishi (yohud Main methodi haqida)
Tags: csharp, dotnet, intro
Published: 2024-05-08 17:15:21


**S:** `Main` nima desa ?       
**J:** Bu method hisoblanadi.
**S:** O'zi method nima desangiz ?
**J:** Method - Function deb ham atasak bo'laveradi. Barcha dasturlash tillarida deyarli bir xil hisoblanadi, Syntaxdan tashqari faqat. 
Methodlar 2 turga bo'linadi qiymat qaytaradigan va qiymat qaytarmaydigan methodlar. Methodlar bizga kodni chiroyli va kamroq yozishimisiz uchun xizmat qiladi. Misol uchun bir method yozib uni dasturni istalgan joyida chaqirib ishlatishimiz mumkin.
`Main` method bu dasturning bajariladigan kirish nuqtasi hisoblanadi. Va shuningdek chiqish nuqtasi ham `Main` orqali amalga oshiriladi.
`Main` Class yoki Struct ichida yoziladi. Va shu o'rinda static bo'lishi kerak. Public yoki Private bo'lishi esa siz tuzayotgan dastur talabiga bo'liq(istagancha😉). 
`Main` doim `void` orqali o'zi qiymati chiqarishidan tashqari qiymat ham qaytara oladi. Misol uchun qanday tiplarda qiymat qaytaradi desangiz  >>  `int`, `double`, `decimal`, `bool`, `char`, `string` va hokazo. 
`Main` methodi o'z ichiga parametr olishi ham olmasligi ham mumkin. Agar u parametr olsa code bunday holda bo'ladi >> static 

```
void Main(string[] args)
{
        Console.WriteLine("Hello dev.to");
}
```

Method buyruq qatori argumentlarini o'z ichiga olgan parametr Main bilan yoki parametrsiz e'lon qilinishi mumkin . string[] Windows ilovalarini yaratish uchun Visual Studio dan foydalangan holda siz parametrni qo'lda qo'shishingiz yoki buyruqlar qatori argumentlarini olish uchun GetCommandLineArgs() usulidan foydalanishingiz mumkin. Parametrlar nol indexli buyruq qatori argumentlari sifatida o'qiladi. C va C++ dan farqli o'laroq, dastur nomi massivdagi birinchi buyruq qatori argumenti sifatida ko'rib chiqilmaydi , lekin u GetCommandLineArgs()args usulining birinchi elementi hisoblanadi .


**Pastda `Main` turlarini ko'rishingiz mumkin**

```public static void Main() { }
public static int Main() { }
public static void Main(string[] args) { }
public static int Main(string[] args) { }
public static async Task Main() { }
public static async Task<int> Main() { }
public static async Task Main(string[] args) { }
public static async Task<int> Main(string[] args) { }```


Tushuntira oldimmi ?
Constants in Solidity
Tags: solidity, smartcontract, ethereum, soliditycontract
Published: 2024-05-08 17:08:56

Constants are variables that cannot be modified.

Their value is hard coded and using constants can save gas cost.

```
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

contract Constants {
     // coding convention to uppercase constant variables
     address public constant MY_ADDRESS = 0x777788889999AaAAbBbbCcccddDdeeeEfFFfCcCc;
     uint256 public constant MY_UINT= 123;
}
```
WEB API VULNERABILITY THROUGH OTP
Tags: apisecurity, webdev, owasp
Published: 2024-05-08 17:08:53

Broken Authentication is a popular part of OWASP TOP 10 list.

Authentication is one of the most important aspects of a platform.

It is the act of confirming that the user that wants to use the platform now through a particular account is actually the user that owns that account - assuming no user would share their login details.

The login details are registered into the system at sign up stage, most the details are password and email address.

Email address is regarded as WHAT YOU HAVE and password is WHAT YOU KNOW. The third factor of authentication is WHO YOU ARE e.g biometric.

When you put down your email address to sign-up, platforms need to confirm if truly you have that email. One way they confirm is by sending you a mail with a token/code which you are to copy and input into the provided place in the platform. If you are not able to do this then it would be considered that you don't have the email address, and your sign-up would not be complete.

Also after signing up it is possible for a user to forget their password, locking them out of their accounts. 

Platforms provide means for users to get back their accounts by allowing users to reset their password. This is also achieved by confirming if the user that wants to reset the password actually HAVE (access) to the email box of the corresponding email address on the said account.

Typical content of such email that's sent looks like this


![screenshot of OTP email ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nkwanu5vst83vys68frv.jpg)


However going extra mile, hackers can sign-up or reset a password of an account for which they don't have the email address. This is possible especially when the platform is being accessed via web.

How?

Most of the codes that are sent are 4 digits. Okay, let's start from here: how many guess would it take to guess a single digit number? 10 guesses. How many would it take to guess two digits? 100. How many guesses would it take to guess four digits 10000.

Hackers, without having the email address, can just run from 0000 through 9999 and calling the API endpoint for each guess. They'd probably hit luck before reaching 9999. Hence defeating the check of WHAT YOU HAVE.

How many guesses would they have to make if the digits were 6? 1000000. Yeah that's one million guesses.

Hence the more the digits the more secure and impractical it becomes for hackers to guess.

With this the platform would be safer of broken authentication.

In one of my next articles I will write about whether to send a verification link is better than sending OTP/codes. What do you think?
How to Visualize LiDAR Data
Tags: datascience, showdev, opensource, ai
Published: 2024-05-08 17:06:57

{% cta https://www.rerun.io/examples/robotics/lidar %} Source Code {% endcta %} {% cta https://www.rerun.io/examples %} Explore Other Examples {% endcta %}

This example demonstrates the ability to read and visualize LiDAR data from the nuScenes dataset, which is a public large-scale dataset specifically designed for autonomous driving. The scenes in this dataset encompass data collected from a comprehensive suite of sensors on autonomous vehicles, including 6 cameras, 1 LIDAR, 5 RADAR, GPS and IMU sensors.

It's important to note that in this example, only the LiDAR data is visualized. For a more extensive example including other sensors and annotations check out the nuScenes example.

# Logging and visualizing with Rerun 

The visualization in this example was created with just the following lines.

```python
rr.set_time_seconds("timestamp", sample_data["timestamp"] * 1e-6) # Setting the time
rr.log("world/lidar", rr.Points3D(points, colors=point_colors)) # Log the 3D data
```
When logging data to Rerun, it's possible to associate it with specific time by using the Rerun's timelines. In the following code, we first establish the desired time frame and then proceed to log the 3D data points.

---

## Join us on Github
{% github https://github.com/rerun-io/rerun %}
The do-while Loop
Tags: java, programming, learning, beginners
Published: 2024-05-08 17:06:52

A **do-while** loop is the same as a **while** loop except that it executes the loop body first and then checks the loop continuation condition.

The **do-while** loop is a variation of the **while** loop. Its syntax is:

```
do {
// Loop body;
 Statement(s);
} while (loop-continuation-condition);
```

Its execution flowchart is shown below.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6tiioukzq97n16287p5s.png)
The loop body is executed first, and then the **loop-continuation-condition** is evaluated. If the evaluation is **true**, the loop body is executed again; if it is **false**, the **do-while** loop terminates. The difference between a **while** loop and a **do-while** loop is the order in which the **loop-continuation-condition** is evaluated and the loop body executed. You can write a loop using either the **while** loop or the **do-while** loop. Sometimes one is a more convenient choice than the other. For example, here's a **do-while** loop, as shown below:

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

Use a **do-while** loop if you have statements inside the loop that must be executed at least once, as in the case of the **do-while** loop in the preceding **TestDoWhile** program. These statements must appear before the loop as well as inside it if you use a **while** loop.
Wedensday Links - Edition 2024-05-08
Tags: java, jvm, gc, jms
Published: 2024-05-08 17:05:02

Explicit vs Diagnostic GC (7 min)🗑️
https://www.javaspecialists.eu/archive/Issue317-Explicit-vs-Diagnostic-GC.html

Java Management Service (6 min)🗄️
https://poonamparhar.github.io/jms/

Let’s Replace the synchronized Keyword (3 min)🛑
https://foojay.io/today/lets-replace-the-synchronized-keyword/

This is not your uncle's Java! Modeling with Java 22 records pattern matching in practice (10 min)👴
https://event-driven.io/en/this_is_not_your_uncle_java/

Asciidoctor Asciidoclet is back (30 sec)📄
https://twitter.com/abelsromero/status/1783618624927707191

The Vary HTTP header (1 min)🗓️
https://blog.frankel.ch/vary-http-header/

What’s New in IntelliJ IDEA Ultimate 2024.1 (12 min)🎉
https://blog.jetbrains.com/idea/2024/05/what-s-new-in-intellij-idea-ultimate-2024-1/
Variables in Solidity
Tags: solidity, smartcontract, variables, ethereum
Published: 2024-05-08 17:04:08

There are 3 types of variables in Solidity

- local
  - declare inside a function
  - not stored on the blockchain

- state
  - declared outside a function
  - stored on the blockchain

- global (provides information about the blockchain)

```
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

contract Variables {
     // State variables are stored on the blockchain.
     string public text = "Hello";
     uint256 public num = 123;

     function doSomething() public { 
          // Local variables are not saved to the blockchain.
          uint256 i = 456;
  
          // Here are some global variables
          uint256 timestamp = block.timestamp; // current block timestamp
          address sender = msg.sender; // address of the caller
     }
}
```
Demystifying Monads: A Primer
Tags: tutorial, programming, computerscience
Published: 2024-05-08 17:03:38

In the realm of functional programming and category theory, there's a concept that often mystifies newcomers and seasoned programmers alike: the monad. Monads are considered difficult to understand, but with the right approach, they can be demystified and appreciated for their elegance and utility.

At its core, a monad is a design pattern used to encapsulate computations in a structured manner. It provides a way to chain operations together while managing side effects, error handling, and state. While this definition might sound abstract, we can break it down into simpler components to gain a better understanding.

# The Three Laws of Monads

Before diving deeper, let's first establish the three fundamental laws that govern monads:

1. **Left Identity**: `return a >>= f` is equivalent to `f a`, where `return` lifts a value into the monadic context.
2. **Right Identity**: `m >>= return` is equivalent to `m`, where `m` is a monadic value.
3. **Associativity**: `(m >>= f) >>= g` is equivalent to `m >>= (\x -> f x >>= g)`.

# Understanding Monads through Examples

To truly grasp the essence of monads, let's explore a classic example: the Maybe monad. The Maybe monad is used for computations that may fail, by encapsulating the possibility of a value being absent or present.

Consider a scenario where we want to perform division but need to handle the case where the divisor is zero, which would result in an error. Without monads, we might write code like this:

```python
def divide(x, y):
    if y != 0:
        return x / y
    else:
        return None

result = divide(10, 5)
if result is not None:
    print("Result:", result)
else:
    print("Error: Division by zero")
```

While this code works, it requires explicit error checking and handling, which can clutter our codebase. Enter the Maybe monad to rescue us from this verbosity:

```haskell
data Maybe a = Just a | Nothing

instance Monad Maybe where
    return x = Just x
    Nothing >>= _ = Nothing
    Just x >>= f = f x

divide :: Float -> Float -> Maybe Float
divide x 0 = Nothing
divide x y = Just (x / y)

main = do
    let result = do
        x <- divide 10 5
        y <- divide x 2
        divide y 2
    case result of
        Just r -> putStrLn $ "Result: " ++ show r
        Nothing -> putStrLn "Error: Division by zero"
```

In this example, we define a `Maybe` type that represents computations that may fail. We implement the `Monad` type class for `Maybe`, defining how values are lifted and composed within this monadic context. With the Maybe monad, error handling becomes implicit, and we can chain computations together elegantly using the `do` notation.

# Conclusion

Monads are powerful abstractions that simplify the management of side effects, error handling, and state in functional programming. By following the laws of monads, programmers can write cleaner, more maintainable code.

# References
https://blog.ploeh.dk/2022/04/25/the-maybe-monad/
https://builtin.com/software-engineering-perspectives/monads
https://ncatlab.org/nlab/files/KohlSchwaiger-Monads.pdf