This file contains 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
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/ron/Documents/GitHub/rjp-test -Dmaven.home=/usr/local/Cellar/maven/3.3.3/libexec -Dclassworlds.conf=/usr/local/Cellar/maven/3.3.3/libexec/bin/m2.conf -Didea.launcher.port=7544 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 14.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/usr/local/Cellar/maven/3.3.3/libexec/boot/plexus-classworlds-2.5.2.jar:/Applications/IntelliJ IDEA 14.app/Contents/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=14.1.3 verify -P ci | |
[INFO] Scanning for projects... | |
[INFO] | |
[INFO] Using the MultiThreadedBuilder implementation with a thread count of 5 | |
[INFO] | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Building rjp-test 1.0.0-SNAPSHOT | |
[INFO] -------------------------------------------------- |
This file contains 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
package com.github.gist.example.collectors; | |
import java.util.Collections; | |
import java.util.EnumSet; | |
import java.util.Set; | |
import java.util.function.BiConsumer; | |
import java.util.function.BinaryOperator; | |
import java.util.function.Function; | |
import java.util.function.Supplier; | |
import java.util.stream.Collector; |
This file contains 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
public static String reverse(String str) { | |
return new StringBuilder(str).reverse().toString(); | |
} | |
public static String reverseString(String str) { | |
char[] chars = str.toCharArray(); | |
String out = ""; | |
for(int i = chars.length - 1; i < 0; i--) { | |
out += chars[i]; | |
} |
This file contains 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
package exercises; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
public class FizzBuzz8 { | |
public static void main(String[] args) { | |
System.out.println(IntStream.range(1, 101).boxed() | |
.map(FizzBuzz8::fizzBuzz) |
This file contains 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 java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
public class Main { | |
public static void main(String[] args) { | |
System.out.println(IntStream.range(1, 101).boxed() | |
.map(Main::fizzBuzz) | |
.collect(Collectors.joining(", "))); | |
} |
This file contains 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
// FizzBuzz problem in Swift (Playground) | |
import Foundation | |
println("\n\nClassic imperative - Print Fizz or Buzz or FizzBuzz") | |
for i in 1...100 { | |
var output = "" | |
if i % 3 == 0 {output += "Fizz"} | |
if i % 5 == 0 {output += "Buzz"} | |
print((output == "" ? "\(i)" : output) + ", ") |
This file contains 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
// Paste in playground | |
// Handy NSColor and String extensions | |
import Cocoa | |
extension String { | |
func conformsTo(pattern: String) -> Bool { | |
let pattern = NSPredicate(format:"SELF MATCHES %@", pattern) |
This file contains 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
#!/usr/bin/env xcrun swift -i | |
var str = "Hello, playground" | |
println(str) |
This file contains 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
After adding a new dependency to your build.sbt file... | |
sbt> reload | |
sbt> eclipse with-source=true | |
After it completes refresh the project in the ide |