This file contains hidden or 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 os | |
import sys | |
# Set the path for spark installation | |
# this is the path where you have built spark using sbt/sbt assembly | |
os.environ['SPARK_HOME'] = "/Users/vvlad/spark/spark-1.0.2" | |
# Append to PYTHONPATH so that pyspark could be found | |
sys.path.append("/Users/vvlad/spark/spark-1.0.2/python") | |
sys.path.append("/Users/vvlad/spark/spark-1.0.2/python/lib/py4j-0.8.1-src.zip") |
This file contains hidden or 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
from cffi import FFI | |
# create ffi wrapper object | |
ffi = FFI() | |
ffi.cdef(''' | |
void* VW_InitializeA(char *); | |
void* VW_ReadExampleA(void*, char*); | |
This file contains hidden or 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
valgrind ./sample_gcc | |
==15743== Memcheck, a memory error detector | |
==15743== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. | |
==15743== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info | |
==15743== Command: ./sample_gcc | |
==15743== | |
this is a native c program calling vw | |
can't open: , error = Success | |
terminate called after throwing an instance of 'std::exception' | |
what(): std::exception |
This file contains hidden or 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
[vagrant@localhost c_test]$ valgrind -v ./sample_gcc | |
==15733== Memcheck, a memory error detector | |
==15733== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. | |
==15733== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info | |
==15733== Command: ./sample_gcc | |
==15733== | |
--15733-- Valgrind options: | |
--15733-- -v | |
--15733-- Contents of /proc/version: | |
--15733-- Linux version 2.6.32-279.el6.x86_64 ([email protected]) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Fri Jun 22 12:19:21 UTC 2012 |
This file contains hidden or 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
{ | |
"metadata": { | |
"name": "User request histogram-s3-1file" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains hidden or 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
tests/scripts/test1.py:3: in <module> | |
import gdbm | |
/usr/lib64/pypy-2.3.1/lib_pypy/gdbm.py:3: in <module> | |
ffi = cffi.FFI() | |
/usr/lib64/pypy-2.3.1/site-packages/cffi/api.py:58: in __init__ | |
assert backend.__version__ == __version__ | |
E assert '0.8.2' == '0.8.6' | |
E + where '0.8.2' = '0.8.2' | |
E + where '0.8.2' = <module '_cffi_backend' (built-in)>.__version__ |
This file contains hidden or 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
exception===IndexError('list index out of range',) magnetic_hadoop/streaming/parse_bid_streaming.py:134 Traceback (most recent call last): | |
File "magnetic_hadoop/streaming/parse_bid_streaming.py", line 164, in <module> | |
print parse_line(line) | |
File "magnetic_hadoop/streaming/parse_bid_streaming.py", line 134, in parse_line | |
d['opt_iponweb_pconv_pv'] = f[61] | |
IndexError: list index out of range | |
^^^event_type===error^^^log_line===1377022200{TAB}1234{TAB}72.80.117.250{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}abcdefabcd1377022200{TAB}cba1f490-e5a5-4bda-b8bf-1bafc9fcd70b{TAB}g{TAB}12345{TAB}{TAB}publisher.com{TAB}728x90{TAB}0{TAB}02-05,02-00{TAB}1500000{TAB}4{TAB}2{TAB}123{TAB}{TAB}{TAB}{TAB}1,2{TAB}3,4{TAB}Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36{TAB}http://articles.publisher.com{TAB}0{TAB}750{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}none{TAB}{TAB}{TAB}{TAB}0.0001{TAB}{TAB}{TAB}{TAB |
This file contains hidden or 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.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.locks.ReentrantLock; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: vvlad | |
* Date: 4/2/13 | |
* Time: 3:21 PM | |
* To change this template use File | Settings | File Templates. |
This file contains hidden or 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.concurrent.Semaphore; | |
public class PingPong { | |
private Semaphore ping_semaphore = new Semaphore(1, true), pong_semaphore = new Semaphore(1, true); | |
private int maxcount = 100; | |
class Ping implements Runnable { | |
@Override |
This file contains hidden or 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
""" | |
python 2.7.1 (cpython) | |
""" | |
from threading import BoundedSemaphore, Thread | |
class Png(Thread): | |
def __init__(self,string,lock1,lock2,times): | |
super(Png, self).__init__() |