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
-@authors.each_with_index do |author, index| | |
#container{:style=>"float:left;"} | |
.bigsansed="#{link_to author.name, author}" | |
%br/ | |
-@authors.each_with_index do |author, index| | |
#container{:style=>"float:right;"} | |
.bigsansed="#{link_to author.name, author}" | |
%br/ | |
#pagination | |
=will_paginate @posts |
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
/* Change lc_width and rc_width to control column width, and voila */ | |
!lc_width= 140px | |
!rc_width= 180px | |
!lc_p= 10px | |
!lc_pad= !lc_p*2 | |
!rc_p= 10px | |
!rc_pad= !rc_p*2 | |
!lc_full= !lc_width + !lc_pad | |
!rc_full= !rc_width + !rc_pad |
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
.floatleft{:style=>"width:200px;"} | |
-@contacts[0...(@contacts.per_page/2)].each_with_index do |contact, index| | |
=render :partial => "contact", :locals => {:contact => contact} | |
.floatright{:style=>"width:200px;"} | |
-@contacts[(@contacts.per_page/2)...@contacts.per_page].each_with_index do |contact, index| | |
=render :partial => "contact", :locals => {:contact => contact} | |
#pagination{:style=>"clear:both;"} | |
=will_paginate |
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
.floatleft{:style=>"width:200px;"} | |
-@contacts[0...(@contacts.per_page/2)].each_with_index do |contact, index| | |
=render :partial => "contact", :locals => {:contact => contact} | |
.floatright{:style=>"width:200px;"} | |
-@contacts[(@contacts.per_page/2)...@contacts.per_page].each_with_index do |contact, index| | |
=render :partial => "contact", :locals => {:contact => contact} | |
#pagination{:style=>"clear:both;"} | |
=will_paginate |
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
module ApplicationHelper | |
def e_tag(model) | |
eval("link_to image_tag(\'pencil.png\'), edit_#{model.class.name.underscore}_path(model)") | |
end | |
def d_tag(model) | |
eval("link_to image_tag(\'delete.png\'), model, :confirm => \'Are you sure?\', :method => :delete") | |
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
(create-circuit :test) | |
(create-channel :tweets) | |
(create-device :tweeter-1 as :tweeter | |
(filters ["ukraine" "russia" "putin" "news" "crimea"])) | |
(create-device :tweet-channel as :channeler | |
(channel :tweets)) | |
(create-wire-> |
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
open Format | |
open Syntax | |
open Support.Error | |
open Support.Pervasive | |
(* ------------------------ EVALUATION ------------------------ *) | |
exception NoRuleApplies | |
let rec isnumericval ctx t = match t with |
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
irb(main):006:0* 1/0 | |
ZeroDivisionError: divided by 0 | |
from (irb):6:in `/' | |
from (irb):6 | |
from /Users/mrb/.rbenv/versions/1.9.3-p545/bin/irb:12:in `<main>' | |
irb(main):007:0> 1/0.0 | |
=> Infinity |
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
irb(main):002:0> 10*"*" | |
TypeError: String can't be coerced into Fixnum | |
from (irb):2:in `*' | |
from (irb):2 | |
from /Users/mrb/.rbenv/versions/1.9.3-p545/bin/irb:12:in `<main>' | |
irb(main):003:0> "*"*10 | |
=> "**********" |
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 prog = | |
CompoundStm(AssignStm("a", OpzExp(NumExp 5, Plus, NumExp 3)), | |
CompoundStm(AssignStm("b", | |
EseqExp(PrintStm[IdExp("a"), OpExp(IdExp("a"), Minus, NumExp 1)], | |
OpExp(NumExp 10, Times, IdExp("a")))), | |
PrintStm[IdExp("b")]));; | |
Error: The variant type exp has no constructor OpzExp | |
Did you mean OpExp? |
OlderNewer