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 kotlin.math.ceil | |
fun friendly(a: Int, b: Int) : Boolean { | |
val evenA: MutableList<Int> = mutableListOf() | |
val evenB: MutableList<Int> = mutableListOf() | |
for (n in 1..a) { | |
if (a % n == 0 && n != a) { | |
evenA.add(n) | |
} |
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
fun fezzBuzz() { | |
for (i in 1..100) { | |
if (i % 3 == 0 && i % 5 == 0) { | |
println("FizBuzz") | |
} else if (i % 3 == 0) { | |
println("Fizz") | |
} else if (i % 5 == 0) { | |
println("Buzz") | |
} else { | |
println(i) |
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
// swift 3 | |
let email = "[email protected]" | |
if let url = URL(string: "mailto:\(email)") { | |
UIApplication.shared.openURL(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
public function paymentRegistered($valor, $reglasProgramacionPago) | |
{ | |
$em = $this->container->get('doctrine')->getManager(); | |
if (!empty($reglasProgramacionPago)) { | |
$movimientoPago = $em->getRepository('TimPagosBundle:MovimientoPago')->findOneByReglasProgramacionPago($reglasProgramacionPago); | |
$facturasDetalle = $em->getRepository('TimPagosBundle:FacturaDetalle')->findByReglasProgramacionPagoAndDate($reglasProgramacionPago); | |
// Validamos que encontramos las facturas detalle y movimiento pago de la obligación. | |
if (!empty($movimientoPago) && !empty($facturasDetalle)) { | |
$now = new \DateTime(); | |
// Registramos el movimiento. |
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
public function updateMovement($reglasProgramacionPago) | |
{ | |
$em = $this->container->get('doctrine')->getManager(); | |
$calificacionObligacion = $em->getRepository('TimPagosBundle:TipoCalificacionObligacion')->findAll(); | |
if (is_array($reglasProgramacionPago)) { | |
foreach ($reglasProgramacionPago as $reglas) { | |
$movimientoPago = $em->getRepository('TimPagosBundle:MovimientoPago')->findOneByReglasProgramacionPago($reglas); | |
if (!empty($movimientoPago)) { | |
// Actualizamos movimiento pago. | |
$tasaDiaria = 0; |