Storage API
learn more about Storage API (Local and Session Storage).
Aug 8, 2016☕ 2 min readdiff --git a/.vscode/settings.json b/.vscode/settings.json index 7c6d168..c07c0bf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,16 @@ { - "cSpell.words": [ - "venkat" - ] -} \ No newline at end of file + "cSpell.words": ["venkat"], + + // The number of spaces a tab is equal to. This setting is overridden + // based on the file contents when `editor.detectIndentation` is true. + "editor.tabSize": 2, + + // Insert spaces when pressing Tab. This setting is overriden + // based on the file contents when `editor.detectIndentation` is true. + "editor.insertSpaces": true, + + // When opening a file, `editor.tabSize` and `editor.insertSpaces` + // will be detected based on the file contents. Set to false to keep + // the values you've explicitly set, above. + "editor.detectIndentation": false +} diff --git a/docs/404.html b/docs/404.html index 473e5c9..a7b14ba 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -
Home | JavaScript | HTML5 | React | Programming | Problems | About
Happy to see you visting WebSlate.IO. I'm a JavaScript and web developer living in sunny Singapore creator of WebSlate.IO.
With a passion for teaching, I started making lot of training materials for free. during pandemic 2020, i started helping people who lose jobs through offline now its online called WebSlate.IO.
I'm just getting started.
Home | JavaScript | HTML5 | React | Programming | Problems | About
Happy to see you visting WebSlate.IO. I'm a JavaScript and web developer living in sunny Singapore creator of WebSlate.IO.
With a passion for teaching, I started making lot of training materials for free. during pandemic 2020, i started helping people who lose jobs through offline now its online called WebSlate.IO.
I'm just getting started.
Home | JavaScript | HTML5 | React | Programming | Problems | About
learn more about Storage API (Local and Session Storage).
Aug 8, 2016☕ 2 min readHome | JavaScript | HTML5 | React | Programming | Problems | About
learn more about Storage API (Local and Session Storage).
Aug 8, 2016☕ 2 mins readHome | JavaScript | HTML5 | React | Programming | Problems | About
One of the good Features in ES6 is Promises Object and their useful methods and they are called software abstraction helps to works smoothly with asynchronous operations. Promise API followed Promises/A+ Specification prior to this, there was Promise/A.
In short, running continuation-passing style. Let me shoot few bullets with simple diagram on Promises below.
Home | JavaScript | HTML5 | React | Programming | Problems | About
One of the good Features in ES6 is Promises Object and their useful methods and they are called software abstraction helps to works smoothly with asynchronous operations. Promise API followed Promises/A+ Specification prior to this, there was Promise/A.
In short, running continuation-passing style. Let me shoot few bullets with simple diagram on Promises below.
Home | JavaScript | HTML5 | React | Programming | Problems | About
I would like to continue with an examination of JavaScript Promise API. Let’s have a look at Promise evolution by various libraries. below three libraries which we are going to explore on this article.
Dec 5, 2016☕ 5 min readOne of the good Features in ES6 is Promises Object and their useful methods and they are called software abstraction helps to works smoothly with asynchronous operations. Promise API followed Promises/A+ Specification prior to this, there was Promise/A.
Oct 21, 2016☕ 2 min readHome | JavaScript | HTML5 | React | Programming | Problems | About
I would like to continue with an examination of JavaScript Promise API. Let’s have a look at Promise evolution by various libraries. below three libraries which we are going to explore on this article.
Dec 5, 2016☕ 5 mins readOne of the good Features in ES6 is Promises Object and their useful methods and they are called software abstraction helps to works smoothly with asynchronous operations. Promise API followed Promises/A+ Specification prior to this, there was Promise/A.
Oct 21, 2016☕ 2 mins readHome | JavaScript | HTML5 | React | Programming | Problems | About
I would like to continue with an examination of JavaScript Promise API. Let’s have a look at Promise evolution by various libraries. below three libraries which we are going to explore on this article.
The q.js is best one for promise implementation by Kris Kowal. It is more evident of promise evolution.
Lets have a look, What makes it special.
Home | JavaScript | HTML5 | React | Programming | Problems | About
I would like to continue with an examination of JavaScript Promise API. Let’s have a look at Promise evolution by various libraries. below three libraries which we are going to explore on this article.
The q.js is best one for promise implementation by Kris Kowal. It is more evident of promise evolution.
Lets have a look, What makes it special.
Home | JavaScript | HTML5 | React | Programming | Problems | About
One of the good Features in ES6 is Promises Object and their useful methods and they are called software abstraction helps to works smoothly with asynchronous operations. Promise API followed Promises/A+ Specification prior to this, there was Promise/A.
In short, running continuation-passing style. Let me shoot few bullets with simple diagram on Promises below.
Home | JavaScript | HTML5 | React | Programming | Problems | About
One of the good Features in ES6 is Promises Object and their useful methods and they are called software abstraction helps to works smoothly with asynchronous operations. Promise API followed Promises/A+ Specification prior to this, there was Promise/A.
In short, running continuation-passing style. Let me shoot few bullets with simple diagram on Promises below.
Home | JavaScript | HTML5 | React | Programming | Problems | About
Fibonacci numbers, commonly denoted Fn sequence
Aug 7, 2021☕ 2 min readPalindrome is in reverse also same
Jul 21, 2020☕ 2 min readHome | JavaScript | HTML5 | React | Programming | Problems | About
Fibonacci numbers, commonly denoted Fn sequence
Aug 7, 2021☕ 10 mins readPalindrome is in reverse also same
Jul 21, 2020☕ 2 mins readHome | JavaScript | HTML5 | React | Programming | Problems | About
The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and characterized by the fact that every number after the first two is the sum of the two preceding ones.
Problem is about a person who has a pair of newborn rabbits (different gender). here problem to determine the numbers of pairs after a year. at the end of each month, a newborn pair grows to maturity.
Newborn | Matured | Total | |
---|---|---|---|
Jan 1 | 1 | 0 | 1 |
Feb 1 | 0 | 1 | 1 |
Mar 1 | 1 | 1 | 2 |
Apr 1 | 1 | 2 | 3 |
May 1 | 2 | 3 | 5 |
Jun 1 | 3 | 5 | 8 |
Jul 1 | 5 | 8 | 13 |
Aug 1 | 8 | 13 | 21 |
Sep 1 | 13 | 21 | 34 |
Oct 1 | 21 | 34 | 55 |
Nov 1 | 34 | 55 | 89 |
Dec 1 | 55 | 89 | 144 |
Jan 1 | 89 | 144 | 233 |
Finding the great common divisor of F5 = 5 and F6 = 8 is 1. This is due to the fact that only positive integer that divide F5 = 5 are 1 and 5 (denoted as gcd(F5, F6) = 1 likewise, F6 = 8 are 1,2,4 and 8 (denoted as gcd(F9, F10) = 1) there are common properties available. lets look at them.
There is various kinds of approaches in order to get this sequence and there is many solutions available. lets see each of them with solutions written in javascript. +
Home | JavaScript | HTML5 | React | Programming | Problems | About
The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and characterized by the fact that every number after the first two is the sum of the two preceding ones.
Problem is about a person who has a pair of newborn rabbits (different gender). here problem to determine the numbers of pairs after a year. at the end of each month, a newborn pair grows to maturity.
Newborn | Matured | Total | |
---|---|---|---|
Jan 1 | 1 | 0 | 1 |
Feb 1 | 0 | 1 | 1 |
Mar 1 | 1 | 1 | 2 |
Apr 1 | 1 | 2 | 3 |
May 1 | 2 | 3 | 5 |
Jun 1 | 3 | 5 | 8 |
Jul 1 | 5 | 8 | 13 |
Aug 1 | 8 | 13 | 21 |
Sep 1 | 13 | 21 | 34 |
Oct 1 | 21 | 34 | 55 |
Nov 1 | 34 | 55 | 89 |
Dec 1 | 55 | 89 | 144 |
Jan 1 | 89 | 144 | 233 |
Finding the great common divisor of F5 = 5 and F6 = 8 is 1. This is due to the fact that only positive integer that divide F5 = 5 are 1 and 5 (denoted as gcd(F5, F6) = 1 likewise, F6 = 8 are 1,2,4 and 8 (denoted as gcd(F9, F10) = 1) there are common properties available. lets look at them.
There is various kinds of approaches in order to get this sequence and there is many solutions available. lets see each of them with solutions written in javascript. Before, lets look at the formulae.
Basically, this approach call itself creating more and more branches of the tree until it hits the base case. Below is the recursive solution in Javascript.
Time Complexity: 2^n (exponential time)
Space Complexity: O(n) considering function call stack size, otherwise O(1).
1function fib_1(n) {2 if (n < 2) {3 return n4 }5 return fib_1(n - 1) + fib_1(n - 2)6}
Time Complexity: O(n) Space Complexity: O(1)
1function fib_2(n) {2 let a = 0, b = 1, c, i;3 if (n == 0)4 return a;5 for (i = 2; i <= n; i++) {6 c = a + b;7 a = b;8 b = c;9 }10 return b;11}
Time Complexity: O(Logn) Space Complexity: O(1) or O(Logn) on function call stack size consideration.
1function fib(n) {2 const F = [[1, 1], [1, 0]];3 if (n == 0)4 return 0;5 power(F, n - 1);6 return F[0][0];7}8// Helper function that multiplies 29// matrices F and M of size 2*2, and10// puts the multiplication result11// back to F[][]12function multiply(F, M) {13 const x = F[0][0] * M[0][0] + F[0][1] * M[1][0];14 const y = F[0][0] * M[0][1] + F[0][1] * M[1][1];15 const z = F[1][0] * M[0][0] + F[1][1] * M[1][0];16 const w = F[1][0] * M[0][1] + F[1][1] * M[1][1];17 F[0][0] = x;18 F[0][1] = y;19 F[1][0] = z;20 F[1][1] = w;21}22// Helper function that calculates F[][]23// raise to the power n and puts the24// result in F[][]25function power(F, n) {26 const M = [[1, 1], [1, 0]];27 // n - 1 times multiply the28 // matrix to {{1,0},{0,1}}29 for (let i = 2; i <= n; i++)30 multiply(F, M);31}32// Optimized version of power() in method 4 */33function power(F, n) {34 if (n == 0 || n == 1)35 return;36 const M = [[1, 1], [1, 0]];37 power(F, n / 2);38 multiply(F, F);39 if (n % 2 != 0)40 multiply(F, M);41}
Binet formula, sums, combinatorial representations and generating function of the generalized Fibonacci -numbers.
Time Complexity: O(logn), this is because calculating phi^n takes logn time.
-Space Complexity: O(1)
1function fib_4(n) {2 let phi = (1 + Math.sqrt(5)) / 2;3 return Math.round(Math.pow(phi, n) / Math.sqrt(5));4}
Let's look at the other facts where we used in real life.
Even our planet activities like Rotations period, Precession Period, Orbital Period are in fibonacci. Refer to Journal of Astronomy on Modeling Celestial Mechanics Using the Fibonacci Numbers
In mathematics, two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities where F(n+1) / Fn is most of the time is 1.618
Golden ratio everywhere like example below.
1function fib_4(n) {2 let phi = (1 + Math.sqrt(5)) / 2;3 return Math.round(Math.pow(phi, n) / Math.sqrt(5));4}
Let's look at the other facts where we used in real life.
Even our planet activities like Rotations period, Precession Period, Orbital Period are in fibonacci. Refer to Journal of Astronomy on Modeling Celestial Mechanics Using the Fibonacci Numbers
In mathematics, two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities where F(n+1) / Fn is most of the time is 1.618
Golden ratio everywhere like example below.
Home | JavaScript | HTML5 | React | Programming | Problems | About
Below is the basic coding solution written in javascript.
function isPalindrome(S) {
+Palindrome Solutions 
Home | JavaScript | HTML5 | React | Programming | Problems | About
Palindrome Solutions
Jul 21, 2020☕ 2 mins readBelow is the basic coding solution written in javascript.
function isPalindrome(S) {
let iteration = Math.round(S.length / 2);
let backward = S.length;
@@ -11,4 +11,4 @@
return "YES";
}
-
\ No newline at end of file
+
Home | JavaScript | HTML5 | React | Programming | Problems | About
10 Things you should know
Jul 21, 2020☕ 2 min readHome | JavaScript | HTML5 | React | Programming | Problems | About
10 Things you should know
Jul 21, 2020☕ 2 mins readHome | JavaScript | HTML5 | React | Programming | Problems | About
10 Things you should know
Home | JavaScript | HTML5 | React | Programming | Problems | About
10 Things you should know
Home | JavaScript | HTML5 | React | Programming | Problems | About
One of the good Features in React 16.x
Jul 21, 2020☕ 2 min readHome | JavaScript | HTML5 | React | Programming | Problems | About
One of the good Features in React 16.x
Jul 21, 2020☕ 2 mins readHome | JavaScript | HTML5 | React | Programming | Problems | About
Welcome to useEffect basics article
Home | JavaScript | HTML5 | React | Programming | Problems | About
Welcome to useEffect basics article
Home | JavaScript | HTML5 | React | Programming | Problems | About
Home | JavaScript | HTML5 | React | Programming | Problems | About
{meta.description}
} {meta.date} - ☕ {meta.readTime + " min read"} + ☕ {meta.readTime + " mins read"}