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
| resources :projects do | |
| member do | |
| get :new_sub_project | |
| end | |
| end | |
| match "projects/:id" => "projects#create_sub_project", | |
| :conditions => { :method => :post }, | |
| :as => :create_sub_project |
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 "java" | |
| require "mdbdriver.jar" | |
| require "log4j.jar" | |
| require "commons_logging.jar" | |
| require "commons_lang.jar" | |
| Java::jstels.jdbc.mdb.MDBDriver | |
| p 1.to_java(:int) |
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
| mouseEntered: function(e) { | |
| // console.log(e); | |
| console.log("ENTER_____"+this.get('layerId')) ; | |
| this.setIfChanged('informativeState', YES); | |
| var parent = this.get('parentView'); | |
| var index = parent.contentIndexForLayerId(this.get('layerId')); | |
| console.log("Adding index of "+this.get('layerId')); |
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
| mouseEntered: function(e) { | |
| // console.log(e); | |
| console.log("ENTER_____"+this.get('layerId')) ; | |
| this.setIfChanged('informativeState', YES); | |
| var parent = this.get('parentView'); | |
| var index = parent.contentIndexForLayerId(this.get('layerId')); | |
| console.log("Adding index of "+this.get('layerId')); |
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
| config :all, | |
| :required => [:sproutcore, 'sproutcore/statechart', :scui], | |
| :themes => ['sproutcore/ace', 'scui/standard_theme'] |
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
| Scenario: Schedule a send time which is *future* to the deal's end date | |
| Given the following deal exists: | |
| | slug | status | end_at | | |
| | deal789 | in-flight | Time.now.tomorrow.midnight - 2.hours | | |
| When I send a POST request to /api/v1/targeted_emails with the following: | |
| """ | |
| { | |
| "api_key" : "homerun", | |
| "deal_id" : 123, | |
| "user_ids" : [user123], |
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
| (::) failed steps (::) | |
| expected between?(Tue, 15 May 2012 23:43:36 UTC +00:00, Tue, 15 May 2012 23:47:36 UTC +00:00) to return true, got false (RSpec::Expectations::ExpectationNotMetError) (RSpec::Expectations::ExpectationNotMetError) | |
| ./features/step_definitions/deal_edit_attachment.rb:20 | |
| ./features/step_definitions/deal_edit_attachment.rb:10:in `/^see a new row corresponding to the uploaded attachment$/' | |
| features/admin2/deal_edit_attachment.feature:16:in `And see a new row corresponding to the uploaded attachment' | |
| Failing Scenarios: | |
| cucumber -p cruise features/admin2/deal_edit_attachment.feature:14 # Scenario: Upload attachments |
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
| # I'm assuming sum operations are cheap and I won't gain much, if at all, from | |
| # memoizing sums. | |
| def complementary_pairs(k, a) | |
| matches = 0 | |
| a.each_index do |i| | |
| # sum the tail, the elements from i (excluded) to the end of a | |
| (i...a.length).each do |j| | |
| sum = a[i] + a[j] | |
| # we have a match but, ... | |
| if sum == k |
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 complementary_pairs(k, a) | |
| matches = 0 | |
| a.each_index do |i| | |
| # sum the tail, the elements from i (excluded) to the end of a | |
| (i...a.length).each do |j| | |
| sum = a[i] + a[j] | |
| # we have a match but, ... | |
| if sum == k | |
| # if its the sum of itself, then there can only be one match | |
| if i == j |
OlderNewer