How to share files between two computers?

If you have above question in your mind then you are at right place. I will discuss today on this very clearly. Let’s understand why we need this if you want to share files like 1GB to 5GB storage type then you need to copy it from one system and paste into other system but if you have files like 40GB or above then you have to think about it. So let’s dig into it.

1. Shares Folders and Drive locally

Let’s discuss about this process. you have to choose a folder (eg. my files) which you want to share with your friends or colleagues pc. because you want to give access to your friend for copying that file very easily without any external drives. so let’s see the below steps to do it easily:

Step 1 : Click on My Computer(windows 7 or This PC – Windows 10) or use shortcut (window + E) to open this

Step 2 : Go to your drive [eg Local Disk (E:) or Local Disk (F:) ] which you have folders and you want to share .

Step 3 : After opening F: Drive (in my situation, it may vary at your time), opened a folder name as study-material and in that folder i want to share laravel video with my friend.

Step 4 : Right click on that folder and click on Properties option from list .

Step 5 : Click on Sharing Tab and then click on Share button from section ( Network File and Folder Sharing ).

Step 6 : After doing above click you will see sharing windows and on that windows Select “Everyone” and Click on Add Button and then click on Share Button

Step 7 : At last go to your Windows Explorer (Window +E) and click on “Network” and see your friend pc icon there and jump into it.

References :

  1. Click Here
Tagged : / / /

302 Found: What It Is and How to Fix It?

What is 302 status?

The HTTP response status code 302 Found is a common way of performing URL redirection. A 302 Found message is an HTTP response status code indicating that the requested resource has been temporarily moved to a different URI. All HTTP response status codes that are in the 3xx category are considered redirection messages.

Diagnosing a 302 Found Response Code

it’s entirely possible that the server is misconfigured, causing it to improperly respond with 302 Found codes, instead of the standard and expected 200 OK code of a normal, functional request.

If your application is responding with 302 Found codes, this is an issue that many other visitors may be experiencing as well, dramatically hindering your application’s ability to service users.

if you want to dig out on above topic then follow below references :

By ClickMinded

so friends here I am describing all above things for understanding about 302. because i am facing this issue in my Laravel application so let’s check out to solve these issues in your Laravel application. below is the attached urls for common issue in Laravel related to 302.

References :

  1. Click Here
  2. Click Here
  3. Click Here
Tagged : / / / / / /

Laravel 5.5 Method paginate does not exist

When I am trying to put some value in my input search box and after pressing enter button showing above issue.
But when I am trying to filter data with my search button then it’s working fine. so i dig into it. i found one solution on it.

FilterController.php
$users = DB::table('users')
->where(function($query) use ($countryId, $stateId, $cityId) {
	if (isset($countryId) && $countryId !== null && $countryId !== '' && $stateId == 'Select State') {
		$query->where('country_id', '=', $countryId);
	}
	if (isset($countryId) && $countryId !== null && $countryId !== '' && isset($stateId) && $stateId !== 'Select State' && $stateId !== '') {
		$query->where([
							['country_id', '=', $countryId],
							['state_id', '<>', $stateId]
						]);
		
	}
})->get()->paginate(5);

Solution :

Just remove the get() and your code will work fine.

$users = DB::table('users')
->where(function($query) use ($countryId, $stateId, $cityId) {
	if (isset($countryId) && $countryId !== null && $countryId !== '' && $stateId == 'Select State') {
		$query->where('country_id', '=', $countryId);
	}
	if (isset($countryId) && $countryId !== null && $countryId !== '' && isset($stateId) && $stateId !== 'Select State' && $stateId !== '') {
		$query->where([
							['country_id', '=', $countryId],
							['state_id', '<>', $stateId]
						]);
		
	}
})->paginate(5);

References :

  1. Click here
  2. Click here
Tagged : / /

HTML tags showing in my public view when I am using Ckeditor to store data in database.

profile.blade.php

{{$users->quality}}

Solution:

Use below codes to hide html tags

{!!$users->quality!!}

Resources :

  1. Click Here
  2. Click Here
Tagged : / / /

DBMS Interview Q&A Part- 2

Q1. Can you create a table without using create command ?

A. Yes, we can create table with the help of SELECT INTO statement. It
copies content of one table to another table. However, there should be
at least one table from where we can copy content.
Example : Copying all columns : select * into new_table from old_table where
condition
Copying specific column : select col1,col2 into new_table from old_table
where condition
Creating new empty table : select * into new_table from old_table where 1
= 0

