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
# Creating a new plot with no spacing | |
fig, axes = plt.subplots(2, 2, sharex=True, sharey=True) for i in range(2): | |
for j in range(2): | |
axes[i, j].hist(randn(500), bins=50, color='k', alpha=0.5) | |
plt.subplots_adjust(wspace=0, hspace=0) | |
# useful bar graph | |
series.value_counts().plot(kind='bar/barh') |
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.nextinstruction; | |
import org.eclipse.jetty.server.Connector; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.server.nio.SelectChannelConnector; | |
import org.eclipse.jetty.server.ssl.SslSelectChannelConnector; | |
import org.eclipse.jetty.util.ssl.SslContextFactory; | |
import org.eclipse.jetty.webapp.WebAppContext; | |
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
(:swank-rpc | |
(swank:connection-info) | |
1) | |
(:return | |
(:ok | |
(:pid nil :implementation | |
(:name "ENSIME-ReferenceServer") | |
:version "0.8.10")) | |
1) | |
(:swank-rpc |
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 tutorial.storm | |
import backtype.storm.utils.Utils | |
import backtype.storm.{LocalCluster, StormSubmitter, Config} | |
import backtype.storm.generated.StormTopology | |
import com.typesafe.scalalogging.slf4j.LazyLogging | |
import org.rogach.scallop._ | |
class RunnerOptions(arguments: Seq[String]) extends ScallopConf(arguments) { |
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/sh | |
remove_dangling() { | |
echo "Removing dangling images ..." | |
docker rmi $(docker images -f dangling=true -q) | |
} | |
remove_stopped_containers() { | |
echo "Removing stopped containers ..." | |
docker rm $(docker ps -qa) |
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
class XmlExamples { | |
static def CAR_RECORDS = ''' | |
<records> | |
<car name='HSV Maloo' make='Holden' year='2006'> | |
<country>Australia</country> | |
<record type='speed'>Production Pickup Truck with speed of 271kph</record> | |
</car> | |
<car name='P50' make='Peel' year='1962'> | |
<country>Isle of Man</country> | |
<record type='size'>Smallest Street-Legal Car at 99cm wide and 59 kg in weight</record> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- Copyright (C) 2011, EclipseSource and others All rights reserved. This | |
program and the accompanying materials are made available under the terms | |
of the Eclipse Public License v1.0 which accompanies this distribution, and | |
is available at http://www.eclipse.org/legal/epl-v10.html --> | |
<project | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | |
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<modelVersion>4.0.0</modelVersion> |
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
================= | |
pom.xml | |
================= | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- Copyright (C) 2011, EclipseSource and others All rights reserved. This | |
program and the accompanying materials are made available under the terms | |
of the Eclipse Public License v1.0 which accompanies this distribution, and | |
is available at http://www.eclipse.org/legal/epl-v10.html --> |
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
class StrategyRunner { | |
Map strategyMap = [:] | |
interface IStrategy { | |
boolean apply(arg) | |
}; | |
def addStrategy(String name, Closure cl) { |
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
(ns joy.sql | |
"SQL DSL example from chapter 1." | |
(:require [clojure.string :as str])) | |
(defn expand-expr [expr] | |
(if (coll? expr) | |
(if (= (first expr) `unquote) ;;#: Handle unsafe literals | |
"?" | |
(let [[op & args] expr] | |
(str "(" (str/join (str " " op " ") (map expand-expr args)) ")"))) |
OlderNewer