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
# Ajax usando JQuery | |
$.ajax({ | |
url: "http://miURL.com/mi_vista_django/", | |
type: 'GET', // POST, DELETE, PUT | |
success: function(data) { | |
console.log(data); // Print data | |
}, | |
error: function() { | |
// Do something | |
} |
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
set serveroutput on | |
DECLARE | |
v_weight NUMBER(3) := 600; | |
v_message VARCHAR2(255) := 'Product 10012'; | |
v_new_locn VARCHAR2(255) := 'America'; | |
BEGIN | |
DECLARE | |
v_weight NUMBER(3) := 1; | |
v_message VARCHAR2(255) := 'Product 11001'; |
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 save(self, *args, **kwargs): | |
if self.celery_retry and self.user.is_superuser(): | |
celery_task.apply_async() | |
self.celery_retry = False | |
super(MyModel, self).save(*args, **kwargs) |
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 GenerateUsername(): | |
username = str(random.randint(0,1000000)) | |
try: | |
User.objects.get(username=username) | |
return GenerateUsername() | |
except User.DoesNotExist: | |
return username; |
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 greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) | |
public class Tablero extends World | |
{ | |
private static int TAM = 3; | |
private int tablero_gato[][] = new int[TAM][TAM]; | |
private int player_ganador = -1; | |
public Tablero() { | |
super(3, 3, 60); |
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
DECLARE | |
TYPE t_number_list IS varray(100) of INTEGER; | |
v_number_list t_number_list; | |
v_prev_number_list t_number_list; | |
v_one INTEGER := 1; | |
v_exponent INTEGER := 10; | |
v_print varchar(100); | |
BEGIN | |
v_prev_number_list := t_number_list(1, 2, 1); | |
DBMS_OUTPUT.PUT_LINE(1); |
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
DECLARE | |
TYPE t_number_list IS varray(12) of INTEGER; | |
v_rut t_number_list := t_number_list(1, 7, 1, 2, 3, 5, 9, 9); | |
v_dig_ver INTEGER; | |
FUNCTION fn_digito_verificador(p_rut IN t_number_list) | |
RETURN INTEGER | |
IS | |
p_dig_ver INTEGER; | |
TYPE t_number_list IS varray(12) of INTEGER; | |
v_serie t_number_list := t_number_list(3, 2, 7, 6, 5, 4, 3, 2); |
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
DECLARE | |
v_concat varchar2(1000) := ''; | |
BEGIN | |
FOR i in 1.. 8 LOOP | |
v_concat := ''; | |
FOR j in i.. 8 LOOP | |
v_concat := v_concat || ' ' || to_char(i * j); | |
END LOOP; | |
dbms_output.put_line(v_concat); | |
END LOOP; |
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 PACKAGE employee_crud AS | |
PROCEDURE crea_empleado(p_last_name IN employees.last_name%TYPE, p_email IN employees.email%TYPE, p_hire_date IN employees.hire_date%TYPE, p_job_id IN employees.job_id%TYPE, p_salary IN employees.salary%type); | |
PROCEDURE borra_empleado(p_employee_id IN employees.employee_id%TYPE); | |
PROCEDURE actualiza_empleado(p_employee_id IN employees.employee_id%TYPE, p_salary IN employees.salary%TYPE, p_email IN employees.email%TYPE, p_department_id IN employees.department_id%TYPE); | |
PROCEDURE consulta_empleado(p_employee_id IN employees.employee_id%TYPE, p_last_name OUT employees.last_name%TYPE, p_first_name OUT employees.first_name%TYPE, p_email OUT employees.email%TYPE, p_hire_date OUT employees.hire_date%TYPE, p_job_id OUT employees.job_id%TYPE, p_salary OUT employees.salary%TYPE); | |
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 PACKAGE over_pack | |
IS | |
PROCEDURE add_dept(p_depto IN departments.department_id%TYPE, p_name IN departments.department_name%TYPE DEFAULT 'unknown', p_loc IN departments.location_id%TYPE DEFAULT 0); | |
PROCEDURE add_dept(p_name IN departments.department_name%TYPE DEFAULT 'unknown', p_loc IN departments.location_id%TYPE DEFAULT 0); | |
END over_pack; | |
/ | |
CREATE OR REPLACE PACKAGE BODY over_pack | |
IS | |
PROCEDURE add_dept(p_depto IN departments.department_id%TYPE, p_name IN departments.department_name%TYPE DEFAULT 'unknown', p_loc IN departments.location_id%TYPE DEFAULT 0) |
OlderNewer