-->

My Blog

Latest blog

 Sort notes and acronyms of some words!!











 

HTTP request in details









 Install Tailwind CSS with react js




You must need to follow some steps


Step1: Create your own project in react. and then go to the project directory

      - npx create-react-app my-project

      - cd my-project

Step2: Install Tailwind CSS follow the commands

          First of all install Tailwind. and its peer dependencies via npm. and then generate both                            `tailwind.config.js` and `postcss.config.js`.

       - npm install -D tailwindcss postcss autoprefixer

       - npx tailwindcss init -p


Step3: Configure the Template Path

Add the paths to all of your template files in your `tailwind.config.js` file.

            content: [

                      "./src/**/*.{js,jsx,ts,tsx}",

                         ],


Step4: Tailwin directives add in `./src/index.css` file

                 @tailwind base;

                 @tailwind components;

                 @tailwind utilities;

Step5: Build the process with `npm run start`

Step6: Start your project with Tailwind CSS

export default function App() {

  return (

    <h1 className="text-5xl  underline">

      Hello, Elvi!

    </h1>

  )

}

 ER Diagram to SQL Representation





















Consider the following relations:

Doctor(SSN, FirstName, LastName, Specialty, YearsOfExperience, PhoneNum)

Patient(SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN)

Medicine(TradeName, UnitPrice, GenericFlag)

Prescription(Id, Date, Doctor_SSN, Patient_SSN)

Prescription_Medicine(Id,Prescription_Id, TradeName, NumOfUnits)


  • The Doctor relation has attributes Social Security Number (SSN), first and last names,specialty, the number of experience years, and phone number.
  • The Patient relation has attributes SSN, first and last names, address, date of birth(DOB), and the SSN of the patientʼs primary doctor.
  •  The Medicine relation has attributes of trade name, unit price, and whether or not themedicine is generic (True or False).
  • The Prescription relation has attributed to the prescription id, the date on which the prescription is written, the SSN of the doctor who wrote the prescription, and the SSN of the patient to whom the prescription is written.
  • The Prescription_Medicine relation stores the medicines written in each prescription along with their quantities (number of units).

1. Write SQL queries to create the above tables and also show the relationship for the above

entities.

The underline attribute is the primary key and the foreign key.

2. Write the SQL expression for the following query

a. Write SQL query to show the trade name of generic medicine with unit

price less than $50.

b. Write SQL query to show the first and last name of patients whose primary

doctor named ʻJohn Smithʼ.

c. Write the SSN of patients who have ʻAspirinʼ and ʻVitaminʼ trade names in

one prescription.

d. Write a SQL query to show all doctors information whose experience is

greater than 5 years and specialty is a neurologist.



Answer To the Question 01

CREATE DATABASE dbmslab_db;

CREATE TABLE doctor_tbl(

   doctor_ssn INT NOT NULL AUTO_INCREMENT,

   first_name VARCHAR(100) NOT NULL,

   last_name VARCHAR(100) NOT NULL,

   speciality VARCHAR(100) NOT NULL,

   yearsof_experience VARCHAR(40) NOT NULL,

   PhoneNum VARCHAR(40) NOT NULL,

   PRIMARY KEY(doctor_ssn)

);

CREATE TABLE patient_tbl(

   patient_ssn INT NOT NULL AUTO_INCREMENT,

   first_name VARCHAR(100) NOT NULL,

   last_name VARCHAR(100) NOT NULL,

   address VARCHAR(100) NOT NULL,

   DOB DATE NOT NULL,

   doctor_ssn INT(10),

   PRIMARY KEY(patient_ssn),

   FOREIGN KEY (doctor_ssn) REFERENCES doctor_tbl (doctor_ssn)

);

CREATE TABLE medicine_tbl(

   trade_name VARCHAR(100) NOT NULL,

   unit_price VARCHAR(100) NOT NULL,

   generic_flag VARCHAR(100) NOT NULL,

   PRIMARY KEY(trade_name)

);

CREATE TABLE prescription_tbl(

   prescription_id INT NOT NULL AUTO_INCREMENT,

   prescription_date DATE NOT NULL,

   doctor_ssn INT,

   patient_ssn INT,

   PRIMARY KEY(prescription_id),

   FOREIGN KEY doctor_ssn REFERENCES doctor_tbl(doctor_ssn),

   FOREIGN KEY patient_ssn REFERENCES patient_tbl(patient_ssn) 

);

