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
def fibo(n) | |
if(n==0) | |
return 0 | |
elsif (n==1) | |
return 1 | |
else | |
return fibo(n-1) + fibo(n-2) | |
end | |
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
import java.util.Scanner; | |
public class QuadradoMagico { | |
public static void main(String[] args){ | |
Scanner e = new Scanner (System.in); | |
int i, j; | |
int matriz[][]= new int [3][3]; | |
/* | |
for (i =0;i<3;i++){ |
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
public class ProcuraOcorrencia { | |
public static void main(String[] args){ | |
String s1 = "carrocaacaca"; | |
String s2 = "ca"; | |
int ocorrencias = 0; | |
for(int i=0;i<s1.length();i++){ | |
if(s1.charAt(i)==s2.charAt(0)){ | |
for(int j=0; j<s2.length();j++){ | |
if(s1.charAt(i)!=s2.charAt(j)){ | |
break; |
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
______________________________________ | |
( In the first place, God made idiots; ) | |
( this was for practice; then he made ) | |
( school boards. ) | |
( ) | |
( -- Mark Twain ) | |
-------------------------------------- | |
o | |
o \_\_ _/_/ | |
o \__/ |
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
#!/usr/bin/env ruby | |
require 'net/ssh' | |
module TestingMethods | |
def create_test #uses the current authorized_keys | |
Net::SSH.start(@server, 'root') do |ssh| | |
ssh.exec "cat ~/.ssh/authorized_keys >> #{@ak_path}" | |
end | |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
Dominios .com.br em processo de liberação (http://registro.br/dominio/proclib.html) | |
1 abati | |
2 abatia | |
3 abunda | |
4 acampe | |
5 acerte | |
6 acidez | |
7 adaga | |
8 adense |
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
# antes: | |
<!--MENU--> | |
<nav class="menu"> | |
<ul> | |
<li> | |
<% if params[:action].eql? 'sobre' %> | |
<%= link_to 'Sobre', help_sobre_url, :class => 'on' %> | |
<% else %> | |
<%= link_to 'Sobre', help_sobre_url %> |
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
Given /^I'm on the landing page$/ do | |
visit '/' | |
end | |
When /^I select my plan, source, destination and time$/ do | |
#@options = { :plan => '120', :source => '018', :destination => '011', :time => '200' } | |
fill_in 'tempo', :with => '200' | |
select '120', :from => 'plano' | |
select '018', :from => 'origem' | |
select '011', :from => 'destino' |
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
require 'spec_helper' | |
describe FaleMais::PriceCalculator do | |
context "#object" do | |
it "should be a subclass of Object" do | |
Object.constants.should include(:FaleMais) | |
end | |
it "should be instantiable" do | |
FaleMais::PriceCalculator.new.should be_an_instance_of FaleMais::PriceCalculator |