###To laptop
Specify an IP address to eth0 (here 192.168.56.1)
sudo ifconfig eth0 192.168.56.1 netmask 255.255.255.0
/* Delete the tables if they already exist */ | |
drop table if exists Movie; | |
drop table if exists Reviewer; | |
drop table if exists Rating; | |
/* Create the schema for our tables */ | |
create table Movie(mID int, title text, year int, director text); | |
create table Reviewer(rID int, name text); | |
create table Rating(rID int, mID int, stars int, ratingDate date); |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
docker-compose up -d | |
docker attach myapp_web_1 |
#!/usr/bin/env bash | |
#============================================================================== | |
# | |
# Install cgroup-bin in Debian Wheezy | |
# | |
# The following required files in a cgroup-bin package of debian wheezy are | |
# missing. That's why this script get these files from a package of debian | |
# squeeze while original init.d scripts of cgroup were not regulated to use | |
# in debian system. | |
# |
/* | |
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
*/ | |
var http = require('http'), | |
fs = require('fs'), | |
util = require('util'); | |
http.createServer(function (req, res) { | |
var path = 'video.mp4'; |
import csv | |
from collections import defaultdict | |
with open('/Users/adam/Downloads/languages-2014.csv', 'r') as f: | |
results_2014 = [row for row in csv.reader(f)][1:] | |
with open('/Users/adam/Downloads/languages-2013.csv', 'r') as f: | |
results_2013 = [row for row in csv.reader(f)][1:] | |
with open('/Users/adam/Downloads/languages-2012.csv', 'r') as f: |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
function ajaxCall(url, parameters, successCallback) { | |
$.ajax({ | |
type: 'POST', | |
dataType: 'json', //la funccion success te devolvera un json | |
url: url, | |
data: parameters, |
// See comments below. | |
// This code sample and justification brought to you by | |
// Isaac Z. Schlueter, aka isaacs | |
// standard style | |
var a = "ape", | |
b = "bat", | |
c = "cat", | |
d = "dog", |