Skip to content

Instantly share code, notes, and snippets.

@milinda
milinda / gist:10174032
Created April 8, 2014 19:14
Testing the filter macro
(deftest defspout []
(is ((streamit/filter test-spout [] [[] -> [:double]]
(init [max 1000])
(work {:push 1}
(let [rand-double (* max (rand))]
(Thread/sleep 10)
(streamit/push [rand-double]))))))
(defmacro filter [name params type & body]
(let [prepare-fn-name (symbol (str name "__prep"))
[input-spec _arrow_ output-spec] type
[init work] body
[i init-defs] init
[w conf & impl-body] work
fn-body (if (empty? input-spec)
(if (empty? init-defs)
`(fn [] (spout (~'nextTuple [] ~@impl-body)))
`(fn [] (let [~@init-defs] (spout (~'nextTuple [] ~@impl-body)))))
[svn-remote "svn"]
url = svn+ssh://mpathira@bitternut.cs.indiana.edu/home/dquob/svn-repo/slosh/cloudpipe/trunk
fetch = :refs/remotes/git-svn
/**
* Validate the provided whirr configuration, copy the configuration(including byon node file) to scratch working
* directory and returns the file path to the whirr configuration.
* @param appDeploymentDesc GFac application deployment description
* @return Whirr configuration file path
*/
private String getWhirrConfigurationFile(HadoopApplicationDeploymentDescriptionType appDeploymentDesc) throws ProviderException, IOException {
if(appDeploymentDesc.getWhirrConfigurationFile() != null){
File whirrConfig = new File(appDeploymentDesc.getWhirrConfigurationFile());
if(!whirrConfig.exists()){
scrapy crawl scrapy
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http.request import Request
from scrapy_sample.items import ScrapySampleItem
class ScrapyOrgSpider(BaseSpider):
name = "scrapy"
allowed_domains = ["scrapy.org"]
start_urls = ["http://blog.scrapy.org/"]
from scrapy.item import Item, Field
class ScrapySampleItem(Item):
title = Field()
link = Field()
content = Field()
scrapy startproject scrapy_sample
<xs:element name="subtract">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="a" type="xs:int"/>
<xs:element minOccurs="0" name="b" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">
<ns:subtract xmlns:ns="http://cts.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></ns:subtract>
</bpel:literal>
</bpel:from>
<bpel:to variable="SubtractPLRequest" part="parameters"></bpel:to>
</bpel:copy>