This file contains 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
indices = res.result | |
ruta = [] | |
indices.each do |fila| | |
id = fila[0] | |
res = @@pgconn.exec "SELECT ST_AsText(the_geom) as texto FROM vertices_tmp WHERE id = #{id};" | |
coord = [ res.result[0][0].gsub("POINT(","").gsub(")","").split(" ")[1].to_f, | |
res.result[0][0].gsub("POINT(","").gsub(")","").split(" ")[0].to_f ] | |
ruta << coord | |
end |
This file contains 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
$.getJSON("/test_route?start_lat="+startLat+"&start_lon="+startLon+"&end_lat="+endLat+"&end_lon="+endLon, function(data) { | |
alert(data); | |
$.each(data, function(i, coord){ | |
var latlng = new google.maps.LatLng(coord[0], coord[1]); | |
route.push(latlng); | |
}); |
This file contains 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
int criba(int b){ | |
bool *m = new bool[10000]; | |
m[0] = false; | |
m[1] = false; | |
int count = 0; | |
int j = 0; | |
for(int i=2; i<=10000; i++) | |
{ |
This file contains 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 User | |
include MongoMapper::Document | |
extend Clearance::User::ClassMethods | |
include Clearance::User::InstanceMethods | |
include Clearance::User::Callbacks | |
include Clearance::User::AttrAccessor | |
key :confirmation_token, String | |
key :email, String, :unique => true |
This file contains 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
module AuthlogicModel | |
def self.included(model) | |
model.class_eval do | |
extend ClassMethods | |
include InstanceMethods | |
include ProtectedAttributes | |
field :username | |
field :email | |
field :crypted_password |
This file contains 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 | |
/* se recupera el carrito de la variable de sesión */ | |
$carrito = $_SESSION['carrito']; | |
/* acá se harian las operaciones de agregar/quitar del carrito */ | |
/* se guardan las modificaciones en la variable de sesión */ | |
$_SESSION['carrito'] = $carrito; | |
?> |
This file contains 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta name="Author" content="Dream Deals Inc" /> | |
<meta name="Descripction" content="A Website store" /> | |
<meta name="Keywords" content="shop, store" /> | |
<meta name="Robots" content="index,follow" /> | |
<link href="estilo.css" rel="stylesheet" type="text/css" media="screen" /> | |
<title>Dream Deals</title> |
This file contains 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 // Manual de PHP de WebEstilo.com | |
if(isset($_POST['agregar'])){ | |
session_start(); | |
session_register('itemsEnCesta'); | |
$item=$_GET['id']; | |
$cantidad=$_POST['cant']; | |
$itemsEnCesta=$_SESSION['itemsEnCesta']; | |
if ($item){ | |
if (!isset($itemsEnCesta)){ |
This file contains 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
for (var i=0; i < 100000; i++) { | |
db.mass_insert.save({ | |
"first_name": "James", | |
"middle_name": "Richard", | |
"last_name": "Windsgate", | |
"email": "jamesrichardwindsgate@email.com" | |
}); | |
}; |
This file contains 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
port java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
import java.util.*; | |
public class Agente_Viajero extends JFrame implements Runnable | |
{ | |
Container c; | |
Mapa mapa; | |
JList Caminos; |