teleren/devto huggingface dataset:
Setup LiveBook/Elixir to run Nx lib with Torchx (with GPU) on Macbook(Apple Silicon)
Tags: torchx, livebook, machinelearning, nx
Published: 2024-03-23 02:07:06

If you want to run Elixir Nx library for machine learning on Macbook/Mac Mini/Mac Studio with Metal (GPU) for Apple Silicon you can simple follow steps.

**1. Setup and config Pytorch.**

Install `asdf` if you don't have one.

Follow below script to install Python3 by `asdf`

```bash
asdf plugin-add python
asdf install python 3.x.x
asdf global python 3.x.x

pip3 install torch torchvision
```

Verify with simple Python script:

Run Python:
```bash
python
```

add text in Python:

```python
import torch
x = torch.rand(5, 3)
print(x)
```

You can see output like:

```python
tensor([[0.3380, 0.3845, 0.3217],
        [0.8337, 0.9050, 0.2650],
        [0.2979, 0.7141, 0.9069],
        [0.1449, 0.1132, 0.1375],
        [0.4675, 0.3947, 0.1426]])
```

Ctrl + D to exit.

**2. Setup LiveBook in local for easy access local environment.**

```bash
git clone https://github.com/livebook-dev/livebook.git
cd livebook
mix deps.get --only prod

# Run the Livebook server
MIX_ENV=prod mix phx.server
...
[Livebook] Application running at http://localhost:8080/?token=dqwkm3a6i3f7pwn6jfmug33322111
```

Access LiveBook from url in terminal.

[LiveBook site](https://livebook.dev)

**3. Create new LiveBook and config LiveBook.**

```elixir
Mix.install(
  [
    #...
    {:nx, "~> 0.7"},
    {:torchx, "~> 0.7"}
  ],
  config: [
    nx: [default_backend: {Torchx.Backend, device: :mps}]
  ]
)
```

Run setup for pull packages.

For case cannot load NIF (related with Torchx) module, try to run setup without cache in LiveBook.

Remember set compiler to default compiler for Axon if needed.

Add your script and have fun!
Loading Images ReactJs
Tags: react, webdev, beginners, tutorial
Published: 2024-03-23 01:52:26

Hello Dev community 
**I want to share with you a simple Image Loading Using Simple userEffect and a promise
**

1. Fist of All , we create a component with a basic user interface 

2. we import ower images from the Public folder 
I have an example in here 
```
import bernuilt from "../../../public/bernuilt.jpg";
import benomial from "../../../public/benomial.jpg";
import uniformDiscret from "../../../public/uniformDiscret.jpg";
import HyperGeomitrique from "../../../public/HyperGeomitrique.jpg";
import Geomitrique from "../../../public/Geomitrique.jpg";
import Poisson from "../../../public/Poisson.jpg";

```

and then this is the useEffect function that does the word for us 

```
const [imagesLoaded, setImagesLoaded] = useState(false);
useEffect(() => {
        const imageLoader = new Promise((resolve, reject) => {
            const images = [bernuilt, benomial, uniformDiscret, HyperGeomitrique, Geomitrique, Poisson];
            let loadedCount = 0;

            images.forEach((imageSrc) => {
                const img = new Image();
                img.onload = () => {
                    loadedCount++;
                    if (loadedCount === images.length) {
                        resolve();
                    }
                };
                img.onerror = () => {
                    reject();
                };
                img.src = imageSrc;
            });
        });

        imageLoader.then(() => {
            setImagesLoaded(true);
        }).catch(() => {
            console.error("Error loading images");
        });
    }, []);
```
and then Lastly to integrate between the Loading and the UI we use this simple Logic 

```
{!imagesLoaded ? (
         <div className="w-full h-full flex items-center justify-center">
            <span className="loader"></span>
         </div>
       ) : (
           // you code here
      )}
```
and for the **.loader** CSS class We use this CSS animation Code 

```
.loader {
    width: 40px;
    height: 40px;
    border: 5px solid #353535;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
```

And That's it , We Done it !
a simple React image Loader with out any external library 


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/un6c6n0xuo0py961srj1.png)
Neurofia Outperforms Thesis and Onnit
Tags: ai, discuss, news
Published: 2024-03-23 01:11:43

