This file contains 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
let rec factorial(n : int) (mem : bigint) = | |
match n with | |
| 0 | 1 -> mem | |
| _ -> factorial (n - 1) (mem * bigint(n)) | |
let BigFactorial(numero,mesaje)= | |
Async.FromContinuations(fun (cont,error,cancelation) -> | |
printfn "ha comenzado el proceso: %s" mesaje | |
factorial numero 1I |>ignore |
This file contains 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
let rec factorial(n : int) (mem : bigint) = | |
match n with | |
| 0 | 1 -> printfn "%A" mem | |
| _ -> factorial (n - 1) (mem * bigint(n)) | |
let BigFactorial(numero,mesaje)= | |
Async.FromContinuations(fun (cont,error,cancelation) -> | |
printfn "begin number: %s" mesaje | |
factorial numero 1I |>ignore |
This file contains 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 aumentar_valor = function(x){ | |
var numero = x; | |
return function(){ | |
return numero+=1; | |
}; | |
}; | |
var add_user = aumentar_valor(0); | |
console.log(add_user()); | |
console.log(add_user()); |
This file contains 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
//al llamar | |
var add_user = aumentar_valor(0); | |
//tenemos | |
var add_user = function(0){ //sustituyendo x por 0 | |
var numero = x; | |
return function(){ | |
return numero+=1; | |
}; |
This file contains 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 aumentar_valor2 = (function(x){ | |
var numero = x; | |
return function(){ | |
return numero+=1; | |
}; | |
})(0); | |
console.log(aumentar_valor2()) //1 |
This file contains 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 myObject = (function ( ) { | |
var value = 0; | |
return { | |
increment: function (inc) { | |
value += typeof inc === 'number' ? inc : 1; | |
}, | |
getValue: function ( ) { | |
return value; | |
} | |
}; |
This file contains 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 phantom = require('phantom'); | |
phantom.create(function(ph) { | |
return ph.createPage(function(page) { | |
return page.open("http://www.google.com", function(status) { | |
console.log("opened google? ", status); | |
return page.evaluate((function() { | |
return document.title; | |
}), function(result) { | |
console.log('Page title is ' + result); | |
return ph.exit(); |
This file contains 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
original file : | |
Welcome = Ember.Application.create({ | |
ready: function(){ | |
// alert('you did it!'); | |
} | |
}); | |
Welcome.Book = Ember.Object.extend({ | |
title: '', |
This file contains 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 gulp = require('gulp'); | |
var zip = require('gulp-zip'); | |
var rename = require("gulp-rename"); | |
var shell = require('gulp-shell') | |
gulp.task('nodewk', function() { | |
gulp.src('app/**') | |
.pipe(zip('app.zip')) | |
.pipe(rename("app.wk")) |
This file contains 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
/* | |
Script: Signal.js | |
Makes chaining functions easy! | |
License & Copyright: | |
Copyright 2009, Mark Obcena <keetology.com> | |
MIT-Style License | |
*/ | |
(function(global){ |
OlderNewer