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
SICP 1.2 | |
Fork me. Solve me. | |
==== | |
-71/300 <= | |
(/ (+ 5 4 (- 2 (- 3 (+ 6 (/ 1 5))))) | |
(* 3 (- 6 2) (- 2 7))) |
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
Please excuse my embarrassing Groovy code. This is a simplified cuke4duke Step definition. | |
GroceryService is a java class that makes a call to repository.findByNamedQueryAndNamedParam("Store.by_zip_code_with_active_promotions", "zip", "48176") | |
The error i'm getting is: | |
org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: groovy.mock.interceptor.MockFor.findByNamedQueryAndNamedParam() is applicable for argument types: (java.lang.String, java.lang.String, java.lang.String) values: [Store.by_zip_code_with_active_promotions, zip, 48176] (NativeException) | |
When(~"the service is invoked") { | |
store = new Store() |
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
package com.chikli.st | |
import org.junit.runner.RunWith | |
import org.scalatest.{FeatureSpec, GivenWhenThen} | |
import org.scalatest.junit.JUnitRunner | |
@RunWith(classOf[JUnitRunner]) | |
class GolSpec extends FeatureSpec with GivenWhenThen { | |
feature("a cell with zero neighbors dies in the next generation") { |
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
I have a model: | |
class Offer extends Backbone.Model | |
And a Collection: | |
class Offers extends Backbone.Collection | |
model: Offer | |
initialize: -> |
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
There are 2 main problems with the code below: | |
1) It appears that fetch is getting called twice somehow | |
2) The fetched JSON is not parsing into the OfferClass objects. | |
I have a server that returns the following JSON at /offerClasses | |
[ {"id":1,"name":"Introductory"}, {"id":2,"name":"Loyalty"} ] | |
Coffee file |
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
# Keep track of the original sync method so we can | |
# delegate to it at the end of our new sync. | |
originalSync = Backbone.sync | |
# Our new overriding sync with dataType and ContentType | |
# that override the default JSON configurations. | |
Backbone.sync = (method, model, options) -> | |
options = _.extend(options, | |
dataType: 'xml' |
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 OE.Offer extends Backbone.Model | |
class OE.Offers extends Backbone.Collection | |
model: OE.Offer | |
url: 'http://localhost:7000/offer/opportunities/merchant/123' | |
parse: (response) -> | |
template = ["//offer", { | |
id: 'id', | |
name: 'name', |
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 TypeTab | |
include PageObject | |
radio_button(:premium_offer_yes, {:name => 'premium-offer', :value => 'true'}) | |
radio_button(:premium_offer_no, {:name => 'premium-offer', :value => 'false'}) | |
# doesn't seem to work in a block | |
def non_working_select_data | |
premium_offer_yes_element.when_visible do |
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
<root> | |
<a> | |
<b>123</b> | |
<b>456</b> | |
<b>789</b> | |
</a> | |
<a> | |
<b>foo</b> | |
</b>bar</b> | |
</a> |
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
The reason we're using "element" is because the html contains a "dl" element. | |
--------------- | |
class HeaderInfo | |
include PageObject | |
element(:merchant, :id => 'merchant-name') | |
OlderNewer