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
# Including logging | |
log_file = who_args.pop('log_file', None) | |
if log_file is not None: | |
if log_file.lower() == 'stdout': | |
log_stream = sys.stdout | |
elif log_file.lower() == 'stderr': | |
log_stream = sys.stderr | |
else: | |
log_stream = open(log_file, 'wb') | |
who_args['log_stream'] = log_stream |
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
google.pacman || | |
function () { | |
var a = true, | |
e = false, | |
g = {}, | |
i = [1, 4, 2, 8], | |
l = { | |
0: { | |
axis: 0, | |
increment: 0 |
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
-- SQL Server | |
SELECT [Tables] = so.name, | |
[Rows] = MAX(si.rows) | |
FROM sysobjects so, | |
sysindexes si | |
WHERE so.xtype = 'U' | |
AND si.id = OBJECT_ID(so.name) | |
GROUP BY so.name | |
ORDER BY 2 DESC |
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
// Connection String to Excel Workbook | |
string excelConnectionString = @"Provider=Microsoft | |
.Jet.OLEDB.4.0;Data Source=Book1.xls;Extended | |
Properties=""Excel 8.0;HDR=YES;"""; | |
// Create Connection to Excel Workbook | |
using (OleDbConnection connection = | |
new OleDbConnection(excelConnectionString)) | |
{ | |
OleDbCommand command = new OleDbCommand |
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
REPLACE(SUBSTRING(ci.dir_cliente, | |
CHARINDEX('->', ci.dir_cliente), | |
CHARINDEX('->', ci.dir_cliente)), '-> ' ,'') |
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 | |
# | |
# A nifty GUI controlling the window controls position | |
# | |
# Depends on python-gconf (started from a python-gconf example) | |
# | |
# @version 0.1 | |
# @author alex(at)eftimie(dot)ro | |
# |
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($) { | |
jQuery.fn.dummyEmailBox = function() { | |
var domains = [ | |
'gmail.com', | |
'hotmail.com', | |
'hotmail.es', | |
'live.com', | |
'live.es', | |
'yahoo.com', | |
'yahoo.es', |
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
# -*- coding: utf-8 -*- | |
SI_NO = ((0, u'No'), (1, u'Sí')) | |
DILUCIONES = ( | |
('1', '1'), | |
('1:2', '1:2'), | |
('1:4', '1:4'), | |
('1:8', '1:8'), | |
('1:16', '1:16'), |
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 | |
(SELECT name | |
FROM ubigeo u0 | |
WHERE u0.province_code = ubigeo.province_code | |
AND u0.department_code = ubigeo.department_code LIMIT 1) AS "provincia", | |
(SELECT name | |
FROM ubigeo u0 | |
WHERE u0.department_code = ubigeo.department_code LIMIT 1) AS "departamento", | |
"ubigeo"."id", "ubigeo"."department_code", "ubigeo"."province_code", "ubigeo"."district_code", "ubigeo"."name" FROM "ubigeo" WHERE "ubigeo"."id" = 758 |
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
def edad_gestacional_fur(self): | |
if self.ultima_menstruacion: | |
# 40 semanas | |
days = (date.today() - self.ultima_menstruacion).days | |
return '{0} {1}/7'.format(days / 7, days % 7) | |
return None | |
def edad_gestacional_1eco(self): | |
"""Retorna la edad gestacional segun la primera ecografia.""" | |
if self.primera_ecografia: |
OlderNewer