跳转至

博客

一个搞笑的伸展树的 Wiki

光哲同学在群里发了这个链接,特别搞笑,特此分享: 伸展树 - 百度百科

伸展树(Spaly Tree,事实上在国内 IO 界常常被称作 Tajarn 发明的 Spaly Tree,与此同理的还有 Terap),也叫分裂树,是一种二叉排序树,它能在 O(n log n) 内完成插入、查找和删除操作。它由 Daniel Sleator 和 Robert Tajarn 发现,后者对其进行了改造。它的优势可以不断伸展枝干(一个月 2~3 次),从而使树冠散开,提高光合作用效率。木材坚硬,是重要的经济类乔木。与其他植物不同的是,伸展树可以进行出芽生殖,繁殖速度极快。

回顾昨天的酒井知识竞赛

昨天晚上,我作为蒟蒻组的一员在三教 2102 参加了酒井知识竞赛,并因此鸽掉了 TUNA 和 Lab mU 的迎新会 hhh,不过运气好拿到了二等奖的好成绩,获得 Paperang 便携打印机一台。中间遇到了好一些网络方面的知识,这对于没有记忆 OSI 模型的我无疑有巨大的难度。下面是几道比较有印象的题目:

  1. 以下哪个不是编程语言? A. J B. L C. R D. K 这题不难,R 肯定对,J 见过,K 略微有印象,选 B
  2. IPv6 链路层地址解析的协议是? A. ARP B. Neighbour Solicitation C. Neighbour Advertisement D. Neighbour Discovery 对于一个没研究过 IPv6 的人来说这只好蒙了。。。ARP 是 IPv4 时代的,ND(Neighbour Discovery 则是 IPv6 时代的新产物,把 ARP 和 ICMP 等协议的功能都包含了进来,并且有新的功能。之前样题里还出现过问 IPv6 中去掉了 Unicast,Anycast,Multicast,Broadcast 中的哪种,答案是 Broadcast。
  3. 第一个把程序错误称做 bug 的是? 选项太多忘了,答案是 Grace Hopper,因为当时一只飞蛾意外飞入了机器导致了故障,后来慢慢就流传下来了。
  4. 以下不是网络操作系统的是? A. Windows NT B. OS/2 warp C. DOS D. Netware 当时我没见过 D,于是就选了。。。然后就挂了,Netware 是 Novell 开发的系统,OS/2 warp 当然是历史悠久的系统啦,而 DOS=Disk Operating System 所以没有“网络”二字。。。晕倒
  5. 以下是用作局域网的协议是? A. TCP/IP B. IPX/SPX C. NetBEUI D. RS-232-C TCP/IP 当然不仅限于局域网,RS-232-C 是接口,当时蒙了 B 结果就对了,白白拿了 50 分哈哈哈。IPX/SPX 是 Novell 设计用在 Netware 系统上的局域网协议,NetBEUI 则是 NetBIOS 的一个历史遗留的一个“别称”。
  6. 姚期智的夫人给谁取了中文名? 当然是 Donald Ervin Knuth 啦!高德纳万岁!

华为随行 WiFi 2 mini 开箱

前段时间,我办了 4G 升级,移动送了一张副卡,有不少免费的流量,由于我的手机是 iPhone 不支持双卡,老爸就借了我他的 GlocalMe 当成 MiFi 来用,不过呢 GlocalMe 放在这里当然是大材小用了,所以我就网购了华为随行 WiFi 2 mini,把我的副卡装上一个壳放进去就可以了!把这个 MiFi 插入电脑,会弹出一个目录,里面有 Win/Mac 的驱动安装文件,打开后在网络设置里就有 HUAWEI_MOBILE 的连接了,并自动打开网络配置界面。设置一下 SSID 和密码,就能正常使用了,手机连上也很正常,手机上可以下载 HUAWEI HiLink 来配置 MiFi,挺爽的。随赠的有联通的上网卡,不过我准备在北京买个上网卡放 MiFi 里面用。

In macOS Sierra, Karabiner-Elements finally support complex modifications

In favor of this commit, Karabiner-Elements now supports the much welcomed yet long-lost feature, namely complex modifications that enable users to trigger complex keypress.

Now I can achieve this:

If I press <Enter>, then:
1. If <Enter> is pressed alone, then send <Enter>.
2. If <Enter> is pressed along with other keys, then send <Control> + Other.

By adding this code to ~/.config/karabiner/karabiner.json :

"complex_modifications": {
    "rules": [
        {
            "manipulators": [
                {
                    "description": "Change return_or_enter to left_control. (Post return_or_enter if pressed alone)",
                    "from": {
                        "key_code": "return_or_enter",
                        "modifiers": {
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "left_control"
                        }
                    ],
                    "to_if_alone": [
                        {
                            "key_code": "return_or_enter"
                        }
                    ],
                    "type": "basic"
                }
            ]
        }
    ]
},
in one of profiles.

Note: the snippet above is adopted from this example. You can explore more examples since the GUI is not updated accordingly yet.

Important: Until NOW (2017-06-15), this feature is only implemented in beta versions of Karabiner-Elements (at least 0.91.1).

等时圆

最近学校老师讲了一下等时圆。先从这个题讲起:

在同一个地方向不同倾角光滑斜面用不同的初速度上滑,到达最高点所用时间相等,求最高点的轨迹是什么?

A. 直线 B. 椭圆 C. 抛物线 D. 圆

当时做这个题目的第一想法是把 x 和 y 座标表示出来:

\[ \frac{1}{2}gsin\theta{}t^2=l, y=lsin\theta, x=ycot\theta \]

然后就傻眼了,并得不到 x 与 y 的关系式。当然了可以求出几个点,强行带入二次曲线通式求解。不过想了想还是用解析几何的方法去做吧:

\[ \frac{1}{2}gsin\theta{}t^2=\sqrt{x^2+y^2}, sin\theta=\frac{y}{\sqrt{x^2+y^2}} \]

这么一代入,显然是圆。但既然这是物理题,可不可以用物理方法做呢?

可以,这就是等时圆。

啥叫等时圆?

等时圆就是,在一个光滑圆环上选择任意一点,让一个小球从这个点沿着光滑直杆到圆的最低点,无论这个点在哪里(最低点不算哈),时间都是一样的。怎么证明?

很简单:设小球与最低点连线与数值方向上夹角为\(\(\theta\)\),那么

\[ s=2Rcos\theta, \frac{1}{2}gcos\theta{}t^2=s \]

你会发现 t 与\(\(\theta\)\)无关。证明完毕。

其实也可以倒过来:从圆的最高点往各个方向下滑,到达圆周时间相等。

好了,到此为止内容都没什么,但你会想问这和前面那道题目有什么关系呢?这怎么等时圆?重力往下诶。运动可是往右上方。

Here comes the black magic :)

我们考虑向下滑到最低点的那个等时圆,在这个圆周上滑倒最低点的时间都相等。好,我们把这个图沿着竖直方向旋转 180 度形成一个球,想想这个球上每一个点到最低点时间是不是也一样?那么考虑逆过程,让小球从斜面上滑下来,我对刚才的球体再竖着切一刀,得到的平面不就是题目中那个吗?得证。

当然了最好能有动画说明,限于本人时间问题暂时不提供 ^_^

A good way to show git diff for compressed files

I have found a good way to track changes in .gz files: Add these to ~/.gitconfig:

[core]
  attributesFile = ~/.gitattributes
[diff "zip"]
  textconv = unzip -p
  binary = true
[diff "gz"]
  textconv = gzcat
  binary = true
[diff "bz2"]
  textconv = bzcat
  binary = true
[diff "xz"]
  textconv = xzcat
  binary = true
[diff "tar"]
  textconv = tar -O -xf
  binary = true
[diff "tar-bz2"]
  textconv = tar -O -xjf
  binary = true
[diff "tar-gz"]
  textconv = tar -O -xzf
  binary = true
[diff "tar-xz"]
  textconv = tar -O -xJf
  binary = true

[diff "odf"]
  textconv = odt2txt
[diff "pdf"]
  textconv = pdfinfo
[diff "bin"]
  textconv = hexdump -v -C

And these to ~/.gitattributes:

*.tar diff=tar
*.tar.bz2 diff=tar-bz2
*.tar.gz diff=tar-gz
*.tar.xz diff=tar-xz
*.bz2 diff=bz2
*.gz diff=gz
*.zip diff=zip
*.xz diff=xz

