自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 收藏
  • 关注

原创 [Python] 用Flask引入CSS无法正常显示

今天根据Flask教程做了一个简单的博客,最后运行时发现css的样式总是不起作用,在浏览器上调试后发现css文件的确成功加载了:解决方法:删除文件开头的字段参考文章:http://www.oschina.net/question/872916_221492?sort=time

2015-11-21 22:06:29 16459 6

原创 [windows] flask - sqlite3.OperationalError: unable to open database file

# all the imports##from __future__ import with_statementimport sqlite3from flask import Flask, request, session, g, redirect,url_for, \ abort, render_template, flashfrom contextlib import c

2015-11-16 23:19:19 3602

原创 [python]在WingIDE中创建flask项目

1.Project ->New Project2.选择flask模板,选择解释器路径为virtualenv路径3.测试在项目中新建文件,看导入flask是否成功若失败会提示

2015-11-04 21:01:57 1553

转载 Windows下安装Flask

Windows下安装FlaskFlask介绍是一个轻量级的Web应用框架, 使用Python编写。基于 WerkzeugWSGI工具箱和 Jinja2模板引擎。Flask使用 BSD 授权。Flask也被称为 “microframework” ,因为它使用简单的核心,用 extension 增加其他功能。Flask没有默认使用的数据库、窗体验证工具。然而,Flask保留

2015-11-03 22:38:20 560

转载 Python easy_install安装插件错误(UnicodeDecodeError)解决办法

电脑上安装的Python是2.7.10,在使用easy_install安装pandas库时发生错误:unicodedecodeerror: 'ascii' codec can't decode byte 0xb8 in position 7: ordinal not in range(128)  经过许久的折腾以及资料查找,找到了一个解决办法  在安装目录下找到 .\Lib\mimetyp

2015-11-03 22:34:01 613

转载 redhat下安装chrome

最近在学习linux,安装的是redhat,自带的firefox,由于不习惯firefox,想安装一个chrome,在网上找的安装方法,记录一下方便以后查找1.创建一个文件/etc/yum.repos.d/google.repo2.如果是32位的[google-chrome]name=google-chrome - 32-bitbaseurl=http://dl.googl

2015-08-30 22:03:54 3050

原创 安装supervisor调试nodejs

让xx.js改变后不用重启服务:npm install supervisorsupervisor xx.js

2015-08-30 21:57:46 503

原创 安装node-inspector来调试node

1.全局安装node-inspector: npm install -g node-inspector --unsafe-perm2.测试是否安装成功:node-inspector3.启动appnode --debug xx.jsnode --debug -brk xx.js (启动应用并停在第一行)4.启动inspector:node-inspector5

2015-08-30 21:54:14 758

转载 VMware虚拟机中nat网络模式的设置方法

NAT模式的具体配置NAT方式:虚拟机可以上外网,可以访问宿主计算机所在网络的其他计算机(反之不行)。1.1.1.        查看虚拟机的网络参数1)      打开虚拟机,选择菜单“编辑”》“编辑虚拟网络”,如下图:2)      选中列表中的“VMnet8 NAT”,点击左下角“恢复默认”按钮,恢复默认参数设置。然后点击“NAT设置”按钮,如下图:

2015-08-30 21:38:48 1753

原创 虚拟机与主机不能ping通的解决方法

由于虚拟机与主机不能ping通,试过网上各种方法,集各家之所长,终于通了,以下是我设置的步骤。1.设置虚拟机为桥接模式VM -> Settings -> Network Adapter: Bridged2.设置桥接需要的本地网卡Edit -> Virtual Network Editor ->更改桥接的自动设置为本机的网卡(我的网卡是Qualcomm ...)3

2015-08-29 13:50:29 15179

原创 Linux下搭建python + nodejs + express环境

一、安装Python:若Python版本过低,安装nodejs会出错:o['default_configuration'] = 'Debug' if options.debug else 'Release'   SyntaxError: invalid syntaxwget --no-check-certificate http://www.python.org/ftp/pytho

2015-08-23 12:22:09 582

原创 Linux - bash : ifconfig command not found

1. whereis ifconfig 看一下这个命令在哪个目录下/etc/sbin2.echo $PATH 看一下该目录是否在路经下3.切换到root用户下 supassword: 输入密码4.修改bashrc文件whereis bashrcvi /etc/bashrc添加行: export PATH=$PATH:/sbin5.使设置生效sourc

2015-08-22 20:56:02 578

原创 虚拟机启动Ubuntu失败 module devicepoweron power on failed

今天打开虚拟机想重新启动Ubuntu遇到这个问题:网上搜索后,解决方案如下:1.根据初始启动页面下的信息,在本地找到Ubuntu.vmx文件:  2.编辑该文件:将 vmci0.present = "true"  改为false

2015-06-13 10:29:39 3086 1

原创 Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space.1221  -> true-1221 -> falseclass Solution {public: bool isPalindrome(int x) { if(x < 0) return false;

2015-05-13 21:49:33 331

原创 String to Integer (atoi)

Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca

2015-05-12 22:27:59 343

原创 Reverse Integer

Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321class Solution {public: int reverse(int x) { long long int res = 0; while(

2015-05-11 21:20:07 343

原创 ZigZag Conversion

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I

2015-05-07 22:14:21 243

原创 Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo

2015-04-21 22:49:09 335

原创 Add Two Numbers

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link

2015-04-19 22:48:21 330

原创 Two Sum

Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, whe

2015-04-14 22:24:30 301

转载 归并排序及其时间复杂度分析

1.归并排序的步骤如下:       Divide: 把长度为n的输入序列分成两个长度为n/2的子序列。       Conquer: 对这两个子序列分别采用归并排序。             Combine: 将两个排序好的子序列合并成一个最终的排序序列。2.时间复杂度:       这是一个递推公式(Recurrence),我们需要消去等号右侧的

2015-04-11 23:08:35 693

原创 Evaluate Reverse Polish Notation

Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1"

2015-04-11 21:26:48 552

转载 C++ Test的使用

C++ Test是什么?    C++ Test是Parasoft公司出品的一个针对C/C++源代码进行代码风格测试,自动化单元测试的工具。C++ Test能给我们带来什么?        1.         可以帮助我们检查程序的编码情况,判断是否严格按编码规范进行开发。        2.         对C/C++源代码进行分析,自动生成相应的测试用例,对函数进行初步的测

2015-03-20 16:03:09 16075 2

转载 学习实践:使用模式,原则实现一个C++自动化测试程序

个人编程中比较喜欢重构,重构能够提高自己的代码质量,使代码阅读起来也更清晰。但是重构有一个问题,就是如何保证重构后带代码实现的功能与重构前的一致;如果每次重构完成后,对此不闻不问,则会有极大的风险,如果每次重构后,都进行一边测试,则工作量会很巨大,最终可能是即使代码有重构的欲望,也会尽量克制住,不去重构。除非代码能够进行自动化测试。实际上进行测试的是接口,而不是所有代码,只要能够保

2015-03-20 15:49:36 476

转载 关于Python 3.x中,使用print函数时出现的语法错误(SyntaxError: invalid syntax)的问题的原因

【现象】很多Python初学者,在安装了最新版本的Python 3.x版本,比如Python 3.2之后,去参考别人的代码(基于Python 2.x写的教程),去利用print函数,打印输出内容时,结果却遇到print函数的语法错误:SyntaxError: invalid syntax【原因】这是因为,你正在用的Python版本是Python 3.

2015-03-19 09:58:47 1274 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除