https://www.youtube.com/watch?v=TMuno5RZNeE
Encapsulation ?
- OO weaken encapsulation by introducing
private
,public
,protected
Inheritance ?
- why Java doesn't have inheritance ? Diamond problem
Polymorphism
https://www.youtube.com/watch?v=TMuno5RZNeE
Encapsulation ?
private
, public
, protected
Inheritance ?
Polymorphism
-- High level API which compiles to GPU code | |
-- It can also compile to a opencl python module (which we use: gpu.py) | |
-- Dependency: pyopencl | |
-- TOTALLY AWESOME STUFF INCOMING !!! | |
-- See: https://futhark-book.readthedocs.io/en/latest/interoperability.html#calling-futhark-from-python | |
-- Overview: https://futhark-lang.org | |
-- vector * vector | |
let dotprod (u: []f32) (v: []f32): f32 = | |
reduce (+) 0.0 (map2 (*) u v) |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
elem.clientLeft
, elem.clientTop
, elem.clientWidth
, elem.clientHeight
elem.getClientRects()
, elem.getBoundingClientRect()
(function(){ | |
var iframes = document.getElementsByTagName('iframe'); for(var i = 0; i < iframes.length; i++) {iframes[i].width = "auto"; } | |
var content="@media print { img {max-width: 640px !important;} iframe { width: auto; display: block; } .section-inner.sectionLayout--insetColumn { max-width: 1024px !important; padding: padding: 0px 0px !important; } }"; | |
var style = document.createElement('style'); | |
style.appendChild(document.createTextNode(content)); | |
document.getElementsByTagName('head')[0].appendChild(style); | |
})(); |
# ------------------------------- | |
# GIT CONFIGURATION | |
# ------------------------------- | |
# checks if branch has something pending | |
parse_git_dirty() { | |
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*" | |
} | |
# gets the current git branch |
// check integer array | |
const num = parseFloat(value); | |
// num is 0 if you parseFloat for example a hex value - we don't | |
// want that | |
if (num === 0 || num % 1 !== 0) { | |
throw new TypeError( | |
`Array value invalid, Integer > 0 expected, got: ${value}`); | |
} |
-server | |
-Xms1024m | |
-Xmx8192m | |
-XX:MaxPermSize=2048m | |
-XX:ReservedCodeCacheSize=2048m | |
-ea | |
-Dsun.io.useCanonCaches=false | |
-Djava.net.preferIPv4Stack=true | |
-Djsse.enableSNIExtension=false | |
-XX:+UseCodeCacheFlushing |
//filter textnodes wrap then in p and remove all br elements | |
$($element.contents()).filter(function(){ | |
this.textContent = _.trim(this.textContent); // trim trailling and leading white spaces | |
return this.nodeType === 3; // filter textnodes only | |
}).wrap('<p></p>').end().filter('br').remove(); |
// Promise.all is good for executing many promises at once | |
Promise.all([ | |
promise1, | |
promise2 | |
]); | |
// Promise.resolve is good for wrapping synchronous code | |
Promise.resolve().then(function () { | |
if (somethingIsNotRight()) { | |
throw new Error("I will be rejected asynchronously!"); |
/* for of loops and iterables */ | |
for(let char/*can use destructuring here*/ of "hello"){ | |
console.log(char); // unicode char | |
} | |
for(let value of [1,2,3]){ | |
console.log(value); | |
} | |
/*for of is for iterable objects like arrays and collections like Map or Set, |