https://github.com/rails-api/active_model_serializers
- Customize fields to be serialized to json
| import org.junit.Assert; | |
| import org.junit.Test; | |
| public class AETests { | |
| @Test | |
| public void queCalcula() { | |
| MuestraDePersonas m = new MuestraDePersonas(2); | |
| m.agregarPersona(new Persona(100, 123)); | |
| m.agregarPersona(new Persona(110, 125)); |
| #!/bin/bash | |
| INPUT=`ls -lt | grep pdf | head -n 1 | awk '{print $9}'` | |
| OUTPUT=VISA-`date +"%Y%m%d"`.pdf | |
| echo $INPUT | |
| echo $OUTPUT | |
| qpdf --password=$1 --decrypt `pwd`/$INPUT $OUTPUT | |
| mv $OUTPUT $HOME/Dropbox | |
| rm $INPUT |
| package edu.unlam.pa; | |
| import java.io.File; | |
| public abstract class EjercicioOIA { | |
| protected File entrada; | |
| protected File salida; | |
| public EjercicioOIA(File entrada, File salida) { |
| ## TBD - Too Busy Disorder | |
| Charla preparada para el encuentro de #CulturaFreelance, a presentar en laOfi el 5 de Octubre de 2015. | |
| Evento especial para la #SemanaDelCoworking | |
| ## Créditos fotográficos | |
| Lloyd Morgan. Despair. | |
| http://www.flickr.com/photos/lloydm/2305701220 |
| require 'date' | |
| feriados = [ | |
| Date.new(2016,1,1), | |
| Date.new(2016,2,8), | |
| Date.new(2016,2,9), | |
| Date.new(2016,3,24), | |
| Date.new(2016,3,25), | |
| Date.new(2016,4,2), | |
| Date.new(2016,5,1), |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(query_start, clock_timestamp()), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
https://github.com/rails-api/active_model_serializers
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
| import java.util.Arrays; | |
| public class Matriz { | |
| private double[][] valores; | |
| public Matriz(int i) { | |
| this.valores = new double[i][i]; | |
| } |
| public class Complejo { | |
| private double real; | |
| private double imag; | |
| // primero los constructores | |
| public Complejo(double real ,double imag) { | |
| this.real = real; | |
| this.imag = imag; | |
| } | |
| public Complejo() { | |
| this(0,0); |