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
/* $ g++ -Wall -std=c++0x pyt.cpp */ | |
#include <iostream> | |
struct triple { | |
int x, y, z; | |
}; | |
class pyt { | |
public: |
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
$ uname -a | |
Linux computer 2.6.32-431.5.1.el6.i686 #1 SMP Wed Feb 12 09:07:48 CET 2014 i686 i686 i386 GNU/Linux | |
$ python | |
Python 2.6.6 (r266:84292, Jan 23 2014, 10:37:44) | |
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> | |
$ python pyseektest.py |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Alejandro Santos, @alejolp. | |
""" | |
This program deadlocks beacuse producers are also consumers and the Queue | |
has a fixed limit. When the consumer reaches a specific level on the expansion | |
tree, deadlocks. | |
""" |
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
package test2; | |
import java.util.Random; | |
import org.apache.commons.logging.Log; | |
import org.apache.commons.logging.LogFactory; | |
import com.espertech.esper.client.Configuration; | |
import com.espertech.esper.client.EPAdministrator; | |
import com.espertech.esper.client.EPRuntime; |
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
#include <openssl/bio.h> | |
#include <openssl/evp.h> | |
void base64calc(const unsigned char* msg, size_t msgsize, char* out, size_t outsize) { | |
BIO *bio, *b64, *mem; | |
// Shit, this base64 thing with openssl was hard to get right. | |
b64 = BIO_new(BIO_f_base64()); |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Ref: http://listas.python.org.ar/pipermail/pyar/2014-January/027667.html | |
Sea f una función continua en [a, b], tal que f presenta un único | |
máximo en [a, b]. Por ejemplo f puede ser una parábola con los cuernos | |
hacia abajo, y f no puede ser de la forma de los cuernos de Sauron |
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
#include <iostream> | |
#include <cmath> | |
#include <portaudio.h> | |
#define SAMPLE_RATE 22050 | |
int input_channels = 2; /* <<< THIS VALUE TO ZERO WORKS!! */ |
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
/* | |
* Arduino SWR Meter | |
* Por Alejandro Santos LU4EXT ([email protected]) | |
* | |
* Conectar en Analog0 la salida de potencia directa, y en Analog1 la salida de reflejada. | |
* Creado para usarlo junto a un puente de ROE, por ejemplo el de XQ2FOD. | |
* http://ludens.cl/Electron/swr/swr.html | |
*/ | |
#include <LiquidCrystal.h> |
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
#! /bin/sh | |
# | |
# soundmodem Start Soundmodem driver. | |
# | |
# Author: Thomas Sailer, <[email protected]> | |
# | |
### BEGIN INIT INFO | |
# Provides: soundmodem | |
# Required-Start: $remote_fs $syslog $named $network $time |
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
>>> def f(): | |
... for x in xrange(10): | |
... print "Mi thread id: ", thread.get_ident() | |
... sys.stdout.flush() | |
... time.sleep(0.1) | |
... | |
>>> | |
>>> | |
>>> tt = [thread.start_new_thread(f, tuple()) for y in xrange(10)] | |
Mi thread id: >>> 139873167742720 |