Skip to content

Instantly share code, notes, and snippets.

const robar = arreglo => {
const casasPorRobarOriginal = [...arreglo];
const arrDesc = [...arreglo];
//Ordenamos las casas a robar por cantidad de dinero de forma descendente
//Y lo guardamos en arrDesc, mantenemos el arrary original para poder comparar indices luego
for(let i = 0; i < arrDesc.length; i++){
for(j = i + 1; j < arrDesc.length; j++){
if(arrDesc[i] < arrDesc[j]){
const grande = arrDesc[j];
arrDesc[j] = arrDesc[i];
definición del form y del formset:
'''
archivo forms.py
'''
class AutorForm(forms.ModelForm):
def clean_nombre(self):
return escape(self.cleaned_data.get('nombre'))
public HttpResponseMessage GetClientes(string browserId)
{
log.Debug("Entró el browserId "+browserId);
Cliente cliente = null;
ServerResponse serverResponse = new ServerResponse();
try
@zulu15
zulu15 / gist:cf1004fb816b43a00e48864060531ee7
Created August 1, 2019 23:50
ListView implementation with FirebaseUI
package com.zulu.fireapp;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;
import com.firebase.ui.database.FirebaseListAdapter;
/*var link = document.createElement('a');
link.href = 'http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe';
link.download = '';
document.body.appendChild(link);
link.click();
*/
document.onreadystatechange = () => {
if (document.readyState === 'complete') {
var html = document.getElementsByTagName("HTML")[0];