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 get(oid: String) = Action.async { | |
//import com.mongodb.casbah.Implicits._ | |
Future { | |
val cbMongoClient: MongoClient = MongoClient("localhost", 27017) | |
val gridFs = GridFS(cbMongoClient("scoin2")) | |
try { | |
gridFs.findOne(new ObjectId(oid) ) match { | |
case Some(f) => |
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
Shell: | |
> go build test.go | |
> ./test & | |
> kill -HUP `pidof test` | |
> cat > ./test | |
bash: /home/user/test: Text file busy | |
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
import numpy as np | |
import random | |
#import matplotlib.pyplot as plt | |
def bk(a1,a2): | |
i = 1 | |
prev = None | |
while True: | |
v = random.randint(0,1) | |
if prev == a1 and v == a2: |
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
class DomainDAO(conn:MongoClient) extends SalatDAO[Domain, ObjectId](collection= conn("merkator")("items")) { | |
collection.ensureIndex(DBObject("domain" -> 1),DBObject("unique"->1)) | |
def update(item:Domain) = { | |
val dbo = (_grater.asDBObject(item) - "_id") | |
collection.update(MongoDBObject("domain"->item.domain),MongoDBObject("$set"->dbo),true,false) | |
} | |
} | |
class DropDAO(conn:MongoClient) extends SalatDAO[Domain, ObjectId](collection= conn("merkator")("drops")) { |
This file has been truncated, but you can view the full file.
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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 26, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ |
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 toPolar(im): | |
mask = np.array(im[:,:,3]) | |
im = np.array(im[:,:,:3]) | |
_, contours, _ = cv2.findContours( mask ,mode=cv2.RETR_EXTERNAL ,method=cv2.CHAIN_APPROX_NONE) | |
contour = contours[0] | |
ellipse = cv2.fitEllipse(contour) | |
cv2.ellipse(im,ellipse,(0,255,0),2) | |
#im = cv2.drawContours(im, [contour], 0, (255,0,0), 3) | |
#plt.imshow(im) |
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
<?xml version="1.0" ?><ItemLookupResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01"><OperationRequest><HTTPHeaders><Header Name="UserAgent" Value="libwww-perl/6.05"></Header></HTTPHeaders><RequestId>805e34c2-eb03-4ba6-b564-c2580faf55a1</RequestId><Arguments><Argument Name="AWSAccessKeyId" Value="AKIAJ2T3JVTLY4N53V3A"></Argument><Argument Name="AssociateTag" Value="AKIAJ2T3JVTLY4N53V3A"></Argument><Argument Name="IdType" Value="EAN"></Argument><Argument Name="ItemId" Value="0044007806128"></Argument><Argument Name="ItemPage" Value="1"></Argument><Argument Name="Operation" Value="ItemLookup"></Argument><Argument Name="ResponseGroup" Value="Large"></Argument><Argument Name="SearchIndex" Value="Music"></Argument><Argument Name="Service" Value="AWSECommerceService"></Argument><Argument Name="Sort" Value="salesrank"></Argument><Argument Name="Timestamp" Value="2015-08-25T16:42:59Z"></Argument><Argument Name="Version" Value="2011-08-01"></Argument><Argument Name="locale" Value="uk"></Argum |
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
[belka@CentOS-63-64-minimal sjdice]$ git diff | |
diff --git a/app/actors/UserManager.scala b/app/actors/UserManager.scala | |
index 5f02dd3..a00e7b8 100644 | |
--- a/app/actors/UserManager.scala | |
+++ b/app/actors/UserManager.scala | |
@@ -584,10 +584,14 @@ class UserManager extends Actor { | |
val rcpt = sender() | |
logger.info(s"Unsubscribe $rcpt Subscription:${subscribers.get(rcpt | |
- val subscription: UserSubscription = subscribers.get(rcpt).get |
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
{ | |
"id": 9, | |
"result": { | |
"computedStyle": [ | |
{ | |
"name": "background-attachment", | |
"value": "scroll" | |
}, | |
{ | |
"name": "background-blend-mode", |
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 completeProcessing() = { | |
logger.info(s"Receive info from url: http://127.0.0.1:${conf.debugPort}/json") | |
val htmlBody = repeatUntilSuccess(10,100.milliseconds) { | |
io.Source.fromURL( s"http://127.0.0.1:${conf.debugPort}/json" ).mkString | |
} | |
val json = Json.parse(htmlBody) | |
val firstTabId = ( json \\ "id" ).head.as[String] |