## The Future of Focus: Neurofia and Generative AI

In a world where attention is a scarce commodity, the quest for enhanced focus and productivity has led to the exploration of various cognitive enhancers. Recently, a groundbreaking study conducted at the University of California, Berkeley has unveiled a new player in this field: **Neurofia**. This novel generative AI has shown promising results, demonstrating the same fast-acting hyper-focus that dextroamphetamine, a commonly used stimulant, does.

The Study
The research trial spanned eight weeks and involved rigorous testing and data collection. The generative AI, Neurofia, was put through a series of tasks designed to measure focus, attention span, and cognitive processing speed. The results were nothing short of remarkable.

Neurofia vs. Dextroamphetamine
Dextroamphetamine, a central nervous system stimulant, is often prescribed for conditions like ADHD and narcolepsy. It works by increasing the levels of certain chemicals in the brain that help with focus and attention. However, it can also have side effects such as insomnia, dry mouth, and increased heart rate.

On the other hand, Neurofia, being an AI driven perscription, does not have these physical side effects. Yet, it was able to engender the same level of hyper-focus that dextroamphetamine does. This makes Neurofia a pot
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbs76lt5eksq9c0bqxlc.png)ential game-changer in the field of cognitive enhancement.

The Implications
The implications of this research are far-reaching. If Neurofia can indeed replicate the effects of dextroamphetamine without the associated physical side effects, it could revolutionize how we approach productivity and focus. It could potentially provide a safer, more accessible means for individuals to enhance their cognitive abilities.

Moreover, this study also underscores the potential of generative AI in various fields. If an AI can mimic the effects of a cognitive enhancer, what else could it do? The possibilities are endless and exciting.

Conclusion
While further research is needed to fully understand the capabilities of Neurofia, this study has certainly paved the way for exciting developments in the realm of cognitive enhancement. As we continue to explore the capabilities of generative AI, we may just be on the brink of a new era of focus and productivity.

Stay tuned for more updates on this groundbreaking research and the exciting future of Neurofia and generative AI.
New generative AI has concluded after an 8-week research trial at the University of California, Berkeley that Neurofia engenders the same fast-acting hyper-focus that dextroamphetamine does.
ID Analyzer - Identity verification service: Scan & verify worldwide IDs
Tags: identitymanagement, api, identity, idservice
Published: 2024-03-23 00:56:51

In today's digital world, robust identity verification is paramount for businesses across industries. Fraud prevention, regulatory compliance, and seamless customer onboarding all hinge upon accurately identifying users. That's where ID Analyzer comes in – a leading identity verification API that simplifies and enhances ID authentication processes. ID Analyzer is a cutting-edge API solution that allows businesses to rapidly extract, analyze, and verify data from various identity documents.

https://www.idanalyzer.com
Laravel Accessors and Mutators (Eloquent Steps 2 )
Tags: laravel, php, bestpractise, accessor
Published: 2024-03-23 00:53:26

Accessors are used to format the attributes when you retrieve them from database. Whereas, Mutators are used to format the attributes before saving them into the database.

Lets get started

## **Creating Accessors **
Suppose that you have two column 


` first_name & last_name in users table`
 Now you want to get the user `full_name `. Accessors create a `"fake" `attribute on the object which you can access as if it were a database column. So if your person has `first_name `and `last_name `attributes, you could write `User Model`:

`Syntax to create accessor –

To define an accessor, create a get{Attribute}Attribute method on your model where {Attribute} is the “studly” cased name of the column.`

Model ` User.php `

```
  protected function getFullNameAttribute()
    {
        return $this->fist_name . "" . $this->last_name;
    }
```

and a Controller that looks like this:

```
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\User;

class AccessorMutatorController extends Controller
{
  
    //get accesor userFullName
    public function getUser()
    {
        $users = User::get();

        foreach($users as $user){
            echo  $user->full_name;
        }

    }
}

```
also a `route `that looks like this:

```
Route::get('accessor',[AccessorMutatorController::class,'getUser']);
```

