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
==== limpar resque | |
Resque::Failure.count | |
a = Resque::Failure.all(0,50); nil | |
lista = [] | |
a.each_with_index do |x,i| | |
if x['payload']['args'].first['queue_name'] == 'salary_stub_load_job' | |
lista << i | |
end |
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 profilesIntoConversation = this.get('currentProfile.conversations').reduce((profilesByConversation, currentConversation) => { | |
profilesByConversation.push({ | |
conversation: currentConversation, | |
profiles: currentConversation.get('participants').filter((participant) => { | |
return (this.removeAccents(participant.get('name').toLowerCase()).indexOf(filter) !== -1 | |
|| participant.get('phone').indexOf(filter) !== -1) | |
&& participant.get('remotoAddress') !== this.get('currentProfile.remotoAddress'); | |
}) | |
}); | |
return profilesByConversation; |
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 robots = new Array(); | |
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.start = function( ev ){ |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
this.state = 'procurando'; | |
this.voltadas = 0 | |
}; | |
Robot.prototype.onIdle = function(ev) { |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); |
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
(ns args_kata.core) | |
(def default-values { | |
Boolean false | |
String "" | |
Integer 0 | |
}) | |
(defn convert-value [type value] | |
(condp = type |
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
int qtdFrames = qtdBolas/2 + qtdBolas%2; | |
for(frame = 0; frame < qtdFrames; frame++){ | |
int indiceBola1 = frame*2; | |
//terceira bola do ultimo frame | |
if (frame == 10) { | |
return resultado; | |
} |
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
for(i = 0; i < tamanho; i++){ | |
frame ++; | |
//terceira bola do ultimo frame | |
if (frame == 11) { | |
return resultado; | |
} | |
//verifica se o frame esta completo | |
if((i+1 < tamanho)) { |
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
void TesteNaoConsideraLixoFimArray(CuTest *tc) { | |
int arrayJogadas[6] = {9,1,1,0,10,10}; | |
//quantidade jogadas(qtdJogadas) menor que arrayJogadas. Nao deve somar os 10`s | |
int qtdJogadas = 4; | |
CuAssertIntEquals(tc,12,calcularResultadoInteiros(arrayJogadas,qtdJogadas)); | |
} |
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
int calcularResultado(char *linha) { | |
int arrayJogadas[21]; | |
int tamanho = getJogadas(linha,arrayJogadas); | |
return calcularResultadoInteiros(arrayJogadas, tamanho); | |
} |
NewerOlder