Just learned a new tip on git shallow clone. As you know, some repository are really really large, such as emacs and linux. Cloning is slow and unstable. And there is no way to pause and resume a git clone. So I use shallow clone to clone them. But what if I want to clone other branches? From here: http://stackoverflow.com/a/27393574/2148614 git remote set-branches origin '*'

Read More

Here is the subtitle: We meet in a week that could change the United Kingdom for ever. Indeed, it could end the United Kingdom as we know it. On Thursday, Scotland votes, of the future of our country is at stake. On Friday, people could be living in a different country with a different place in the world and the different future ahead of it. This is the decision that could break up our family of nations and rips Scotland from rest of the United Kingdom.

Read More

Most of us have learnt how to use PCLogo to draw some graphics. Logo is a dialect of Lisp in fact, so most of us used a Lisp dialect at a early time! For some people, it is earlier than C++. Cool.

Read More

I’m here to share some interesting links. I do not have much time writing the blog now. Recently I have been working on CodeFalling/MacGesture on Github. If you are interested in it, go and have a look. Here are the links to share: https://twitter.com/PoolpOrg/status/694593152670437376 https://github.com/wellle/targets.vim http://thecodelesscode.com/case/225 https://twitter.com/zhangyuze320602/status/706457155763712000 I have done reading the biography of Steve Jobs. Great book.

Read More

Android Studio 手工更新小记

迁移自本人在 CSDN 上的博客:https://blog.csdn.net/build7601/article/details/41776599 因为长时间不更新 Android Studio,回头一看,我的版本才 135.1339820,最新版本都 135.1626825 去了,我就萌生了更新的念头。。 首先,我尝试调用 update_studio.sh。。。。。但是!!404 Not Found!!看来版本跨度太大无法打补丁了呢。。 那只好看看 https://dl.google.com/android/studio/patches/updates.xml 这个里面了,找到我的版本号: <channel id="AI-0-beta" name="Android Studio updates" status="beta" url="http://tools.android.com/recent" feedback="https://code.google.com/p/android/issues/entry?template=Android+Studio+bug" majorVersion="0"> <build number="135.1623071" version="0.9.9"> <message> <![CDATA[ <html> A new Android Studio 0.9.9 is available in the beta channel.<br> This patch will allow you to update from 0.x to 1.x.<br> After updating, please check for updates again to install 1.0 RC.<p/> </html> ]]> </message> <button name="Download" url="http://developer.android.com/sdk/installing/studio.html" download="true"/> <button name="Release Notes" url="http://tools.

Read More

@微信 SDK 开发者,发现一个 BUG~

迁移自本人在 CSDN 上的博客:https://blog.csdn.net/build7601/article/details/39826065 经过测试,发现微信客户端登录 SDK 有一个 BUG。注:目前只在 iOS 上测试过,可以重现。 BUG 重现 1.做一个可以用微信登陆的软件,先安装到设备。 2.更改 project 的 Bundle Identifier,只更改大小写,重新安装到设备。P.S.实际情况是包名大小写修改过引发这个问题。 3.打开第二个安装的 APP,选择微信登陆,跳转到微信。 4.点击微信登陆,则会跳转到第一个 APP 中,而不会跳转到第二个 APP。 我的 BUG 分析 这可能是因为,微信 sdk 传到微信的是一个 bundle identifier+回调函数地址,回调时找到另一个 APP 再执行回调。 可能在某处进程的名称不分大小写,按照顺序找到了第一个去了。一旦两个 APP 版本不一致,可能执行到空的地址甚至发生不可预测的行为。 经过测试,发现同一样的版本的 APP 也发生了崩溃。

Read More

用数学方法 + 数学软件去做一个物理题~

