teleren/devto huggingface dataset:
How are METHODs used in primitive types in JavaScript?
Tags: javascript, webdev, programming, frontend
Published: 2024-01-23 18:52:35


**There are two types of data types in Javascript**
1) Primitive types
2) Non-primitive types (object references)

**Primitive types:** Primitives are known as being immutable data types because there is no way to change a primitive value once it gets created.

**Non-primitive types:** Non-primitive values are mutable data types. Objects can store data, and collections of their properties are mutable.


_let's also understand, what is a method?_

**Methods:** A method is a special kind of function that is associated with an object. It's a property of an object that holds a function definition, allowing you to perform specific actions on the object's data.


_Did you notice something..._
_Primitive type and immutable data and methods are associated with objects._
_But even then we have built-in methods in javascript for primitive data types._
_So how does it work!!, Let's learn.._

All **primitive types**, except `null` and `undefined`, have their corresponding **object wrapper** types, which provide useful methods for working with the **primitive values**. 

When a property is accessed on a primitive value, JavaScript automatically wraps the value into the corresponding wrapper object and accesses the property on the object instead.

![object wrapper types](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m1gzwb5uw39hcmwxi7bx.png)

**Here's how JavaScript handles methods for primitive values using object wrapper types:**

**1. Primitive Value Handling:**

- When you try to call a method on a primitive value directly, JavaScript recognizes the attempt to use a method on a value that doesn't inherently have methods.

- To provide the necessary functionality, it performs a temporary conversion of the primitive value into its corresponding object wrapper type.

- This conversion happens behind the scenes, without you explicitly creating the wrapper object yourself.


**2. Wrapper Object Creation:**

- JavaScript creates a wrapper object that encapsulates the primitive value.
- This wrapper object has the same value as the primitive but belongs to the object wrapper type (e.g., Number, String, Boolean).
- The wrapper object has the methods associated with its type, allowing you to perform operations on the primitive value.


**3. Method Execution:**

- The method you called is then executed on the wrapper object.
The method can access and manipulate the primitive value through the wrapper object's properties.
- Once the method finishes execution, the wrapper object is discarded.
- The original primitive value remains unchanged, as it was never directly modified.

```javascript
let name = "akshay";
let myName = name.toUpperCase(); // Calls toUpperCase() on the primitive string "akshay"

console.log(myName); // Output: "AKSHAY"
console.log(name); // Output: "akshay"
console.log(typeof name);  // Output: "string" (still a primitive)


```
Meet updated ADO.NET Data Providers, Entity Developer, LinqConnect with .NET 8 and EF Core 8 Support, and More
Tags: adonet, aspnet, efcore, devart
Published: 2024-01-23 18:49:33

