What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-23 06:20:56
javascript counting sort
const countingSort = arr => { const min = arr.reduce((acc, v) => (acc < v ? acc : v)) const max = arr.reduce((acc, v) => (acc > v ? acc : v)) const count = new Map() for (let i = min; i <= max; i++) { count[i] = 0 } for ... Add solution -
C# 2022-01-22 23:40:55
unittest servicector automapper
public TestsCtor() { _fixture = new Fixture().Customize(new AutoMoqCustomization()); var converterLogger = _fixture.Freeze<Mock<ILogger<MyTypeConverter>>>(); var automapperServiceCtor = _fixture.Freeze<Mock<Func<Type... Add solution -
Other 2022-01-22 23:40:46
content type converter
List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>(); //Add the Jackson Message converter MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); // ... Add solution -
Other 2022-01-22 22:15:31
Table has no primary key. Doctrine does not support reverse engineering from tables that don't have a primary key.
if (!$table->hasPrimaryKey()) { // comment this Throw exception // throw new MappingException( // “Table “ . $table->getName() . “ has no primary key. // Doctrine does not “. // “support reverse... Add solution -
Javascript 2022-01-22 00:30:31
filter array with unique objects javascript
const array = [ { "name": "Joe", "age": 17 }, { "name": "Bob", "age": 17 }, { "name": "Carl", "age": 35 } ] const key = 'age'; const arrayUniqueByK... Add solution -
Javascript 2021-11-21 14:40:31
code to convert rgb to hsl color
// see: https://en.wikipedia.org/wiki/RGB_color_model // see: https://en.wikipedia.org/wiki/HSL_and_HSV // expects R, G, B, Cmax and chroma to be in number interval [0, 1] // returns undefined if chroma is 0, or a number interval [0, 360] degrees functio... Add solution -
Javascript 2021-11-19 02:45:10
react-mapbox-gl custom marker
// add markers to map geojson.features.forEach(function(marker) { // create a HTML element for each feature var el = document.createElement('div'); el.className = 'marker'; // make a marker for each feature and add to the map new mapboxgl.Mark... Add solution -
Other 2021-11-15 06:42:12
Converting/Parsing an Enumeration to a String More Generically
private interface EnumerationToStringHelper { List<Object> ProvideEnumerationValues(); Boolean CompareEnumerationToString(String possibleEnumeration, Object enumerationValue); } private class ExampleEnumToStringHelper implements Enumeration... Add solution
Best helpers
Ranking is empty