Skip to content

Instantly share code, notes, and snippets.

@goganchic
goganchic / gist:3736205
Created September 17, 2012 08:39
расстояния
CREATE OR REPLACE FUNCTION distance(point1 point, point2 point) RETURNS float8 AS $$
DECLARE
long1 float8;
long2 float8;
lat1 float8;
#include <stdio.h>
#include <string.h>
#define SUCCESS_CODE 0
#define ERR_CODE 1
/*
* Функция разбора входных параметров
*
* аргументы:
Circle = (center, radius, options) ->
options = $.extend({accuracy : 32}, options)
# Вызывает родительский конструктор
YMaps.Polygon.call(@, [], options)
# Вызывается при добавлении круга на карту
@.onAddToMap = (map, container) ->
YMaps.Polygon.prototype.onAddToMap.call(@, map, container)
@.updatePoints()
Circle = (center, radius, options) ->
options = $.extend({accuracy : 32}, options)
# Вызывает родительский конструктор
YMaps.Polygon.call(@, [], options)
# Вызывается при добавлении круга на карту
@.onAddToMap = (map, container) ->
YMaps.Polygon.prototype.onAddToMap.call(@, map, container)
@.updatePoints()
class Room < ActiveRecord::Base
has_many :auctions
end
class Auction < ActiveRecord::Base
belongs_to :room
validates :room, :presence => true
end
FactoryGirl.define do
Started GET "/ussd?from=%2A100%23&msisdn=79049225884&request=9" for 127.0.0.1 at Fri Oct 28 15:58:15 +0400 2011
Читаем сессию из кеша; результат: #<MobileMenu::Sessions::Session:0xb4fbcad4>
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."msisdn" = 79049225884 LIMIT 1
Пытаюсь войти в экран: MobileMenu::Ussd::ResumeSession
Сохраняем сессию в кеш; результат: true
Рендерю экран: MobileMenu::Ussd::ResumeSession
User Load (0.5ms) SELECT "users".* FROM "users" WHERE (users.aimsid IS NOT NULL AND users.events_url IS NOT NULL)
User Load (0.5ms) SELECT "users".* FROM "users" WHERE (users.aimsid IS NOT NULL AND users.events_url IS NOT NULL)
User Load (0.5ms) SELECT "users".* FROM "users" WHERE (users.aimsid IS NOT NULL AND users.events_url IS NOT NULL)
User Load (0.5ms) SELECT "users".* FROM "users" WHERE (users.aimsid IS NOT NULL AND users.events_url IS NOT NULL)
def require_user
return true if logged_in?
reauthenticate
return false
end
def reauthenticate
cookies[:return_to] = request.fullpath
@user = User.new
(::) failed steps (::)
scope '.calendar-res-container' not found on page (Capybara::ElementNotFound)
./features/step_definitions/web_steps.rb:14:in `with_scope'
./features/step_definitions/web_steps.rb:108:in `/^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/'
features/calendar.feature:11:in `Then I should see "Rename Me" within ".calendar-res-container"'
expected #has_content?("Create Event") to return true, got false (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/web_steps.rb:110
./features/step_definitions/web_steps.rb:14:in `with_scope'
Pending:
Role add some examples to (or delete) /home/ebaranov/workspace/scheduler/patient-scheduler-ruslan/spec/models/role_spec.rb
# Not Yet Implemented
# ./spec/models/role_spec.rb:4
EventType add some examples to (or delete) /home/ebaranov/workspace/scheduler/patient-scheduler-ruslan/spec/models/event_type_spec.rb
# Not Yet Implemented
# ./spec/models/event_type_spec.rb:4
UsersHelper add some examples to (or delete) /home/ebaranov/workspace/scheduler/patient-scheduler-ruslan/spec/helpers/users_helper_spec.rb
# Not Yet Implemented
# ./spec/helpers/users_helper_spec.rb:14
require 'json'
require 'oauth'
class TwitterOauth
class GeneralError < StandardError
end
class APIError < TwitterOauth::GeneralError
end
class UnexpectedResponse < TwitterOauth::APIError