Skip to content

Instantly share code, notes, and snippets.

/*
* File: dataStructs.h
* Author: tian
*
* Created on 22 September 2010, 12:38
*/
#ifndef _DATASTRUCTS_H
#define _DATASTRUCTS_H
CREATE TABLE Usuario(
ID INTEGER NOT NULL,
Nombre VARCHAR(45) NOT NULL,
Tipo INTEGER,
Puntuacion INTEGER,
Fecha_Registro DATE,
CONSTRAINT ID_Usuario_PK PRIMARY KEY (ID)
);
CREATE TABLE Categoria(
#!/bin/bash
S1='astring'
S2='a string'
if [ "$S1"="$S2" ];
then
echo "S1('$S1') is not equal to S2('$S2')"
fi
if [ "$S1"="$S1" ];
then
echo "S1('$S1') is equal to S1('$S1')"
@tian2992
tian2992 / apache-results
Created March 16, 2011 01:55
lighttpd-vs-apache
tian2992@li55-22:~/Sites$ ab -n 2000 http://labs.sebastianoliva.com/info.php
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking labs.sebastianoliva.com (be patient)
Completed 200 requests
Completed 400 requests
Completed 600 requests
Completed 800 requests
<form method="post" id="main_search" action="/search">
<fieldset class="search">
<input name="query" type="text" class="box" />
<button class="search_button" title="Search Profiles">Search</button>
</fieldset>
</form>
@tian2992
tian2992 / test1.py
Created October 28, 2011 16:35
Drawing With Shoebot as a Module
import shoebot
from shoebot.core import CairoCanvas, CairoImageSink, NodeBot
outputfile = 'output.svg'
iterations = 1
sink = CairoImageSink(outputfile, "svg", multifile = false)
canvas = CairoCanvas(sink, enable_cairo_queue=True)
bot = shoebot.core.NodeBot(canvas)
bot.size(150,150)
bot.fill(1,0,0)
bot.rect(10,10,100,100)
@tian2992
tian2992 / remotedisplay.py
Created January 2, 2013 00:06
An Android monkeyrunner based remote control. Thanks to Jython and Swing. Should be executed from the monkeyrunner REPL
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage
device = MonkeyRunner.waitForConnection()
from javax.swing import JButton, JFrame, JPanel, ImageIcon
frame = JFrame('Android Display!',
defaultCloseOperation = JFrame.EXIT_ON_CLOSE,
size = (960, 540)
)
tian@kaji-ryoji:~> openssl speed
Doing mdc2 for 3s on 16 size blocks: 3057182 mdc2's in 2.99s
Doing mdc2 for 3s on 64 size blocks: 816407 mdc2's in 2.99s
Doing mdc2 for 3s on 256 size blocks: 208712 mdc2's in 2.99s
Doing mdc2 for 3s on 1024 size blocks: 52461 mdc2's in 2.99s
Doing mdc2 for 3s on 8192 size blocks: 6542 mdc2's in 2.99s
Doing md4 for 3s on 16 size blocks: 16661195 md4's in 2.99s
Doing md4 for 3s on 64 size blocks: 12731101 md4's in 2.99s
Doing md4 for 3s on 256 size blocks: 7565149 md4's in 3.00s
Doing md4 for 3s on 1024 size blocks: 2874154 md4's in 2.99s
@tian2992
tian2992 / secante.c
Last active December 16, 2015 16:29
Sacar raices de manera aproximada con el metodo de la secante iterativo.
#include <stdio.h>
#include <math.h>
/* Funcion a evaluar
Debe venir con valor double de x.
*/
double funcion (double x) {
return (x * x * x) + (x * x) + 10 * x - 20;
}
@tian2992
tian2992 / requirements.txt
Last active December 22, 2015 12:29
A veces los dias son nublados.
requests
#Optional for process_cloudy
#numpy