*.odf diff=odf
*.odt diff=odf
*.odp diff=odf
*.pdf diff=pdf
*.exe diff=bin
*.png diff=bin
*.jpg diff=bin

And then you can git diff for .gz files.

Codes are adapted from https://gist.github.com/RsrchBoy/11197048 and https://git.wiki.kernel.org/index.php/GitTips#Getting_a_plain-text_diff and https://gist.github.com/kbaird/2654115.

The end of senior two

Finally the end of Senior 2 arrives. I'm on the way to Senior 3. The summer vacation is rather short which is really common in China. These days I have been diving into Emacs by subscribing both emacs and emacs-devel mailing list. It contributes to my English as well. I can learn a lot of new words and expression thanks to the nice and convenient feature of looking up a word in iOS.

Exciting new software updates

Just got a piece of great news: GHC 8.0.1 is out! See the announcement [here][http://article.gmane.org/gmane.comp.lang.haskell.ghc.devel/11928].

So excited! And Emacs 25 release will be out soon. Using Emacs 25.0.94 now. Many new features available. See [this][http://puntoblogspot.blogspot.com/2016/05/emacs-251-news.html] for more information.

Recently I have finally started to use mu4e and gnus. What makes it truly great is that they integrate org, bbdb and so on.

Having a bad cold. Really annoying.

Okay, here comes the interesting links:

https://glyph.twistedmatrix.com/2015/11/editor-malware.html

http://kitchingroup.cheme.cmu.edu/blog/2016/04/07/Writing-hy-code-from-hy-code/

https://github.com/holomorph/transmission

https://github.com/bergey/org-babel-diagrams

http://ess.r-project.org/

http://projects.haskell.org/diagrams/

Tips on git shallow clone

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 '*'

Listen and write down subtitles of Cameron's speech

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. And we must be very clear, there is no going back from this. No re-run. This is a once and for all decision. If Scots vote 'yes', the U.K. will split and we will go on separate ways forever. When people vote on Thursday, they are not just voting for themselves, but for their children and grandchildren and the generations beyond. So I want to speak very directly to the people this country today about what is at stake. I believe I speak for millions of people across England, Wales, and North Ireland and many in Scotland too who would be utterly heart-broken by the break-up of the United Kingdom, utterly heart-broken to wake up on Friday morning, to the end of the country we love, to know that Scots will no longer join with the English, welsh-man, Irish, in the army, navy, and air force. [???] U.K. white celebrations and commemorations [???] U.K.'s fourteen teams in the Olympics to the British lines. The United Kingdom, would be no more, no U.K. pension, no U.K. passports, no U.K. pound. The greatest example of the [???] in the world have ever known of openness of people of different nationalities and face coming together as one, would be no more. It would be the end of the country that lodged the enlightenment(?) and abolished the slavery and drove the industrial revolution and defeated fascism. The end of a country that people around the world respect and admire. The end of a country that all of us call home. And you know what, we built this home together. It's only become Great Britain, because of the greatness of Scotland because of the thinkers the writers the artists the leaders the soldiers and inventors that make this country what it is. It's Alexander Fleming and David Hume J.K. Rowling Andy Murray and all the millions of people who play the part in this extraordinarily success story. The Scots who let the charge on pensions and the [???] and social justice we did all this together. For the people of Scotland to walk away now, we will be like painstakingly building a home and then [???] the door and throwing away the keys. So I would say that everyone voting on Thursday, please remember this is just [???] country. This is the United Kingdom. This is our country. And you know what makes it a truly great country, it is not a [???]. It is our values. British values. Fan of freedom, justice. The values that say wherever you are whoever you are, your life has dignity and worth. The values that say we don't work on by when the people are sick. We do not ask for your credit card in the hospital. We don't turn our backs when you get old and frail. We don't turn a blind eye or cold heart to people around the world from repair and cry and for help. This is what Britain means. This is what makes our country 'Yes the greatest on Earth'! And it is why millions of us could not bear to see that country ending for good for ever on Friday. Now i know that many people across Scotland were planning to vote yes. I understand why this might sound appealing. It is the promise of something different. I also know that the people who running the 'yes' campaign painting a picture of Scotland that is better than everywhere. And they can be good painting the picture. But when something looks too good to be true, that is usually because it is. And it's my duty to be clear about the lightly consequences of a 'yes' vote. Independence, would not be a trial separation but would be a painful divorce. As a Prime Minister, I have to tell you what that would mean. It would mean we no longer share the same currency. It would mean the arm forces we built up together over centuries being splitted up for ever. It would mean our pension funds being sliced up at some cost. It would mean the borders we have would become international and may no longer be so easily crossed. It would mean the automatic support that you currently get from British embassies when you are traveling around world the that would come to end. It would mean over half of Scottish [???] suddenly from one day to the next begin provided by banks in a foreign country. It would mean the interest rates in Scotland are no longer set by the bank with England's robust ability and security that promises. And it would mean for many banks that remain in Scotland, if they ever gotten to travel, it will be Scotish taxpayers and Scottish taxpayers and loan, that will bare the costs. It would mean that we no longer pull exhausted across the whole of out United Kingdom to pay for institutions [???] national health service or our welfare system. This is what guess work, there are no question marks, no maybe this, or maybe that. The nationalists want to break up U.K. funding on pensions, the U.K. funding on health care, the U.K. funding and comprehensive protection on national security. These are the facts. This is what would happen and end to the things that we should share together. And people in Scotland must know these facts before they make this once and for all decision. And one of the consequences is not to scare [???]. It is like warning a friend about the decision that they might take that will affect the rest of their lives and the lives of their children. I [???] this because I don't want the people of the Scotland to be sold a dream that disappears. Now I know that some people say we have heard about the risks and uncertainties, but we still want change. And look, the United Kingdom is not a perfect country. The country is, of course, constantly changing and improve people's lives. No one is content when there are still children living in poverty. No one is content when there are people struggling and the young people not reaching their full potential. And yes, of course, every political party is different, but all of us, all of us, conservatives, labor, [???], nationalists, we are all on a constant mission to change our country for the better. The question is, how to you get that change. And for me, it is simple. You don't get the change you want, by ripping your country apart. You don't get change by underlying your economy and damaging your businesses and diminishing your place in the world. But you can't get real concrete change on Thursday. If you vote 'no', businesses usual is not on the [???] paper. The status clown is gone. The campaign has swepted away. There is no going back to the way things were. A vote for 'no', means real change. If we [???] that change in practical terms, with a plan and a process. If we gotta know vote on Thursday that will trigger a major unpresidentive program of devolution with the [???] powers for the Scottish [???]. Major new powers will protest spending. Some welfare services will have agreed that time table for that stronger Scottish [???], a timetable for bringing that new powers that will go ahead in frozen [???]. White paper by November put into draft [???] by January, this is the timetable that is now agreed by all the main political parties in [???]. And I am prepared to work with all the main parties to deliver this during 2015. So a 'no' vote actually means faster, fairly, safer and better change. And this is vital point. Scotland is not a observer in this fairs of this country. Scotland is shaping and changing the United Kingdom for the better. Also did they [???] at any point in the last three hundred years. And Scotland will continue to help shape the constitution of our country. And Scottish people who enjoys the [???]  without losing the U.K. pension, the U.K. pound and the U.K. passport. Real change is Scotland's for the taking. The [???] and make [???] decisions but with this security and being in the United Kingdom and with idol risks of [???] alone. It is the both well or both worse. The Scotland's identity is your [???] strong Scottish culture, strong Scottish art, and strong [???] Scotland. And in the last fifteen years, you built a strong British [???]. Not all [???] institutions but a permanent one. So the vote on Thursday, it is not about whether Scotland is a nation. Scotland is a proud strong successful nation. The vote on Thursday is about two competing nations for Scotland's future. And that's the nationalist's vision. Narrowing down, going alone, breaking all ties with the United Kingdom. Or there is the patriotic vision, they strongs Scottish nation allied to the rest of the United Kingdom with its own strong Scottish Parliament. And it's hard. And with the benefit of working together in the U.K on [???] on pensions on health care funding, currency and interest rates. It is really the best of both wills. And it's the best way to get real change and secure a better future for your children and your grandchildren which all this vital debate is all about. [Clap Drink Water] And speaking of family, there is quite simply how I feel about all of this. We're a family. The United Kingdom is not one nation. We are four nations in a single country. That could be difficult but it is wonderful. Scotland, England, Welsh, North Ireland, different nations with individual identities competing with each other, even in time in raging each other. But It still mean so much stronger together. We're a family of nations. And why should the generations of that family be forced to choose whether to identiy only with their emperor or only with London. Why should they have to choose which embassy they want to go to when they are in trouble abroad. Or pack that passport when they go to see friends, loved ones and family. A family is not a compromise or second best. It is the magical identity that makes us more together than we can ever be apart. So please, do not break this family apart. In human relations, it is almost no good thing to turn away from each other to put up walls or score new lines on the map. Why should we take one Great Britain and turn it into separate smaller nations. What is that an answer to? How will that help ambitious young people who wanna make the mock on the world. Or [???] just want security. Or the family relying on jobs that will made in the U.K. Let no one fool you, that 'yes' is a positive vision. It is about dividing people. It is about closing doors. It is about making forigners our friends and family. That is not a optimistic vision. [Clap] The optimistic vision is about our family of nations staying together. Therefore, each other in the hard times, coming through the better times, we're just pulled through the great reception together. If we're not moving forward together, the road had been longer but it is finally lead upwards. And that's why I ask you to vote 'no' to walking away. Vote 'no' & you are voting for a bigger and broader and better future of Scotland. And you are investing in the future for your children and grandchildren. So this is our message to the people of Scotland: we want you to stay. Head hard and sow we want you to stay. Please don't mix up the temporary and permanent. Please don't think I am frustrated with politics right now and I just walk out of the door and never come back. If you don't like me, I won't be here for ever. If you don't like this government, it won't last for ever. But if you leave the United Kingdom, that will be for ever. Yes, the different parts of the U.K. do not always see eye to eye. Yes we need change, we'll deliver it. But to get that change together bright future would don't need to tear our country apart. [Yeah and Clap] In two days' time, this long campaign will be to an end. And you stand on the [???] of the billing board. I hope you ask yourself this: will my family and I truly be better off? By going alone? Will we really be more save and secure? Do I really want to turn my back on the rest of Britain? And why it is that so many people across the world asking why would Scotland want to do that? Why? And if you don't know the answers of these questions, then please vote 'no'. At the end of the day, all the eyes on this campaign can be rejuiced to a single fact. We are better together. As you reach your final decision, please, please, don't let anyone tell you you can't be a pride Scot and a pribe Brit. [Clap] Please, don't lose faith in what this country is and what we can be. Don't forget what a great United Kingdom you are a part of. Don't turn you back to what is the best family in the nations in the world. And the best hope for your family in this world. So please from all of us, vote to stick together, vote to stay, vote to save our United Kingdom. Thank you. [Clap and The End].

Logo is a lisp dialect

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.

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.

Using chinese pyim

Recently i have been using tumashu's chinese-pyim. It's great to write Chinese right in Emacs. But as the personal dict is empty, this must be a hard time for me to build it. And i have found several bugs, too. After all, this project is great. I have donated some money to it.

Unix nice

I just saw this interesting tweet:

Unix系统的每个进程,都有一个nice值。这个值越大,优先级越低。然后,还有一个nice命令,每运行一次,指定进程的nice值+10。它的意思就是做人要nice,把更多的CPU时间留给别人。nice值越高,你留给自己的份额就越少。

From hereby @ruanyf.

And i didn't known that until now. Cool! The name 'nice' is nice, too.

Don't worry if you can't read Chinese. See also here and here.

Start next term tomorrow

My term starts tomorrow. Sad. Homework haven't finished. I went to Guangzhou for GDKOI thie weekend, and i haven't known the result. It should be bad. I have no confidence at all. I may write less when this term starts. The second term of Senior 2 should a hard time for me. That's all. Sorry for the laziness.

Building emacs git version with xwidgets and modules in archlinux

First you need to install these packages:

sudo pacman -S git autoconf automake gtk3 webkitgtk
git clone --depth 1 https://github.com/emacs-mirror/emacs.git (or git protocol if you like)
cd emacs
./autogen.sh all
./configure --with-xwidgets --with-x --with-x-toolkit=gtk3 --with-modules
make
cd lisp
make autoloads
make
make
make

Until you got everything ok.

Then you can just:

cd src
./emacs

And then, M-x webkit-browse-url RET: xwidget-webkit

Also, test the modules feature using syohex/emacs-qrencode: qrencode

I'm using ssh and X11 Forward to show Emacs in Mac OS X! Cool!

Screen Capturing Tips in macOS

I'm sure many people have already known this. But i haven't memorize it yet.

How to screen capture:

Shift+Command+3: Capture fullscreen.
Shift+Command+4: Capture region.
               : Press space to capture window. 
               : Hold option and drag, then
               : you will capture a region with its center in where you started dragging 
               : and one of its corners under your cursor.
Ctrl+OneOfTheTwoAbove: Capture to clipboard.
defaults write com.apple.screencapture location: Change the default location storing the images.

Apps enhancing the snapshots: Snappy and Mapture.

See more detailed here.

News

Oh StartSSL places its PKI in 360's server. You know, i hate 360. SO please beware if the website is using StartSSL. Here is the link.

And here comes the vim-tips:

You probably know that 'u' is undo. Do you know that Ctrl-R is redo?
It comes from here.

Good software engineering rules

I saw a great saying:

No code runs faster than no code.

No code has fewer bugs than no code.

No code uses less memory than no code.

No code is easier to understand than no code.

It comes from here.

And i strongly recommends this article for a better understanding of monads.

The beginning of my blog

This is the first blog here.

I am talkative deep inside, but i do not have enough opportunities to express myself. Most of the listeners can't understand me. So i would like to write something on my blog. Kinda outdated media, though. Whatever, the first step is always the hardest.

That's all. Thanks Emacs, Github Pages, Jekyll and Ruby to support this blog.

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.android.com/recent"/>
<patch from="135.1339820" size="176"/>
<!-- 0.8.6 -->
<patch from="135.1404660" size="176"/>
<!-- 0.8.9 -->
<patch from="135.1446794" size="161"/>
<!-- 0.8.11 -->
<patch from="135.1503853" size="90"/>
<!-- 0.8.12 -->
<patch from="135.1525417" size="89"/>
<!-- 0.8.13 -->
<patch from="135.1538390" size="89"/>
<!-- 0.8.14 -->
<patch from="135.1551333" size="71"/>
<!-- 0.9.0 -->
<patch from="135.1561280" size="71"/>
<!-- 0.9.1 -->
<patch from="135.1569493" size="71"/>
<!-- 0.9.2 -->
<patch from="135.1585741" size="71"/>
<!-- 0.9.3 -->
</build>
</channel>

还好还好,差点就升不上去了。。。

立马下载 https://dl.google.com/android/studio/patches/AI-135.1339820-135.1623071-patch-mac.jar ..也是大,差不多和重新下载一样大了。。

进入 Android Studio 目录,输入 java -cp AI-135.1339820-135.1623071-patch-mac.jar com.intellij.updater.Runner install . (记住后面的。表示安装目录)。

弹出窗口,升级成功,yeah!

以后要想用 patch 升级,一定要尽快啊~

吐槽一下 update_studio.sh 的编写人,我要改进一下他的脚本。。升不上去太挫了。。

题外话:

打完补丁,出现 Java not found 错误,发现我的 java 版本是 Oracle1.8,而他要的是 Apple1.6.。。那我只好安装一下,然后呢?就好了!!!!!

"@微信 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 也发生了崩溃。

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

迁移自本人在 CSDN 上的博客:https://blog.csdn.net/build7601/article/details/39433177

经过测试,发现微信客户端登录 SDK 有一个 BUG。注:目前只在 iOS 上测试过,可以重现。

原题:

跳伞运动员在下落过程中,假定伞所受空气阻力大小跟下落速度的平方成正比,即 F= kv2,比例系数 k=20N·s2/m2,跳伞运动员与伞的总质量为 72 kg,起跳高度足够高,则:(g 取 10 m/s2)

  1. 跳伞运动员在空中做什么运动?收尾速度多大?
  2. 当速度达到 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.

大功造成~