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
| # 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 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
| 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 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 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 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 GenerateUsername(): | |
| username = str(random.randint(0,1000000)) | |
| try: | |
| User.objects.get(username=username) | |
| return GenerateUsername() | |
| except User.DoesNotExist: | |
| return username; |
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 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 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
| 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 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
| 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 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
| 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 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
| DECLARE | |
| i number(3); | |
| j number(3); | |
| function es_primo(p int) return boolean | |
| is | |
| BEGIN | |
| FOR k in reverse 2..(p-1) LOOP | |
| IF mod(p, k) = 0 THEN | |
| RETURN false; | |
| END IF; |
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
| DECLARE | |
| TYPE t_array IS TABLE OF integer INDEX BY varchar2(2000); | |
| v_array t_array; | |
| i integer; | |
| j integer; | |
| function es_primo(p int) return boolean | |
| is | |
| BEGIN | |
| FOR k in reverse 2..(p-1) LOOP | |
| IF mod(p, k) = 0 THEN |
OlderNewer