## **Creating Mutators**
A mutator transforms an Eloquent attribute value when it is set. Mutators work when we save data inside database table.

Syntax to create mutators –

To define a mutator, define a `set{Attribute}Attribute` method on your model where {Attribute} is the “studly” cased name of the column which we want to get altered when saved.

Model `User.php`
```
    // when "name" will save, it will convert into lowercase
    protected function setNameAttribute($value){
        $this->attributes['name'] = strtolower($value);
    }

```

and a Controller that looks like this:

```
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\User;

class AccessorMutatorController extends Controller
{
    //setUser with mutator
    public function setUser()
    {
        $user = new User();

        $user->name = "Alan Donald";
        $user->fist_name = "Alan";
        $user->last_name = "Donald";
        $user->email = "jone@gmail.com";
        $user->password = bcrypt("123456");

        $user->save();
    }

}
```

also a `route `that looks like this:

```
Route::get('mutator',[AccessorMutatorController::class,'setUser']);
```

## Check the result

The result should look something like this:



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

Hurray! We have successfully created and used accessors and mutators , use this on your future projects to improve the readability , stability and performance of your code!
Episode 24/11: Angular 17.3
Tags: webdev, javascript, angular, programming
Published: 2024-03-23 00:37:12

Angular 17.3 has arrived. It completes the new API, which provides features we require for "component communication".

