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
| Sempre que vocês forem iniciar uma nova funcionalidade, antes é preciso criar um branch. | |
| Para criar um branch usem o comando a baixo: | |
| hg branch "nomedobranch" | |
| hg commit -m "criado o branch nomedobranch" | |
| Para verificar se o branch foi criado, usem o comando abaixo: | |
| hg branches, esse deve listar todos os branches existentes no seu repoistório. O branch que você abacou de criar deve estar nesta lista | |
| Para verificar se o branch corrente é o branch que acabamos de criar, usem o comando abaixo: | |
| hg branch, provavelmente o resultado será o branch que acabamos de criar, do contrário, use o comando abaixo para alternar entre os branches: |
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
| #params = Parameter.new "registration", "0000000000000000" | |
| #transaction = Transaction.create! params, connection | |
| module Integration | |
| class Transaction | |
| attr_reader :data | |
| def initialize(data) | |
| @data = data | |
| end |
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
| //Pra que isso :@ | |
| if (Convert.ToInt32(((IDbDataParameter)parameters.GetValue(0)).Value) > 0) | |
| bitRetorno = false; | |
| else | |
| bitRetorno = true; | |
| return bitRetorno; |
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 http = require('http'); | |
| var host = "search.twitter.com"; | |
| var twitter = http.createClient(80, host); | |
| var requestUrl = '/search.json?q=nodejs'; | |
| var request = twitter.request('GET', requestUrl, | |
| { "host" : host, "User-Agent" : "Nodejs HTTP Client" }); | |
| request.addListener('response', function(response){ | |
| var body = ''; |
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 http = require('http'); | |
| var host = "search.twitter.com", | |
| requestUrl = '/search.json?q=nodejs', | |
| twitter = http.createClient(80, host), | |
| request = twitter.request('GET', requestUrl, | |
| { "host" : host, "User-Agent" : "Nodejs HTTP Client" }); | |
| request.on('response', function(response){ | |
| var body = ''; | |
| response.setEncoding("utf8"); |
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 sys = require('sys'); | |
| var express = require('express'); | |
| var io = require('socket.io'); | |
| var app = express.createServer(); | |
| app.listen(8080); | |
| var socket = io.listen(app); |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
| <script src="http://cdn.socket.io/stable/socket.io.js"></script> | |
| <script> | |
| $(document).ready(function () { | |
| var socket = new io.Socket("localhost", {port: 8080}); | |
| socket.on('connect', 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
| var express = require('express') | |
| ,io = require('socket.io'); | |
| server = express.createServer(function(req, res){ | |
| res.writeHead(200, { 'Content-Type' : 'text/html' }); | |
| res.end('<h1>Running server nodejs</h1>'); | |
| }); | |
| server.listen(9090, function(){ | |
| adr = server.address(); |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
| <script src="http://localhost:9090/socket.io/socket.io.js"></script> | |
| <script> | |
| var socket = io.connect("http://localhost", {port: 9090}); | |
| socket.on('connect', function () { | |
| socket.send('A client connected.'); |
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 scala.annotation.tailrec | |
| object Fatorial extends App { | |
| var calculadora = new Calculadora() | |
| println(calculadora.calcular(500000)) | |
| } | |
| class Calculadora{ | |
| def calcular(f: BigInt): BigInt = { | |
| @tailrec def calc(f: BigInt, result: BigInt): BigInt = { |