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
// 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; | |
} |
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
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: |
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
# 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/ |
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
var a1=2; | |
var a2=4; | |
function sum(a, b) { | |
var res=0; | |
var sum = 0; | |
var i = 0; | |
while (i < b) { |
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 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; |
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
/* | |
* 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.*; |
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 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 |
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 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 |
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
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); |
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
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); | |
} |