Q2. What is Denormalization ?

A. It is the reverse process of Normalization. It is the process of trying to
improve the readability of the database by grouping data. Denormalization
is also used for speeding up the performance.

Q3. What are Joins ?

A. Join clause are used to combine rows from two or more tables,
depending upon the columns between them.

Q4. What are the different types of Joins ?

A. Different types of Joins are :

  1. INNER JOIN : It returns all records that are common in both tables.
  2. LEFT OUTER JOIN : It returns all records from the left table, and matched records from right table
  3. RIGHT OUTER JOIN : It returns all records from the right table, and matched records from left table.
  4. FULL OUTER JOIN : It returns all records when there is a match in either left or right table.
Q5. Explain Transaction ?

A. Transaction refers to the collection of multiple statements, that are
responsible for transferring a database from one consistent state to another
consistent state.

Q6. Explain the role of views in database ?

A.View refers to the virtual table. We can create view using create view
statement.

CREATE VIEW as Select col1
FROM table1
where CONDITION;
Q7. Explain Trigger ?

A. Triggers are defined as special kind of stored programs, which are
automatically executed whenever a specific operation occurs in the
database server.

Q8. What are Locks ?

A. Locking is the mechanism to protect data integrity and ensure data
consistency during transactions. Locks are the most common cause of
blocked processes. Stronger the Isolation level, more the chances of
blocking.

Q9. Explain different types of Locks ?

A. Locks are broadly characterized into following types :

Shared Locks : These locks are acquired by readers during read
operations. In other words, these locks exist when two transactions are
granted read access. Data updation is not allowed until shared lock is
released.
Exclusive Locks : In exclusive lock, data items can be both read as well
as written by the transaction. In Exclusive lock, multiple transactions do not
modify the same data simultaneously.

Q10. What is Super Key ?

A. An attribute or set of attributes that uniqueness in database is refered to
as Super key. It is the superset of Candidate key.

Q11. What is Candidate Key ?

A. A minimal set of attribute/attributes that can be used to uniquely identify
a single row in a given relation is refered to as Candidate key.

Q12. Explain Primary Key ?

A. DB Designer selects one of the candidate key as primary key for a
relation for the purpose of identification of a tuple uniquely. It is identified
during table creation.

Q13. What is Composite Key ?

A. If a primary key has more than one attribute, then it is referred to as
Composite key.

Q14. Explain Foreign Key ?

A. A set of attribute/attributes that is used to establish and enforce a link
between data in two or more relations.

Q15. Can a table have more than one primary key ?

A. No.

Q16. Can We Have NULL Value in Primary Key?

A. No.

Q17. What are cursors ?

A. A cursor is a temporary work area created in system memory when a
SQL statement is executed. A cursor can hold more than one row, but can
process only one row at a time.

Q18.What are the differences between Hash join, Merge join and Nested loops?
Hash joinMerge joinNested loops
The hash join is used when you have to join large tables.Merge join is used when projections of the joined tables are sorted on the join columns.The nested loop consists of an outer loop and an inner loop.
Q19. What do you understand by Proactive, Retroactive and Simultaneous Update ?
  1. Proactive Update: These updates are applied to the database before it becomes effective in the real-world environment.
  2. Retroactive Update: These retroactive updates are applied to a database after it becomes effective in the real-world environment.
  3. Simultaneous Update: These updates are applied to the database at the same instance of time as it becomes effective in a real-world environment.
Q20.What do you understand by Data Independence?

A. When you say an application has data independence, it implies that the application is independent of the storage structure and data access strategies of data.

Tagged : / / / / / / / / /

DBMS Interview Q&A Part- 1

Q. What is Data ?

A. Data refers to raw facts and figures that can be recorded.

Q. What is Database ?

A. Database refers to the collection of interrelated and coherent data.

Q. Explain DBMS ?

A. DBMS stands for Database Management System. It is a software
package designed to define, manipulate, retrieve and manage data in
database.

Q. Why DBMS ?

A. To make information easy to access and protected, we use database
management systems. DBMS is important because it manages the data
efficiently and allow users to perform multiple tasks on it with the ease.

Q. What is a database system?

A. The collection of database and DBMS software together is known as a
database system.

Q. What do you mean by Data Modelling ?

