This is a SCRIPT-8 cassette.
/** | |
* js-timeout-polyfill | |
* @see https://blogs.oracle.com/nashorn/entry/setinterval_and_settimeout_javascript_functions | |
*/ | |
(function (global) { | |
'use strict'; | |
if (global.setTimeout || | |
global.clearTimeout || | |
global.setInterval || |
// form http://blueimp.github.com/JavaScript-MD5/ | |
var md5 = function (str) { | |
/* | |
* Add integers, wrapping at 2^32. This uses 16-bit operations internally | |
* to work around bugs in some JS interpreters. | |
*/ | |
function safe_add(x, y) { | |
var lsw = (x & 0xFFFF) + (y & 0xFFFF), | |
msw = (x >> 16) + (y >> 16) + (lsw >> 16); |
function formatMoney(n, c, d, t) { | |
c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0; | |
return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); | |
} | |
console.log(formatMoney(600000.00)); | |
console.log(formatMoney(10)); | |
console.log(formatMoney(100)); | |
console.log(formatMoney(0.5)); | |
console.log(formatMoney(1500)); | |
console.log(formatMoney(89)); |
#Unix Toolbox
##Unix Toolbox revision 14.4
Error reports and comments are m
states = { | |
'AC': 'Acre', | |
'AL': 'Alagoas', | |
'AP': 'Amapá', | |
'AM': 'Amazonas', | |
'BA': 'Bahia', | |
'CE': 'Ceará', | |
'DF': 'Distrito Federal', | |
'ES': 'Espírito Santo', |
É difícil falar de Ruby sem mencionar seu framework web mais famoso, Ruby on Rails. Mas não adianta muito encarar o framework sem um prévio estudo da linguagem (o que de fato já observei acontecer inúmeras vezes). Esse post tem como intuito auxiliar na aprendizagem tanto da linguagem como do framework, para evitar que erros comuns como esse tornem a utilização de ambos um desastre.
Ruby é uma linguagem de programação que apareceu para o mundo em 1995, criada por Yukihiro "Matz" Matsumoto. Tem como características o fato de ser uma linguagem de uso geral, com tipagem dinâmica e forte, orientada a objetos e que incorpora diversos paradigmas de programação, como o funcional e o imperativo.
- Ruby in Twenty Minutes - É o que o nome diz: um pequeno tutorial que promete não tomar mais do que 20 minutos do seu tempo. Se encarrega de mostrar como baixar e instalar o Ruby. Faz grande uso da IRB (Int
# Available only in the 2.2 legacy branch and posterior versions | |
func _ready(): | |
# The old way: | |
print("HELLO") # Code before the yield | |
# Setting up the yield: | |
var t = Timer.new() # Create a new Timer node | |
t.set_wait_time(5.5) # Set the wait time | |
add_child(t) # Add it to the node tree as the direct child |