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
class Event < ActiveRecord::Base | |
attr_accessible :_timed, :details, :end_date, :start_date, :text | |
# From http://www.dhtmlx.com/docs/products/dhtmlxScheduler/xml/events.xml | |
def to_xml (options = {}) | |
options[:indent] ||= 2 | |
xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent]) | |
xml.instruct! unless options[:skip_instruct] | |
xml.event(:id => id, :timed => _timed) do | |
xml.text text |
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
void agregar_nueva_linea () { | |
segmento *ultimo_segmento; | |
char linea[ANCHO_LINEA]; | |
int continuar = 1; | |
while (continuar) { | |
fgets(linea,ANCHO_LINEA,stdin) | |
/* Si hay una nueva línea, es que acabamos de procesar el texto */ | |
if (linea[strlen(linea) - 1] == '\n') { |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/*#define TECLA_ARRIBA 72*/ | |
/*#define TECLA_ABAJO 80*/ | |
/* El programa fue probado a través de SSH, no funcionan las flechas */ | |
#define TECLA_ARRIBA 'r' | |
#define TECLA_ABAJO 'b' |
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 <stdlib.h> | |
using namespace std; | |
// copiar un array en otro | |
// si *copia es NULL, se aloja memoria para guardarlo | |
double *copiar (double *array, double *copia, unsigned long longitud) { | |
if (!copia) { | |
copia = (double *)calloc(longitud,sizeof(double)); |
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 <stdlib.h> | |
using namespace std; | |
// copiar un array en otro | |
// si *copia es NULL, se aloja memoria para guardarlo | |
double *copiar (double *array, double *copia, unsigned long longitud) { | |
if (!copia) { | |
copia = (double *)calloc(longitud,sizeof(double)); |
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
<?php | |
set_time_limit(0); | |
ini_set('memory_limit','128M'); | |
function burbuja ($v,&$metodo) { | |
$tmp = $v[0]; | |
$N = count($v); | |
$metodo['burbuja']['tiempo'] = microtime(true); |
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> | |
using namespace std; | |
void intercambiar_int (int *a, int *b) { | |
int tmp; | |
tmp = *a; | |
*a = *b; | |
*b = tmp; |
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
// ==UserScript== | |
// @name FCA en linea | |
// @namespace fca_en_linea | |
// @include http://fcaenlinea1.unam.mx/informatica/escritorio/ | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
/** |
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
<?php | |
class Google_OAuth { | |
var $client_id; | |
var $client_secret; | |
var $redirect_uri; | |
var $scopes = array( | |
'userinfo' => array( |
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
<?php | |
$client_id = GOOGLE_CLIENT_ID; | |
$client_secret = GOOGLE_CLIENT_SECRET; | |
$redirect_uri = GOOGLE_CALLBACK; | |
$google_oauth = new Google_OAuth($client_id,$client_secret,$redirect_uri,'userinfo'); | |
$status = ''; | |
$credentials = FALSE; | |
$errors = array(); |