A. Data Modelling is the set of conceptual tools for describing data
relationship, data semantics, and consistency constraints. Different data
models are : Network model, Relational model, Object Oriented model, ER
model, and more.

Q. Explain RDBMS ?

A. RDBMS stands for Relational Database Management System. It
arranges information into allied rows and columns. RDMS is an information
management system which is oriented on a data model. RDBMS Example
systems are SQL Server, Oracle, MySQL, MariaDB and SQLite.

Q. Explain Abstraction of Data, with reference to DBMS ?

A. Data Abstraction refers to the process of hiding background details from
user.

Q. Explain the 3 L’s of Data Abstraction ?

A. It refers to three levels of abstraction. They are :

  1. Physical Level : It is lowest level of abstraction. It describes how data is
    actually stored. It also describes complex data structure in detail.
  2. Logical Level : It describes what data get stored in the database and what are the relationships among them.
  3. View Level : It is the highest level of data abstraction that only describes a part of database indirectly
Q. What is Database Schema ?

A. Schema refers to the overall structure of database without data values.

Q. What do you mean by transparent DBMS?

A. The transparent DBMS is a type of DBMS which keeps its physical
structure hidden from users.

Q. Explain ER Model ?

A. This model is based on the perception of real world that consists of
collection of basic entities and relationship among these objects. It is the
graphical representation of the database.

Q. What do you understand by Data Independency ?

A. It refers to the capacity to change data at one level without affecting next
higher level is called Data Independence. It is of two types : Physical DI,
Logical DI.
Physical DI : It indicates that physical storage of device could be changed
without affecting conceptual view.
Logical DI : It indicates that conceptual schema can be changed without
affecting existing external schema.

Q. What is a Database Language ?

A. Database Language is a medium by which we can interact with the
database system through some set of commands. These commands are
structured.

Q. What is a Tuple ?

A. A single row of a table, which contains a single record for that relation is
called a tuple.

Q. Explain degree and Cardinality ?

A. Degree is the total number of attributes in a relation or table and
cardinality is total number of tuples/rows in a relation/table.

Q. What is a relation in DBMS ?

A. A database relation refers to an individual table in a relational database.
A table is a relation because it stores the relation between data in its
column-row format.

Q. What is the role of DML Compiler ?

A. It translates DML statements in a query language into low-level
instructions that the query evaluation engine can easily understand.

Q. Explain me the role of using clause for queries ?

A. Clause enables you to specify conditions that filters the results as per
the requirement. Some of the most commonly used clauses are : having,
where etc.

Q. What is a Query ?

A. Query is a statement that is used for the extraction of data from
database.
For example – select * from table1 is a query

Q. What is Subquery ?

A. Subquery is a query within query.
For example – select * from students where marks = ( select max(marks)
from students);

Q. Explain BCNF ?

A. BCNF is Boyce-Codd Normal Form. It is considered to be the advanced
version of 3 NF. Hence it is also refered to as 3.5 NF. A relation is said to
be in BCNF, if it satisfies following rules :

  1. It is in 3NF.
  2. For every functional dependency P->Q, P should be the super key of the table.
Q. What are Stored Procedures ?

A. Stored Procedure refers to the set of Structured Query Language(SQL)
statements stored in a relational database management system as a group.
It can further be reused and shared by multiple programs. It provides a
layer of security between a user interface and database.

Tagged : / /

How to set read more button using data from database in Laravel?

Hi friends, I want to add read more… button in my blade file where data is coming from database.

below is my code in blade file getalldata.blade.php

<ul class="text-justify">
	<li>
        <small>{{$users->pro_experience}}</small>
    </li>
</ul>

In above Unordered list I am getting a long data from database and I want to add a Read more and Read Less toggle option. Now follow below steps to get your result now.

getalldata.blade.php

<ul class="text-justify">
	<li class="">
		<!-- <small>{{$users->pro_experience}}</small> -->
		@if(strlen($users->pro_experience) > 50)
			{{substr($users->pro_experience,0,50)}}
			<span class="read-more-show hide_content">More<i class="fa fa-angle-down"></i></span>
			<span class="read-more-content"> {{substr($users->pro_experience,50,strlen($users->pro_experience))}} 
			<span class="read-more-hide hide_content">Less <i class="fa fa-angle-up"></i></span> </span>
		@else
			{{$users->pro_experience}}
		@endif
	</li>
</ul>

Javascript Code

