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
== 20080725214621 CreateMapas: migrating ====================================== | |
-- create_table(:mapas) | |
-> 0.0183s | |
== 20080725214621 CreateMapas: migrated (0.0187s) ============================= |
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
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<%= GMap.header %> | |
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | |
<title>Mapas: <%= controller.action_name %></title> | |
<%= stylesheet_link_tag 'scaffold' %> | |
<%= javascript_include_tag 'ym4r-gm' %> | |
</head> | |
<body> | |
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
class BuscaSeq | |
def initialize | |
end | |
def busca_sequencial(vetor,elemento) | |
@result = {:pos=>0,:iter=>0, :valor=>elemento} | |
vetor.each do |el| | |
@result[:iter]+=1 | |
el == elemento ? (return @result) : @result[:pos]+=1 | |
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
<div id="content"> | |
<div id="header"> | |
<div id=tobase><h1> TITULO PORRAA!</h1> <br><hr> | |
</div> |
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
def format_number! | |
if self.instance_of? Cpf | |
@numero =~ /(\d{3})\.?(\d{3})\.?(\d{3})-?(\d{2})/ | |
@numero = "#{$1}.#{$2}.#{$3}-#{$4}" | |
else | |
@numero =~ /(\d{2})\.?(\d{3})\.?(\d{3})\/?(\d{4})-?(\d{2})/ | |
@numero = "#{$1}.#{$2}.#{$3}/#{$4}-#{$5}" | |
end | |
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
<dl> | |
<dt><label for="localidade_cidade">Cidade:</label></dt> | |
<dd><%= select "rotas","cidades",@localidades,:size=>"1" %> | |
<%=link_to_remote "Adicionar Cidade",{:url=>{:id=>1,:action=>"add_locate_in_route",:with =>"'thing='+$('#rotas_cidades option:selected').text()"}}.merge(loading_tag)%> | |
</dl> |
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
@res = ActiveRecord::Base.establish_connection(:password=>"xxx", :port=>5432, :username=>"postgres", :adapter=>"postgresql", :encoding=>"utf8", :min_messages=>"warning", :database=>"transat", :host=>"000.000.000.000") | |
con = ActiveRecord::Base.connection | |
attrs = con.columns("tr_veiculo") | |
attrs.each do |attr| | |
puts attr.name | |
end | |
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
id | |
veiculo | |
ano | |
modelo | |
conservacao | |
pasta | |
combustivel | |
placa | |
chassis | |
renavan |
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
>> usuario = Usuario.create(:nome=>"Dextter",:endereco=>"Al 2", | |
:cpf=>12312312323,:nascimento=>"2009-01-01", | |
:descricao=>"Usuario") | |
=> <Usuario id: 4> | |
>> projeto = Projeto.create(:nome=>"Segundo Projeto") | |
=> <Projeto id: 2> | |
>> usuario.projetos << projeto | |
=> [<Projeto id: 2>] |
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
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.expenses_list); | |
dbAdapter = new DbAdapter(this); | |
try { | |
dbAdapter.open(); | |
} catch (SQLiteException e) { | |
e.printStackTrace(); | |
} catch (FileNotFoundException el) { |
OlderNewer