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
// ==UserScript== | |
// @name UTN FRRe: SysAcad - Extra Info Exámenes | |
// @namespace http://sysacadweb.frre.utn.edu.ar | |
// @author Sebastián J. Seba | |
// @version 1.2.8 | |
// @description Muestra información ampliada sobre los exámenes tales como promedios generales, aplazos, cantAusentes y más. | |
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html | |
// @include http://sysacadweb.frre.utn.edu.ar/examenes.asp | |
// @include http://sysacadweb.frre.utn.edu.ar/examenes.asp?id=* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js |
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
/* | |
* @Owner Gonzalo H. Mendoza | |
* @Version 1.0.0 | |
*/ | |
import java.util.List; | |
import org.blh.habilitacion.util.HibernateUtil; | |
import org.hibernate.Session; | |
import org.hibernate.SessionFactory; |
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 org.blh.habilitacion.controllers; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import org.blh.habilitacion.entities.Centros; | |
import org.blh.habilitacion.util.HibernateUtil; | |
import org.hibernate.Hibernate; | |
import org.hibernate.Session; | |
import org.hibernate.Transaction; | |
import org.hibernate.criterion.Order; |
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
/* | |
* Copyright (C) 2011 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
SELECT current_date - (timestamp '2015-11-29')::date; | |
CREATE OR REPLACE FUNCTION betweenDays(fecha date) | |
RETURNS integer AS $$ | |
DECLARE | |
output integer; | |
BEGIN | |
IF fecha IS NOT NULL THEN | |
SELECT current_date - fecha INTO output; | |
ELSE |
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
-- Table: public.config | |
-- DROP TABLE public.config; | |
CREATE TABLE public.config | |
( | |
id character varying(255) NOT NULL, | |
dia_emision integer NOT NULL, | |
dia_vencimiento integer NOT NULL, | |
fecha_creacion timestamp with time zone, |
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
-- Function: public.update_config() | |
-- DROP FUNCTION public.update_config(); | |
CREATE OR REPLACE FUNCTION public.update_config() | |
RETURNS trigger AS | |
$BODY$ | |
DECLARE | |
output integer; | |
BEGIN |
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
CREATE OR REPLACE FUNCTION date_arg_format(fecha date) | |
RETURNS CHARACTER VARYING AS $$ | |
DECLARE | |
mes double precision; | |
mes_salida character varying(20); | |
BEGIN | |
IF (fecha IS NOT NULL) THEN | |
mes = date_part('month',fecha); | |
CASE mes | |
WHEN 1 THEN mes_salida = 'Enero'; |
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
CREATE OR REPLACE FUNCTION validateEmail(email character varying) | |
RETURNS BOOLEAN AS $$ | |
BEGIN | |
IF (email !~ '^[A-Za-z0-9._%-]+@[A-Za-z0-9-]+[.][A-Za-z]+$') THEN | |
RETURN FALSE; | |
ELSE | |
RETURN TRUE; | |
END IF; | |
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
public List callProcedure(String query, Map<String,Object> params){ | |
SessionFactory sf = HibernateUtil.getSessionFactory(); | |
Session s = sf.openSession(); | |
Query consulta = s.createSQLQuery(query); | |
Iterator it = params.entrySet().iterator(); | |
while (it.hasNext()) { | |
Map.Entry pair = (Map.Entry)it.next(); | |
consulta.setParameter(pair.getKey(), pair.getValue()); | |
} | |
List result = consulta.list(); |
OlderNewer