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
$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(); |
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
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 |
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
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"}}}]}} | |
``` |
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
GSSAPIAuthentication no | |
ServerAliveInterval 60 | |
Host * | |
ControlMaster auto | |
ControlPath ~/.ssh/%h-%p-%r | |
ControlPersist yes |
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
// original | |
{ | |
"sv": "7.4.0", | |
"os": "iphone", | |
"sw": 320, | |
"ch": "1006820a", | |
"pd": "map", | |
"mb": "iPhone6,2", | |
"sh": 480, | |
"ov": "7.000000", |
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
GSSAPIAuthentication no | |
ServerAliveInterval 60 | |
Host * | |
ControlMaster auto | |
ControlPath ~/.ssh/%h-%p-%r | |
ControlPersist yes |
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
################################################################################ | |
# _ooOoo_ | |
# o8888888o | |
# 88" . "88 | |
# (| -_- |) | |
# O\ = /O | |
# ____/`---'\____ | |
# .' \\| |// `. | |
# / \\||| : |||// \ | |
# / _||||| -:- |||||- \ |
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
/* | |
3 ┏┓ ┏┓ | |
4 ┏┛┻━━━━━━━━━━┛┻┓ | |
5 ┃ ┃ | |
6 ┃ ━ ┃ | |
7 ┃ ┳┛ ┗┳ ┃ | |
8 ┃ ┃ | |
9 ┃ ┻ ┃ | |
10 ┃ ┃ | |
11 ┗━┓ ┏━┛ |
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
#| | |
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 |
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
#!/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)) |