CREATE TABLE prescription_medicine_tbl(

   prescription_medicine_id INT NOT NULL AUTO_INCREMENT,

   prescription_id INT, 

   trade_name VARCHAR(100) NOT NULL,

   num_of_units VARCHAR(100) NOT NULL,

   PRIMARY KEY(prescription_medicine_id),

   FOREIGN KEY(prescription_id) REFERENCES prescription_tbl(prescription_id), 

   FOREIGN KEY(trade_name) REFERENCES medicine_tbl(trade_name)

);

INSERT INTO medicine_tbl(trade_name, unit_price,generic_flag) VALUES ("square","15$", "safe"), ("ibne sina","20$", "effective"), ("Incepta","30$", "high quality"), ("Opsonin ","50$", "strength"), ("Renata","60$", "safe")

INSERT INTO prescription_tbl(prescription_date,doctor_ssn,patient_ssn) VALUES ("2022-2-6","1", "1"), ("2022-2-6","3", "2"), ("2022-2-6","5", "3"), ("2022-2-6","2", "4"), ("2022-2-6","4", "5")

INSERT INTO prescription_medicine_tbl(prescription_id,trade_name,num_of_units) VALUES ("1","square", "5"), ("2","ibne sina", "10"), ("3","Opsonin", "8"), ("4","square", "9"), ("5","ibne sina", "5")




Answer To question no 02


a. 

SELECT* FROM medicine_tbl WHERE unit_price <"50$";

b.

SELECT patient_tbl.first_name, patient_tbl.last_name

FROM patient_tbl

INNER JOIN doctor_tbl ON patient_tbl.doctor_ssn = doctor_tbl.doctor_ssn AND doctor_tbl.first_name = "jubair";

c.

SELECT prescription_tbl.patient_ssn FROM prescription_tbl INNER JOIN prescription_medicine_tbl ON prescription_tbl.prescription_id = prescription_medicine_tbl.prescription_id WHERE prescription_medicine_tbl.trade_name = 'square' OR prescription_medicine_tbl.trade_name = 'ibne sina';

d.

SELECT* FROM doctor_tbl WHERE yearsof_experience>5 AND speciality="neurologist";

 Relational Design 



Simulate the SJF Non preemptive Scheduling Algorithms. Using this scheduling algorithm find the min &amp; max waiting time.

 

#include<stdio.h>

int main()

{

int bt[20],p[20],wt[20],tat[20],i,j,n,total=0,pos,temp, maxWatingTime=0,

minWatingTime=0;

float avg_wt,avg_tat;

printf("Enter number of process:");

scanf("%d",&n);

printf("\nEnter Burst Time:\n");

for(i=0;i<n;i++)
{
printf("p%d:",i+1);
scanf("%d",&bt[i]);
p[i]=i+1;

}

//sorting of burst times

for(i=0;i<n;i++)

{

pos=i;

for(j=i+1;j<n;j++)

{

if(bt[j]<bt[pos])

pos=j;

}

temp=bt[i];

bt[i]=bt[pos];

bt[pos]=temp;

temp=p[i];

p[i]=p[pos];

p[pos]=temp;

}

wt[0]=0;

for(i=1;i<n;i++)

{

wt[i]=0;

for(j=0;j<i;j++)

wt[i]+=bt[j];

total+=wt[i];

}

avg_wt=(float)total/n;

total=0;

printf("\nProcess\t Burst Time \tWaiting Time\tTurnaround Time");

for(i=0;i<n;i++)

{

tat[i]=bt[i]+wt[i];

total+=tat[i];

printf("\np%d\t\t %d\t\t %d\t\t\t%d",p[i],bt[i],wt[i],tat[i]);

}

          avg_tat=(float)total/n;

printf("\n\nAverage Waiting Time=%f",avg_wt);

printf("\nAverage Turnaround Time=%f\n",avg_tat);

maxWatingTime = wt[0];

for(i=0;i<n;i++)

{

if(wt[i] > maxWatingTime)

{

maxWatingTime = wt[i];

}

if(wt[i] < maxWatingTime)

{

minWatingTime = wt[i];

}

}

printf("Maximum Wating Time : %d\n", maxWatingTime);

printf("Minimum Wating Time : %d\n", minWatingTime);

}


Output:

Operating Systems Quiz 



1. The systems which allows only one process execution at a time, are called

a) uniprogramming systems

b) uniprocessing systems

c) unitasking systems

d) none of the mentioned

2.  What is the ready state of a process?

a) when process is scheduled to run after some execution

b) when process is unable to run until some task has been completed

c) when process is using the CPU

d) none of the mentioned

3. A set of processes is deadlock if

a) each process is blocked and will remain so forever

b) each process is terminated

c) all processes are trying to kill each other

d) none of the mentioned

4. The address of the next instruction to be executed by the current process is

provided by the

a) CPU registers

b) Program counter

c) Process stack

d) Pipe

5. The processes that are residing in main memory and are ready and waiting to

execute are kept on a list called

a) job queue

b) ready queue

c) execution queue

d) process queue

6.  In priority scheduling algorithm

a) CPU is allocated to the process with highest priority

b) CPU is allocated to the process with lowest priority

c) Equal priority processes cannot be scheduled

d) none of the mentioned

7. The interval from the time of submission of a process to the time of completion

is termed as

a) waiting time

b) turnaround time

c) response time

d) throughput

8.  Response time is :

a) the total time taken from the submission time till the completion time

b) the total time taken from the submission time till the first response is produced

c) the total time taken from submission time till the response is output

d) none of the mentioned

9. A process is selected from the ______ queue by the ________ scheduler, to be

executed.

a) blocked, short term

b) wait, long term

c) ready, short term

d) ready, long term

10. In the following cases non – preemptive scheduling occurs :

a) When a process switches from the running state to the ready state

b) When a process goes from the running state to the waiting state

c) When a process switches from the waiting state to the ready state

d) All of the mentioned

11. There are 10 different processes running on a workstation. Idle processes are

waiting for an input event in the input queue. Busy processes are scheduled with

the Round-Robin timesharing method. Which out of the following quantum times

is the best value for small response times, if the processes have a short runtime,

e.g. less than 10ms?

a) tQ = 15ms

b) tQ = 40ms

c) tQ = 45ms

d) tQ = 50ms

12.  Which of the following algorithms tends to minimize the process flow time?

a) First come First served

b) Shortest Job First

c) Earliest Deadline First

d) Longest Job First

13. The most optimal scheduling algorithm is:

a) FCFS – First come First served

b) SJF – Shortest Job First

c) RR – Round Robin

d) None of the mentioned

14. Consider the following set of processes, the length of the CPU burst time given

in milliseconds :

Process Burst time

P1 6

P2 8

P3 7

P4 3

Assuming the above process is scheduled with the SJF scheduling algorithm:

a) the waiting time for process P1 is 3ms

b) The waiting time for process P1 is 0ms

c) The waiting time for process P1 is 16ms

d) The waiting time for process P1 is 9ms

15. One of the disadvantages of the priority scheduling algorithm is that :

a) it schedules in a very complex manner

b) its scheduling takes up a lot of time

c) it can lead to some low priority process waiting indefinitely for the CPU

d) none of the mentioned


Answer: 

1) a

2) b

3) a

4) b

5) b

6) a

7) b

8) b

9) c

10) b

11) a

12) b

13) b

14) a

15) c


#OperatingSystemQuiz

 Regex strength in javaScript







