This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Non Static Method Example | |
public interface Foo { | |
default void bar() { | |
System.out.print("Hello"); | |
baz(); | |
} | |
private void baz() { | |
System.out.println(" world!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<String> list=List.of("apple","bat"); | |
List<String> list=List.of("apple",null); // It doesn't allow null values - NullPointerException will be thrown if added. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_MangledGlobal__mangled = "From Global" | |
class MangledGlobal: | |
def test(self): | |
return __mangled # Do notice we havn't used self here | |
print(MangledGlobal().test()) # Prints "From Global" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i | |
me | |
my | |
myself | |
we | |
our | |
ours | |
ourselves | |
you | |
your |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<config> | |
<searchComponent name="suggest" class="solr.SuggestComponent"> | |
<lst name="suggester"> | |
<str name="name">mySuggester</str> | |
<str name="lookupImpl">AnalyzingInfixLookupFactory</str> | |
<str name="dictionaryImpl">DocumentDictionaryFactory</str> | |
<str name="field">headline</str> | |
<str name="suggestAnalyzerFieldType">text_en</str> | |
<str name="buildOnStartup">false</str> | |
</lst> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Paper, withStyles, Grid, TextField, Button, FormControlLabel, Checkbox } from '@material-ui/core'; | |
import { Face, Fingerprint } from '@material-ui/icons' | |
const styles = theme => ({ | |
margin: { | |
margin: theme.spacing.unit * 2, | |
}, | |
padding: { | |
padding: theme.spacing.unit | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const wait = time => new Promise( | |
res => setTimeout(() => res(), time) | |
); | |
wait(200) | |
// onFulfilled() can return a new promise, `x` | |
.then(() => new Promise(res => res('foo'))) | |
// the next promise will assume the state of `x` | |
.then(a => a) | |
// Above we returned the unwrapped value of `x` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const fs = require('fs'); | |
const path = require('path'); | |
function clone(generatorFunction) { | |
function callback(err) { | |
if (err) { | |
return generator.throw(err); | |
} | |
const results = [].slice.call(arguments, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shape - superclass | |
function Shape() { | |
this.x = 0; | |
this.y = 0; | |
} | |
// Superclass method | |
Shape.prototype.move = function(x, y) { | |
this.x += x; | |
this.y += y; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const redux = require('redux'); | |
const createStore = redux.createStore; | |
const initialState = { | |
counter:0 | |
} | |
// Order matters Reducer -> Store -> Subscription -> dispatcher | |
// Reducer |
NewerOlder