A -- (master)
\--> B (remove-blanks)
Master repo awaits user contributions. Many ways to achieve that, let's review some of them.
#!/usr/bin/env ruby |
#define BLACK 0 | |
#define RED 1 | |
typedef struct tree_el{ | |
int value; | |
struct tree_el *left; | |
struct tree_el *right; | |
int color; | |
} node; |
def mergesort(list) | |
return list if list.size <= 1 | |
mid = list.size / 2 | |
merge mergesort(list[0, mid]), mergesort(list[mid, list.size]) | |
end | |
def merge(left, right) | |
sorted = [] | |
until left.empty? or right.empty? | |
if left.first <= right.first |
package fields | |
import ( | |
"fmt" | |
"reflect" | |
) | |
// Provides a shortcut and prettier syntax for map definitions. | |
type Assigns map[string]reflect.Value |
#!/usr/bin/env ruby | |
require 'gosu' | |
module GoUp | |
def self.update(obj, window) | |
obj.move(0, -1) | |
end | |
end |
flexmock(User).should_receive(:find).with('42').and_return(jane) # Flexmock | |
User.should_receive(:find).with('42').and_return(jane) # Rspec | |
User.expects(:find).with('42').returns {jane} # Mocha | |
User.should_receive(:find).with('42') {jane} # Rspec using return value blocks | |
mock(User).find('42') {jane} # RR |
void MainWindow::show_message() | |
{ | |
std::stringstream title, content; | |
title << "The first [" << m_spin_button.get_value_as_int() << "] lines"; | |
Gtk::MessageDialog dialog(title.str()); | |
std::ifstream file; | |
file.open(m_file_chooser_button.get_filename().c_str(), std::ifstream::in); | |
char buffer[512]; | |
short i = 0; |
task :minitest do | |
path = File.expand_path('test', Rails.root) | |
require File.expand_path('test_helper', path) | |
Dir[path + '/*_test.rb'].each do |file| | |
require file | |
end | |
end |
kuba:Blog$ tree spec/ | |
spec/ | |
├── controllers | |
│ └── posts_controller_spec.rb | |
├── helpers | |
│ └── posts_helper_spec.rb | |
├── models | |
│ └── post_spec.rb | |
├── requests | |
│ └── posts_spec.rb |