Quickupdate

  • Home
  • Top Trending
    • Top Android Apps
    • Top Ios Apps
  • Featured
  • About Us
  • Contact us
  • Privacy Policy and Disclaimer

Friday, 29 January 2021

Interesting Questions of Software Engineering

 Developers     January 29, 2021     FAANG     No comments   

1) REST ful API

Source: https://www.smashingmagazine.com/2018/01/understanding-using-rest-api/

Short: REST determines how the API looks like. It stands for “Representational State Transfer”. It is a set of rules that developers follow when they create their API. One of these rules states that you should be able to get a piece of data (called a resource) when you link to a specific URL.

2) How passwords are stored in the Database?

Source: https://www.geeksforgeeks.org/store-password-database/#:~:text=The%20password%20entered%20by%20user,is%20different%20for%20different%20users.

Short: You can generate a Random Salt for every user to secure the user's password. BUT

If the database is compromised the hacker will not only get your password hashes but also the dynamic salt used. You might be wondering then what is the advantage of dynamic salt over static salt if the attacker has dynamic salt? Even if the attacker has dynamic salt he needs to create a new hash-table (or rainbow table) for each and every user present in the database (as per dynamic salt). This is a lot more expensive operation than creating just one table for all the users.

The above approach is quite good to slow down a hacker. However, it is recommended to use algorithms like bcrypt and scrypt instead of MD5/SHA1. Bcrypt is a hashing algorithm based on Blowfish. It requires you to specify a cost/work factor. The work factor makes the overall process slower and hence time taken to generate hash-table would increase multiple times.

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Friday, 10 January 2020

Oops PHP : Access Modifires

 Developers     January 10, 2020     No comments   

There are 3 types of access modifiers.
public : public property or method can be accessed Form anywhere (This is by default)
protected : protected proerty can be accessed With in the class & child class which extending parent class
private : "private" property or method can be access ONLY in the class.


NOTE: if you want to Access a "Private Property" Which is only accessible inside the class, then for that,
first, you have to create a "Public function", Then access that "Public function" after creating an object.


<?php

class AccessModifiers
{

    public $name;
    protected $color;
    private $height;

    function get_protected($color)
    {
        return $this->color = $color;
    }
}

$a_Obj = new AccessModifiers();
echo $a_Obj->name = 'mango. <br>';

echo $a_Obj->get_protected("red");

?>

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

PHP Oops - Static Properties / Keword

 Developers     January 10, 2020     No comments   

1) there are many variations of static keyword
1) static method
2) static property
3) static closure (A CLOSURE is an anonymous function that can access variables imported from the outside scope without using any global variables.)
4) static variable
5) static as a class name

2) $this isn't accessible in these methods

3) IF you create a static property/method THen you don't have to create/instantiate a class. you can access without creating the object of a class.

4)if you declared a static property and you created obj of class, then you cannot access that property. (but you can access, Methods)
E.g:

<?php

  class StaticClassExample {
  public static function test() {
  echo "this is the static function";
  }
}

new StaticClassExample();
StaticClassExample::test();
?>

5) To access a static property use the class name, a double colon (::), and the property name
ClassName::staticPropName();

6) A class can have both static and non-static Properties. A static Property can be accessed from a METHOD in the SAME class using
the "self" keyword and double colon "(::)".

7) You can create 2 classes in One File

<?php
class StaticClassExample
{

    public static function test()
    {
        echo "this is the Static function.<br>";
    }

    public function testOne()
    {
        echo "This is the Normal function.<br>";
    }
}

StaticClassExample::test();
// $a = new StaticClassExample();
// $a->testOne();


class NewClass extends StaticClassExample
{

    public function get_value_from_static()
    {
        echo parent::testOne();
    }
}

$b = new NewClass();
$b->get_value_from_static();
?>

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Thursday, 9 January 2020

Oops PHP : __constructors()

 Developers     January 09, 2020     No comments   

in short: Once the Object created of class Constructor Will be called Automatically.

Example:

<?phpclass BaseClass {
    function 
__construct() {
        print 
"In BaseClass constructor\n";
    }
}

class 
SubClass extends BaseClass {
    function 
__construct() {
        
parent::__construct();
        print 
"In SubClass constructor\n";
    }
}

class 
OtherSubClass extends BaseClass {
 
// inherits BaseClass's constructor
}

// In BaseClass constructor
$obj = new BaseClass();// In BaseClass constructor
// In SubClass constructor

$obj = new SubClass();// In BaseClass constructor
$obj = new OtherSubClass();?>
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Tuesday, 27 August 2019

#Day2 Conditional Statements

 Developers     August 27, 2019     No comments   

#202124 Darcula theme color
if, else if, and else statements.
**********************************************
comparison operators.

Less than: <
Greater than: >
Less than or equal to: <=
Greater than or equal to: >=
Is equal to: ===
Is NOT equal to: !==
**********************************************
logical operators.
There are three logical operators:

the and operator (&&)
the or operator (||)
the not operator, otherwise known as the bang operator (!)
****************************************************************
truthy vs falsy values.

these values are false values when they are checked as a condition.
0
Empty strings like "" or ''
null which represents when there is no value at all
undefined which represent when a declared variable lacks a value
NaN, or Not a Number


