Skip to content

Instantly share code, notes, and snippets.

View matiasfha's full-sized avatar

Matías Hernández Arellano matiasfha

View GitHub Profile
@matiasfha
matiasfha / index.html
Created June 2, 2011 20:19
nodejs + thrift +socket.io + couchdb
<!DOCTYPE>
<html>
<head>
<title>Test</title>
</head>
<body>
<div id="mensajes">
Hola Mundo
@matiasfha
matiasfha / client.html
Created June 6, 2011 16:04
nodejs + thrift +socket.io for image streaming
<script src="jquery-1.6.1.min.js"></script>
<script src="socket.io/socket.io.js"></script>
<script>
var socket = new io.Socket(null,{port:8080});
socket.connect();
socket.on('message',function(obj){
switch(obj.tipo){
case 'imagen':
img = document.getElementById('stream');
img.src="";
@matiasfha
matiasfha / circularbuffer.h
Created June 9, 2011 16:32
Buffer Circular (boost)
/**
This file is part of VisionStreaming.
VisionStreaming is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
VisionStreaming is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@matiasfha
matiasfha / index.html
Created June 10, 2011 15:14
node.js + socket.io + thrift
<img src="/videoStream" id="video"/>
<script src="socket.io/socket.io.js"></script>
<script>
var socket = new io.Socket(null,{port:8080});
socket.connect();
socket.on('connect',function(){
document.getElementById('mensajes').innerHTML = "conectado";
})
@matiasfha
matiasfha / html5example
Created October 10, 2012 15:38
HTML Example
<body>
<header>
<hgroup>
<h1>Page title</h1>
<h2>Page subtitle</h2>
</hgroup>
</header>
<nav>
<ul>
@matiasfha
matiasfha / cameracapture.c
Created October 11, 2012 14:10
Camera Capture OpenCV
#include "cv.h"
#include "highgui.h"
#include <stdio.h>
// A Simple Camera Capture Framework
int main() {
CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );
if ( !capture ) {
fprintf( stderr, "ERROR: capture is NULL \n" );
getchar();
return -1;
@matiasfha
matiasfha / index.html
Created November 26, 2012 15:26
CSS para ventana modal
<!--HTML para la ventana modal-->
<div class="modal">
<div class="inner-modal">
<div class="head">
</div>
<div class="content">
</div>
<div class="action">
@matiasfha
matiasfha / gist:6690359
Created September 24, 2013 19:56
Ejemplo AWT
import java.awt.*;
import java.awt.event.*;
public class DibujoPrueba extends Frame implements WindowListener,ActionListener,KeyListener {
//ELEMENTOS DE NUESTRO FRAME
private Label L1,L2,L3,L4,L5=null;
private Label V1,V2,V3,V4,V5,V6=null;
private TextField T1,T2,T3,T4,T5,T6,T7,T8=null;
private Button calculo=null;
@matiasfha
matiasfha / gist:6690891
Created September 24, 2013 20:38
Ejemplo AWT 2
import java.awt.Frame;
import java.awt.Button;
import java.awt.TextField;
import java.awt.TextArea;
import java.awt.Panel;
import java.awt.Label;
import java.awt.List;
import java.awt.Checkbox;
import java.awt.CheckboxGroup;
import java.awt.FlowLayout;
@matiasfha
matiasfha / gist:6784047
Created October 1, 2013 19:48
Ejemplo de lectura de archivo en java
StringBuffer texto = new StringBuffer();
try{
FileReader fr = new FileReader("archivo.txt");
entrada = new BufferedReader(fr);
String s;
while(s = entrada.readLine(fr)){
text.append(s);
}
entrada.close();
}catch(java.io.FilenotFoundException e){