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
rparree@hp-8570w:jbadmin-setup> vagrant vbguest --auto-reboot --no-provision | |
GuestAdditions versions on your host (4.3.24) and guest (4.3.22) do not match. | |
Loaded plugins: fastestmirror, langpacks | |
Loading mirror speeds from cached hostfile | |
* base: mir01.syntis.net | |
* extras: mirror-fr1.bbln.org | |
* updates: mir01.syntis.net | |
Package kernel-devel-3.10.0-123.20.1.el7.x86_64 already installed and latest version | |
Package gcc-4.8.2-16.2.el7_0.x86_64 already installed and latest version | |
Package 1:make-3.82-21.el7.x86_64 already installed and latest version |
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
<plugin> | |
<groupId>org.bsc.maven</groupId> | |
<artifactId>maven-processor-plugin</artifactId> | |
<version>2.2.4</version> | |
<executions> | |
<execution> | |
<id>process</id> | |
<goals> | |
<goal>process</goal> | |
</goals> |
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
#!/bin/bash | |
# https://gist.github.com/rparree/7562785 | |
PROJECT_NAME="$1" | |
SCALA_VERSION="2.10.2" | |
mkdir $PROJECT_NAME | |
cd $PROJECT_NAME | |
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 org.w3c.dom.Document; | |
import org.w3c.dom.NodeList; | |
import org.xml.sax.InputSource; | |
import org.xml.sax.SAXException; | |
import javax.xml.parsers.DocumentBuilder; | |
import javax.xml.parsers.DocumentBuilderFactory; | |
import javax.xml.parsers.ParserConfigurationException; | |
import javax.xml.xpath.*; | |
import java.io.IOException; |
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
char[] buffer = new char[1024]; | |
String chunk = null; | |
while ((read = reader.read(buffer)) != -1) { | |
String s = String.valueOf(buffer, 0, read); | |
/* process the string: Look for "-", keep the part after it | |
for the next iteration. Add part before it to previous | |
chunk | |
*/ | |
} |
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
<!-- | |
Source: https://www.scala-lang.org/files/archive/spec/2.13/13-syntax-summary.html | |
Just some nifty regex search/replace | |
--> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> |
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
abstract class MyStringBuilder { | |
def get(): String | |
def append(s: String) | |
} | |
class BasicStringBuilder extends MyStringBuilder { | |
private var value : String = "" | |
def get(): String = value | |
def append(s: String) = value = value + s | |
} |
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
case class PersonalInfo(email: String, twitter: Option[String]) | |
case class Student(username: String, personalInfo: Option[PersonalInfo]) |
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 scala.util.{Left, Right} | |
case class Name(value: String) extends AnyVal { | |
def +(s: Name) = Name(this.value + s) | |
override def toString: String = value | |
} | |
implicit def strToName(s: String) = Name(s) |
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 demo | |
/** | |
* todo | |
*/ | |
object FutureDemoApp extends App { | |
import scala.concurrent.Future | |
import scala.concurrent.ExecutionContext.Implicits.global | |
object supporting { |
OlderNewer