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
ruta_img = img_propiedad_tuple[1] | |
with open(os.path.join(path,ruta_img),'r+b') as im: | |
imagen = ImageFile(im) | |
print("Imagen: %s" %imagen) | |
print("Imagen: %s" %type(imagen)) | |
print("Image opened: %"%im) | |
new_img_propiedad.imagen = imagen | |
new_img_propiedad.etiqueta = img_propiedad_tuple[2] | |
new_img_propiedad.principal = img_propiedad_tuple[3] | |
new_img_propiedad.propiedad = Propiedad.objects.get(id = IDs['propiedad'][img_propiedad_tuple[4]]) |
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
def curl(url): | |
bs4(url) | |
def curl2(**kwargs): | |
url = kwargs['url'] | |
bs4(url) |
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
%%Create a tablespace | |
CREATE SCHEMA IF NOT EXISTS stations AUTHORIZATION david; | |
\dt stations.* | |
#DEfault: | |
SET search_path = stations; | |
CREATE TABLE IF NOT EXISTS stations.equipment( | |
id bigserial PRIMARY KEY , | |
name varchar(50), | |
model varchar(50), |
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
import argparse | |
parser=argparse.ArgumentParser(description="Obtener parámetros de operación") | |
parser.add_argument('--group', | |
type=int, | |
help="Select the group of stations {0,1,2,3}", | |
choices=[0,1,2,3]) |
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
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
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
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
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
""" | |
Example with Signal-Slot system from QT | |
When generate data, sends and load on the Gui's text widget | |
""" | |
import sys | |
from PyQt5.QtCore import QObject, pyqtSignal, QSharedMemory | |
from PyQt5.QtWidgets import QApplication | |
from PyQt5.QtWidgets import QMainWindow |
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
$('.place.modal') | |
.modal({ | |
allowMultiple: true | |
}) | |
; | |
$('.second.modal') | |
.modal('attach events', '.first.modal #btn_new_localization') | |
; |
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
# Enable upgrading of connection (and websocket proxying) depending on the | |
# presence of the upgrade field in the client request header | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
upstream wscada { | |
# fail_timeout=0 means we always retry an upstream even if it failed | |
# to return a good HTTP response (in case the Unicorn master nukes a |
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
{'children': [{'children': [{'children': ['g'], 'name': 'f'}, {'children': [], 'name': 'h'}], 'name': 'e'}, {'children': [{'children': [{'children': [{'children': [], 'name': 'l'}, {'children': [], 'name': 'm'}], 'name': 'k'}], 'name': 'j'}], 'name': 'i'}, {'children': [{'children': [{'children': [], 'name': 'c'}, {'children': [], 'name': 'd'}], 'name': 'b'}], 'name': 'a'}], 'name': 'PIGRO'} |