Skip to content

Instantly share code, notes, and snippets.

View aruld's full-sized avatar
🎯
Focusing

Arul Dhesiaseelan aruld

🎯
Focusing
View GitHub Profile
@aruld
aruld / LocalVariableTypeInferenceTest.java
Created January 11, 2018 03:02
Local Variable Type Inference Examples
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;
public class LocalVariableTypeInferenceTest {
private void processOrder(String order) {
@aruld
aruld / Info.plist
Last active March 29, 2016 14:07
To run Intellij 14.1 with latest JDK 9 on OS X Yosemite, edit /Applications/IntelliJ\ IDEA\ 14.app/Contents/Info.plist and set JVMVersion to 1.8 under JVM Options.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
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(","));