Difference between bigO notation and theta notation, why (theta) Өnotation is suitable to insertion sort to describe i
Date : March 29 2020, 07:55 AM
To fix this issue We use Өnotation to write worst case running time of insertion sort. But I’m not able to relate properties of Өnotation with insertion sort, why Өnotation is suitable to insertion sort. How does the insertion sort function f(n), lies between the c1*n^2 and c2*n^2 for all n>=n0. , The use of Өnotation : suppose we have a function ,
f(n) = 4logn + loglogn
we can write this function as
f(n) = Ө(logn)
Because its upper bound and lower bound
are O(logn) and Ω(logn) repectively, which are same
so it is legal to write this function as ,
f(n)= Ө(logn)
**Finding upper bound :**
f(n) = 4logn+loglogn
For all sufficience value of n>=2
4logn <= 4 logn
loglogn <= logn
Thus ,
f(n) = 4logn+loglogn <= 4logn+logn
<= 5logn
= O(logn) // where c1 can be 5 and n0 =2
**Finding lower bound :**
f(n) = 4logn+loglogn
For all sufficience value of n>=2
f(n) = 4logn+loglogn >= logn
Thus, f(n) = Ω(logn) // where c2 can be 1 and n0=2
so ,
f(n) = Ɵ(logn)
If running time of insertion sort is described by simple function f(n).
In particular , if f(n) = 2n^2+n+1 then
Finding upper bound:
for all sufficient large value of n>=1
2n^2<=2n^2  (1)
n <=n^2 (2)
1 <=n^2 (3)
adding eq 1,2 and 3, we get.
2n^2+n+1<= 2n^2+n^2+n^2
that is
f(n)<= 4n^2
f(n) = O(n^2) where c=4 and n0=1
Finding lower bound:
for all sufficient large value of n>=1
2n^2+n^2+1 >= 2n^2
that is ,
f(n) >= 2n^2
f(n) = Ω(n^2) where c=2 and n0=1
because upper bound and lower bound are same,
f(n) = Ө(n^2)
if f(n)= 2n^2+n+1 then, c1*g(n) and c2*g(n) are presented by diagram:

How to convert big negative scientific notation number into decimal notation string in javascript?
Date : March 29 2020, 07:55 AM
like below fixes the issue This works for any positive or negative number with the exponential 'E', positive or negative. (You can convert a numerical string to a number by prefixing '+', or make it a string method, or a method of any object, and call the string or number.) Number.prototype.noExponents= function(){
var data= String(this).split(/[eE]/);
if(data.length== 1) return data[0];
var z= '', sign= this<0? '':'',
str= data[0].replace('.', ''),
mag= Number(data[1])+ 1;
if(mag<0){
z= sign + '0.';
while(mag++) z += '0';
return z + str.replace(/^\/,'');
}
mag = str.length;
while(mag) z += '0';
return str + z;
}
var n=2.54E20;
n.noExponents();
"0.0000000000000000000254"

What is the difference between array notation and object notation when creating multiple chunks in webpack?
Date : March 29 2020, 07:55 AM
To fix this issue If you just want to specify several chunks you can just add hotloading script to one of them: entry: {
vandor: './vendor/vendor.js',
app: ['webpackhotmiddleware/client', './src/js/entry.js']
},
entry: {
vandor: ['./vendor/vendor.js'],
app: ['./src/js/entry.js']
},
...
webpackConfig.entry.app.unshift('webpackhotmiddleware/client');

How do I replace arraystyle notation in templates with objectnotation when switching from cakephp 2.x to 3.x
Tag : php , By : Blaise Roth
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further When migrating, what is a fast way to replace the array notation of cakephp 2.x , this regular expression works: find this \$order\['(\w+)'\]
$order>\1
\$offcut>$1

Prevent Jupyter from switching between normal mathematical notation and scientific notation
Date : March 29 2020, 07:55 AM
around this issue I want to ask a question about turning off scientific notation of numbers in Jupyter notebook. , This is a numpy print issue: In [544]: with np.printoptions(suppress=True):
...: np.array([[1.63276953e+02, 1.41858314e01],
...: [1.64042353e+02, 5.13131094e01]])
...:
In [545]: with np.printoptions(suppress=True):
...: print( np.array([[1.63276953e+02, 1.41858314e01],
...: [1.64042353e+02, 5.13131094e01]]))
...:
...:
[[163.276953 0.14185831]
[164.042353 0.51313109]]
In [546]: with np.printoptions(suppress=False):
...: print( np.array([[1.63276953e+02, 1.41858314e01],
...: [1.64042353e+02, 5.13131094e01]]))
...:
...:
[[1.63276953e+02 1.41858314e01]
[1.64042353e+02 5.13131094e01]]

