These days I find my disks almost full, and want to find some tools to scan my disks and find out the large files that occupy the space. After some simple searches, some free software are found. However, it seems that they are not open source, although some of them are free (of prices). So I make some deeper searches. Finally, I find out two analyzers are provided by the open source community:…
How to package and encrypt files or folders easily using symmetry password in unix way? tar -> gzip -> gpg to rescue. Here is my quick note. Every reader should use the command at the own risk. No guarantee is given that the generated files are uncrackable or crackable using the command below. Suggestion: always choose a strong password. The code is released under GPL. See these for references:…
This is the quick note before and after installing Windows 10 pro. installing Windows: download: https://www.microsoft.com/software-download/Windows10 remember to add this file \sources\ei.cfg so that we can select installing home or pro during installation: [Channel] Retail Windows features search “Turn Windows features on of off” enable Hyper-V and Windows Subsystem For Linux Chrome: offline…
A few days ago, I wanted to transfer photos from my iPhone to my computer. But it was very annoying that after copying for a while, the process stopped with some errors occured. After some searching, I found the reason: iPhone automatically transfer photos to JPEG format but the process was not stable. Here is the fix: Settings App -> Photos -> TRANSFER TO MAC OR PC -> choose "Keep Originals"…
In Windows 10 Anniversary Update and later Creators Update, if we press “shift” key and right click on desktop, drive, folder, folder blackground, we could see the menu “Open PowerShell window here”. It’s convenient for development. But how to reveal the menu? After searching on the Internet for a while, I found the clear solution on TenForums and decided to note it down here. In short: “Win + R”,…
字体发布 继 2014 年 Adobe 发布 思源黑体 之后,现在 2017 年 Adobe 发布了 思源宋体 !两者都开源!不要钱!走过路过不要错过!这是一种什么精神?!一种国际主义精神! Noto Sans CJK 和 Noto Serif CJK 又是什么鬼? Noto 是 Google 贴牌的字体族,其中的中日韩字体部分,由 Google 和 Adobe 等共同开发。所以,两种字体的中日韩部分是一样的,一字两表。 那么问题来了,使用哪个? 我也受到这个问题困扰很久。没有特殊情况下,应该是 安装其中一种就够了 。 推荐 如果没有意外,以后的 Android 的 CJK 字体必然自带 Noto CJK 的!而且,现在的 Ubuntu 已经全面拥抱 Noto Sans CJK 了。所以出于实用主义缘故,使用 Noto Sans CJK 和 Noto Serif CJK…
tl;dr This post shows how to use Electron as the GUI component of Python applications. (Updated version of one of my previous posts.) The frontend and backend communicate with each other using zerorpc . The complete code is on GitHub repo . important notice This post and README.md on GitHub repo should be the same. If there are inconsistencies, the README.md on the GitHub repo is more accurate.…
topological sorting can be solved using DFS and BFS in asymptotical time complexity $O(V + E)$. The problem LeetCode #210 Course Schedule II is an excellent exercise for us to practice the solution to topological sorting. The problem is int[] findOrder(int numCourses, int[][] prerequisites) . For (the official) example, one answer to 4, [[1,0],[2,0],[3,1],[3,2]] is [0, 1, 2, 3] . We should pay…
tl;dr Remember the core idea in React : UI = func(const props, state) . what exactly is React? Quoted from the official page : “A JavaScript library for building user interfaces”. Nothing more and nothing less. And I would like to conclude the code idea of it: UI = func(const props, state) , nothing more and nothing less. While you are searching tutorials about React online, many fancy words bump…
tl;dr I choose to use create-react-app , then use ES2016 standard to write react to build the UI and use redux to manage the data, and write flexbox to manage layouts in CSS, if I am going to start a completely new general-purposes front end project in early 2017. disclaimer This post only expresses my current opinion and suggestions and I am not responsible for any potential lost or profit for…
tl;dr This post discusses the $O(n^2)$, $O(n log(n))$ complexity methods to find the length of longest increasing subsequence (LIS), and the way to recover the subsequence. the naive dynamic programming … which has $O(n^2)$ time complexity. dp[i] is the max length of LIS ending with nums[i] . Thus we have dp[i] = max(dp[j], 1) for 0 <= j < i and nums[j] < nums[i] . import java.util.* ; public…
introduction Edit Distance is a famous algorithm problem solved by dynamic programming. I heard it for multiple times, until now I understand the solution after having an algorithm class. problem Given two strings word1 and word2 , everytime we are allowed to insert , delete , replace a character of word1 . Return the minimum number of steps to convert word1 to word2 . solutions DFS It’s not the…
Hadley’s ggplot2 book is a useful resource about learning his ggplot2 package. He generously provides the online version for us to read. But how to compile and get the (personal) pdf version from the repo? I figure it out and note down here. I am working on Windows 10. To sum up: we need these working in command line: git R xelatex make optipng pandoc . Then make clean && make . pre-installation…
Heapsort is one of the algorithms for sorting, with average time complexity $O(n log(n))$ and worst $O(n log(n))$, and space complexity $O(1)$. I think it’s kind of interesting, so I write down the Java implementation here. Previously I was familar with the top-down ( siftUp() ) method, but in this post I write down the buttom-up ( siftDown() ) way, based on Wikipedia. Firstly heapify() using…
Quicksort is a usual algorithm for sorting, with average time complexity $O(n log(n))$ and worst $O(n^2)$, and (stack depth) space complexity $O(log(n))$. As an exercise, I wrote down the quicksort for array and linked list in Java here. For the array, the code is kind of trivial. Select the first element as the pivot, then scan and swap the elements less than pivot with the elements at the…
what While developing on Windows, sometimes I need to switch to a *nix-like environment. Right now Docker has released the Docker for Windows . But the documents are lacking and I did not use Docker too much before, so sometimes I got confused, and here are some notes. docker installation We can download the stable or edge version. Moreover, we need a Windows 10 pro + with the Hyper-V virtual…
As of now ( April 2016 Aug 2019), there are two free domain email services available: Yandex.Mail for Domain (originally in Russian and you need to switch language if you read English) and Zoho Mail Suite , while Microsoft and Google have cancelled their free domain email plans. Yandex is a Russian website and it provides generous quota for free. So I decide to give Yandex a try and note down some…
what I just bought Thinkpad X1 Carbon 4th gen (2016) (20FB) . So far so good. I am feeling great satisfaction. Some notes Disable secure boot and enable virtualization. If want to cleanly install Windows 10, go to official TechBench to download latest Windows 10 iso file. We should use diskpart to format the disk if necessary: select disk 0 clean convert gpt create partition efi size=400 format…
what Let’s Encrypt is an awesome project providing free SSL certs to the world. In Dec 3, 2015, it entered public beta. It says : Anyone who owns a domain name can use Let’s Encrypt to obtain a trusted certificate at zero cost. why For the glory of Santa of course! Well… Because security is important, so we should take enabling https into consideration. why this post However, the client doesn’t…
偶尔会发一些奇怪的梦。比如说这两。 1 昨晚发了一个奇怪的梦。 半夜热得醒来了,看了看手机,发现在不同国家留学的小钟同学也失眠了发了个微信朋友圈。于是起来和小钟聊了聊微信:“你咋也失眠了”“压力大啊。你在干嘛呢?”“哦我起来坐在沙发上玩电脑了,热得睡不着。”小钟回复到:“这么巧,我也是啊!我们拍个自拍合照吧!你摆好姿势呗。”我想了想,好啊,反正无聊,于是摆了一个俗套的 V 字型手势。 过了几秒,小钟微信上说“好啦!我们的姿势还行。”于是发来了一张我们并排坐在沙发上微笑的照片,都是左手在玩着电脑,右手在摆着 V 字的俗套姿势。 2 其实昨天发了第二个梦。这个梦更加好玩。长文。 半夜醒来玩了玩电脑聊了聊天,之后困了回去继续睡觉。无奈早上七点钟的时候被一个电话吵醒了。“你好,我是苹果公司的客服。经过我们的检测,你一天问 Siri 十次 what is the weather like today…
important notice Do NOT need to read this post. Please checkout the updated post for a better solution and a better explanation. what Electron (formerly Atom Shell) is a desktop node.js-powered “shell”. It is designed by Github and used to build Atom Editor . Python is a simple and powerful programming language. This post is a note about how to use Electron as the desktop GUI for Python…
Mathematica is a great solution to some computing problems. However it has only one disadvantage: it is very expensive. Any other way to avoid the fee? No, I am not talking about swithching to R, Python, etc. Firstly, consult the university if being a university student. I found that many universities in United States provide Mathematica to their staffs and students, allowing them install it on…
I began learning English at age of 10 in primary school. However, it is in 2005 that I fell in love with English and realized its importance in my life. In 2005, the sixth book of Harry Potter was released. As a big fan of the Harry Potter Series, I could not wait to read the new book. However, the Chinese edition did not come out at that time. Coincidently, my relatives came back from UK with a…
Dual Thrust is a very simple but seemly effective strategy in quantitative investment. Attention: I am NOT responsible for ANY of your loss! strategy After the close of first day, let m = max(FirstDayHighestPrice-FirstDayClosePrice, FirstDayClosePrice-FirstDayLowestPrice) , then let SecondDayTrigger1 = m * k1 , SecondDayTrigger2 = m * k2 . SencondDayTrigger1 and SecondDayTrigger2 are called…
前言 最近想试一下捣腾一个 R 包出来,故参考了一些教程。现在看到的最好的就是谢益辉大大之前写过的 开发R程序包之忍者篇 ,以及 Hadley 大神(ggplot2 devtools 等一系列包的作者)的 教程 。但是前者有一些过时,后者是全英文的,所以我这里记录一下比较简单的过程,给读者们一个参考思路。如果你有一些 R 程序,想塞到去一个自创的 R 包中,那么这篇文章就可能是你想要的。为了方便说明,这里用我的包来进行示例。 准备工作 安装好 R。 可能需要 RStudio,没有的话也没有影响。 如果你是 Windows 下,请安装 rtools,去官网下载 exe 安装;如果你是 Linux 下,请安装对应的 R 开发包,Debian/Ubuntu 下就是运行命令 sudo apt-get install r-base-dev ;如果你是 OS X 下,要装好…
experience My Hackintosh crashed a few days before. What’s worse, I couldn’t install OS X 10.9 Maverick any more because some wired stuff! :-( So in case I want to do something relative with *nix, I wanna install a desktop Linux now. And for safe, I am installing it in a virtual machine firstly. Long days before, I was accoustomed to use Ubuntu. In fact I started to use it from 08.10. And…
找回高中的笔记本,然后把其中不错的诗词整理出来了。有诗词有对联。 无题 by S 流霞漫醉,应残叶飘零,朔风未息;……低吟微啜,独念来年归客。 青玉案*念有负旧人 by e10t 相逢欲语恨塞言,又一年,愧相见。三月长风驱黄叶,枝头新绿,不似春天。短柳苦难牵,金鞍貂裘傲气扬,怎料今,落魄相。多情忍作无情样,非懒回顾,只恐倩影,一望断一肠。 青玉案*念有负旧人 by Man 去时无风雨帘,离愁泪,反成霜,无色犹寒故情念,青竹如眠,春来非晚,只是红尘淡。抚剑柳下轻招扇,逝年华,唏嘘脸。久逢斜桥两相谦,人容似倦,过亦无言,何处伤痕乱。 青玉案*念有负旧人 by fy 犹记去年枝相缠,今何年,叶繁天。树似人同事变迁,共笑不再,愧语失言,柳短欲牵断。金鞍貂裘傲风扬,现夕阳,落魄相。水虽多情无情倘,忍不回顾,一望倩影,一曲悲肠唱。 卜算子 by fy…
At last, I installed Mac OS X Mountain Lion 10.8.3 in my Thinkpad T410, though I thought never using hackintosh before. I am getting used to OS X and considering transferring all my working flow into OS X now. In my old passage, I prefer avoiding hackintosh because of the sucking hardware driver support, and the difficulty to build up the prefect system environment. But the world is developing…
These days, I wanna have a look at the hot and smart technology: Node.js. So I’d like to make some notes and share some useful resources. Node.js What’s Node.js? Javascript on the server side. What’s npm? The package manager for Node.js. npm for Node.js is as apt-get for Ubuntu. How to install it? I’m not talking about how to do it in Windows, because it’s bringing ourselves into troubles. Use one…
R is an useful software for statistical computing. And it has a package system, which enables users to install many interesting and useful packages. Here I note and recommend some. install.packages ( "ggplot2" ) # powerful printing system install.packages ( "devtools" ) # make dev life easier install.packages ( "knitr" ) # elegant report generator install.packages ( "reshape2" ) # use melt() and…
It’s quite important to acquire, deal with and import data for statisticso work. Here is some notes about acquiring and importing data in R. This post may be updated frequently. # first of all, we should know where we are: normalizePath ( "~" ) # change the working directory if necessary: setwd ( "~/tmp" ) # show the file in the directory: dir () # edit some file if necessary: file.edit ( "a.txt"…
Never use Hackintosh. After many frustracted experiences, I had to believe the fact. A few days ago, I saw a man use a IdeaPad, and his screen attracted me: it runs max os (10.7.3 Lion). Actually, I heard of the “mystery” Hackintosh before. But it was the first time I saw anyone successfully insall it on a PC. “I love anything from Apple Inc. And the mac os is my major operating system instead of…
Nowadays, Jekyll (suddenly) becomes populars among hackers. In short, “Jekyll is a blog-aware, static site generator in Ruby”. It can be used to build a “static” blog, instead of using WordPress. Born in “static”, Jekyll does not have the problems such as security issues, C10K problems, php and database engines backend needed, software updates…… Considering that the comments, analytics can be done…
If Adobe open source Flash, it will regain the control of the web. It’s no doubted that Flash has greatly contributed to the development of the web. (Well, if it didn’t appear, will HTML standard be developed even faster? Who knows.) But today, Powerful JavaScript, improved HTML 5 and CSS 3 are going to replace it. New tags in HTML 5 such as video and audio can function like Flash. Angry birds and…
It’s likely that a new tipping point of the new style of education – including teaching and studying – is coming. Education , encompasses teaching and learning specific skills, and something less tangible but more profound: the imparting of knowledge, good judgment, and wisdom. It’s important to focus on and improve the way of interact between teaching and studying. It’s obvious that how students…
The year of Drangon in China is here. I define the topic of my life “high quality” in the new Chinese year now. Being addicted to web is harmful. Today, my blog’s domain has changed to www.fyears.org . wtfy.org will be kept for a while but not long. The rss addresses are http://feeds.feedburner.com/Fleeting-Years (not changed) or www.fyears.org/feed/ . (changed from …wtfy.org…). Feel free the…
Due to the exams at the beginning of 2012, I haven’t finished this post until now. It’s hard to image that the “fleeting” 2011 has passed with such a fast step. In fact, I began to rethink what I had done since I came to university, I always found that I had wasted so much time and fortunately catch some opportunities as well in 2011. 60 percent of the time in 2011 is my life as a freshman in…
“Less is more.” It’s one of my favorite motto. While designing a project, a production, or an art, which I would like to say, I always prefer to make subtraction, until nothing should be thrown away or given up. However, while bringing the project out of the paper or the brain, I discover that it is much harder to remain the simplicity – the details, the additional must-have, and something…
Today it occurs to me that I haven’t seen you for such a long time. How are you? What are you doing? What are you interested in now? How about your new friends and are they as reliable as your old friends? What’s your hairstyle? What are you happy for or what is grieving you?…… All questions flood to me. But I don’t know. And I don’t know how to get to know. You seldom update your QQ, RenRen,…