teleren/devto huggingface dataset:
Spark SQL: Toolkit for Smart Data Manipulation
Tags: python, datascience
Published: 2024-03-25 07:25:20

**Intro**:
It’s not surprising that SQL has been a mainstay for some time, and survey respondents have a strong preference for it as their chosen technology for data operations, with a majority of 51.52% endorsing it. For those transitioning from a software development background, especially one that is heavily reliant on SQL, adapting to Python dataframes, such as those offered by the Pandas library, can be challenging. Pandas is a popular Python library that simplifies data manipulation and analysis, offering advanced data structures and functions that are designed to handle structured data efficiently and intuitively.

The Sparks ecosystem enables distribute computing / multi-threading. So if you have larger data set working with Pandas might not be the best thing to work with. Also Sparks ecosystem uses in-memory computation which is faster than the disk-based computation used by Pandas.

Lets explore how to query dataset with SQL 

**Generating Synthetic Data**:

```
np.random.seed(10)
num_rows = 10000
num_columns = 5
data = {
    'Cust_ID': np.arange(1, num_rows + 1),  # Unique identifier for each customer
    'Age': np.random.randint(18, 60, num_rows),  # Customer Age
    'Gender': np.random.choice(['Male', 'Female'], num_rows),  # Gender 
    'Affluency': np.random.choice(['Cluster A', 'Cluster B', 'Cluster C'], num_rows),  # Cluster group
    'Avg Basket Value':np.random.randint(25, 60, num_rows),# Avg sale bucket
    'Market_Follow_status': np.random.choice(['Ongoing', 'Completed'], num_rows)  # Follow-up status
}
df = pd.DataFrame(data)
```


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

Now if I need to summaries the data by understanding the Avg Basket value by gender by cluster the <u>pandas</u> _groupby_ 
operation would be easy 

```
result_P = df.groupby(['Gender', 'Affluency'])['Avg Basket Value'].mean().reset_index
```

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

Now to do similar operation but with SQL concept would be achieved by first converting the pandas data structure into a logical table. 

```
spark.createDataFrame(df).createOrReplaceTempView("df_view")
```

Once you have a table available in memory then its like normal SQL to arrive at the same summarization

```
result_S = spark.sql("""
    SELECT Gender, Affluency, AVG(`Avg Basket Value`) AS mean_basket_value
    FROM df_view
    GROUP BY Gender, Affluency
""")
```

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


This approach would be no stranger to developers working with structured data in a familiar SQL-like manner.


