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
apiVersion: v1 | |
kind: Service | |
metadata: | |
creationTimestamp: 2015-06-29T02:33:28Z | |
labels: | |
name: hello | |
name: hello | |
namespace: default | |
resourceVersion: "135" | |
selfLink: /api/v1/namespaces/default/services/hello |
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
import java.util.List; | |
import java.util.Iterator; | |
import java.util.LinkedList; | |
class ListAlgorithms { | |
private static <T extends Comparable<T>> void insert(T v, List<T> list) { | |
int i = 0; | |
for (T curr : list) { | |
if (curr.compareTo(v) == 1) break; | |
++i; |
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
nextPos :: Grid -> Movement -> (Int, Int) -> (Int, Int) | |
nextPos grid GoLeft (x,y) | |
| inRange (bounds grid) (x-1,y) = (x-1,y) | |
| otherwise = (x,y) | |
nextPos grid GoRight (x,y) | |
| inRange (bounds grid) (x+1,y) = (x+1,y) | |
| otherwise = (x,y) | |
nextPos grid GoUp (x,y) | |
| inRange (bounds grid) (x,y+1) = (x,y+1) | |
| otherwise = (x,y) |
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
{ | |
"title": "Interatividade", | |
"services": { | |
"query": { | |
"list": { | |
"0": { | |
"id": 0, | |
"type": "topN", | |
"query": "*", | |
"alias": "", |
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
import Data.List | |
data BloodType = BloodA | BloodB | BloodAB | BloodO deriving (Eq, Show) | |
data Gene = A | B | O deriving (Eq, Show, Ord) | |
type Genes = [Gene] | |
allGenes = [A, B, O] | |
possibleGenesByBlood :: BloodType -> [Genes] | |
possibleGenesByBlood BloodA = [[A, O], [A, A]] |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
tr { | |
background-color: red; | |
height: 30px; | |
} | |
</style> | |
</head> |
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
app = Flask(__name__) | |
app.config.from_object('yourapplication.default_settings') | |
app.config.from_envvar('YOURAPPLICATION_SETTINGS') |
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
<% first_lawyer = @contact.lawyers.first %> | |
<h1 class="g-title">Contato: <%= first_lawyer.name %></h1> | |
<%= @contact.errors.messages %> <!-- prints {:sender_name=>["não pode ficar em branco"]} --> | |
<%= form_for(@contact) do |f| %> | |
<div class="g-form-label"> | |
Advogado: | |
</div> | |
<div class="g-block-div"> | |
<%= first_lawyer.name %> | |
</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
class Lawyer < ActiveRecord::Base | |
def extracted? | |
!source.blank? | |
end | |
with_options :unless => :extracted? do |lawyer| | |
lawyer.validates_presence_of :oab, | |
:phones, | |
:address, |
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
<%= form_for @user do |f| %> | |
<%= f.label :email %><%= f.email_field :email %> | |
.... | |
<% @user.lawyers.each do |lawyer| %> | |
<%= f.fields_for :lawyers, lawyer do |lf| %> | |
<%= lf.label :name, "Nome: " %><%= lf.text_field :name %> | |
<!-- Everything is working fine so far. However, I can get this to work. A lawyer can have many services: --> | |
<% Service.all.each do |service| %> | |
<%= check_box_tag ???, service.id, lawyer.services.include?(service) %> | |
<% end %> |