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
require(ggplot2) | |
# Figure 1 | |
ggplot(GermanCredit, aes(x = Class)) + | |
geom_bar(aes(y = (..count..)/sum(..count..))) + | |
labs(y = "prob.") |
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
require(ODB) | |
database_path = "~/example_path/my_database.odb" | |
# Create a database | |
odb.create(database_path) | |
# Connect to the database | |
ODB <- odb.open(database_path) |
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
require(ggplot2) | |
require(gridExtra) | |
require(reshape2) | |
set.seed(1) | |
predictors = data.frame(x1 = rnorm(1000, mean = 5, sd = 2), | |
x2 = rexp(1000, rate=10)) | |
p1 = ggplot(predictors) + geom_point(aes(x = x1, y = x2)) |
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
var http = require("http"); | |
http.createServer(function (request, response) { | |
// Send the HTTP header | |
// HTTP Status: 200 : OK | |
// Content Type: text/plain | |
response.writeHead(200, {'Content-Type': 'text/plain'}); | |
// Send the response body as "Hello World" |
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
<html> | |
<head> | |
<title>File Uploading Form</title> | |
</head> | |
<body> | |
<h3>File Upload:</h3> | |
Select a file to upload: <br /> | |
<form action="http://127.0.0.1:8081/file_upload" method="POST" | |
enctype="multipart/form-data"> | |
<input type="file" name="file" size="50" /> |
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/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.companyname.projectgroup</groupId> | |
<artifactId>project</artifactId> | |
<version>1.0</version> | |
<build> | |
<plugins> |
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/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>gd.wa</groupId> | |
<artifactId>minimal-pom</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> |
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 unittest | |
# Subclass TestCase class | |
class TestUM(unittest.TestCase): | |
# Execute code prior to unit tests being run | |
def setUp(self): | |
pass | |
# create unit tests using assert methods |
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"?> | |
<data> | |
<country name="Liechtenstein"> | |
<rank>1</rank> | |
<year>2008</year> | |
<gdppc>141100</gdppc> | |
<neighbor name="Austria" direction="E"/> | |
<neighbor name="Switzerland" direction="W"/> | |
</country> | |
<country name="Singapore"> |
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 xml.etree.ElementTree as ET | |
# parse XML from a file | |
tree = ET.parse(file_path) # parse the file and obtain ElementTree obj | |
root = tree.getroot() # get the root Element obj | |
# parse XML in a string format | |
root = ET.fromstring(country_data_as_string) | |
root = ET.XML(country_data_as_string) # equivalent to above |
OlderNewer