This file contains 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
from __future__ import absolute_import | |
from .mycelery import app as celery_app |
This file contains 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 | |
import sys, codecs | |
def transform(enc1, enc2, f1, f2): | |
infile = codecs.open(f1, 'rU', enc1) | |
outfile = codecs.open(f2, 'w', enc2, errors='ignore') | |
if enc1 == 'utf-8' and enc2 == 'gbk': | |
for line in infile.readlines(): | |
outfile.write(line[:-1] + '\r\n') | |
elif enc1 == 'gbk' and enc2 == 'utf-8': |
This file contains 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
from flask import Flask, jsonify, request, redirect, url_for, render_template | |
from flask.ext.sqlalchemy import SQLAlchemy | |
from datetime import datetime | |
import qiniu.conf, qiniu.rs | |
import os | |
app = Flask(__name__) | |
app.config['DATABASE_FILE'] = 'app.db' | |
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + app.config['DATABASE_FILE'] | |
app.config['AK'] = 'YOUR QINIU ACCESS KEY' |
This file contains 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
from flask import Flask, render_template | |
from flask.ext.sqlalchemy import SQLAlchemy | |
from flask.ext.security import Security, SQLAlchemyUserDatastore, \ | |
UserMixin, RoleMixin, login_required | |
from flask.ext.security.utils import encrypt_password, verify_password | |
# Create app | |
app = Flask(__name__) | |
app.config['DEBUG'] = True | |
app.config['SECRET_KEY'] = 'super-secret' |
This file contains 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
from flask import Flask | |
from flask.ext.sqlalchemy import SQLAlchemy | |
from flask.ext import admin | |
from wtforms import TextAreaField | |
from wtforms.widgets import TextArea | |
from flask.ext.admin.contrib.sqla import ModelView | |
app = Flask(__name__) | |
app.config['SECRET_KEY'] = '123456790' |
This file contains 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
#include<stdio.h> | |
#include <math.h> | |
#include <time.h> | |
#define rval (-4.0/9) | |
float f(float x){ | |
return sqrt(x)*log(x); | |
} | |
int main(){ |