Python进行MySQL数据备份:数据查询和添加

运行前,需要安装MySQLdb模块!!! sudo yum install MySQL-python #!/usr/bin/python # -*- coding: UTF-8 -*- import MySQLdb import datetime def backYestoday(): today = datetime.date.today() yesterday = today - datetime.timedelta(days=1) # 打开数据库连接 db_mat = MySQLdb.connect("hostname", "root", "password", "db", charset='utf8') # 使用cursor()

Nginx+Tomcat下的Http 504超时问题的解决办法

1.前端选用JQuery框架下 延迟超时时间和错误处理 timeout: 6000, error: function (xmlHttpRequest, error) { console.info(xmlHttpRequest, error); } 2.后端Nginx增大缓存区 http { ... # set size to:8*128k fastcgi_buffers 8 128k; send_timeout 60; ... } 3.以上可以

Spring4.x MVC responsebody 406错误的解决方案

Spring MVC REST 风格API升级到Spring4.x(4.1.1.RELEASE)+的时候报了406错误。结合网上方案,最终定位为: 1、pom文件 <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId>

Tweet Button发送成功后回调

意图:网站增加社交分享功能,对于成功分享的用户,赠送优惠活动。 Tweet Button设置: https://about.twitter.com/resources/buttons#tweet Tweet发推后绑定事件: $.getScript("https://platform.twitter.com/widgets.js", function(){ function handleTweetEvent(event){ if (event) { console.log('callback event') } } twttr.events.bind('tweet', handleTweetEvent); });