⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
[2012-10-19 19:59:54,085][INFO ][index.search.slowlog.query] [Elastic Search 4] [busk_prod_0310][0] took[566.9ms], took_millis[566], search_type[QUERY_THEN_FETCH], total_shards[8], source[...], extra_source[], | |
[2012-10-19 19:59:54,102][INFO ][index.search.slowlog.query] [Elastic Search 4] [busk_prod_0310][5] took[612.5ms], took_millis[612], search_type[QUERY_THEN_FETCH], total_shards[8], source[...], extra_source[], | |
[2012-10-19 20:02:21,702][INFO ][index.search.slowlog.query] [Elastic Search 4] [busk_prod_0310][0] took[745.8ms], took_millis[745], search_type[QUERY_THEN_FETCH], total_shards[8], source[...], extra_source[], | |
[2012-10-19 20:02:21,809][INFO ][index.search.slowlog.query] [Elastic Search 4] [busk_prod_0310][5] took[832.9ms], took_millis[832], search_type[QUERY_THEN_FETCH], total_shards[8], source[...], extra_source[], | |
[2012-10-19 20:08:27,309][WARN ][index.search.slowlog.fetch] [Elastic Search 4] [busk_prod_0310][5] took[54.3s], took_millis[54399], search_type[QUERY_THEN_FETCH], total_shards[8], sou |
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 CrawlRoundSender(master: ActorRef, scheduler: CrawlScheduler) extends Actor { | |
def receive = { | |
case CrawlRound => { | |
scheduler.next() match { | |
case Some(crawlFeed) => { | |
master ! crawlFeed | |
self ! CrawlRound | |
} | |
case None => context.system.scheduler.scheduleOnce(100.millis, self, CrawlRound) | |
} |
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
package com.redis | |
import redis.clients.jedis._ | |
object PerfTests { | |
def keys = (0 until 20000) map { "somekey:" + _ } | |
def populate() { | |
val jedis = new Jedis("localhost") | |
keys foreach { n => | |
jedis.set("somekey:"+n, n.toString) | |
} |
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
organization := "com.busk" | |
name := "SearchServer" | |
version := "0.1.0-SNAPSHOT" | |
scalaVersion := "2.9.1" | |
seq(webSettings :_*) |
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
final def updateClusterSize(docId: String, newClusterSize: Int) : ListenableActionFuture[UpdateResponse] = { | |
val fields = client.prepareGet(indexName, typeName, docId) | |
.setFields("_timestamp") | |
.execute().actionGet().fields() | |
val oldTimestamp = if (fields == null) | |
(new Date()).getTime | |
else | |
fields.get("_timestamp").value() | |
client.prepareUpdate(indexName, typeName, docId) | |
.setScript(""" |
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
{ | |
"query" : { | |
"constant_score": { | |
"filter": { | |
"terms": { | |
"_id": [ "44554814", "44506463", "44504729", "44506997", "44524881", "44509720", "44511458", "44522991", "44516257", "44504696", "44510314", "44543302", "44511529", "44508846", "44553660", "44513106", "44523403", "44550041", "44546073", "44506741", "44510843", "44559504", "44546960", "44511807", "44511889", "44516652", "44508535", "44542304", "44548172", "44504430", "44560101", "44545461", "44505070", "44524517", "44512248", "44505853", "44510579", "44510031", "44545932", "44511065", "44504916", "44515151", "44505492" ] | |
} | |
} | |
} | |
}, |
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
mysql> SELECT category_id, categories.name, count(*) as count FROM article_categories LEFT JOIN categories ON categories.id = category_id WHERE article_id in (select article_id from article_categories where category_id = 2179) AND category_id <> 2179 GROUP BY category_id ORDER BY count DESC LIMIT 100; | |
+-------------+------------------------+-------+ | |
| category_id | name | count | | |
+-------------+------------------------+-------+ | |
| 334 | olympics | 2806 | | |
| 280214 | olympícs | 2243 | | |
| 123916 | commentid=sports | 754 | | |
| 8023 | mlb | 530 | | |
| 36 | news | 435 | | |
| 199103 | london-olympics | 344 | |
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
high-thread-dispatcher { | |
# Dispatcher is the name of the event-based dispatcher | |
type = Dispatcher | |
# What kind of ExecutionService to use | |
executor = "fork-join-executor" | |
# Configuration for the fork join pool | |
fork-join-executor { | |
# Min number of threads to cap factor-based parallelism number to | |
parallelism-min = 200 | |
# Parallelism (threads) ... ceil(available processors * factor) |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |