Skip to content

Instantly share code, notes, and snippets.

View piyush0101's full-sized avatar

Piyush Srivastava piyush0101

  • DigitalOcean
  • Portland, OR
View GitHub Profile
@piyush0101
piyush0101 / life.lisp
Created October 21, 2012 16:39 — forked from rik0/life.lisp
Game of Life in Lisp
(proclaim '(optimize (speed 3) (space 0) (debug 0)))
(defparameter *width* 80)
(defparameter *height* 23)
(defparameter *length* (* *width* *height*))
(defun neighbours (pos)
(mapcar (lambda (x) (mod x *length*))
(delete pos
(mapcan (lambda (pos)
public class AbstractTweetService {
protected List<Tweet> tweets;
public AbstractTweetService() {
tweets = TweetDownloader.downloadTweets();
}
public void persistTweets(String user, int numberOfTweets) {
TweetPersister.persistTweets();
public class AbstractTweetService {
protected List<Tweet> tweets;
public AbstractTweetService(TweetDownloaderHelper downloaderHelper) {
tweets = downloaderHelper.downloadTweets();
}
public void persistTweets(String user, int numberOfTweets) {
TweetPersister.persistTweets();
from unittest import TestCase
from pecan import conf
import requests
class UpdateDataTest(TestCase):
def test_should_store_data_in_datastore(self):
conf.update({"db": {"url": "mim://localhost:27017/collection"}})
service = "service"
#!/usr/bin/perl
@failed_tests=('Coverage-vector-9.coverage',
'Coverage-vector-10.coverage',
'Coverage-vector-11.coverage');
@passed_tests=('Coverage-vector-7.coverage',
'Coverage-vector-8.coverage');
@failed_keys=('gamma', 'alpha');
import os
import re
with open('sept record.csv', 'r') as records:
minutes = 0.0
for line in records:
match = re.search("(\d+):(\d+)", line)
if match:
duration = int(match.group(1)) * 60 + int(match.group(2))
minutes += duration
package GoJava;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
---
- job:
name: project-py-build
description: >
Run unit tests and build project package
This job is managed by jenkins-job-builder. Changes made through
the web interface will be lost!
node: "big-slave"
display-name: "Build Project Application"
triggers:
Using public TSA key from environment.
Using private worker key from environment.
{"timestamp":"1468613418.367889643","source":"worker","message":"worker.garden.unpack-assets.unpacking","log_level":1,"data":{"session":"1.1"}}
{"timestamp":"1468613423.881664515","source":"worker","message":"worker.garden.unpack-assets.done","log_level":1,"data":{"session":"1.1"}}
{"timestamp":"1468613423.882001400","source":"worker","message":"worker.garden.extract-resources.extract.extracting","log_level":1,"data":{"resource-type":"archive","session":"1.2.1"}}
{"timestamp":"1468613424.163156509","source":"worker","message":"worker.garden.extract-resources.extract.extracting","log_level":1,"data":{"resource-type":"bosh-deployment","session":"1.2.2"}}
{"timestamp":"1468613424.580854177","source":"worker","message":"worker.garden.extract-resources.extract.extracting","log_level":1,"data":{"resource-type":"bosh-io-release","session":"1.2.3"}}
{"timestamp":"1468613424.773968697","source":"worker","message":"worker.garden.extract-r
goroutine 430187 [syscall, 137 minutes]:
syscall.Syscall6(0x3d, 0x3b47, 0xc8222a7d94, 0x0, 0xc822507a70, 0x0, 0x0, 0x0, 0x4703b0, 0x7f5f2de4a028)
/usr/local/go/src/syscall/asm_linux_amd64.s:44 +0x5
syscall.wait4(0x3b47, 0xc8222a7d94, 0x0, 0xc822507a70, 0x90, 0x0, 0x0)
/usr/local/go/src/syscall/zsyscall_linux_amd64.go:172 +0x7f
syscall.Wait4(0x3b47, 0xc8222a7ddc, 0x0, 0xc822507a70, 0xf467e0, 0x0, 0x0)
/usr/local/go/src/syscall/syscall_linux.go:256 +0x55
os.(*Process).wait(0xc822775580, 0x509a1c, 0x0, 0x0)
/usr/local/go/src/os/exec_unix.go:22 +0x105