-
Clone an existing repository:
git clone <repo>
(e.g.
https://gist.github.com/1125520.git
). -
[Checkout and pull an existing branch][gcp]:
sudo apt-get install -y php5-common libapache2-mod-php5 php5-cli curl libcurl3 libcurl3-dev php5-curl php5-mcrypt php5-ldap php5-gd php5-mysql phpunit php-pear
sudo pear upgrade pear
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover components.ez.no
sudo pear channel-discover pear.symfony-project.com
sudo pear install --alldeps phpunit/PHPUnit
slf4j's Logger.debug is a perfect example of item 42 in Effective Java 2nd Edition (on varargs), but I have a question.
I believe that they have found that the vast majority of use cases of debug
have 2 or less arguments and that by over loading the methods with 0,1,2 arguments, the implementation is able to avoid allocating an array?
/**
* Log a message at the DEBUG level.
*
* @param msg the message string to be logged
*/
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 sys, csv, json | |
if len(sys.argv) == 1: | |
print "1 argument for filename required" | |
sys.exit() | |
gdoc = csv.reader(open(sys.argv[1])) | |
# Get the 1st line, assuming it contains the column titles | |
fieldnames = gdoc.next() |
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
- match: \b(catch)\b | |
scope: keyword.control.catch-exception.java | |
push: | |
- meta_scope: meta.catch.java | |
- match: (?=\)) | |
pop: true | |
- include: catch-clause | |
# https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.20 |
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.*; | |
public class MainClass { | |
public static void main(String[] args) { | |
System.out.println(Arrays.deepToString(args)); | |
} | |
} |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>net.mlbam.bdt</groupId> | |
<artifactId>java-sandbox</artifactId> | |
<version>0.0.0-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<name>Java Sandbox</name> | |
<properties> | |
<maven.compiler.source>1.8</maven.compiler.source> | |
<maven.compiler.target>1.8</maven.compiler.target> |