**Reference**:
[Stack OverFlow Survey](https://survey.stackoverflow.co/2023/#most-popular-technologies-language-prof)
[Spark SQL](https://spark.apache.org/sql/)
How to Connect BH1750 with the Raspberry Pi Pico/Pico W
Tags: micropython, raspberrypi, python
Published: 2024-03-25 07:24:15

{% embed https://www.youtube.com/watch?v=l9MAZu7yvN4 %}

Discover the power of the BH1750 sensor and Raspberry Pi Pico W by learning to measure ambient light in lux using MicroPython. While often overlooked, this sensor is a versatile tool for creating intelligent lighting solutions. Mastering the BH1750 is essential for beginners, as it opens up a world of exciting DIY projects and inspiring tutorial possibilities.

Also, be sure to subscribe and support the channel if you have not!

Subscribe:

[Youtube](https://www.youtube.com/@mmshilleh)

Support:

[https://www.buymeacoffee.com/mmshilleh](https://www.buymeacoffee.com/mmshilleh)

Access All Code Related to This Video by Subscribing to the Level 1 Perk on My YouTube Channel

[https://www.youtube.com/@mmshilleh/membership](https://www.youtube.com/@mmshilleh/membership)
It's raining TsConfigs
Tags: typescript, javascript, webdev
Published: 2024-03-25 07:20:04

Good morning everyone and happy MonDEV!☕
How was this past weekend?

Today I want to get straight to the point and dive into the heart of the topic!
How many of you use TypeScript? Personally, I am among the fans and, although I recognize that it is not ideal for every project, I always try to use it whenever possible.
A part that can often be a bit tricky, especially when starting to get familiar with the language, is the tsconfig file, which, if not set correctly, can lead to unexpected results when switching from TS to JS. I have experienced this on several occasions both with the make-js-component command and with the related VS Code extension, both clearly developed in TypeScript. In both cases, the correct configuration of TypeScript has proven to be a crucial point in their development.

To better understand this file and to have a good starting point, on [this page](https://www.totaltypescript.com/tsconfig-cheat-sheet) of the totallytypescript blog, you will find an ideal tsconfig, with some comments indicating some parts that may need to be kept in some cases or removed in others. Everything is explained in a very clear and immediate way and you will have no problems bringing it into your project. However, a complete explanation follows the full version of the file, which will allow you to better understand, option by option, what is happening and therefore intervene more precisely.

If, however, you want to have a tsconfig tailored specifically for your project, you cannot miss the [tsconfig/bases](https://github.com/tsconfig/bases) repository, a collection of configurations designed specifically for certain types of projects, among which it is very easy to find yours. Among the various configs designed specifically for various versions of notes, for Vite, or React Native, or Nuxt... you have really a lot of choices and if you don't find what suits you, you can always start from one of the existing ones and create one more suitable... and then maybe make a PR!
Each config can be imported into the project directly with npm install, a matter of seconds and you will be ready to run your TypeScript watcher!

Today's resource was a quick one, I hope it is useful to those of you who use or want to learn TypeScript. As always let me know if you found it useful and/or interesting!
In the meantime, I wish you all a good start to the week!
Happy Coding 0_1
Dubai Tattoo Studio - Skilled Artists
Tags: tattoos, tattooing, tattooshops, dubaitattoostudio
Published: 2024-03-25 07:03:47

  Where Art Meets Skin  
    Dubai Tattoo Studio - Skilled Artists is a premier tattoo studio in Dubai, offering a wide range of tattoo services to suit every taste and style. Our team of highly skilled artists is passionate about creating beautiful and meaningful tattoos that will exceed your expectations.
  Visit us today at our studio in Dubai or contact us to schedule an appointment.
 𝐇𝐨𝐭𝐥𝐢𝐧𝐞 / Whatsapp Now:  +971 52 929 0071
Contact Via Email - dubaitatts@gmail.com
🗺️ Map Link: https://maps.app.goo.gl/T17Fr9dugfe3uaVX9
  GMB Links https://g.page/r/CXLcJeMtGHrSEAI/review
  Address: Exit 1 - near ADCB metro station - Al Karama - Dubai - United Arab Emirates
Social Links:
✔  https://instagram.com/dubai__tattoo_studio
✔  https://web.facebook.com/people/Dubai-Tattoo-Studio/61554704165735/
✔  https://dubaitattoostudio.wixstudio.io/dubaitattoostudio
✔  https://dubai-tattoo-studio.webnode.page/

#Tattoos 
#Tattooing 
#tattoo shops near me 
#tattoo shops 
#Dubai Tattoo Studio
Camp Activities: Fire Theme
Tags: frontendchallenge, devchallenge, css, javascript
Published: 2024-03-25 06:47:11

_This is a submission for DEV Challenge v24.03.20, Glam Up My Markup: Camp Activities_

## What I Built
<!-- Tell us what you built and what you were looking to achieve. -->
I've developed an interactive camp inquiry activities form for the Markup Challenge.

## Demo
<img width="100%" style="width:100%" src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExOWpxNXpndDBqNTlpOHNua2Rmdm5jMmJuMWtsaGh0MTBhcW1meHAycCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/wc686yL0noVapnzc38/giphy.gif">

Here is the playground link below:
https://playcode.io/1812359


## Journey
Throughout this journey, I delved into various Ideas to enhance form's interactivity using CSS and JavaScript. One small challenge I faced while integrating a background auto-play video using Javascript without HTML tags. I even discovered converting videos to GIFs, uploading them to a platform and seamlessly embedding them into the post. Despite the occasional struggle, the overall experience was immensely rewarding, leaving me with newfound knowledge and a sense of accomplishment. 

Thank you😊


<!-- Thanks for participating! -->
NAGA169 LOGIN LINK ALTERNATIF ANTI NAWALA 2023
Tags: naga
Published: 2024-03-25 06:41:10

NAGA169 klik di sini login akun admin anti rungkad dan pastinya bisa memberikan kalian keuntungan besar tanpa modal besar.

[![Klik Di Sini](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/35rdmaeizpn8ctyawmee.gif)](https://long169.vip/ref-2)
crypto trading bot development
Published: 2024-03-25 06:41:02

AR In the fast-paced world of cryptocurrency trading, staying ahead of the game can be a challenge. This is where trading robots come in handy. This automated software executes trades on behalf of users based on predefined strategies. If you are interested in building your own crypto trading robot but don't know where to start, here is a simple guide to get you started:

**Understand the basics:** Before diving into robot development, it is important to have a proper understanding about cryptocurrency markets, trading strategies and programming concepts. Start by learning about popular cryptocurrencies like Bitcoin and Ethereum, as well as key trading indicators like moving averages and the Relative Strength Index (RSI).

**Choose a programming language:** Most trading robots are built using languages such as. Python, JavaScript or C++.  Choose a language that works for you, with robust libraries and frameworks to interact with cryptocurrency exchanges.

**Choose an exchange:** Different exchanges have different APIs (Application Programming Interfaces) to trade data and execute transactions. Research and choose a reputable exchange that offers a comprehensive API and supports the cryptocurrencies you want to trade.

**Plan your strategy:** The core of any trading robot is its trading strategy. Decide whether you want to implement a simple strategy, such as dollar cost averaging, or a more complex one, such as arbitrage or trend. Test your strategy against historical data to make sure it's effective.

**Develop your bot:** Start coding your bot using the programming language of your choice and the Exchange API. Break your strategy down into manageable parts such as data collection, signal generation, risk management and ordering. Make sure you implement proper error handling and security measures to protect your assets.

**Test and Optimize:** Once your bot is ready, it's time to test it in a simulated environment using a paper shop or demo account. Monitor its performance closely and make the necessary changes to improve its profit and reduce risk.

**Deploy Your Robot:** When you are satisfied with the performance of your robot, deploy it to start trading with real funds. Monitor its performance regularly and be prepared to further optimize as market conditions change.

**Be informed:** The cryptocurrency market is highly volatile and constantly evolving. Stay up to date with the latest news, market trends and regulatory developments to adapt your bot accordingly and stay ahead of the competition.


**In conclusion,** the development of a crypto trading bot offers immense potential for investors seeking automated strategies. Leveraging advanced algorithms and machine learning, these bots optimize trading decisions. Beleaf Technologies stands at the forefront, providing cutting-edge solutions to navigate the dynamic crypto market landscape.
seo course in Lahore
Published: 2024-03-25 06:40:57

[SEO course in Lahore ](https://www.pnytrainings.com/best-seo-training-institute-in-lahore
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/128urgkot33u0ez8vhvs.jpg))
In Lahore's competitive digital market, SEO expertise is indispensable for companies and individuals aiming to thrive. Participating in SEO courses in Lahore offers the chance to acquire the essential knowledge, skills, and expertise required to effectively navigate the intricacies of SEO management.
Web Storage API: One Byte Explainer ✍️
Tags: frontendchallenge, devchallenge, javascript, webdev
Published: 2024-03-25 06:40:56

_This is a submission for DEV Challenge v24.03.20, One Byte Explainer: Browser API or Feature._

## Explainer

Web Storage API stores data locally in the browser using sessionStorage or localStorage. Use localStorage.setItem() to save and localStorage.getItem() to retrieve. sessionStorage lasts one session; localStorage persists. Handy for quick, local data access.

## Additional Context

[Learn more about Web Storage API](https://www.w3schools.com/js/js_api_web_storage.asp)
courses for IT in Rawalpindi
Tags: itcourses, bestcourses, shortitcourses
Published: 2024-03-25 06:37:55


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/stihrjej2zpl8xsvhkvf.png)[](url) [][**courses for IT in Rawalpindi**](https://www.pnytrainings.com/short-courses-in-rawalpindi)
What is the use of service providers for laravel
Tags: laravel, webdev, javascript, programming
Published: 2024-03-25 06:31:51


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

Hi guys,

In this article, We are studying Service Providers. It is the central place of all laravel application bootstrapping. You can be bootstrapping custom classes and laravel core classes, which contain registering service container bindings, event listeners, middleware, and custom routes.

You can see providers inside the config/app.php file. It contains the Providers array. You can specify your service providers and already contain a set of laravel core service providers and Provider loads on a specific route. You will learn how to write and register your service provider in the laravel application.


## Create a Service Provider

All Service Provider extends the Illuminate\Support\ServiceProvider class. Run the below command to make your service provider.

`php artisan make:provider InstallServiceProvider`

It contains a register and boot method. In the register method, you can specify only bind things into the service container. You should not register any event listeners or routes.

## Register method:

You should not register any event listeners, routes, or functionality within the register method of a service container. Instead, only bind things in the container. You can access the $app property, which provides access to the service container.

```
<?php
 
namespace App\Providers;
 
use App\Services\Riak\Connection;
use Illuminate\Support\ServiceProvider;
 
class RiakServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton(Connection::class, function ($app) {
            return new Connection(config('riak'));
        });
    }
}
```

## Bindings and Singletons Properties:

You want to register many service providers in a simple binding using bindings and singletons properties. It will automatically check these properties and register their bindings.

```
<?php
 
namespace App\Providers;
 
use App\Contracts\DowntimeNotifier;
use App\Contracts\ServerProvider;
use App\Services\DigitalOceanServerProvider;
use App\Services\PingdomDowntimeNotifier;
use App\Services\ServerToolsProvider;
use Illuminate\Support\ServiceProvider;
 
class AppServiceProvider extends ServiceProvider
{
    /**
     * All of the container bindings that should registered.
     *
     * @var array
     */
    public $bindings = [
        ServerProvider::class => DigitalOceanServerProvider::class,
    ];
 
    /**
     * All of the container singletons that should be registered.
     *
     * @var array
     */
    public $singletons = [
        DowntimeNotifier::class => PingdomDowntimeNotifier::class,
        ServerProvider::class => ServerToolsProvider::class,
    ];
}
```
[Click here to Read More](https://www.devrohit.com/service-provider-in-laravel/)
Complete SQL Subqueries Tutorial
Tags: sql, sqlserver, devart, dbforge
Published: 2024-03-25 06:31:49

An integral part of many SQL queries are SQL subqueries. They make it possible to retrieve data from the database more efficiently and precisely by allowing for complicated queries, dynamic filtering, and calculations based on the outcomes of other queries. However, proper application is key, as with any method. The best SQL techniques, types, and scope of SQL subqueries are covered in this material: 
https://www.devart.com/dbforge/sql/studio/sql-subqueries-with-examples.html
Python fundamentals
Tags: beginners, python
Published: 2024-03-25 06:28:09

For me, when I started my coding journey. I started with javascript for 6 weeks and then I started to learn python. Although, I felt more confident in my coding ability and learning how the computer reads code, I found it a bit tricky to learn the new syntaxes of Python. Below I have some examples of the basic of Python.

list: candy = ['Sour Patch', 'Skittles', 'Starburst']
tuple: candy = ('Sour Patch', 'Skittles', 'Starburst')
set:   candy = {'Sour Patch', 'Skittles', 'Starburst'}

As you can see, my variable name is candy and I have shown you the different syntaxes between 3 data structures. Make sure that the names inside how '' or "". Making quotations will make sure that it is shown as a string so python can read the code. 

Be sure to experiment in your python shell to test out the different data structures. You can use the type function to get comfortable with the different rules of each data_structure.

type(candy = ['Sour Patch', 'Skittles', 'Starburst'])
Zeusbola• Revolusi Game Slot Online di Indonesia
Published: 2024-03-25 06:27:49


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

**[[DAFTAR SEKARANG KLIK DI SINI]](https://heylink.me/zeusbola.win/)**
CLFCOIN Exchange: Navigating the Crypto Landscape
Published: 2024-03-25 06:21:40

The establishment of CLFCOIN Exchange marks an important milestone in the crypto market, which not only represents the fruits of technological innovation, but also symbolizes confidence in the crypto economic model. Since its inception, CLFCOIN Exchange has been committed to providing users with a secure, convenient and transparent trading environment to meet the growing market demand and user expectations.

Founding Philosophy
The founding of CLFCOIN Exchange stems from the observation and deep understanding of the inadequacy of the services of existing crypto trading platforms. The founding team understands that in the crypto field, users are most concerned about the security of assets, the convenience of transactions, and the stability of the platform. Therefore, CLFCOIN has placed these factors at the center of its development from the very beginning, aiming to solve the industry's pain points and enhance the user experience through technological innovation and strict security measures.


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

Technology and Security
Technology wise, the CLFCOIN exchange utilizes leading blockchain technology to guarantee fairness and transparency of transactions. The platform has built-in advanced encryption technology and multi-signature wallets to greatly enhance asset security. In addition, CLFCOIN has introduced an advanced risk management system and a real-time monitoring mechanism to guard against potential security threats and abnormal transactions, ensuring the stability of the platform's operation and the safety of users' assets.

User Experience
In terms of user experience, CLFCOIN Exchange has designed a user-friendly interface that makes it easy for novice users to get started. At the same time, in order to meet the needs of different users, CLFCOIN provides a variety of trading pairs and a wealth of trading tools, including but not limited to spot trading, contract trading, leverage trading and so on. The platform also has a 24/7 customer service center to answer users' questions and handle their trading needs.

Future Outlook
Looking ahead, CLFCOIN Exchange will continue to focus on technological innovation and service optimization to expand its range of products and services. At the same time, CLFCOIN will also actively participate in the regulatory dialog and cooperation in the global crypto market to promote the healthy and sustainable development of the industry. Through in-depth cooperation with all parties, CLFCOIN Exchange hopes to become a bridge connecting the traditional financial world with the crypto economy, providing users with more value and choices.

In short, the establishment of the CLFCOIN Exchange is not only a firm investment in the future growth potential of crypto, but also a demonstration of commitment to building a more fair, transparent and secure trading environment. As the crypto industry continues to mature and evolve, CLFCOIN Exchange looks forward to becoming one of the leaders in the field to lead the industry forward.
JavaScript Design Patterns - Structural - Bridge
Tags: javascript, beginners, programming
Published: 2024-03-25 06:20:16

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

The **bridge** pattern allows one interface in our class to build different implementations depending on what **instance** we are receiving and what **instance** we need to return.

In the example below, we create a **bridge** between types of **Soldiers** and types of **Weapons**. In this way, we can correctly pass the instance of **weapons** to our **soldiers**.

```ts
class Soldier {
  constructor(weapon) {
    this.weapon = weapon;
  }
}

class SuperSoldier extends Soldier {
  constructor(weapon) {
    super(weapon);
  }

  attack() {
    return 'SuperSoldier, Weapon: ' + this.weapon.get();
  }
}

class IronMan extends Soldier {
  constructor(weapon) {
    super(weapon);
  }

  attack() {
    return 'Ironman, Weapon: ' + this.weapon.get();
  }
}

class Weapon {
  constructor(type) {
    this.type = type;
  }

  get() {
    return this.type;
  }
}

class Shield extends Weapon {
  constructor() {
    super('shield');
  }
}

class Rocket extends Weapon {
  constructor() {
    super('rocket');
  }
}

export { SuperSoldier, IronMan, Shield, Rocket };
```

👉 Use this pattern when we need to use a specific implementation in runtime from an abstraction.

🚀 A complete example here: https://stackblitz.com/edit/vitejs-vite-efyrjy?file=main.js

---

I hope you found it useful. Thanks for reading. 🙏

Let's get connected! You can find me on:
- **Medium:** https://medium.com/@nhannguyendevjs/
- **Dev**: https://dev.to/nhannguyendevjs/
- **Hashnode**: https://nhannguyen.hashnode.dev/
- **Linkedin:** https://www.linkedin.com/in/nhannguyendevjs/
- **X (formerly Twitter)**: https://twitter.com/nhannguyendevjs/
- **Buy Me a Coffee:** https://www.buymeacoffee.com/nhannguyendevjs
💻 My VScode Setup
Tags: vscode, workstations, tooling, extensions
Published: 2024-03-25 06:12:05

I am All time Sublime Fan, 
And maybe its time to switch to a more efficient code editor.

## Short-cut
C + S + f : find text in whole PJ
C+S+p : Command Palette 
C+` : Toggle Terminal 
C+S+x : extension 


## Assets
- [hermit font](https://github.com/pcaro90/hermit)


## Extension
- One Dark Pro
- Materail Icon
- Vetur
- Bracket Pair Colorizer 2
- color highlight
- ReactJS
- TailwindCSS
- Thunder Client
- Live Server
- Prettier



> Tribute to Sublime
> - I love this application even being a not opensource project
> - This is my way of showing gratitude of using sublime
> - I've haven't purchase its license yet but eventually I will doesn't matter i use it or not