Skip to content

Instantly share code, notes, and snippets.

View aruld's full-sized avatar
🎯
Focusing

Arul Dhesiaseelan aruld

🎯
Focusing
View GitHub Profile
var employees = { "neal", "s", "stu", "j", "rich", "bob" }
var result = employees.where(\s -> s.length > 1)
.map(\s -> s.capitalize())
.join(",")
static Void main() {
employees := ["neal", "s", "stu", "j", "rich", "bob"]
Str result := employees.findAll { it.size > 1 }
.map { it.capitalize }
.join(",")
}
void main() {
value employees = {"neal", "s", "stu", "j", "rich", "bob"};
String result = ",".join(employees
.filter((String e) => e.longerThan(1))
.map((String s) => s.segment(0, 1).uppercased + s.spanFrom(1))
);
// using a for comprehension
String result = ", ".join {
for (i in employees)
def static void main(String[] args) {
val employees = Arrays.asList("neal", "s", "stu", "j", "rich", "bob")
val result = employees.stream
.filter[length() > 1]
.map[toFirstUpper()]
.reduce[x, y | x + "," + y]
}
// without map()
def static void main(String[] args) {
fun main(args: Array<String>) {
val employees = array("neal", "s", "stu", "j", "rich", "bob")
val result = employees filter { it.length > 1 } map { it.capitalize() } reduce { x, y -> x + "," + y }
}
@aruld
aruld / gist:8152172
Created December 27, 2013 20:26
SSL debug trace 2 with delegating key manager used here:
trigger seeding of SecureRandom
done seeding SecureRandom
Using SSLEngineImpl.
Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
@aruld
aruld / gist:8152111
Created December 27, 2013 20:21
SSL debug trace with delegating key manager used here:
X509KeyManager passed to SSLContext.init(): need an X509ExtendedKeyManager for SSLEngine use
trigger seeding of SecureRandom
done seeding SecureRandom
Using SSLEngineImpl.
Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
employees.parallelStream()
.filter(e -> e.length() > 1)
.map(s -> s.substring(0, 1).toUpperCase() + s.substring(1))
.collect(joining(","));
employees.stream()
.filter(e -> e.length() > 1)
.map(s -> s.substring(0, 1).toUpperCase() + s.substring(1))
.collect(joining(","));
(defn process [list-of-emps]
(reduce str (interpose ","
(map clojure.string/capitalize
(filter #(< 1 (count %)) list-of-emps)))))