teleren/devto huggingface dataset:
Soroswap 🪐 on Testnet Overview
Published: 2023-11-15 20:53:15

# Soroswap Testnet Overview

Soroswap is an Automated Market Maker (AMM) built on Soroban, designed to facilitate token trading and liquidity provision. With its user-friendly interface, Soroswap offers a seamless and intuitive experience for users to engage with decentralized finance (DeFi) on the Soroban and Stellar

Check it in https://soroswap.finance/

## User-Friendly Interface

Soroswap boasts a user-friendly interface that ensures a smooth and enjoyable trading experience. The intuitive design caters to both beginners and experienced traders, making it easy to navigate the platform and interact with its features.

## Key Features and Benefits

** Currently Soroswap works only on Soroban Testnet**, and provides several key features and benefits for users:

- **Balance Section:** Conveniently view your test token balances in the Balance section. This feature allows you to keep track of your assets and monitor their availability for transactions within the app.

- **Swap Section:** Easily exchange one token for another within the liquidity pool using Soroswap's Swap section. This feature provides a straightforward and efficient solution for diversifying your portfolio or making specific token swaps.

- **Liquidity Section:** Empowers users to add or remove liquidity from the pools. By participating in liquidity provision, you contribute to the stability and efficiency of the Soroswap ecosystem. Effectively manage your liquidity positions in the Liquidity section for a smooth and rewarding experience.

Soroswap on the Sorosban Testnet allows users to fully explore and test the platform using test tokens. This enables you to experience the complete functionality of the app without risking real funds. It provides an opportunity to familiarize yourself with the features, understand the process of adding liquidity, performing swaps, and removing liquidity.

By utilizing Soroswap on the testnet, you can gain hands-on experience with decentralized exchanges and DeFi concepts. It serves as a valuable learning tool and a safe environment to experiment with different trading strategies and liquidity provision.

In the following sections, we will provide step-by-step instructions on how to use Soroswap on the testnet, including installing the Freighter wallet, adding liquidity, performing swaps, and removing liquidity. These instructions will help you navigate the platform and make the most of the features and benefits offered by Soroswap. Let's dive in!

Did you like it?
Please give us feedback. Join our Discord channel: https://discord.gg/wyesAQhP
Alura - Aula 3 - AluraFlix
Tags: codepen, alura, imersaodev7
Published: 2023-11-15 20:28:49

Catalogo de Filmes com cadastro. Verificação se já há o filme cadastrado, e se a URL se refere à um jpg/jpeg.