Devart, a recognized vendor of world-class data connectivity solutions for various data connection technologies and frameworks, rolled out new versions of [ADO.NET Data Providers](https://www.devart.com/dotconnect/?utm_source=devto&utm_medium=referral&utm_campaign=pr_dotconnect_17.01.24), [Entity Developer](https://www.devart.com/entitydeveloper/?utm_source=devto&utm_medium=referral&utm_campaign=pr_dotconnect_17.01.24), and [LinqConnect](https://www.devart.com/linqconnect/?utm_source=devto&utm_medium=referral&utm_campaign=pr_dotconnect_17.01.24) products. The main features of this release are **.NET 8 and EF Core 8 Support**.  

**The other significant improvements:** 

- Support for Visual Studio 2022 version 17.9 Preview for all dotConnect drivers.
- Two new options are available for Entity Developer: Show System Schemas and Retrieve Cross Schema Relations.
- Added new property “Do Not Generate OnConfiguring Method” to enhance the improve the flexibility of EF Core.
- dotConnect for Oracle: added support for server connections with enabled Security Banners in the Direct mode.

To learn more about the recent release and download new products, visit: https://blog.devart.com/new-in-ado-net-data-providers-entity-developer-and-linqconnect-net-8-and-ef-core-8-support-implementation-and-more.html

**dotConnect** is an enhanced data connectivity solution built over ADO.NET architecture and a development framework with a number of innovative technologies. dotConnect includes high-performance data providers for major databases and popular cloud applications and offers a complete solution for developing data-related applications and websites. dotConnect can be used in all areas of modern application development: web applications and services, windows forms applications, mobile and enterprise development.

**About Devart**
 
Devart is one of the leading developers of database tools and administration software, ALM solutions, data providers for various database servers, data integration, and backup solutions. The company also implements Web and Mobile development projects. 
For additional information about Devart, visit https://www.devart.com/.
OLAP cubes are dead; change my mind
Tags: analytics, database
Published: 2024-01-23 18:48:31

A database cube, also known as a data cube, is a multidimensional data structure that is used for data analysis and reporting. It organizes data into dimensions and measures, which allows users to slice and dice the data to gain insights into their business.

Database cubes were popular in the early days of data warehousing, but they have largely been replaced by other technologies, such as columnar databases (Snowflake, StarRocks) and distributed computing frameworks (Apache Spark).

There are a few reasons for the decline of database cubes:

- They are complex and expensive to set up and maintain. Database cubes require specialized hardware and software, and they can be difficult to scale to large datasets.
- They are not well-suited for real-time analytics. Database cubes are typically used for batch processing, which means that they cannot provide real-time insights into data.
- They are not as flexible as other technologies. Database cubes are typically designed for specific use cases, such as sales analysis or financial reporting. They can be difficult to adapt to new requirements or to support user-facing analytics (self-service analytics or ad-hoc queries).

Other technologies, such as columnar databases and distributed computing frameworks, offer a number of advantages over database cubes:

- They are more scalable and cost-effective. Columnar databases and distributed computing frameworks can be used to process large datasets efficiently and at a lower cost.
- They are more flexible. Columnar databases and distributed computing frameworks can be used for a variety of use cases, including real-time analytics and machine learning.
- They are easier to use. Columnar databases and distributed computing frameworks are more user-friendly than database cubes, and they can be used with a variety of programming languages.

Overall, database cubes are a legacy technology that has been largely replaced by other technologies. Other technologies offer a number of advantages over database cubes, including scalability, flexibility, cost-effectiveness, and ease of use.

Here are some examples of technologies that can be used to replace database cubes:

- Columnar databases, such as Apache Parquet and open source OLAP databases like StarRocks
- Distributed computing frameworks, such as Apache Spark and Hadoop
- In-memory databases, such as Redis and Memcached
- Cloud-based data warehouses, such as Google BigQuery and Amazon Redshift

If you are considering using a database cube, I recommend that you evaluate the alternatives carefully. Other technologies may offer a better fit for your needs.

Read more about StarRocks at http://starrocks.io

StarRocks, a Linux Foundation project, is a next-generation sub-second MPP OLAP database for full analytics scenarios, including multi-dimensional analytics, real-time analytics, and ad-hoc queries. StarRocks received InfoWorld’s 2023 BOSSIE Award for best open source software.
React API calls made simple with Axios
Tags: react, api, learning, newbie
Published: 2024-01-23 18:48:23

React is a JavaScript library for building user interfaces. Often you will want to fetch data from an API and display it in your React application.
Axios is a promise-based HTTP client that makes it easy to fetch data from APIs.
In this tutorial I will show you the simplest way to fetch API data and display it in your website.

## Prerequisites
You should have a basic knowledge of React

## Install Axios
Install Axios in your project folder using the following command:

```
npm install axios
```

## Import Axios
Import Axios in the component which you want to make API calls in as shown below:

```
import React, { useEffect, useState } from 'react';
import axios from 'axios';
```

## Making a GET Request
To make a GET request, use the following code:

```
axios.get(url)
  .then(response => {
    // Handle the successful response here
    console.log(response.data);
  })
  .catch(error => {
    // Handle errors here
    console.error('Error fetching data:', error);
  });
```

## Handling Asynchronous Operations
To handle asynchronous functions we use 'async/await' since API calls are asynchronous operations and React ensures that the UI remains responsive during these calls:

```
const fetchData = async() =>{
      try {
        const response = await axios.get(url)
        setData([response.data])
      } catch (error) {
        console.log(error)
      }
    }
    fetchData()
```

## Integrate with React Components
Integrate your knowledge of data fetching in your React components as shown below:

```
import axios from 'axios'
import React, {useState, useEffect} from 'react'

const App = () => {
  const [data, setData] = useState([])
  const url = "https://api.chucknorris.io/jokes/random"

  useEffect(() => {
    const fetchData = async() =>{
      try {
        const response = await axios.get(url)
        setData([response.data.value])
      } catch (error) {
        console.log(error)
      }
    }
    fetchData()
  }, [])
  return (
    <ul>
      {data.map((item, index) => (
        <li key={index}>{item}</li>
      ))}
  </ul>
  )
}

export default App

```
We use the useEffect hook to call the API when the component mounts.
Axios makes the Get request and returns a promise. When the promise resolves, we set the state using setData.
We finally use the map function to loop the data and display it on the page.
Remove React.StrictMode in your index.js file(If you are using Create-React-App) or main.js file(If you are using Vite) to prevent the useEfect hook from running twice.
Refresh the page to get more Chuck Norris jokes.
Introducing Flowbite Blazor WASM Starter Project
Tags: dotnet, css, opensource
Published: 2024-01-23 18:45:57

## **Hi There**
If you've been following my articles for a while, then you should know I'm a fan of Tailwind CSS. And if you're familiar with Tailwind CSS yourself, you would also know that there's a vast number of resources when it comes to UI libraries built with Tailwind. My personal favorite is Flowbite, which I've used in some of my projects and I absolutely love it. Luckily though, Flowbite introduced their Blazor integration in late 2023, which made it possible to use their components with all the interactivity goodies in Blazor applications, which is **INCREDIBLE.**

However, for a good while, the integration only worked for Blazor server, on the other end, Blazor WASM didn't have its integration sorted out, but a while ago, I was reading their docs and found that the integration for WebAssembly is actually out. So I tested it myself and it does work flawlessly.

## **So, what's the starter project all about?**
It's simple, in every .NET project, we've got templates which we can utilize to create our projects much more quickly, the template would do all the wiring and setup for you, so you can hit the ground running. For that reason, I wanted to create the **Flowbite Blazor WASM Starter** template. The main reason being, setting up Tailwind alone, is a bit redundant, add Flowbite to the mix, and it's more setup you got, and to be honest, we .NET developers are a bit spoiled, because the tooling is always productive and quick, and that's what the template is for.


![Home page on the template project with Tailwind and Flowbite](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tssju3hfihf0kukr8x3o.png) 


![Counter page on the template project with Tailwind and Flowbite](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qbqacrjy2zn8ppguipcr.png)


![Weather page on the template project with Tailwind and Flowbite](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/524xxlel9ymnj505b2el.png)

> 💡 The previous pictures showcase the look of the project using some of the components **Flowbite** provides, the design is same as that of the default template.


The template includes everything you need from tailwind's config file, the required packages and node modules, CDN link, and everything you need to have Tailwind & Flowbite up and running in your Blazor project.
All you have to do is clone the Github repository, run 2 quick commands, and the project is ready for development.

I will not go into how to install or use the template, because I documented all of the necessary information inside the repository's Readme file, so if you want to get started, you can follow the link for the Github repository, and take it on from there.

> 💡 Here's the link for the Github repository: https://github.com/rasheed-k-mozaffar/FlowbiteBlazorWasmStarter
React API calls made simple with Axios
Tags: react, api, learning, newbie
Published: 2024-01-23 18:45:01

React is a JavaScript library for building user interfaces. Often you will want to fetch data from an API and display it in your React application.
Axios is a promise-based HTTP client that makes it easy to fetch data from APIs.
In this tutorial I will show you the simplest way to fetch API data and display it in your website.

## Prerequisites
You should have a basic knowledge of React

## Install Axios
Install Axios in your project folder using the following command:

```
npm install axios
```

## Import Axios
Import Axios in the component which you want to make API calls in as shown below:

```
import React, { useEffect, useState } from 'react';
import axios from 'axios';
```

## Making a GET Request
To make a GET request, use the following code:

```
axios.get(url)
  .then(response => {
    // Handle the successful response here
    console.log(response.data);
  })
  .catch(error => {
    // Handle errors here
    console.error('Error fetching data:', error);
  });
```

## Handling Asynchronous Operations
To handle asynchronous functions we use 'async/await' since API calls are asynchronous operations and React ensures that the UI remains responsive during these calls:

```
const fetchData = async() =>{
      try {
        const response = await axios.get(url)
        setData([response.data])
      } catch (error) {
        console.log(error)
      }
    }
    fetchData()
```

## Integrate with React Components
Integrate your knowledge of data fetching in your React components as shown below:

```
import axios from 'axios'
import React, {useState, useEffect} from 'react'

const App = () => {
  const [data, setData] = useState([])
  const url = "https://api.chucknorris.io/jokes/random"

  useEffect(() => {
    const fetchData = async() =>{
      try {
        const response = await axios.get(url)
        setData([response.data.value])
      } catch (error) {
        console.log(error)
      }
    }
    fetchData()
  }, [])
  return (
    <ul>
      {data.map((item, index) => (
        <li key={index}>{item}</li>
      ))}
  </ul>
  )
}

export default App

```
We use the useEffect hook to call the API when the component mounts.
Axios makes the Get request and returns a promise. When the promise resolves, we set the state using setData.
We finally use the map function to loop the data and display it on the page.
Remove React.StrictMode in your index.js file(If you are using Create-React-App) or main.js file(If you are using Vite) to prevent the useEfect hook from running twice.
Refresh the page to get more Chuck Norris jokes.
The Ultimate Guide to Cartel Software's US30 EA: Features, Benefits, and Performance
Published: 2024-01-23 18:38:28

In the fast-paced world of financial markets, staying ahead of the curve is the key to success. [Cartel Software's US30 EA](https://cartelalgo.com/) emerges as a game-changer, promising traders unparalleled precision, robust features, and impressive performance. This ultimate guide delves into the intricacies of this cutting-edge trading tool, shedding light on its features, benefits, and overall impact on trading strategies.

Features that Redefine Precision:
Cartel Software's US30 EA is engineered with an arsenal of features designed to empower traders. The algorithm employs advanced technical indicators, real-time market analysis, and adaptive strategies to navigate the dynamic landscape of the US30 index. From trend identification to risk management, the software's features are finely tuned to maximize trading precision.

Benefits for Discerning Traders:
This EA isn't just about features; it's about delivering tangible benefits to traders. Enhanced decision-making capabilities, reduced emotional biases, and improved execution speed are just a few advantages users can expect. The EA adapts to varying market conditions, providing traders with a versatile tool that aligns with their unique trading styles.

Performance that Speaks Volumes:
Cartel Software's US30 EA stands tall on the performance front. Backed by rigorous testing and optimization, the EA consistently demonstrates its ability to outperform traditional trading approaches. Whether in volatile markets or stable conditions, its adaptive nature ensures optimal performance, offering traders a reliable ally in the pursuit of financial success.

User-Friendly Interface:
Navigating the complexities of the financial markets shouldn't be a daunting task. [The US30 EA](https://cartelalgo.com/pricings/) boasts an intuitive and user-friendly interface, ensuring that both seasoned traders and newcomers can harness its power effortlessly. With customizable settings and detailed performance metrics, users can fine-tune their strategies and monitor results with ease.

In conclusion, the Cartel Software's US30 EA stands as a beacon of innovation in the world of algorithmic trading. Its sophisticated features, tangible benefits, and consistent performance make it an indispensable tool for traders seeking an edge in the competitive landscape of financial markets.
**[Get Started with US30 MT5 EA.](https://cartelalgo.com/)**
GET THE NEW IPHONE 12 TODAY !!
Tags: iphone, iphone12, giveway, apple
Published: 2024-01-23 18:38:04

**GET THE NEW IPHONE  12 TODAY !! giveaway Free iPhone Chance to win a brand new iPhone 12 pro Max [click here ]( https://bitly.ws/3aBDG)
[join now ]( https://bitly.ws/3aBDG )*
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zeph3hiclyyb2n3ucrrd.jpg)*
Trino / Presto (PrestoDB) alternatives
Tags: analytics, database
Published: 2024-01-23 18:34:36

When it comes to Trino and PrestoDB competitors, it’s important to consider them within two main categories:

1. Direct Competitors: These are tools that offer similar functionality and target the same use cases as Trino, primarily focusing on distributed SQL querying across data warehouses and data lakes. Here are some of the biggest names:

- Starburst: Founded by the creators of the original Presto project, Starburst is a well-established commercial distribution of Trino with additional features and enterprise support.
- Dremio: This cloud-native data lake engine uses a query engine similar to Trino and focuses on simplifying data access and governance.
- Ahana: Acquired by Cloudera in 2020, Ahana is another commercial distribution of Trino offering enterprise features and integrations with Cloudera’s data platform.
- Kloudfuse: Focused on data virtualization, Kloudfuse leverages Trino as its query engine while providing a unified data access layer across various sources.

2. Alternative Technologies: While not direct competitors in the strictest sense, these tools cater to similar needs with different approaches:

- Apache Spark: This popular distributed processing framework can also be used for SQL-like queries on large datasets, but requires more coding knowledge compared to Trino’s pure SQL interface.
- PrestoDB: Although closely related to Trino, this fork of the original Presto project takes a different development path and caters to a distinct community.
- Other SQL Engines: Traditional OLAP database engines like open source StarRocks, Snowflake or Redshift may be considered alternatives for specific use cases, depending on data size, scalability, and cost requirements.

If you want to understand more on why StarRocks is different than Trino, check out https://www.starrocks.io/blog/comparison-starrocks-vs-trino
Video deep dive: Advanced distributed training with Hugging Face LLMs and AWS Trainium
Tags: opensource, ai, aws, huggingface
Published: 2024-01-24 11:32:01

---
title: Video deep dive: Advanced distributed training with Hugging Face LLMs and AWS Trainium
published: true
date: 2024-01-23 18:34:12 UTC
tags: opensource,ai,aws,huggingface
canonical_url: https://julsimon.medium.com/video-deep-dive-advanced-distributed-training-with-hugging-face-llms-and-aws-trainium-ae06fda8bc86
---

Following up on my recent “[Hugging Face on AWS accelerators](https://youtu.be/66JUlAA8nOU)” deep dive, this new video zooms in on distributed training with NeuronX Distributed Optimum Neuron and AWS Trainium.

![](https://cdn-images-1.medium.com/max/1024/1*VJqRkBcZyc3BYvnwRhryeg.png)

First, we explain the basics and benefits of advanced distributed techniques like tensor parallelism, pipeline parallelism, sequence parallelism, and DeepSpeed ZeRO. Then, we discuss how these techniques are implemented in NeuronX Distributed and Optimum. Finally, we launch an Amazon EC2 Trainium-powered instance and demonstrate these techniques with distributed training runs on the TinyLlama and Llama 2 7B models.

Of course, we share results on training time and cost, which will probably surprise you!

{% youtube zZU5JjBG1fI %}