Skip to content

Instantly share code, notes, and snippets.

GSSAPIAuthentication no
ServerAliveInterval 60
Host *
ControlMaster auto
ControlPath ~/.ssh/%h-%p-%r
ControlPersist yes
1. print query out at search/views.py
s = s.query_raw(query)
print jsond.dumps(query)
then we got:
```
{"bool": {"minimum_should_match": 1, "should": [{"bool": {"must": [{"multi_match": {"fields": ["item_name_standard_analyzed^1000", "brand_name^100", "tags_standard^10", "description"], "type": "phrase", "query": "\u667a\u591a\u661f"}}]}}, {"match": {"item_spec_ng": "\u667a\u591a\u661f"}}, {"term": {"sku": "\u667a\u591a\u661f"}}, {"match": {"stick_key": {"query": "\u667a\u591a\u661f", "boost": "10000"}}}]}}
```
Traceback (most recent call last): File "/cube/app/search.tuijianbao.net/server/search/poco/apps/apis/recommender/action_processors.py", line 204, in process
return self._process(site_id, args) File "/cube/app/search.tuijianbao.net/server/search/poco/apps/apis/recommender/action_processors.py", line 768, in _process
self.logAction(site_id, args, self.getRecommendationLog(args, req_id, recommended_items))
File "/cube/app/search.tuijianbao.net/server/search/poco/apps/apis/recommender/action_processors.py", line 192, in logAction
logWriter.writeEntry(site_id, action_content)
File "/cube/app/search.tuijianbao.net/server/search/poco/apps/apis/recommender/action_processors.py", line 82, in writeEntry
write_log.delay(site_id, content)
File "/cube/app/search.tuijianbao.net/server/env/local/lib/python2.7/site-packages/celery/app/task.py", line 453, in delay
return self.apply_async(args, kwargs)
File "/cube/app/search.tuijianbao.net/server/env/local/lib/python2.7/site-packages/celery/app/t
$json = '{"content":[{"panoinfo":[],"poiinfo":{"Catalog":"010505","Dir":358,"IID":"b3d914ba8452438b8505bf08","PID":"0100220000130808102448157J5","PanoX":12957303,"PanoY":4827896,"Pitch":-2,"Rank":935,"Time":"2013","Timeline":[],"UID":"49d959381b59a043c61e5102","X":12957233,"Y":4828356,"Zoom":"1.31","bus":"","hasinter":1,"hasstreet":1,"importance":0,"ismodified":1,"name":"\u5317\u6d77\u516c\u56ed","std_tag":"\u65c5\u6e38\u666f\u70b9;\u516c\u56ed","StartID":"0400220000130924115253753IN"}}],"result":{"error":0}}';
$json = str_replace(""", "hack_quot", $json);
$json = html_entity_decode(preg_replace('/\\\\u([a-z0-9]{4})/i', '&#x$1;', $json),ENT_QUOTES, 'UTF-8');
$json = str_replace("hack_quot", """, $json);
echo $json;
echo "\n";
$d = array();
$d['array'] = array();
@aoeuidht
aoeuidht / index.jade
Created February 17, 2014 10:12 — forked from zhuangya/index.jade
.big-wrapper
.notice
pre
code vertical-align: middle
br
| for IE 7+
style
:stylus
.big-wrapper
@aoeuidht
aoeuidht / gist:8932059
Created February 11, 2014 09:55
the new cc protocol
{
"result": {
"err_no": 0
},
"content": [
{
"type": "log",
"content": {
"enable": 1,
"size": 3072
@aoeuidht
aoeuidht / gist:8115186
Last active January 1, 2016 07:59
human couldn't understood php.
<?php
function test_foreach(&$tgt)
{
foreach ($tgt as &$_t)
{
$_t['v'] = $_t['v'] + 1;
}
foreach ($tgt as $_t)
if isinstance(c_content, (str, unicode)):
uc = c_content.encode('utf8')
cnt['content'] = json.loads(uc)
# -*- coding: utf-8 -*-
import socket
import select
if __name__ == '__main__':
addr = ('127.0.0.1', 8004)
max_sockets = 3
max_requests = 100
request_cnt = 0
sockets = {}
# -*- coding: utf-8 -*-
import socket
import select
if __name__ == '__main__':
addr = ('127.0.0.1', 8004)
epoll = select.epoll()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(addr)
s.setblocking(0)