Skip to content

Instantly share code, notes, and snippets.

View DaniloOliveira28's full-sized avatar
😁

Danilo Oliveira DaniloOliveira28

😁
View GitHub Profile
def n_lower_chars(string):
return sum(1 for c in string if c.islower())
def n_lower_chars_position(string):
return list((x, string[x] + "->" + string[x].upper())
for x in range(0, len(string)) if string[x].islower())
def format_word(word):
def n_lower_chars(string):
return sum(1 for c in string if c.islower())
def format_word(word):
if word == word.upper() or word == word.lower():
return 0
M = dict()
M[0] = 0
def is_palindrome(palavra):
return palavra[::-1] == palavra
def palindrome(texto):
if len(texto) <= 1:
return 0, ["None"]
res_pal = is_palindrome(texto)
if res_pal is True:
return 0, ["None"]
def is_palindrome(palavra):
return palavra[::-1] == palavra
def palindrome(texto):
if len(texto) <= 1:
return 0
res_pal = is_palindrome(texto)
if res_pal is True:
return 0
0 1 5
0 4 2
0 5 1
0 6 1
0 7 1
0 9 1
0 10 1
0 13 2
0 14 1
0 16 3
@DaniloOliveira28
DaniloOliveira28 / Cabeçalhos-Prestação de Contas
Created November 15, 2015 21:44
Diferença de cabeçalhos relativos aos dados do TSE de prestação de contas. (http://www.tse.jus.br/eleicoes/estatisticas/repositorio-de-dados-eleitorais)
2002
SEQUENCIAL_CANDIDATO;SG_UF;SG_PART;DS_CARGO;NO_CAND;NR_CAND;DT_RECEITA;CD_CPF_CGC;SG_UF_DOADOR;NO_DOADOR;VR_RECEITA;TP_RECURSO
2004
NO_CAND;DS_CARGO;CD_CARGO;NR_CAND;SG_UE_SUP;NO_UE;SG_UE;NR_PART;SG_PART;VR_RECEITA;DT_RECEITA;DS_TITULO;CD_TITULO;TP_RECURSO;TP_RECURSO;NO_DOADOR;CD_CPF_CGC_DOA;RV_MEANING
2006
SEQUENCIAL_CANDIDATO;NOME_CANDIDATO;DESCRICAO_CARGO;CODIGO_CARGO;NUMERO_CANDIDATO;UNIDADE_ELEITORAL_CANDIDATO;NUMERO_CNPJ_CANDIDATO;NUMERO_PARTIDO;SIGLA_PARTIDO;VALOR_RECEITA;DATA_RECEITA;TIPO_RECEITA;CODIGO_TIPO_RECEITA;DESCRICAO_TIPO_RECURSO;CODIGO_TIPO_RECURSO;NOME_DOADOR;NUMERO_CPF_CGC_DOADOR;UNIDADE_ELEITORAL_DOADOR;SITUACAO_CADASTRAL
2008
angular.module('starter.services', [])
.factory('Chats', function() {
// Might use a resource here that returns a JSON array
// Some fake testing data
var chats = [{
id: 0,
name: 'Ben Sparrow',
lastText: 'You on your way?',
angular.module('starter.controllers', [])
.controller('DashCtrl', function($scope) {})
.controller('ChatsCtrl', function($scope, Chats) {
$scope.chats = Chats.all();
$scope.remove = function(chat) {
Chats.remove(chat);
}
})
// Ionic Starter App
// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// 'starter.services' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])
.run(function($ionicPlatform, PushNotification) {
E/chromium(26821): [ERROR:unix_domain_client_socket_posix.cc(101)] Not implemented reached in virtual int net::UnixDomainClientSocket::GetPeerAddress(net::IPEndPoint*) const
E/chromium(26821): [ERROR:unix_domain_client_socket_posix.cc(101)] Not implemented reached in virtual int net::UnixDomainClientSocket::GetPeerAddress(net::IPEndPoint*) const
I/ThermalEngine( 353): Sensor:chg_therm:32000 mC
E/chromium(26821): [ERROR:unix_domain_client_socket_posix.cc(101)] Not implemented reached in virtual int net::UnixDomainClientSocket::GetPeerAddress(net::IPEndPoint*) const
E/chromium(26821): [ERROR:unix_domain_client_socket_posix.cc(101)] Not implemented reached in virtual int net::UnixDomainClientSocket::GetPeerAddress(net::IPEndPoint*) const
I/SBar.MotoNetworkCtrlr( 1377): onReceive: WifiManager.RSSI_CHANGED_ACTION Received
I/SBar.MotoNetworkCtrlr( 1377): refreshSignalCluster[0]: wifi: mWifiConnected=true Wifi=0x7f020130=stat_sys_wifi_signal_3_fully Activity=0x00000000=( none ) Accessibility="Wi-Fi three bars."
E/c