|| it gets the value from left side
&& it gets the vaue from right side.
let tool = 'marker';

// Use short circuit evaluation to assign writingUtensil variable below:
let writingUtensil =tool || "pen";

console.log(`The ${writingUtensil} is mightier than the sword.`);

**********************************************
***ternary operators.***
Normal if else
let isLocked = false;

if (isLocked) {
console.log('You will need a key to open the door.');
} else {
console.log('You will not need a key to open the door.');
}
***ternary if else****
let isLocked = false;

isLocked ?
console.log('You will need a key to open the door.'):
console.log('You will not need a key to open the door.');



**********************************************
the switch statement.

this is an alternative of if-else statement.

because suppose if you want to check 100 of condition then it will be a pain to write that amount of conditions.
that's why we use SWITH CASE.

EXAMPLE :
let athleteFinalPosition = 'third place';
switch(athleteFinalPosition){
case "first place":
console.log('lo');
break;

case "third place":
console.log('third place prints');
break;

case "second place":
console.log('second place prints');
break;
default:
console.log("you loose");
}

if you wil not use break; keyword all the code blocks will run.
you should add break keyoword at the end of the default case
**********************************************

CONDITIONAL STATEMENTS
Review
Way to go! Here are some of the major concepts for conditionals:

An if statement checks a condition and will execute a task if that condition evaluates to true.
if...else statements make binary decisions and execute different code blocks based on a provided condition.
We can add more conditions using else if statements.
Comparison operators, including <, >, <=, >=, ===, and !== can compare two values.
The logical and operator, &&, or “and”, checks if both provided expressions are truthy.
The logical operator ||, or “or”, checks if either provided expression is truthy.
The bang operator, !, switches the truthiness and falseness of a value.
The ternary operator is shorthand to simplify concise if...else statements.
A switch statement can be used to simplify the process of writing multiple else if statements. The break keyword stops the remaining cases from being checked and executed in a switch statement.

you can reffer this for in depth knowladge
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Let Vs Var

 Developers     August 27, 2019     No comments   

diff between var and Let
the diff is scope

let has an inner scope
var is used to declare a global variable

// let b = "rahul";
for(let b=1;b<11;b++){
console.log(b);
}
console.log("b is:"+b);
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Saturday, 24 August 2019

#day1 Javascript Variable

 Developers     August 24, 2019     1 comment   

#Day1 #BackToBasics
1) const and Let Keywords are introduced in Es6 2015.

2) LET : LET has a Block Scope
VAR : VAR has a Function Scope

Let: it signals that variable can be assigned reassigned a different value
(it means let can be reassigned).
eg:- let meal = 'Enchiladas';
console.log(meal); // Output: Enchiladas
meal = 'Burrito';
console.log(meal); // Output: Burrito

3) if we don't assign a value to a variable it will give an output of undefined.

4) Const: const was introduced in es6 it is constant. if you try to redefine const variable it will give you TypeError: Assignment to constant variable.

5) constant variables need to assign a value at the time of declaration and if you don't assign a value it will give you SyntaxError.

6) Mathematical Operators
7) +=,
8) -=
9) *=
10) /=

11) String Interpolation : it can be done with `` this BackTics.
eg:- const myPet = 'armadillo';
console.log(`I own a pet ${myPet}.`);

12) Typeof operator: return the typeof variables (string, num, etc...)


Let’s review what we learned:


  • Variables hold reusable data in a program and associate it with a name.
  • Variables are stored in memory.
  • The var keyword is used in pre-ES6 versions of JS.
  • let is the preferred way to declare a variable when it can be reassigned, and const is the preferred way to declare a variable with a constant value.
  • Variables that have not been initialized store the primitive data type undefined.
  • Mathematical assignment operators make it easy to calculate a new value and assign it to the same variable.
  • The + operator is used to concatenate strings including string values held in variables
  • In ES6, template literals use backticks ` and ${} to interpolate values into a string.
  • The typeof keyword returns the data type (as a string) of a value.


Apply your learning with Projects based on Javascript Variables.do it now

1) Kelvin Project
2) Dog Years

Learn More here

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Home

Popular Posts

  • How to upload the existing folder on GitHub Or GitLab?
    These are the steps to upload the existing folder on GitHub Or GitLab. Whenever you want to push your existing folder to git or GitHub you m...
  • Map Filter & Reduce in Javascript
    Map, Filter, Reduce are the higher-order function in javascript.  Map The map function is used to transform an array. Suppose you have this ...
  • #day1 Javascript Variable
    #Day1 #BackToBasics 1) const and Let Keywords are introduced in Es6 2015. 2) LET : LET has a Block Scope VAR : VAR has a Function S...

Categories

  • FAANG (2)
  • Javascript (6)
  • Node (1)
  • Project Management (1)
  • React (9)
  • SQL (1)
  • Testing (1)

Blog Archive

  • January 2023 (1)
  • January 2022 (1)
  • November 2021 (3)
  • October 2021 (3)
  • August 2021 (1)
  • July 2021 (7)
  • June 2021 (12)
  • February 2021 (1)
  • January 2021 (1)
  • January 2020 (3)
  • August 2019 (3)