docker.sh: a small interactive shell hack for docker
Usage: ./docker.sh [base-image-name]
docker.sh: a small interactive shell hack for docker
Usage: ./docker.sh [base-image-name]
'use strict'; | |
var COMPILED = !0, goog = goog || {}; | |
goog.global = this; | |
goog.DEBUG = !1; | |
goog.LOCALE = "en"; | |
goog.provide = function (a) { | |
if (!COMPILED) { | |
if (goog.isProvided_(a)) | |
throw Error('Namespace "' + a + '" already declared.'); |
'use strict'; | |
var COMPILED = !0, goog = goog || {}; | |
goog.global = this; | |
goog.DEBUG = !1; | |
goog.LOCALE = "en"; | |
goog.provide = function (a) { | |
if (!COMPILED) { | |
if (goog.isProvided_(a)) | |
throw Error('Namespace "' + a + '" already declared.'); |
import java.util.Iterator; | |
import com.google.appengine.api.datastore.Entity; | |
import com.google.appengine.api.datastore.Key; | |
public class EntityToKeyIterable implements Iterable<Key> { | |
Iterable<Entity> iterable; | |
public EntityToKeyIterable(Iterable<Entity> iterable) { | |
this.iterable = iterable; | |
} | |
@Override |
set -e | |
[ $# -ge 2 ] || (echo 'usage: depy PACKAGES... DIRECTORY' ; false) | |
PACKAGES=${@:1:$(($#-1))} | |
DESTINATION=${!#} | |
TMPDIR=/tmp/depy.$$ | |
pip install -E $TMPDIR $PACKAGES | |
find $TMPDIR -type f -name "*.pyc" -delete | |
PACKAGES=$(pip freeze -E $TMPDIR | cut -d '=' -f 1 | xargs -n 1 -I @package@ find $TMPDIR -ipath '*/@package@/__init__.py' | sed -e s/__init__\.py//) | |
mkdir -p $DESTINATION | |
cp -R $PACKAGES $DESTINATION |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import com.google.appengine.api.users.UserService; | |
import com.google.appengine.api.users.UserServiceFactory; | |
public class AuthServlet extends HttpServlet { | |
@Override | |
public void doGet(HttpServletRequest request, HttpServletResponse response) { | |
UserService userService = UserServiceFactory.getUserService(); |
[[('A',0,1),('B',0,1),('A',0,1)], [('A',0,1),('B',0,1),('B',1,1)], | |
[('A',0,1),('B',0,1),('A',2,2)], [('A',0,1),('B',0,1),('B',4,1)], | |
[('A',0,1),('A',1,1),('A',0,1)], [('A',0,1),('A',1,1),('B',1,1)], | |
[('A',0,1),('A',1,1),('A',2,2)], [('A',0,1),('A',1,1),('B',4,1)], | |
[('A',0,1),('B',2,2),('A',0,1)], [('A',0,1),('B',2,2),('B',1,1)], | |
[('A',0,1),('B',2,2),('A',2,2)], [('A',0,1),('B',2,2),('B',4,1)], | |
[('A',0,1),('A',4,1),('A',0,1)], [('A',0,1),('A',4,1),('B',1,1)], | |
[('A',0,1),('A',4,1),('A',2,2)], [('A',0,1),('A',4,1),('B',4,1)], | |
[('B',1,2),('B',0,1),('A',0,1)], [('B',1,2),('B',0,1),('B',1,1)], | |
[('B',1,2),('B',0,1),('A',2,2)], [('B',1,2),('B',0,1),('B',4,1)], |
count1 c (x:xs) = count1' (c == x) + count1 c xs | |
count1 c [] = 0 | |
count1' True = 1 | |
count1' False = 0 | |
count2 c (x:xs) | c /= x = 0 + count2 c xs | |
| otherwise = 1 + count2 c xs | |
count2 c [] = 0 | |
count3 c (x:xs) = (if c == x then 1 else 0) + count3 c xs |
#include <assert.h> | |
#include <fcntl.h> | |
int main(int argc, int argv) { | |
int in, out, n; | |
char data[1024]; | |
char header[1]; | |
header[0] = 0x89; | |
in = open("/tmp/corrupted.png", O_RDONLY); | |
out = open("/tmp/corrupted2.png", O_CREAT|O_WRONLY); |
ok: | |
00000000: 8950 4e47 0d0a 1a0a 0000 000d 4948 4452 .PNG........IHDR | |
00000010: 0000 00e3 0000 00cc 1002 0000 005e 865f .............^._ | |
00000020: bb00 0000 096f 4646 7300 0002 5b00 0001 .....oFFs...[... | |
00000030: bf00 4963 8793 0000 0009 7048 5973 0000 ..Ic......pHYs.. | |
corrupted: | |
00000000: efbf bd50 4e47 0d0a 1a0a 0000 000d 4948 ...PNG........IH | |
00000010: 4452 0000 00ef bfbd 0000 00ef bfbd 1002 DR.............. | |
00000020: 0000 005e efbf bd5f efbf bd00 0000 096f ...^..._.......o |