{% embed https://youtu.be/H_Iz6MSBfC0 %}

The old API used to be the property decorators `@Input`, `@Output`, `@ViewChild`, `@ViewChildren`, and `@ContentChild`, `@ContentChildren`.

The new API replaces those decorators with simple function calls, which return a Signal — except the output function — and have a `required` method that enforces a certain type.

It is important to note that the old API and the decorators are still there; they aren't deprecated, and the new API - as it is already tradition - starts in "developer preview". That means features aren't buggy, but breaking changes between minor versions could happen.

---

Angular 17.3 added the `output` function, which returns you a new type `OutputEmitterRef`, which is an object literal containing an emit function that works in the same as the old `EventEmitter`.

The main difference is that it is not a `BehaviorSubject` under the hood. You might have to change something if you've been using `next` instead of `emit`.

The reason for that decoupling is the long-term plan to make RxJs optional. Some former episodes already covered that topic.

Nevertheless, you still have the possibility of mapping from an Observable to `OutputEmitterRef`. The function for that is `outputFromObservable`.

---

Other than that, we now have support for the brand-new TypeScript 5.4. The `inject` function also got an extension. Whenever a directive wanted to inject an attribute, it had to do it via the constructor. Now, the `inject` function is also able to do that.

For more information about the release, check out the ChangeLog, and the various blog postings and videos.

---

https://github.com/angular/angular/releases/tag/17.3.0

{% embed https://www.angulararchitects.io/en/blog/component-communication-with-signals-inputs-two-way-bindings-and-content-view-queries/ %}

{% embed https://blog.ninja-squad.com/2024/03/13/what-is-new-angular-17.3/ %}

{% embed https://www.angularaddicts.com/p/whats-new-in-angular-17-3 %}
Revolutionizing Your Portfolio: Top 10 AI-Powered Stock Trading Apps of the Year 2024
Published: 2024-03-23 00:14:14

<div class="markdown prose w-full break-words dark:prose-invert light"><p>In the rapidly evolving domain of stock trading and investing, the integration of Generative AI technologies has ushered in a new era of applications designed to optimize investment strategies, provide in-depth market analysis, and automate trading processes. These platforms leverage advanced AI to cater to a wide array of investor needs, from seasoned traders to those just beginning their investment journey. Below is a curated list of ten notable AI stock trading apps that have made a significant impact over the last year:</p><ol><li><p><strong>Pionex</strong> - Specializes in AI-powered bot strategies for cryptocurrency trading, supporting a vast range of cryptocurrencies. <a target="_new" href="https://www.pionex.com">Visit Pionex</a></p></li><li><p><strong>Coinrule</strong> - Tailored for beginners, allowing users to create custom trading rules using the IFTTT model for automated trading across numerous exchanges. <a target="_new" href="https://www.coinrule.com">Visit Coinrule</a></p></li><li><p><strong>Wealthfront</strong> - Manages diversified portfolios with AI algorithms, featuring tax-loss harvesting and automatic rebalancing. <a target="_new" href="https://www.wealthfront.com">Visit Wealthfront</a></p></li><li><p><strong>Trade Ideas</strong> - Features Holly AI for after-hours market analysis and trade suggestions, ideal for information-driven traders. <a target="_new" href="https://www.trade-ideas.com">Visit Trade Ideas</a></p></li><li><p><strong>TrendSpider</strong> - Offers extensive technical analysis and AI alerts, catering to advanced traders seeking a wide range of options. <a target="_new" href="https://www.trendspider.com">Visit TrendSpider</a></p></li><li><p><strong>eToro’s CopyTrader</strong> - Enables users to follow the trades of top investors, providing a dynamic way to learn and trade. <a target="_new" href="https://www.etoro.com">Visit eToro</a></p></li><li><p><strong>Signal Stack</strong> - Converts trading platform alerts into executed orders in brokerage accounts, automating the trading process. <a href="https://signalstack.com/" target="_new">Visit signal stack</a></p></li></ol><p>Each of these apps represents the forefront of AI-driven trading, providing tools and features that cater to various aspects of the trading and investment process. From automated cryptocurrency trading bots to comprehensive platforms for managing diversified portfolios, these applications are reshaping how individuals and institutions engage with financial markets.</p><p>For those interested in exploring even more AI trading platforms, this comprehensive list offers a wider selection of sites dedicated to leveraging AI for trading and investment purposes. It's an excellent resource for anyone looking to dive deeper into the world of AI-assisted trading. <a target="_new" href="https://aisites.love/site/candlestick/">Visit the comprehensive list</a>.</p></div>
Caption This! 🤔💭
Tags: watercooler, discuss
Published: 2024-03-23 00:00:00

---
published_at : 2024-03-23 00:00 +0000
---
Can you come up with the wittiest caption to explain what's happening here?

![Image of asphalt outside being held together by a bandaid](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k4mb5i7w0hmi2x132h5x.jpg)
FOUR IMPORTANCE OF XLOOKUP
Tags: data, analysis, xlookup, webdev
Published: 2024-03-22 23:53:51


FOUR IMPORTANCE OF XLOOKUP
1.	Lookup functionality: The XLOOKUP function in 1. Excel is a powerful tool that allows users to search a range or array for a specific value and return a corresponding value from another range or array. This makes it easy to find and retrieve data from large datasets without the need for complex nested formulas.





2.	Flexibility: One key advantage of XLOOKUP is its flexibility. Unlike older lookup functions like VLOOKUP and HLOOKUP, XLOOKUP allows users to search in any direction (rows or columns) and also supports searching for approximate matches, exact matches, and wildcard matches. This makes it a versatile tool for a wide range of data lookup tasks.




3.	Error handling: XLOOKUP also includes built-in error handling functionality, making it easier to handle situations where a lookup value is not found. Users can specify a default value to return if the lookup value is not found, or choose to return an error message instead. This helps to ensure that users can easily identify and troubleshoot any issues with their lookup formulas.
4. Array support: Another key feature of XLOOKUP is its support for array operations. Users can use XLOOKUP to search and return multiple values at once, making it easier to work with complex datasets and perform advanced calculations. This can help to streamline data analysis tasks and improve overall efficiency in Excel.
Unity dev blog #1
Published: 2024-03-22 23:07:17

This blog is mainly just to keep me at my projects. I find writing about them helps keep my motivation up and its also nice looking back on work done.

I've played with game dev off and on over the years, one of my first large projects was a kind of space invaders clone done in Java without an engine. I never finished, I got more interested in the engine-making than the actual game.

After that I toyed around with various game-dev topics over the years like collision detection, space partitioning, rendering, path finding. 

I started to learn Unity during the Covid lockdowns, it took a while to get the hang of how everything worked. I ran through several tutorials but it felt unintuitive and awkward. I made a basic top down shooter and a sort of anti-aircraft gun game before my interest waned.

I dabbled a little bit after, I tried making a card game and a civ-like game. The first one fizzled due to poor game-design, the second got snarled up by bad code-planning.

And then theres now. I made another terrible, top-down shooter. This was mainly just to orientate myself again and work out how to write a complete game loop. I've then dipped my toes into post processing and particles systems.

My plan is to create a series of games and spend about 10-15 hours on each. I'd like to explore different parts of unity and different genres. 

The first is yet another top-down shooter but i'd like this one to be a bit more polished and complete then it's predecessors.
Laravel Taxify
Tags: laravel, php, tax
Published: 2024-03-22 23:02:33

---
title: Laravel Taxify
published: true
description: Laravel Taxify provides a set of helper functions and classes to simplify tax (VAT) calculations within Laravel applications.
tags: Laravel, php, tax
# cover_image: ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/03766ijqngq69uvq44w6.jpeg)
# published_at: 2024-03-22 15:27 +0000
---
Laravel Taxify provides a set of helper functions and classes to simplify tax (VAT) calculations within Laravel applications. that allow developers to easily integrate tax calculation functionalities into their projects with multi tax profiles settings and (fixed, percentage) ways. it's offers a straightforward and efficient solution Designed to streamline the process of handling taxes.

## [Documentation](https://omaralalwi.github.io/laravel-taxify)

## Features

- Calculate tax for individual amounts or a collection of amounts
- Retrieve tax amount, rate, and type for any profile as individual.
- Retrieve tax `amount_with_tax` and `tax_amount`  and `tax_rate` for any profile as individual for one amount or a collection of amounts
- Get tax rate as a percentage (for percentage type only)
- Customizable configuration options through environment variables easy.
- helper functions easy-to-use.
- support all php and laravel versions.
- Exception Handling: Robust error handling to ensure smooth operation and easy debugging.
- Logging: Automatic logging of errors and exceptions for better error tracking and debugging.
- Unit Tests.
preventing overfitting
Published: 2024-03-22 22:50:18

Bir modelin overfitting olduğunu anlamak için çeşitli görselleştirme ve değerlendirme tekniklerinden yararlanabiliriz. İşte overfitting'in belirtileri ve bu belirtileri değerlendirmek için kullanılabilecek bazı teknikler:

Eğitim ve doğrulama kayıplarının karşılaştırılması: Eğitim süreci boyunca eğitim ve doğrulama kayıplarını izleyin. Eğer eğitim kaybı sürekli olarak azalırken, doğrulama kaybı artmaya başlarsa, bu overfitting'in belirtisi olabilir.

Eğitim ve doğrulama doğruluklarının karşılaştırılması: Eğitim süreci boyunca eğitim ve doğrulama doğruluklarını izleyin. Eğer eğitim doğruluğu sürekli olarak artarken, doğrulama doğruluğu bir noktadan sonra düşmeye başlarsa, bu overfitting'in belirtisi olabilir.

Öğrenme eğrisinin görselleştirilmesi: Eğitim ve doğrulama kayıplarını veya doğruluklarını grafik olarak çizerek modelin öğrenme eğrisini görselleştirin. Overfitting varsa, eğitim kaybı düşerken doğrulama kaybı artacaktır.

Modelin doğrulama seti performansının değerlendirilmesi: Modelin doğrulama setindeki performansını dikkatlice değerlendirin. Eğer model eğitim verilerine çok iyi uyum sağlıyor ancak doğrulama setinde kötü performans gösteriyorsa, bu overfitting'in bir işaretidir.

Çapraz doğrulama (Cross-validation): Modelin çapraz doğrulama kullanarak farklı veri altkümeleri üzerinde değerlendirilmesi, overfitting'i tespit etmek için faydalı olabilir. Eğer model farklı veri altkümeleri üzerinde tutarlı performans göstermiyorsa, bu overfitting'in bir belirtisi olabilir.

Regularizasyon tekniklerinin kullanılması: Regularizasyon teknikleri (örneğin, dropout, L1 veya L2 düzenleme) kullanarak modelin overfitting'e karşı daha dirençli hale gelmesini sağlayabilirsiniz.