Skip to content

Instantly share code, notes, and snippets.

$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();
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
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"}}}]}}
```
GSSAPIAuthentication no
ServerAliveInterval 60
Host *
ControlMaster auto
ControlPath ~/.ssh/%h-%p-%r
ControlPersist yes
// original
{
"sv": "7.4.0",
"os": "iphone",
"sw": 320,
"ch": "1006820a",
"pd": "map",
"mb": "iPhone6,2",
"sh": 480,
"ov": "7.000000",
GSSAPIAuthentication no
ServerAliveInterval 60
Host *
ControlMaster auto
ControlPath ~/.ssh/%h-%p-%r
ControlPersist yes
@aoeuidht
aoeuidht / gist:f33fbc2d68a701acc775
Created December 17, 2014 03:58
只加工资 不改需求
################################################################################
# _ooOoo_
# o8888888o
# 88" . "88
# (| -_- |)
# O\ = /O
# ____/`---'\____
# .' \\| |// `.
# / \\||| : |||// \
# / _||||| -:- |||||- \
@aoeuidht
aoeuidht / gist:26388271dd916a80db37
Created February 5, 2015 14:25
神兽庇佑, 代码无bug
/*
3        ┏┓    ┏┓
4       ┏┛┻━━━━━━━━━━┛┻┓
5       ┃      ┃  
6       ┃   ━    ┃
7       ┃ ┳┛  ┗┳ ┃
8       ┃       ┃
9       ┃   ┻    ┃
10       ┃       ┃
11       ┗━┓    ┏━┛
#|
CPS Lecture
No published books do this subject justice (including Dan's!)
Which part of (f (g (h i) j) k) can be done first? (h i), since it
must be evaluated before (g (h i) j) can be applied.
What about (f (g (h i) (j k)))? Scheme doesn't specify the order in
@aoeuidht
aoeuidht / cps
Last active August 29, 2015 14:24
cps/trampoline version
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# the cps version
def s(n, f):
if n < 1:
return f(n)
return s(n-1,
lambda x: f(x + n))