Expression: ^(?=.*[A-Z].*[A-Z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8}$



   Explanation

^                                       Start anchor
(?=.*[A-Z].*[A-Z])          Ensure string has two uppercase letters.
(?=.*[!@#$&*])               Ensure string has one special case letter.
(?=.*[0-9].*[0-9])             Ensure string has two digits.
(?=.*[a-z].*[a-z].*[a-z])   Ensure string has three lowercase letters.
.{8}                                   Ensure string is of length 8.
$                                        End anchor.

How to Install Laravel 8 Project with React Js



  • Create a fresh Laravel Project:

composer create-project --prefer-dist laravel/laravel projectname

composer require laravel/ui


  • Generate Basic Scaffolding:

php artisan ui react //for react connect with laravel


  • Build All

npm install

npm run dev


  • If you need an authentication system on your website then run this command. otherwise, ignore

php artisan ui react --auth


  • React Router 6

npm add history react-router-dom@next

yarn add history react-router-dom@next


  • Working with react state, then you need to add those instruction in package.json

"babel":{

   "presets":[

  "@babel/preset-env",

  "@babel/preset-react"   

],

"plugins":[

"@babel/plugin-proposal-class-properties"

]

}


  • Controller Create

php artisan make:controller ControllerName

  • Create Model

php artisan make:model modelName

  • Migrate Table

php artisan migrate

  • If needed to change any Attribute then you can re-migrate the table using this command:

php artisan migarte:rollback




Follow the steps:


1. Copy HTTPS from the assignment git repository

   //Create a folder in your device and open your terminal, then type cd "folder name"--

2. git clone --bear
3. go to the personal GitHub repository and create a new repository, then copy the URL
4. cd project path
5. git push --mirror "Your personal repo URL"
6. done

If you want to change the origin(URL)

1. git remote -v //Check the origin
2. git remote set-url origin "Your own repo HTTPS"



Create an "Arithmetic Calculator" using different languages..!😍✌️



Using Laravel: https://www.youtube.com/watch?v=M2Wl4KieJEs



Using Jquery : https://www.youtube.com/watch?v=n71aXk9Kt50



Using JavaScript: https://www.youtube.com/watch?v=WAr_BdtPxME



Using PHP: https://www.youtube.com/watch?v=UM0M6yYu2yU&t=112s


Source code : https://github.com/Jubair-Ahmed-Junjun/Arithmetic-Calculator

YouTube Link : https://www.youtube.com/c/JubairAhmedJunjun/videos

#javascript #jQuery #laravel #vuejs #php

ফেসবুকে আসলে হয়ছিলটা কি? 🤔



সর্বশেষ আপডেট অনুযায়ী, ফেসবুক সার্ভারের তথ্য বা অন্য কোন কারণে এ ঘটনার সৃষ্টি হয়নি। বরং ঘটনাটি ঘটেছে ফেসবুক সার্ভারগুলোর ট্র্যাক হারিয়ে যাওয়ার কারণে। এ সার্ভারগুলো ইন্টারনেট থেকে হারিয়ে গিয়েছিল। যার কারণে এই সময়টাই সবাই ফেসবুকের ডিএনএস সার্ভারে অনেক খোজ করেও তার দেখা মিলেনি।

আসল কাহিনিটা কি?

ইন্টারনেটের শর্টকাট ডেফিনেশন হলো - রাউটারের সাথে সংযুক্ত অনেকগুলো ছোট ছোট নেটওয়ার্কের সমষ্টি। আর আমাদের ডিভাইসে থাকা অ্যাপস বা ব্রাইজারের কাজ হলো ডিএনএস বা ডোমেইন নেম সার্ভিসের মাধ্যমে কোন একটি সাইটের আইপি এড্রেসকে বের করে আনা। আর এগুলোই মুলত সার্ভার থেকে ডেটা নিয়ে আসে।

কিন্তু ঐ পর্যন্ত ডেটা প্রেরনের রিকোয়েস্ট কেমনে পচিবল?

সেটা সম্ভব হয় বর্ডার গেইটওয়ে প্রোটোকল বা বিজিপি এর মাধ্যমে। রাউটারগুলো সাধারণত ডেটার ধরণ (কোন সার্ভারে কিভাবে কোন পথে যাওয়া যায়) নিয়ন্ত্রন করে। এরা শুধু ডেটা ইন্টারেকশনের কাজটা করে থাকে। বিষয়টা অনেকটা এরকস যে, ধরেন আপনি চিটাগাংয়ে নতুন আসছেন। ধামপারা কাউন্টারে নেমে কাউকে আস্ক করলেন চকবাজার কেমনে যাবো ভাই, তখন সে বলল আপনাকে প্রথমে বাসে করে লালখান বাজার যেতে দেন ওখানে গিয়ে কাউরে আস্ক করতে। আপনি এমনটাই করে চকবাজার পর্যন্ত পৌছালেন। ইন্টারনেটেও ঠিক একই কাহিণি ঘটে, আপনি ফেসবুকের সার্ভারে এক্সেস নিতে চাইলে রাউটার টু রাউটার ঘুরে ঘুরে কোন একসময় আপনার রিকুয়েস্ট যায় ফেসবুক সার্ভারে।

কিন্তু রিসেন্ট ঘটে যাওয়া ঘটনাটা কেনইবা ঘটল?

মুলত ফেসবুকের ডোমেইন সার্ভিসটা গায়েব হই গেছিল। তাই আপনি ফেসবুক ডট কম দিয়ে সার্চ করেও এক্সেস নিতে পারতেছিলেন না। আপনি সঠিক ডোমেইন দিয়ে খোজার পরও আইএসপি রাউটার আপনাকে চিনতে পারেনি। এটাই মুল কারণ।

কেন যে এমনটা হলো সেই বিষয়টা আসলে এখনো ঘোলাটে। নেটওয়ার্ক কনফিগারেশন বা স্যাবোটাজের কারণ হইতে পারে। ফরেন্সিক ইনভেস্টিগেশন এর পর হয়তো শিউর হবে। যা সময় সাপেক্ষ। ইউএসএ নেটব্লক্সের হিসেব মতে ৬ ঘন্টায় ক্ষতি হয়েছে প্রায় 232 মিলিয়ন ডলার। আর সারা বিশ্বে হয়তো বিলিয়ন ছাড়বে।

 ES6 কি এবং কেন?



ES6 এর পুর্ণরূপ ECMAScript6. ECMAScript একটি স্টান্ডার্ড,ফ্লেক্সিবল  আর জাভাস্ক্রিপ্ট মূলত ES6 এর একটি ইমপ্লিমেন্টেশন। ১৯৯৭ সালে ECMAScript এর প্রথম ভার্সন ECMAScript 1 রিলিজ হয় । এরপর  ১৯৯৮ সলে দ্বিতীয় ভার্সন এবং  ১৯৯৯ সালে তৃতীয় ভার্সন রিলিজ হয়। মাঝখানে অনেক সময় নিয়ে ২০০৯ সালে ভার্সন ৫ রিলিজ হয় । ভার্সন ৪ বাতিল করা হয়েছিলো।ভার্সন ৫ থেকেই এতে এডভান্স সব প্রোগ্রামিং মেথডলজি যুক্ত করা শুরু হয় । ES6 রিলিজ হয় ২০১৫ সালে, এই ভার্সনের নতুন ফিচার ছিল let, const কিওয়ার্ড, ডিফল্ট প্যারামিটার, Array.find() এবং Array.findIndex() মেথড।

আরো বেশ কিছু ফিচার উল্লেখযোগ্যঃ

  • Arrow Functions.
  • Multi-line Strings.
  • Default Parameters.
  • Template Literals.
  • Destructuring Assignment.
  • Enhanced Object Literals.
  • Promises.

এছাড়াও ES6 থেকে জাভাস্ক্রিপ্ট by default 'strict mode’ এ থাকে, তাই আর ES5 এর মতো "strict mode" ডিক্লেয়ার করা লাগেনা।

আরো একটা বেনিফিট হলো, ES6 এ সাধারণত রেগুলার এক্সপ্রেশনে ব্যাবহার করা অনেক ঝামেলার কাজ এক বা দু'লাইনেই করা যাচ্ছে।


 Login and Logout with Session


Login and Logout with Session


 Form Validation


Form Validation


Form handling


PHP || Form handling


 PHP || File handling in php || readfile() function


PHP || File handling in php || readfile() function


PHP || fopen() || fread() || fclose function  


PHP || fopen() || fread() || fclose function 

 PHP || file create and write || fopen() || fwrite() || fclose() function


PHP || file create and write || fopen() || fwrite() || fclose() function

 Ware a mask or not


Face mask detect || Ware a mask or not. #Deeplearning #Keras #TensorFlow #opencv.

Contact Me

Contact With Me

Contact me for a free consultation. Let's Work Together.

  • Chattogram, Bangladesh
  • +8801854992594
  • jubair.ahmed.junjun@gmail.com
  • www.jubairahmedjunjun.blogspot.com//