python版gb转big5, 复活pygb2big.py
想找gbk到big5转换的python版,网上到处是同一篇文章,讲了原理,却发生了最稀奇的事情:到处都找不到pygb2big.py文件,于是操刀根据原理复原了pygb2big.py , 打破惯例,先提供下载,再展示代码,最后才是解说:
pygb2bigDownload
# -*- coding: utf-8 -*-
import getopt
import sys
def usage():
print('big5 file to gbk file:')
print('\tpygb2big.py -b inputfile outputfile ')
print('gbk file to b... 阅读全文
apktool: No resource identifier found for attribute 'compileSdkVersionCodename' in package 'android'
change your <menifest.../> in AndroidMenifest.xml header like this:
[php]<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.android.calendar" platformBuildVersionCode="23" platformBuildVersionName="6.0-2166767">[/php]
only leave xmlns, package, platformBuildVersionCode, platformBuildVer... 阅读全文
Reduce APK Size build by android studio
Reduce apk size build by android studio(build.gradle, AndroidManifest.xml):
1. build.gradle
[php]android {
compileSdkVersion 27
defaultConfig {
applicationId "reduce.apk.size"
minSdkVersion 8
targetSdkVersion 18
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
zipAl... 阅读全文
Duplicate files copied in APK lib/arm64-v8a/libGNaviData.so
Error:Execution failed for task ':youProject:transformNativeLibsWithMergeJniLibsForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK lib/arm64-v8a/libGNaviData.so
File1: [gradle cache dir]\.gradle\caches\modules-2\files-2.1\com.amap.api\3dmap\5.3.0\134242459debbdb0f08856d8036e40b38f8d772b\3dma... 阅读全文
VS2010编译使用Boost正则表达式
本文介绍使用boost库正则表达式来解决字符匹配、搜索、替换等应用。现在介绍一下VC2010中怎样配置与使用boost库正则表达式。
1、下载与安装boost库,下载地址:http://sourceforge.net/projects/boost/files/latest/download?source=files,将其解压到E:\boost目录。
2、编译动态库,本文只要支持正则表达式就可以,因此只需要编译E:\boost\libs\regex\build目录下的文件。这步比较关键。
具体操作:
[php]在“运行”里输入“cmd”... 阅读全文
彻底杀死nginx并重启
这个标题其实不准确,我想表达的意思是:在检测到Nginx、httpd内存占用或系统负载较大时,自动重启相应进程。
为什么要这么大费周章?
1、为了自动化处理,在无人值守时一样能监控到系统状态并作出处置;
2、我们都知道,Nginx、httpd进程在使用service nginx restart命令时常常会出现意外,出现杀不死同时新进程也无法启动,最终反而使进程僵死,导致所有用户无法访问网站。所以需要先使服务停止,再检测是否还有同名服务,有... 阅读全文
Awesome在IE8(Internet Explorer 8)不显示的解决办法
Font Awesome not appearing in Internet Explorer 8
up vote 8 down vote favorite
8
We have recently developed a website with a strong reliance on Font Awesome as part of it's design. We're using the standard implementation with before:content and their supplied CSS.
For some reason Font Awesome isn't displaying in IE8. I've spent quite a few hours troubleshooting and trying variou... 阅读全文
wpseo_get_suggest目标关键词补丁
WordPress插件 WordPress-seo插件的百度建议词补丁。原因是原函数获取的是谷歌关键词建议,而我们根本无法访问到谷歌,故替换为百度关键词建议。
修改目标文件 /admin/ajax.php,替换 wpseo_get_suggest函数内容如下:
[php]function wpseo_get_suggest() {
check_ajax_referer( 'wpseo-get-suggest' );
$t=microtime();
$ta=explode(' ',$t);
$t=$ta[1].substr($t, 2,3);
$term = urlencode( $_GET['term'] );
$result... wpseo_get_suggest, 建议关键词, 目标关键词阅读全文
jqxInput处理iOS汉字输入bug的解决办法
将jqxInput官方示例简化版本如下:
[php]<!DOCTYPE html>
<html lang="cn">
<head>
<meta content="application/xhtml+xml;charset=UTF-8" http-equiv="Content-Type" />
<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>
<meta name="msapplication-tap-highlight" content... iOS, jQuery, jqxInput阅读全文
iOS Safari用Firebug
在Safari中任意添加1个书签,然后使用编辑书签功能,将其名字改为Firebug或者你喜欢的名字,链接替换成以下内容:
[php]javascript:(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&&F.documentElement.namespaceURI;E=E?F[i+'NS'](E,'script'):F[i]('script');E[r]('id',b);E[r]('src',I+g+T);E[r](b,u);(F[e]('head')[0]||F[e]('body')[0]).appendChild(E);E=new%20Image;E[r]('src',I+... 阅读全文
Windows下PHP连接Oracle的设置
Windows平台下用PHP连接Oracle进行开发,开发环境的设置有几个关键点,如下:
一、php.ini设置
把php.ini中的extension=php_oci8.dll开启,前面的注释分号去掉,加载php_oci8模块。
二、Oracle客户端安装
下载Oracle客户端绿色版本,注意:无论开发环境是64位系统和32位系统均选择32位的,这是一个很关键的点。到http://www.oracle.com/technetwork/topics/winsoft-085727.html 要注册登录才能下载
下载basic-nt版即可: http:/... Oracle, PHP, php_oci8, Windows阅读全文
WordPress优化计划任务执行
WordPress计划任务依靠页面执行触发计划任务去执行,这样做会增加用户访问时的负载,拖慢访问速度,并且会有很多局限,解决办法如下:
1.禁用WP-Cron,方法:编辑wp-config.php,加入一下一行:
define('DISABLE_WP_CRON', true);
2.然后在你后台系统的crontab文件里,增加下面的内容:
*/15 * * * * YOUR_USER /usr/bin/wget -q --post-data '' http://YOUR_SITE/wp-cron.php?doing_wp_cron -O /dev/null
... Wordpress Cron, Wordpress计划任务阅读全文
Linksys WRT54G和WRT54GS各版本对照
转自 http://www.linksysinfo.org/index.php?threads/autopsy-linksys-wrt54g-and-wrt54gs-hardware-versions-under-the-knife.15698/
原文就不翻译了,看图识型号,哈哈!
So, the question has been asked a thousand times before - Which hardware version should I buy? Well, we are here to provide you with the knowledge to make that decision. Features added or lost between revisions will the one of the two p... Linksys, WRT54G, WRT54GS阅读全文
Error: Package: pkcs11-helper-1.08-1.el5.rf.x86_64 (rpmforge) Requires: libgnutls.so.13()
Error: Package: pkcs11-helper-1.08-1.el5.rf.x86_64 (rpmforge) Requires: libgnutls.so.13()错误解决方法
[php]wget ftp://rpmfind.net/linux/Mandriva/official/2008.0/x86_64/media/main/release/lib64gnutls13-2.0.0-2mdv2008.0.x86_64.rpm
rpm -Uvh lib64gnutls13-2.0.0-2mdv2008.0.x86_64.rpm[/php]
如果上述下载始终无法开始,请尝试将ftp://换为http://,如果还不行,尝试如下地址:
[php]wget http://195.220.108.108... 阅读全文
LNMP、LAMP、LANMP一键安装脚本(自用镜像)
因为常需要配置LANMP环境,之前下载了又好忘,再找时找半天找不到,所以把原作者这篇文章搬过来,当做自用镜像,嘿嘿嘿。
文章中的链接均保持原网站链接,以备需要时跳到原网站去查。
LNMP、LAMP、LANMP一键安装脚本(定期更新)
这个脚本是使用shell编写,为了快速在生产环境上部署LNMP/LAMP/LANMP(Linux、Nginx/Tengine、MySQL/MariaDB/Percona、PHP),适用于CentOS/Redhat 5+、Debain 6+和Ubuntu 12+
脚本特性:
持续不... 阅读全文