{% codepen https://codepen.io/leoguain/pen/mdvBoem %}
Aligt Motion Mod Apk
Published: 2023-11-15 20:20:39

 [Alight Motion Mod APK](https://alightmotionmodapk.cc/) is a mobile phone application that lets you make graphics, visual effects, and animations. There isn’t a better app for Android devices than this one to make animations. Alight Creative Inc. offers the application for free. The first motion designing app in the world is called Alight Motion Pro
Core Data with Table Views Part II
Tags: swift, mobile, beginners
Published: 2023-11-15 20:18:20

In this blog, I will try to extend the app we built in Part I by adding a search bar in the Main View Controller so that you type in the search bar and it will filter the employees based on the name, age or phone. I will also add other entities and add relationships between these entities.

**In `MainVC`, add `setupSearchBar()` to add the searchBar in UI.**

```swift
import UIKit

class MainVC: UIViewController {
    ...
    private let searchBar = UISearchBar()
    override func viewDidLoad() {
        ...
        setupSearchBar()
    }...
}
```

**In `extension MainVC`, searchBar related functions are implemented as below.**

```swift
extension MainVC: UITableViewDataSource, UITableViewDelegate, UISearchBarDelegate {
    private func setupSearchBar() {
        searchBar.placeholder = "Search Employees"
        navigationItem.titleView = searchBar
        searchBar.delegate = self
    }
    
    func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
        if searchText.isEmpty {
            empArray = CoreDataHandler.shared.fetchData()
        } else {
            empArray = CoreDataHandler.shared.searchData(with: searchText)
        }
    }
    
    func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
        searchBar.text = ""
        searchBar.resignFirstResponder()
        empArray = CoreDataHandler.shared.fetchData()
    }
...
```

**Lastly, add `searchData()` in `CoreDataHandler` to retrieve data matching the user's input**

```swift
class CoreDataHandler {
    ...
    func searchData(with searchText: String) -> [Emp] {
        let fetchRequest: NSFetchRequest<Emp> = Emp.fetchRequest()
        fetchRequest.predicate = NSPredicate(format: "name CONTAINS[c] %@ OR age == %@ OR phone CONTAINS[c] %@", searchText, searchText, searchText)
        do {
            let result = try context!.fetch(fetchRequest)
            return result
        } catch {
            print("Failed to search employees")
            return []
        }
    }
}
```

**Result**

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

**Add other entities and add relationships between these entities.**

![relationship](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/la41q9g5nhakhva8xi6a.png)

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

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

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

Full code is available in [employeeCatalogue](https://github.com/avelynhc/employeeCatalogue)
Create an SVG Fractal Tree by Writing a Recursive Function - Easy JavaScript Tutorial
Tags: javascript, svg, webdev, frontend
Published: 2023-11-15 20:11:29

After a long hike searching for mushrooms and observing the trees around me with their beautiful patterns, I wondered if I could create a function to generate a tree in JavaScript. The next morning, I started researching and learned a bit about fractal mathematics and how it involves repeating the same pattern at different scales. This realization meant that I could probably create a recursive function to generate my tree.

I set out to create the function, and it turned out to be much simpler than I initially thought. Of course, this simplicity came after rewriting messy code multiple times. So now, I finally have a function that creates a cool fractal tree in less than 20 lines of code - it could be simplified to 10.

To render the tree, I used the SVG element, which I really enjoy working with. The function draws the first line (the base of the tree) and then recursively draws two lines at a time. The angles and lengths are calculated dynamically.

I learned a lot during this process, especially about how elegant and enjoyable using recursive functions can be. If you want to see how I did it or learn about using recursive functions to generate a pattern, I made a YouTube tutorial:

{% youtube https://youtu.be/gwv7yqwxN1g %}

If you want to jump straight to the code:

Code Pen: https://codepen.io/Piko-the-solid/pen/RwvjNed
Github: https://github.com/PikoCanFly/fractal-tree
Which should you use? Array.from vs. Spread Operator
Tags: javascript, vanilla, tutorial, discuss
Published: 2023-11-15 20:00:00

I had a conversation with a coworker about the merits of using spread `...` vs `Array.from`. While they look the same on the outside, they work differently.

## Iterable vs. Length

If you want to spread something into an array, it *needs* to have a `Symbol.iterator` property.

This means that the following Javascript will fail:

```js
const spreadObject = [...{ user: 'jane' }];
```

Even though this would work:

```js
const user1 = {
    user: 'eloise'
};

const updatedUserInfo = {
    lastLogin: 'today'
};

const user1New = {
    ...user1,
    ...updatedUserInfo
};
```

The solution would be to add a `[Symbol.iterator]` generator function to the object, which is honestly not worth it.

`Array.from` creates an array if the object has either an iterator or  `.length` property.

## Built in mapping function

Have you ever seen a snippet like this:

```js
const mappedArray = [...arr].map(item => {
    // do stuff to item
})
```

Did you know that that creates 2 arrays? `Array.from` has a built in mapping function though.

```js
const mappedArray = Array.from(arrLike, item => {
    // do stuff to item
})
```

I find this helps keep things more explicit, especially when you are not using an inline function.

```js
const approveUser = (user) => ({
    ...user,
    approved: user.age > 21
});

const allApprovedSpreadUsers = [...users].map(approveUser).every(user => user.approved);

const allApprovedMappedUsers = Array.from(users, approveUser).every(user => user.approved);
```

*Do you need to care about making that extra array? Probably not, but it is a neat thing to remember.*

## Which do you use?

I usually reach for `Array.from`. The spread operator is very useful when getting `n` arguments from a funciton, and spreading objects into another is priceless.

```js
const mergeUserInfo {
    ...userFromSource1,
    ...userFromSource2
};

function approveMergedUsers(user1, ...otherUsers) {
    // do user stuff
}
```

Either way, I think `Array.from` is worth keeping in your tool belt.
Popular Apps Created Using React Native
Tags: javascript, mobile, discuss, tutorial
Published: 2023-11-15 19:59:12

**These are some popular mobile apps which are created using React Native:**

- Skype
- Bloomberg
- Facebook Ads Manager
- UberEATS
- SoundCloud Plus
- TownSquare Media 
- Instagram
- Facebook
- Airbnb
- Walmart
- Discord
- Pinterest

Some of these mobile apps were created fully using React Native and some of these apps were partially created using React Native. Which are some of your favorite apps which were created using React Native?
Introducing NumPy, a hero in Pythonland
Tags: beginners, python, datascience
Published: 2023-11-15 19:27:46

Hey good people! How is it going? Today I'm here to get you introduced to NumPy, a hero in Pythonland.  


   Once upon a time, in the land of Python, there was a data wizard named Matrix. Matrix had a mission – to tackle the wild, untamed world of numerical data. She could already do it but she was not fast enough. She needed a sidekick, a trusty companion to help her dominate over numbers and manipulate arrays in the easiest way. 

   Finally, after years of divine contemplation, she discovered NumPy, a superhero for handling data. Together, they danced through arrays, tamed wild datasets, and conquered dragons of linear algebra.

   NumPy's magical powers turned the life of a data scientist livable, making complex tasks a breeze. With seamless integration and a vibrant community, they formed an unbeatable team, turning coding challenges into thrilling adventures. And so, in the land of Python, Matrix and NumPy lived happily ever after, making every data dream come true.


So after reading this story, what do you get? what is actually NumPy?

NumPy is a Python library that helps with dealing with n-dimensional arrays. It can do more than just that – it's also good at math stuff like working with patterns, special kinds of math called linear algebra, and dealing with grids of numbers called matrices. (Yeah, the wizard in the story.)
How constant is const in C?
Tags: programming, c, pointers, tips
Published: 2023-11-15 19:17:00

---
title: How constant is const in C?
published: true
description: A short post about why #define ends up being used for constants in C
tags: programming, C, pointers, tips
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rf2iwn8g9oooc9i187yx.png
# Use a ratio of 100:42 for best results.

---

Let's look at the simple statement

```
const int a = 2;
```

If you come from a C# perspective, you expect the keyword `const` to mean that the value in `a` will never change. It's a way to help the compiler optimise the code.

In C, however, `const` is not exactly what you would expect.
For sure if you later wrote

```
a = 4;
```
then the compiler will throw an error, something along the lines of:
> `error: assignment of read-only variable ‘a’`

But the thing is, this is C, so if you want to shoot yourself in the foot, you can quite easily do it.

(In C# it is possible to change the value of a `const` with reflection, or unsafe code. It's a fair amount of code, but it *can* be done.)

This is all the work it takes:

```
#include <stdio.h>
int main()
{
  const int a = 2;
  printf("a: %d\n", a);
  int* x = &a;
  *x = 4;
  printf("a: %d\n", a);
  return 0;
}
```

Just like that. Create a pointer, give it the address of your constant and set the value via the pointer.

Now, depending on the compiler, and your compiler options, you will likely get a warning, something like:
> `warning: initialization discards ‘const’ qualifier from pointer target type`

So, it doesn't go by unnoticed, but it compiles and the code will run just fine.

This is part of the reason I use `#define` for constants. The other is it's just what I've always done.

I think, for C, it's helpful to think of `const` as only referring to the variable name, and not the data behind the variable. It's akin to a promise that the variable won't be used to change the value, and not that the value will never change.
Dynamic destructuring JavaScript
Tags: javascript
Published: 2023-11-15 19:05:44

Hi!

Today I want to share with you a trick about dynamic destructuring in JavaScript.

It is not always clear what exactly property we want to desctruct from an object.

This is a vice versa situation when you want to access object property dynamically.

For example, let's assume this object with balances of three cryptocurrency exchanges:

```javascript
const balances = {
   binance: {
     balance: someBinanceData
   },
   kucoin: {
     balance: someKucoinData
   },
   bybit: {
     balance: someByBitData
   }
}
```

Let's say we have a component in which we pass a source_key as a variable. Somewhere in the component, we need to get particular data. We don't know that "source_key" is binance, kucoin or bybit and we want component to be reusable. So we can do this:

```javascript

const source_key = 'binance' // <--- we can receive this from the outside as variable
const { [source_key]: balanceSource } = balances

console.log(balanceSource.balance)
//someBinanceData
```
"Learning to Code with a Full-Time Job": CodeNewbie Podcast S26E3
Tags: podcast, career, codenewbie, beginners
Published: 2023-11-15 18:48:34

In our third episode of Season 26 of the CodeNewbie Podcast, @saronyitbarek talks about working in television, digital media production, teaching, and software development with [Beau Carnes](https://twitter.com/beaucarnes), Director of Technology Education at freeCodeCamp.org.

{% embed https://www.codenewbie.org/podcast/learning-to-code-with-a-full-time-job %}

Beau is a software developer and teacher. He manages the freeCodeCamp.org YouTube channel and creates many resources to help people learn software development.

- [Listen on Apple Podcasts](https://podcasts.apple.com/us/podcast/codenewbie/id919219256?i=1000634941316)

- [Listen on Spotify](https://open.spotify.com/episode/7mPXYrUWXUAFLc2tssDTc8?si=a1e6ff3bd0c94b86)

Or, listen wherever you normally get your podcasts!

***

### We will see you next week, happy coding

PS: Make sure to subscribe to the CodeNewbie podcast if you haven't yet + review us on your chosen platform!
How to pay for Apple Music subscription using GCash?
Published: 2023-11-15 18:41:41

Quick Overview On How To [Pay Your Apple Music Subscription Using GCash](https://moneytechguide.com/how-to-pay-your-apple-music-subscription-using-gcash/):

Step 1: Linking GCash
Step 2: Subscribe to Apple Music
Step 3: Enjoy Apple Music

Steps For How To Pay Your Apple Music Subscription Using GCash
Step 1: Linking GCash
Select the Apple ID in your mobile phone’s settings, navigate to “Payment and Shipping,” choose “Add Payment Method,” select GCash from the list, and finalize the login using OTP or MPIN to receive a confirmation message.

Step 2: Subscribe To Apple Music
After connecting your GCash account to your Apple ID, launch the Apple Music app. Navigate to the “For You” tab, click on “Start Free Trial,” pick your preferred plan (individual or family), input billing details, opt for GCash as your payment method, specify the subscription amount, and press “Next.” Confirm the transaction with your MPIN and await GCash’s confirmation message for a successful transaction.

Step 3: Enjoy Apple Music
Have fun with Apple Music! After signing up with GCash, start listening to your favorite songs and albums. Use the Apple Music app on your iOS or Android device or iTunes on your computer to enjoy the service.

That’s it! This is the step-by-step method to enjoy Apple Music using the GCash mobile app in the Philippines without having a Credit Card.
My problem learning a new language of programming
Tags: beginners, productivity, coding
Published: 2023-11-15 18:37:48

My first language of programming was C, my second language of programming was Pascal and the last Visual Basic, Java. 

I learn this language of programming in the university, i learn the basic of this language. The time for learn this language was weeks and develop a project at the end of the course.

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

When i want learn a new language of programming my learning curve is slow. I start the first month of the year very well  but i have insomnia, discouragement and loss interest to month or the last week of the month. 

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

So, i am unstable. At the end i don't dominate the language and waste time. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9p3yvfm08swngk1p8uh6.jpg)
Venetian Plaster London - Ultimate London
Tags: plaster
Published: 2023-11-15 18:29:52

[Venetian plasterers](https://ultimate-london.com/venetian-plaster-london/) -  [Venetian Plaster London](https://ultimate-london.com/venetian-plaster-london/) - [Polish Plaster London](https://ultimate-london.com/venetian-plaster-london/)


At Ultimate London, we have made it our mission to be the Venetian plastering contractor of your choice across London and throughout the UK. All of our projects are bespoke to your individual requirements, and our team of highly skilled plastering artisans is ready to carry out any task you bring forward


Venetian plastering, a wall and ceiling finish consisting of plaster and marble dust, is an art that originated in Italy back in the Roman era. This ancient art has recently flourished across the UK. With many colours and finishes, Venetian plaster can be applied in various properties, and all finishes are bespoke to whatever your requirements are.

Venetian plaster is a luxury design trend that has seen a mass growth in popularity due to its jaw-dropping aesthetics and everyday practicality. Ultimate London is a leading provider of luxury polished concrete walls for businesses and commercial premises across the UK. 

 

Due to the versatility of Venetian Plaster, we can create any design, turning your dreams into reality.
 

If you want to discuss any Venetian Plastering projects, please contact our team today to discuss your requirements and arrange a site survey.


For 24-7 emergency enquiries, please contact us at 0746 833 7967 or via WhatsApp and mail - info@ultimate-london.com
All used cars
Tags: javascript, react
Published: 2023-11-15 18:26:50

We are India’s new age used cars marketplace with 10,000+ cars to choose from with 1000+ verified dealers. Presently, we are available in New Delhi, Gurugram, Noida, Faridabad, Bengaluru and Mumbai. Please visit our website - (https://www.allusedcars.in/) and test drive your dream car now!
PHP Design Patterns: Singleton
Tags: php, designpatterns, tutorial
Published: 2023-11-15 18:19:14

### What is Singleton?

Singleton is a creational design pattern, which ensures that only one object of this type exists and provides a single point of access to it for any other code.

![Singleton](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sol2pqgxiqin3sl1wpqw.png)

Just like a global variable, the Singleton pattern allows you to access an object from anywhere in the program. However, it also protects that instance from being overwritten by other code.

### Example

**Step 1 - Directory System:**

```
📦 Singleton
 ┣ 📜 Preferences.php
 ┣ 📜 Application.ini
 ┗ 📜 index.php
```
**Step 2 - Preferences Class:**

```php
<?php

namespace Singleton;

class Preferences
{
    private array $data;
    private static object $instance;
}

```

- **construct** method

```php
// Constructor method is private so we can have a global object.
private function __construct()
{
    // The data property receives information from the application file.
    $this->data = parse_ini_file('application.ini');
}
```

- **getInstance** method

```php
// Method for creating an instance or rescuing an already instantiated object.
public static function getInstance(): object
{
    // if there is no instance.
    if (empty(self::$instance)) {
        // Create a new instance.
        self::$instance = new self();
    }

    // return instance.
    return self::$instance;
}

```

- **setData** and **getData** methods

```php
// Method for getting information.
public function getData(string $key): mixed
{
    return $this->data[$key];
}

// Method for inserting or changing information.
public function setData(string $key, mixed $value): void
{
    $this->data[$key] = $value;
}
```

- **save** method

```php
// Method for writing information to the file application.ini
public function save(): void
{
    // Variable for information.
    $string = '';
    // If there is any information on date.
    if ($this->data) {
        // Traverses the data vector.
        foreach ($this->data as $key => $value) {
            // Fills the string variable with the information.
            $string .= "{$key} = \"{$value}\" \n";
        }
    }
        
    // Write information to the file.
    file_put_contents('application.ini', $string);
}

```

### Testing

```php
<?php

require_once 'Preferences.php';

use Singleton\Preferences;

$p1 = Preferences::getInstance();
var_dump($p1);

$p2 = Preferences::getInstance();
var_dump($p2);

```

```php
object(Singleton\Preferences)[1]
  private array 'data' => 
    array (size=0)
      empty

object(Singleton\Preferences)[1]
  private array 'data' => 
    array (size=0)
      empty
```

**Insert Data**

```php
<?php

require_once 'Preferences.php';

use Singleton\Preferences;

$p1 = Preferences::getInstance();
$p1->setData('Language', 'en');
$p1->save();

$p2 = Preferences::getInstance();
print $p2->getData('Language');
var_dump($p2);
```

```php
Language: en

object(Singleton\Preferences)[1]
  private array 'data' => 
    array (size=1)
      'Language' => string 'en' (length=2)
```
Objects `p1` and `p2` have the same **instance**.