归档 2014年10月

[LeetCode]Maximum Product Subarray

题目描述:

Find the contiguous subarray within an array (containing at least one number) which has the largest product.

For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has the largest product = 6.

题目大意:

从数组(至少包含一个数字 ...

继续阅读

Python脚本如何生成Windows可执行文件.exe

Python是一种简单而强大的编程语言,适用于编写脚本,甚至于应用程序的开发。Python可用的各种GUI包使得利用Python编写全功能的应用变为可能。这很好,但你有没有想过将你编写的Python脚本转化为可执行文件?这似乎是一个很赞的主意,有许多原因!你可以在没有Python解释器的情况下重新部署你的应用。终端用户不需要在他的机器上安装Python。你可以将你的应用闭源(很不幸)等等……这篇文章可以告诉你如何从你的Python脚本生成win32可执行文件。 

Python is a simple and powerful language for scripting and even application development. Various GUI packages available for Python makes it suitable for developing full fledged ...

继续阅读

HTML表单input字段disabled属性与readonly属性的区别

HTML表单输入字段包含两个比较相似的属性:disabled="disabled"以及readonly="readonly",它们之间的区别如下:

a readonly element is just not editable, but gets sent when the according form submits. a disabled element isn't editable and isn't sent on submit. another difference is that readonly elements can be focused (and ...

继续阅读

5款优秀数据恢复工具简介

原文地址:http://lifehacker.com/5237503/five-best-free-data-recovery-tools

Five Best Free Data Recovery Tools

The best way to recover from unexpected data loss is to be properly prepared. With one of the following tools on hand, you'll always be ready to save your data from the Reaper.

应对数据意外丢失的最好办法就是做足准备 ...

继续阅读

SAE Django如何syncdb到线上数据库

使用SAE部署Django应用时,如何将应用的数据库同步至线上?

在本地开发环境中,如下配置数据库,即可执行 python manage.py syncdb 直接syncdb到线上数据库。

# 线上数据库的配置
MYSQL_HOST = 'w.rdc.sae.sina.com.cn'
MYSQL_PORT = '3307'
MYSQL_USER = 'ACCESSKEY'
MYSQL_PASS = 'SECRETKEY'
MYSQL_DB   = 'app_APP_NAME'

from sae._restful_mysql import monkey
monkey.patch()

DATABASES = {
    'default': {
        'ENGINE':   'django.db.backends.mysql ...

继续阅读

每日归档

上个月

下个月

归档