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
package com.aep.billing.dao.dialect; | |
import static org.junit.Assert.assertEquals; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.junit.Test; | |
/** |
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
import scala.util.matching.Regex.Match | |
val a = """Esto es un ejemplo de como ejemplo por que siempre ejemplo""" | |
val regex = "eje\\w*+" r | |
class Reemplazar[E](lista:List[E]) { | |
var i:Int = -1 | |
def apply(replacer: Match) = { |
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
import scala.slick.jdbc.JdbcBackend.Database | |
import Database.dynamicSession | |
import scala.slick.jdbc.StaticQuery.interpolation | |
object Main extends App { | |
Database.forURL("jdbc:postgresql://localhost:5432/miuler", user = "miuler", password = "1234", driver="org.postgresql.Driver") withDynSession { | |
val result = sql"SELECT name, age FROM user LIMIT 10".as[(String, Int)] | |
println(result.list) | |
} |
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
const Gtk = imports.gi.Gtk; | |
const GLib = imports.gi.GLib; | |
// Initialize the gtk | |
Gtk.init(null, 0); | |
let mwindow = new Gtk.Window ({type : Gtk.WindowType.TOPLEVEL}); | |
let label = new Gtk.Label ({label : "Hello World"}); | |
// Set the window 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
/* Este es un ejemplo de fijar un bloque en la esquina superior izquierda, usando css | |
sacado de la libreria blackbird | |
Vamos a sacar una de las partes más interesantes, para colocar un bloque siempre a | |
la esquina superior izquierda: | |
*/ | |
#blackbird { | |
z-index:10; margin:0; padding:0; position:fixed; _position:absolute; | |
font:11px/1.3 Consolas, 'Lucida Console', Monaco, monospace; _border:2px solid #BBB; |
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
// Ext.ux.GMapPanel - Google Maps | |
// Extensión para ExtJs para crear mapas de google | |
function open_map(el, evn){ | |
_latitude = 10; | |
_longitude = -70; | |
winMap = new Ext.Window({ | |
layout: 'fit', | |
title: 'Unidad en google maps', | |
//closeAction: 'hide', |
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
#!/usr/bin/env python | |
import pygtk | |
import datetime | |
import locale | |
pygtk.require('2.0') | |
t = 'Fri May 09 02:38:22 +0000 2008' | |
print datetime.datetime.strptime(t, "%a %b %d %H:%M:%S +0000 %Y") | |
print datetime.datetime.strftime(datetime.datetime.now(), '%a %b %d %H:%M:%S +0000 %Y') | |
print locale.getlocale() |
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
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
# vim: ai ts=4 sts=4 et sw=4 | |
# Autor: Hector Miuler Malpica Gallegos | |
# Email: miuler@gmail.com | |
# Rev: $Rev | |
# ------------------------------------------------------------------- | |
import gtk | |
import datetime |
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
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
# vim: ai ts=4 sts=4 et sw=4 | |
# Autor: Hector Miuler Malpica Gallegos | |
# Email: miuler@gmail.com | |
# Rev: $Rev | |
# ------------------------------------------------------------------- | |
""" | |
Este es un ejemplo de como agegar una método que genere |
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
-- DAR PERMISOS A TODAS LAS TABLA DES UN SCHEMA | |
-- ============================================ | |
-- Funcion para asigar todos lo privilegios a un usuario | |
-- para todas las tablas, vistas, | |
-- que pertenecen aun esquema en particular. | |
-- | |
-- Esta función te lo resuelve: | |
CREATE OR REPLACE FUNCTION grant_all_privileges(p_user text, p_schema text) | |
RETURNS void AS |
OlderNewer