I hereby claim:
- I am marcastr0 on github.
- I am marcastr0 (https://keybase.io/marcastr0) on keybase.
- I have a public key ASCV0TzqAn9-ZDAaO4WWc2OSpakvaITR3EgvldAtkFk9UAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#include "temperature.h" | |
#include <math.h> | |
float to_fahrenheit(float celsius) { | |
float fahrenheit; | |
fahrenheit = roundf( ( (celsius * (9.00f/5.00f)) + 32.00f ) * 100.00f ) / 100.00f; | |
return fahrenheit; | |
} |
%% Kevin Bacon movies | |
cast(['Kevin Bacon', 'Lori Singer', 'John Lithgow', 'Dianne Wiest']). %% Footloose (1984) | |
cast(['Tom Cruise', 'Jack Nicholson', 'Demi Moore', 'Kevin Bacon']). %% A Few Good Men (1992) | |
cast(['Tom Hanks', 'Bill Paxton', 'Kevin Bacon', 'Gary Sinise']). %% Apollo 13 (1995) | |
%% Tom Cruise movies | |
cast(['Tom Cruise', 'Kelly McGillis', 'Val Kilmer', 'Anthony Edwards']). %% Top Gun (1985) | |
cast(['Tom Cruise', 'Cuba Gooding Jr.', 'Renée Zellweger', 'Kelly Preston']). %% Jerry Maguire (1996) | |
cast(['Tom Cruise', 'Rebecca De Mornay', 'Joe Pantoliano', 'Richard Masur']). %% Risky Business (1983) |
function checkRut(rut) { | |
var cleanRut = rut.replace(/[\.|-]/g, ''); | |
var dv = cleanRut.substr(-1); | |
var rest = cleanRut.substr(0, cleanRut.length-1); | |
var digits = rest.split('').reverse().map(function(d, i) { return [(i%6)+2, parseInt(d)]; }); | |
var sum = digits.map(function(x) { return x[0]*x[1]; }).reduce(function(x, y) { return x+y; }); | |
var result = 11 - (sum % 11); | |
switch(result) { | |
case 11: | |
return (0 === dv); |