#说明:
- google的公共库国内访问不稳定
- 与将JS库存放在服务器单机上相比,CDN公共库更加稳定、高速。
##百度公共库
- [地址](http://developer.baidu.com/wiki/index.php?title=docs/cplat/libs)
- 百度公共CDN为您的应用程序提供稳定、可靠、高速的服务,包含全球所有最流行的开源JavaScript库
- 如果对版本要求不严,百度的公共库的确提供了一个很好的解决方案,不管从速度和稳定性方面都不错
- 百度CDN最明显的优势就是速度快
# simple math expression pratt parser | |
def lexer(s): | |
'''token generator''' | |
ix = 0 | |
while ix < len(s): | |
if s[ix].isspace(): ix += 1 | |
elif s[ix] in "+-*/()": | |
yield s[ix]; ix += 1 | |
elif s[ix].isdigit(): |
import socket | |
HOST = 'localhost' | |
PORT = 9876 | |
ADDR = (HOST,PORT) | |
BUFSIZE = 4096 | |
videofile = "videos/royalty-free_footage_wien_18_640x360.mp4" | |
bytes = open(videofile).read() |
from chatterbot import ChatBot | |
from chatterbot.trainers import ChatterBotCorpusTrainer | |
import websocket | |
from time import sleep | |
import json | |
# Insert database name here | |
db_name="jimdb" | |
# Insert valid database URI here |
version: '3' | |
services: | |
postgres: | |
image: postgres:9.4-alpine | |
volumes: | |
- ./pgdata_new:/var/lib/postgresql/data | |
ports: | |
- '127.0.0.1:5432:5432' | |
elasticsearch: | |
#image: wwj2 |
#说明:
##百度公共库
* http://codecombat.com/ | |
* https://www.codeavengers.com/ | |
* https://scratch.mit.edu/projects/editor/?tip_bar=hoc | |
* https://www.tynker.com/ | |
* http://lightbot.com/ | |
* https://codehs.com/ | |
* https://code.org/learn | |
* http://freecodecamp.com/ |
import dbm, os | |
import cPickle as pickle | |
from gensim.models import Word2Vec | |
import numpy as np | |
def save_model(model, directory): | |
model.init_sims() # making sure syn0norm is initialised | |
if not os.path.exists(directory): | |
os.makedirs(directory) | |
# Saving indexes as DBM'ed dictionary |
import threading | |
from flask import Flask, make_response | |
import itchat | |
qrSource = '' | |
def start_flask(): | |
flaskApp = Flask('itchat') | |
@flaskApp.route('/') |
[default] | |
access_key = asf | |
bucket_location = US | |
cloudfront_host = cloudfront.amazonaws.com | |
cloudfront_resource = /2010-07-15/distribution | |
default_mime_type = binary/octet-stream | |
delete_removed = False | |
dry_run = False | |
encoding = UTF-8 | |
encrypt = False |
#!/usr/bin/env python3 | |
# Copyright (c) 2016 Anki, Inc. (except Chatterbot part and a couple of my | |
# own lines of code) | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License in the file LICENSE.txt or at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |