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
public void TestChanges() | |
{ | |
var session = new CloudantSession("https://user.cloudant.com"); | |
session.Changes<dynamic>("some_db", FeedType.longpoll, include_docs: true).Subscribe(doc => | |
{ | |
Console.WriteLine(doc); | |
}, | |
(e) => Console.WriteLine("Error "+e)); | |
} |
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
map function: | |
function(doc) { | |
if(doc.symbol.lastIndexOf("HFF") == 0){ | |
emit(doc.symbol,{last_update:doc.last_updatedutc,symbol:doc.symbol,last_yield:doc.last_yield}); | |
} | |
} | |
View output: |
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
function(doc) { | |
var d = new Date(doc.date); | |
var today = new Date(); | |
var d1 = d.toDateString(); | |
var d2 = today.toDateString(); | |
if(d1 == d2){ | |
emit(doc.strategy, doc); | |
} | |
} |
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
function(keys, values) { | |
var sumObj = {"qty_cross_ccy": 0, | |
"qty_base_ccy": 0, | |
"fees": 0, | |
"profit_loss_realized": 0, | |
"realized_pl_percentage": 0, | |
"average_buy_rate" : 0, | |
"average_sell_rate" : 0, | |
"asset_under_management" : 0}; |
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
Dispatch = [{'_', [ | |
{[<<"index.htm">>,'...'], cowboy_static, | |
[ {directory, {priv_dir, monterl_carlo_websocket,[]}}, | |
{file,<<"index.htm">>}, | |
{mimetypes, [{<<".html">>, [<<"text/html">>]}]}]}, | |
{[<<"flot.jquery.js">>,'...'],cowboy_static, | |
[ {directory, {priv_dir, monterl_carlo_websocket,[]}}, | |
{file,<<"flot.jquery.js">>}, | |
{mimetypes, [{<<".js">>, [<<"text/javascript">>]}]}]}, | |
{'_', monterl_carlo_websocket_handler, []} |
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
Dispatch = [{'_', [ | |
{[<<"index.htm">>,'...'], cowboy_static, | |
[ {directory, {priv_dir, monterl_carlo_websocket,[]}},{mimetypes,[<<"text/html">>,<<".html">>,<<".htm">>]}]}, | |
{[<<"flot.jquery.js">>,'...'],cowboy_static, | |
[ {directory, {priv_dir, monterl_carlo_websocket,[]}}, | |
{file,<<"flot.jquery.js">>}]}, | |
{'_', monterl_carlo_websocket_handler, []} | |
]}], |
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
deal(0,_,_). | |
deal(NumCards,Deck,Out) :- | |
get_card(C,Deck,Rest), | |
NewNum is NumCards-1, | |
append(Out,[C],Result), | |
deal(NewNum,Rest,Result), | |
Out = [C|Result],!. |
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
import mechanize | |
br = mechanize.Browser() | |
br.addheaders = [('User-agent', 'Mozilla/5.0 (Windows NT 5.2; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11')] | |
br.set_handle_robots(False) | |
br.open("http://hagstofa.is/?PageID=618&src=/temp/Dialog/varval.asp?ma=UMH01101%26ti=Fri%F0l%FDst+sv%E6%F0i+1928%2D2011+%26path=../Database/land/landfr/%26lang=3%26units=Fj%F6ldi%20/ferk%EDl%F3metri") | |
print "page opened" | |
for link in br.links(): | |
if(link.text == None): | |
br.open(link.url) |
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
2013-01-31 09:38:10.729 [info] <0.77.0>@riak_core_sysmon_handler:handle_event:92 monitor long_gc <0. | |
934.0> [{name,' 24311'},{initial_call,{mbo_book,init,1}},{almost_current_function,{mbo_book,'-get_or | |
der/3-lc$^0/1-0-',2}},{message_queue_len,94606}] [{timeout,63},{old_heap_block_size,8024355},{heap_b | |
lock_size,1346269},{mbuf_size,0},{stack_size,25},{old_heap_size,3476907},{heap_size,25464}] |
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
{ | |
_id: "GUID", | |
_rev: "4-8029d009bb439f3c15dd27fd6663df57", | |
name:"amqp_client", | |
version:'3.0.1' | |
deps:[ | |
{druna, Name, _rev}, | |
{git, repo, branch} | |
], | |
_attachments: { |
OlderNewer