Skip to content

Instantly share code, notes, and snippets.

@chilloutman
chilloutman / ClassLoadersInspector.java
Created May 17, 2018 11:20
ClassLoadersInspector.java
import static java.lang.System.out;
import static java.util.Arrays.stream;
import static java.util.stream.Collectors.joining;
import static java.util.stream.Stream.generate;
import java.net.URL;
import java.net.URLClassLoader;
class ClassLoadersInspector {
@chilloutman
chilloutman / ZHAW_AI.md
Last active February 27, 2017 08:55
AI: Harmful or Helpful

AI: Harmful or Helpful?

Technological optimism leads many to believe that technology inherently improves our lives. Many new technologies such as flight, have done that. Even though initially the idea that humans could fly seemed far-fetched, it works thanks to technology and it has greatly benefited humanity. We might be standing on the cusp of a new powerful technology, Artificial Intelligence. Right now we are limited to creating narrow intelligence for specialized tasks. We should mature artificial narrow intelligence by practicing it. Two suitable topics would be cognitive human extension and cognitive human amplifier, which would already initiate a big leap in humans life. It sounds like a good way to grow the technological progression. Predicting the future is hard, but many people believe this to be the beginning of something big.

While the range of biological intelligence seems very likely limited by evolution amongst other things, artificial intelligence may not be. A technology that powerful co

@chilloutman
chilloutman / Closeable.groovy
Last active August 29, 2015 14:22
Ensuring Closeable is closed in Java/Groovy
public class Database {
public void useConnection (Consumer consumer) {
try (def connection : newConnection()) {
consumer.accept(connection);
}
}
private Connection newConnection () { /*...*/ };
@chilloutman
chilloutman / forEach.js
Created December 4, 2012 16:00
JavaScript: forEach support for older browsers
/*
* forEach support for older browsers.
* Source: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach
*/
(function() {
"use strict";
if (!Array.prototype.forEach) {
Array.prototype.forEach = function(fn, scope) {
for(var i = 0, len = this.length; i < len; ++i) {
fn.call(scope || this, this[i], i, this);