<script type="text/javascript">
// Hide the extra content initially:
            $('.read-more-content').addClass('hide_content')
            $('.read-more-show, .read-more-hide').removeClass('hide_content')

            // Set up the toggle effect:
            $('.read-more-show').on('click', function(e) {
              $(this).next('.read-more-content').removeClass('hide_content');
              $(this).addClass('hide_content');
              e.preventDefault();
            });
            $('.read-more-hide').on('click', function(e) {
              var p = $(this).parent('.read-more-content');
              p.addClass('hide_content');
              p.prev('.read-more-show').removeClass('hide_content'); // Hide only the preceding "Read More"
              e.preventDefault();
            });
</script>

CSS Code

<style type="text/css">
    .read-more-show{
      cursor:pointer;
      color: #ed8323;
    }
    .read-more-hide{
      cursor:pointer;
      color: #ed8323;
    }

    .hide_content{
      display: none;
    }
</style>

Resources :

  1. Click Here
  2. Click Here
Tagged : / / / / /

How to set a selected option using ajax in Laravel 5.6?

Hey friends, I am trying to show database column data in my edit form of a Laravel project. yesterday I failed to show data from database in a select list using ajax. so let’s see the below blade file and ajax also to get your solution.

edit.blade.php
<div class="form-group">
  <label for="Blood_Group">Blood Group</label>
	<select class="form-control" id="bgroup" name="bgroup">
	  <option value="" disabled selected>Select BG</option>
	  <option value="O+">O+</option>
	  <option value="O-">O-</option>
	  <option value="A+">A+</option>
	  <option value="A-">A-</option>
	  <option value="B+">B+</option>
	  <option value="B-">B-</option>
	  <option value="AB+">AB+</option>
	  <option value="AB+">AB-</option>
	</select>
</div>
profile.js
$.ajax({
	type: "GET",
	url: 'addprofile',
	data: null,
	success: function(response) {
          let data = response.data;
          $("#bgroup").append('<option value=' + data[0].bgroup+ '>' + data[0].bgroup+ 
           '</option>');

        }
});

Error : updated data from database is not showing in selected list when i am trying to update it again.

Solution :
$("#bgroup").val(data[0].bgroup).attr('selected','selected');

You can also use below code:

$('#bgroup option[value="' + data[0].bgroup+ '"]').prop('selected', true);

Above solution is working for me. so if you have more solution on select option then please feel free to comment and share your knowledge.

Resources :

  1. Click here
  2. Click here

Tagged : / / / /

How to configure WordPress date and time settings ?

Date-Time Is showing wrong.

Hey friends, Today I am going to explain you about wordpress date and time settings. Today I saw something in blog post that time is not showing as in my pc time. so i totally confused after seeing this. so i decided to fix it. so that is for this. Let’s get started :

Step 1 : Login to your wordpress as Administrator

Step 2 : Under Dashboard, click Settings, and then click General.

Step 3 : Scroll down to the Timezone list box, and then select the time zone you want.

Time zones are grouped geographically under Africa, America, Asia, Europe, and other regions.

Step 4 : Under Date Format, select one of the predefined formats for WordPress to use to display dates.

Step 5 : Under Time Format, select one of the predefined formats.

Step 6 : at last click Save Changes.

Tagged :

How to add jQuery DataTables into your Laravel projects?

First of all, let’s discus here, What is DataTable?

Datatable is a plugin for jQuery JS Library. it’s really flexible tool. it provides the search, filter & pagination and it’s also mobile friendly.

📚 Step 1 : Open Datatables website (URL )

📚 Step 2 : Copy CSS & JS CDN Link from Home page

//cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css
//cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js

📚 Step 3 : Add it to your blade file. just see below how to add these css and js cdn links into your particular pages.

@section('css')
   <link rel="stylesheet"href="//cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css">
@endsection

📚 Step 4 : Now Adding JS CDN

@push('scripts')
   <script src="//cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js">
@endpush

📚 Step 5 : Add one more script which is the ID of your table where you are going to active your datatable. if you will see below code then you will find a ID (#myTable). it is your table id. in your case it will be something else.

<script>
		$(document).ready( function () {
			$('#myTable').DataTable();
		} );
</script>

Note : if you are using DataTable into your particular page then only add in that particular file and if you are going to use it multiple places then add it to your main file like app.blade.php .

Hey friends after following above steps you will find your view like below image :