Skip to content

Instantly share code, notes, and snippets.

// If each iteration has 30ms, then
// 100 000 iterationts * 30ms = 3 000 000ms
// 3 000 000ms/1000ms = 3000s
// 3000s / 60s = 50minutes
function totalTimeInMinutes(iterationsCount, iterationDurationInMs)
{
return ((iterationsCount*iterationDurationInMs)/1000)/60;
}
function tasaNominalToEfectiva(tasa_nominal_anual, freq_anual)
{
return Math.pow(1+(tasa_nominal_anual/freq_anual), freq_anual) - 1;
}
function cambioPeriocidadTasaEfectiva(tasa_efectiva_por_periodo, nueva_periodicidad)
{
// Si tenemos una tasa efectiva mensual del 2% y queremos convertirla a anual, debemos hacer nueva_periodicidad == 12 (meses)
/*
Valores comunes para el parametro nueva_periodicidad, suponiendo que la tasa efectiva por periodo esta en meses:
@jorovipe97
jorovipe97 / Python SimpleHTTPServer with SSL
Last active September 30, 2017 23:06 — forked from rozifus/Python SimpleHTTPServer with SSL
Python 3.x https server with SSL
# useful for running ssl server on localhost
# which in turn is useful for working with WebSocket Secure (wss)
# copied from http://www.piware.de/2011/01/creating-an-https-server-in-python/
var a1=2;
var a2=4;
function sum(a, b) {
var res=0;
var sum = 0;
var i = 0;
while (i < b) {
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class HelloWorld{
static int bonApetit(int n, int k, int b, int[] arr) {
int totalCost = 0;
int bactual = 0;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication1;
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
static String timeConversion(String s) {
// Complete this function
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
static String timeConversion(String s) {
// Complete this function
function sFact(num)
{
var rval=1;
for (var i = 2; i <= num; i++)
rval = rval * i;
return rval;
}
function poisson(k, lambda) {
return (Math.exp(-1*lambda) * Math.pow(lambda, k))/sFact(k);
CHIP Or {
IN a, b;
OUT out;
PARTS:
// Put your code here:
Nand(a=a, b=a, out=nanda);
Nand(a=b, b=b, out=nandb);
Nand(a=nanda, b=nandb, out=out);
}