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
#include "main.h" | |
Line * Line_new(int id, int city_c, int travel_c) { | |
int i; | |
Line * line = malloc(sizeof(Line)); | |
assert(line != NULL); | |
line->id = id; | |
line->city_c = city_c; | |
line->travel_c = travel_c; |
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
while(!all_processed(processed, network->city_c)) { | |
int u; | |
Neighbor *tmp; | |
u = extract_next(djk->marks, processed, network->city_c); | |
processed[u] = true; | |
tmp = network->cities[u]->neighbors; | |
while(tmp != NULL) { | |
int l; | |
int v = tmp->city_id; | |
travel = Travel_next(tmp->travel, djk->marks[u]%(24*60)); |
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 nothing | |
nil | |
end | |
if $0 == __FILE__ | |
puts nothing | |
elsif $0 =~ /spec$/ | |
describe "foo" do | |
it "should" do | |
nothing.should be_nil |
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 | |
%w(rubygems rzen time).each{|l| require l} | |
gem("twitter4r", ">=0.2.4") | |
require "twitter" | |
include Twitter | |
include RZen | |
message = ARGV[0] | |
if message.nil? || message.empty? | |
message = Entry.get(:title => "Twit", :text => "Twitter: ", :width => 500) |
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 | |
# Command line autotest tool | |
target = ARGV[0] | |
raise ArgumentError if target.nil? || !File.exist?(target) | |
running = true | |
trap "INT" do | |
puts "Interrupted by user" |
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 'rubygems' | |
require File.join(File.dirname(__FILE__), 'lib', 'xup') | |
require 'redcloth' | |
require 'haml' | |
require 'markaby' | |
require 'benchmark' | |
Xup.load :xml | |
n = 10_000 |
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
# 1.8.7, 1.9 | |
def self.build(&block) | |
new.tap {|c| c.instance_eval(&block) }.buffer | |
end | |
# old: | |
def self.build(&block) | |
c = new | |
c.instance_eval(&block) | |
c.buffer |
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
$:.unshift File.join(File.dirname(__FILE__), 'lib') | |
require 'xup' | |
module Animals | |
module Cat | |
def meow | |
concat "meow!\n" | |
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
use HonkPost | |
title "Un post pour mon blog" | |
tags %w[foo bar baz] | |
time Time.now | |
comments true | |
contents do | |
use HTML, YapokOrgExt |
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
$:.unshift File.join(File.dirname(__FILE__), 'lib') | |
require 'time' | |
require 'xup' | |
require 'xup/modules/xml' | |
class Xup::Document::RSS < Xup::Context | |
use Xup::Modules::XML | |
end | |