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
(in /home/proppy/Desktop/playground/watir-webdriver) | |
All dependencies seem to be installed. | |
trying 0.0.0.0:2000... | |
[2010-08-23 19:31:16] INFO WEBrick 1.3.1 | |
[2010-08-23 19:31:16] INFO ruby 1.8.7 (2010-01-10) [x86_64-linux] | |
trying 0.0.0.0:2000... | |
trying 0.0.0.0:2000... | |
trying 0.0.0.0:2000... | |
trying 0.0.0.0:2000... | |
trying 0.0.0.0:2000... |
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 assert = require('assert'); | |
var s = ''; | |
var append_char = function(arg) { | |
s+= arg; | |
}; | |
function rendezvous(callback) { | |
return { | |
callbacks: [], | |
callback: function(cb) { |
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
proppy@unubore:~/Desktop/mape$ cat connectform.js | |
var connect = require('connect'); | |
var form = require('connect-form'); | |
var server = connect.createServer( | |
form({ keepExtensions: true }), | |
function(req, res, next){ | |
// Form was submitted | |
if (req.form) { | |
// Do something when parsing is finished | |
// and respond, or respond immediately |
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
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 |
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
#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); |
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
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 |
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
[[('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)], |
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 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(); |
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
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 |
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.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 |