迁移自本人在 CSDN 上的博客:https://blog.csdn.net/build7601/article/details/39433177 经过测试,发现微信客户端登录 SDK 有一个 BUG。注:目前只在 iOS 上测试过,可以重现。 原题: 跳伞运动员在下落过程中,假定伞所受空气阻力大小跟下落速度的平方成正比,即 F= kv2,比例系数 k=20N·s2/m2,跳伞运动员与伞的总质量为 72 kg,起跳高度足够高,则:(g 取 10 m/s2) 跳伞运动员在空中做什么运动?收尾速度多大? 当速度达到 4 m/s时,下落加速度是多大? 做法: 我拿出我的数学大杀器,直接受力分析 + 牛顿第二定律得出 a=g-k/mvv. 我一看,这转化成数学不就是 f’’(t)=10-5/18*f’(t)^2, f(0)=0, f’(0)=0,喜闻乐见的微分方程啊哈哈! 直接丢到各种数学软件,我用了Wolfram|Alpha 瞬间得到答案: f(t) = -6/5 (5 t-3 log(e^(10 t/3)+1)+log(8)) yeah~ 看看上面那个网址里面下面的函数图像,表示第一题可以秒杀~ 好的,至于第二题,因为速度为 4,则可以写出:f’(t)=4 的方程,输入 d(-6/5 (5 t-3 log(e^(10 t/3)+1)+log(8)))/dt=4 解出 t = (3 log(5))/10 带入 f’’(t),输入 diff(diff(-6/5 (5 t-3 log(e^(10 t/3)+1)+log(8)),t),t),t=(3 log(5))/10, 得 a=5.5556. 大功造成~

Read More

写了一个程序,分析各个源文件之间的 include 关系。

迁移自本人在 CSDN 上的博客:https://blog.csdn.net/build7601/article/details/37343993 最左边是 expat,上面 zlib,左下角 mxml,中间最恶心的是 lua,右边的是 jpeg。 讲讲大概思路: 1.扫描源文件,这里判断最简单的#include,然后建立关系。 2.把这些作为一个个 body 加到 box2d 的世界里,让物理解决这一切!! 3.然后把有 include 关系的用一个 distancejoint 连接起来~你会发现他们就能保持一定距离了。但是!没有被连接的全都聚在一起,怎么办! 4.把距离近的,不和自己相连的(来个 dfs)给个反方向的力! 5.好吧,这就是最终结果,有什么更好的方法?希望大家交流。 6.我不想开源,毕竟这还只是个半成品。。。。。做好了自然会开源的 7.像那个恶心的 lua 怎么解开?文件之间的依赖太多了,成环了。 8.使用 java+libgdx+box2d 写成,也就是说 android 也支持。 9.没啥了。。。。

Read More

IntelliJ IDEA 手动更新方法

迁移自本人在 CSDN 上的博客:https://blog.csdn.net/build7601/article/details/27704683 经常,IntelliJ IDEA 更新时,会发现这个: download-cf.jetbrains.com/idea/IU-135.690-135.909-patch-win.jar 下载不了。不然只能去下载完全版重新安装一次 解决方案如下: 使用代理下载上面那个文件(视版本而定), 拷贝到 IntelliJ IDEA 安装目录, 敲击 java -classpath IU-135.690-135.909-patch-win.jar com.intellij.updater.Runner install . 注意,最后那个点表示更新到当前目录。 会输出这个:Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/log4j/Layo ut at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.getMethod0(Unknown Source) at java.lang.Class.getMethod(Unknown Source) at sun.launcher.LauncherHelper.validateMainClass(Unknown Source) at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.

Read More

Linux on Android 简单教程

迁移自本人在 CSDN 上的博客:https://blog.csdn.net/build7601/article/details/24544879 介绍: Linux on Android,顾名思义,就是让你能在 Android 上跑 linux。。。。 步骤: 1.下载所需的文件: 项目主页为:tinyurl.com cn3lxgz 在这里举 Ubuntu 13.10 为例,下载 tinyurl.com lp7fqw4 Core 只有最基本的东西,没界面。。但是我的 sd 卡空间过小,只好用这个, Small 就有界面了,Large 还有很多东东,具体看 tinyurl.com m5tdmkj 下面的 Readme 然后下载 Complete Linux Installer,这是用来启动 linux 的: tinyurl.com mzsbud8 还要下载 VNCViewer(浏览 linux 桌面),终端模拟器 2.做好准备工作: 解压下载好的 zip,把里面的.img 解压出来。 安装好 Complete Linux Installer VNCViewer 终端模拟器到 android 上,把解压的.img 文件传到 sd 卡上,比如: adb push ubuntu-13.10.CORE.ext2.img 你的 sd 卡路径 安装完是这个样子的: 3.开始启动! 打开 Complete Linux Installer, 选择启动系统,点击右上角 Settings,选择添加:

Read More