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 Purchase < ActiveRecord::Base | |
belongs_to :type, | |
:class_name => "PurchaseType" | |
# :foreign_key => "type_id" | |
validates_presence_of :expense, :amount, :type | |
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
describe List do | |
describe "#push" do | |
it "should push to empty list" | |
it "should push to non-empty list to tail" | |
end | |
describe "#pull" do | |
it "should return nil if empty list" | |
it "should return element from tail if non-empty list" | |
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
#include <stdlib.h> | |
int sort_buble(int *array, size_t size) | |
{ | |
int *r = array + size - 1; | |
int *i; | |
while (array < r) | |
{ | |
for(i = array; i < r; ++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
["2009-01-27 18:17:59 UTC - cypok", | |
"2009-01-27 18:20:01 UTC - Сибирячка", | |
"2009-01-27 18:39:07 UTC - Nabira", | |
"2009-01-28 17:11:27 UTC - NIA", | |
"2009-02-02 17:49:36 UTC - ledy-ideal", | |
"2009-02-06 19:34:20 UTC - znakV", | |
"2009-02-07 08:14:22 UTC - Viveru", | |
"2009-02-07 20:29:53 UTC - Валентина", | |
"2009-02-07 20:54:46 UTC - людмила", | |
"2009-02-07 20:59:42 UTC - Almaz", |
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
NoMethodError in GalleriesController#show | |
undefined method `base_class' for Hash:Class | |
/usr/lib/ruby/gems/1.8/gems/be9-acl9-0.9.3/lib/acl9/model_extensions/subject.rb:85:in `get_role' | |
/usr/lib/ruby/gems/1.8/gems/be9-acl9-0.9.3/lib/acl9/model_extensions/subject.rb:9:in `has_role?' | |
app/controllers/galleries_controller.rb:25:in `show' |
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 GalleriesController < ApplicationController | |
include GalleriesHelper | |
before_filter :find_gallery, :only => [:edit, :show, :update, :destroy] | |
before_filter :find_parent, :only => [:new_gallery, :new, :create] | |
access_control do | |
allow all, :to => [:index, :show] | |
allow :admin, :to => [:new_root, :new, :create, :edit, :update, :destroy] |
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
#!/usr/bin/env ruby | |
# only for arrays with length equal to 16 :) | |
@arr = %w{17 7 27 1 43 3 56 2 29 4 40 32 5 8 28 6}.map &:to_i | |
def out(n) | |
a = @arr[0, n] | |
0.upto(5) do |l| | |
spacer = " " * (16 / 2**l - 1) |
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
* | |
* You have some suspicious patch lines: | |
* | |
* In app/controllers/galleries_controller.rb | |
* trailing whitespace (line 9) | |
app/controllers/galleries_controller.rb:9: | |
* In app/controllers/items_controller.rb | |
* trailing whitespace (line 7) | |
app/controllers/items_controller.rb:7: | |
* In app/views/items/_comment.html.erb |
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
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace DoubleLinkedList | |
{ | |
class ListNode | |
{ | |
public ListNode next; | |
public ListNode prev; |
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
>> OzonBook.first | |
=> #<OzonBook id: 1, name: "Ремонт квартиры в современн...", author: "В. С. Левадный", url: "http://www.ozon.ru/context/detail/id/83061/?from=pa...", price:120, currence: nil, picture: "http://www.ozon.ru/multimedia/books_covers/fo223_06...", publisher: "Аделант", year: 2007, ISBN: "5-89691-024-X", page_extent:384, binding: "84x108/32", description: "нию вентиляции.", created_at: "2009-03-02 17:10:09", updated_at: "2009-03-02 17:10:09"> |