Skip to main content

Posts

How a machine learning will works?

  How a machine learning will works?   Tabular Data How a neural network will works (deep learning)? Images How a model is understanding the text? Natural language process Machine Learning (ML) Deep Learning (DL) Natural language Process (NLP)
Recent posts

Natural intelligence == Artificial Intelligence

  Natural intelligence == Artificial Intelligence Whatever the data AI understood as numbers, For an example lets take an example  Lets compare two hotels reviews Hotel A has good 5 star reviews Hotel B has bad reviews. here based on percentage will decide the best Hotel. Similarly AI also decide.  Another example: Lets decide best doctor. Doctor A received 9 rating out of 10 from 100 patients. Doctor B received 3-2 rating from 100 Patients. Here we are converting data into some numbers. Based on this point we are deciding the best doctor as Natural way. Similarly AI also worked. To clarify how AI algorithms or Models are work  Example I have Math problem like X        Y 1          1 2          4 3          9 4          ? Y= x * x? Step1: We are loading past data in our brain, Here past data means (1,1)(2,2)(3,3) as our brain bring data or und...

Create a Seeder: Generate a seeder class using Artisan that will insert the dummy user

To insert a dummy user for testing purposes so you don't need to insert it manually each time you run `php artisan migrate:fresh`, you can use Laravel's seeding feature.  Here's a step-by-step guide to achieve this: 1. **Create a Seeder**: Generate a seeder class using Artisan that will insert the dummy user.    ```bash    php artisan make:seeder UserSeeder    ``` 2. **Define Seeder Logic**: Update the `UserSeeder` class to insert the dummy user. Open `database/seeders/UserSeeder.php` and add the following code:    ```php    <?php    namespace Database\Seeders;    use Illuminate\Database\Seeder;    use Illuminate\Support\Facades\DB;    use Illuminate\Support\Str;    use Illuminate\Support\Facades\Hash;    class UserSeeder extends Seeder    {        /**         * Seed the application's database.        ...

Laravel form validations

 Laravel Validations: List of types "first_name" => 'required|alpha:ascii|min:3|max:100',// alpha:ascii (only accepts a-z) "middle_name" => 'string', "last_name" => 'required|string', "email" => 'required|email|unique:users,email', "password" => 'required|string|confirmed', "sex" => 'required|string', "phone_no" => 'required|string', "account_type" => 'required|string', "dob" => 'required|date_format:d-m-Y', // date with format "nationality" => 'required|string', "company" => 'required|string', "company_sector" => 'required|string', "company_address" => 'required|string' "bank_account_no" => 'required|min_digits:3|max_digits:5', "role" => 'required|in:admin,editor,viewer', ...

Laravel API Docs Setup

 Laravel API's Docs setup Step 1: composer require dedoc/scramble Step 2: Publishing config. Optionally, you can publish the package’s config file: php artisan vendor:publish --provider="Dedoc\Scramble\ScrambleServiceProvider" --tag="scramble-config" Step 3: check the endpoint http://127.0.0.1:8000/docs/api more info: check here

React Components

React applications are made of   components. What’s a component? A component is a small, reusable chunk of code that is responsible for one job. That job is often to render some HTML and re-render it when some data changes. Take a look at the code below. This code will create and render a new React component: import React from 'react'; import ReactDOM from 'react-dom/client'; function MyComponent() { return <h1>Hello world</h1>; } ReactDOM.createRoot( document.getElementById('app') ).render(<MyComponent />); Import React This creates an object named React, which contains methods necessary to use the React library. React is imported from the 'react' package, which should be installed in your project as a dependency. With the object, we can start utilizing features of the react library! By importing the library, we can use important features such as Hooks, which we’ll explore in detail later. import React from 'react'; ...

React Advanced JSX

 class vs className This lesson will cover more advanced JSX. You’ll learn some powerful tricks and some common errors to avoid. Grammar in JSX is mostly the same as in HTML, but there are subtle differences to watch out for. The most frequent of these involves the word class. In HTML, it’s common to use class as an attribute name: <h1 class = "big" > Title </h1> In JSX, you can’t use the word  class ! You have to use  className  instead: <h1 className = "big" > Title </h1> This is because JSX gets translated into JavaScript, and  class  is a reserved word in JavaScript. When JSX is  rendered , JSX  className  attributes are automatically rendered as  class  attributes. Self-Closing Tags Another common JSX error involves  self-closing tags . What’s a self-closing tag? Most HTML elements use two tags: an  opening tag  ( <div> ), and a  closing tag  ( </div> ). However, som...