分類
方法

从命令行启动安卓应用程序

首先要有root权限,没有的就不用往下看了。从命令行启动程序你需要两个东西,命令行和命令。命令行推荐Android Terminal Emulator。命令就是:

su
am start -n com.ea.game.simpsons4_row/com.ea.simpsons.SimpsonsSplashScreen

关于-n后面参数的获取,我是通过ADW桌面的备份文件找到的,位于/sdcard/ADW_Backups/adw_……/APP_CATALOG_0.xml中。

如果不想每次都输入一条那么长的am命令,可以将这条命令保存成文本,然后放到/system/xbin/中。例如把文本命名为z,这样只要在terminal输入z执行就好了。

本文更新於 2017/10/16。

分類
程序

qpython3

qpython3是一个能在安卓手机上执行python3脚本的软件,很好用。通过SL4A(qpython3已内置),可以方便的编写出实用的安卓脚本程序。

https://github.com/pggdt/loc/tree/master/qpython3-cn这个是我用python3写的一个获取并保存地理位置的小程序。用到的有SL4A中location部分,webview部分,python3中的urllib等,最后用了下bootstrap美化。

分類
软件

图层蒙版

GIMP中使用图层蒙版只需在图层上右击,添加图层蒙版(Add Layer Mask)即可。然后根据需要选择透明部分,画笔的透明度可以改变蒙版的透明度。PS中蒙版也是这样,而且PS的图层蒙版支持多个,GIMP中似乎只能应用图层蒙版后再添加蒙版。

分類
其它

Tenacy开心直通车

鑑於這篇 2014 年的文章居然還有一點點擊率,我就簡單更新一下,我已經很久沒用 Tenacy 的服務了, vpnGate 也早就涼了。從年初開始,我竟然介紹開始使用加速器,如果大家有需求可以一試,我覺得速度還可以,查個資料是夠用的。安全性就不做保證了。附:帶 aff 的鏈接不帶 ref 的鏈接。購買的地方在底部的「網絡加速」,我買的是 45 CNY /季的。——200814


http://www.tenacy-free.com/public被封,新网址是http://tenacy.ninja/,新网址是http://tenacy.link/,新网址是http://tenacy.co.uk/

【7.20通告】Tenacy 對最近服務質素受到影響表示歉意。目前,我們正應對各種狀況,包括與中國政府之間的溝通。我們不能接受任何借用 Tenacy 的服務,散佈涉及色情、軍火、賭博、毒品、謠言信息,或攻擊他人伺服器、非法入侵、侵犯版權等犯罪行為。我們正建立預防機制並收集相關資料,不排除我們會進一步與各國政府合作,提供涉及犯罪行為的證據。

在Tenacy找到解决办法前,不如试试vpnGate项目,相当不错!下面是主站和镜像:

  • http://www.vpngate.net/
  • mirror1
  • mirror2
  • mirror3
  • mirror4
  • mirror5
  • vpngate用起来稍显麻烦,安卓上不管是原生L2TP方式的VPN还是OpenVPN效果都挺好。但是windows下即使用来官方的客户端也不行,可能是联通的小区网络实在是太复杂啦。

    本文更新於 2020/08/14。

分類
其它

奇怪的英语

captcha
全自动区分计算机和人类的图灵测试(英语:Completely Automated Public Turing test to tell Computers and Humans Apart)俗称验证码。
chaos
/ˈkeɪ.ɒs/ Complete disorder and confusion.混沌。
WYSIWYG
What You See Is What You Get.所见即所得。In computing, a WYSIWYG editor is a system in which content (text and graphics) onscreen during editing appears in a form closely corresponding to its appearance when printed or displayed as a finished product, which might be a printed document, web page, or slide presentation.
分類
程序

把照片重命名为拍摄时间

主要问题就是获取照片的EXIF信息中的拍摄时间。Java的话推荐Drew Noakes的metadata-extractor。python3用Pillow就行了。另外还有一个好用的python3库可以获取exif信息,EXIF.py Python3 port,短小精悍可以用在qpython3上。

实现了下java,成品和源码都在https://github.com/pggdt/rename-JPG-to-Date。先基于后缀名判断下是否是jpg文件,然后有exif信息的重命名为“年年月月日日-时时分分秒秒”格式,如果同一秒还有照片就在文件名后加1。如果勾选了重命名为最后修改时间,则会继续重命名没有exif信息的照片,将它们的名字改为图片的最后修改日期。

分類
程序

Eclipse用法

我是在ubuntu12.04上用的adt-bundle,安装好Sun Java后解压就可以使用了。关于ubuntu12.04上安装Sun Java,参考Ubuntu安装SunJava

为Eclipse安装WindowBuilder

In order to install WindowBuilder on Eclipse 4.3 (Kepler) Modeling let’s click on Help -> Install New Software… and choose (into “Work with:” field ) the main Kepler Update Site (http://download.eclipse.org/releases/kepler), expand the Category “General Purpose Tools” (make sure that “Group items by Category” flag be selected) and choose the following items:

  • SWT Designer
  • SWT Designer Core
  • WindowBuilder Core
  • WindowBuilder Core UI
  • WindowBuilder GroupLayout Support
  • WindowBuilder Java Core

Then press the Next button and follow the wizard until it asks to restart Eclipse. Let’s accept pressing Restart Now button. If you download instead the package Eclipse 4.3 (Kepler) for RCP and RAP Developers WindowBuilder is included.