A Life Climber

不辜负自己,不将就生活。

Page 2 of 8

Awesome Plugins for Vimers – 2

Vim plugins continued …

YouCompleteMe

YouCompleteMe is the best auto-completion plugin for Vim. It contains support for a variety of programming languages, such as c, c++, python, javascript, etc. YCM also supports the powerful snippet plugin Ultisnips. One thing I think YCM is great is the way it supports semantic completion. By semanic completion, YCM understands your code at realtime, not by simply guessing patterns from buffer which is implemented by other auto-completion plugins such as neocomplete. However, due to YCM uses clang, it is a bit hard to install YCM on Windows, in such conditions, you can choose install a precompiled YCM, such as this one.

Ultisnips

Ultisnips provides the best snippet for Vim. YouCompleteMe integrates support of Ultisnips as well, which means when you type, the system will give you smart hints for snippets if available in addition to buffer or semantic completion. The experience is perfect.

Syntastic

Syntastic is used for static checking of source codes. It comes from Martin Grenfell, author of nerdtree and nerdcommenter. Syntastic runs well with a variety of programming languages and checkers, such as cppcheck, jshint, pylint, tidy, prettyccs, etc. I recommend you to install Syntastic along with YCM, as it enhances YCM with a decent syntax checking. Type :SyntasticInfo to see the available checkers you have, and install your preferred tool.

vim-licenses

Vim-licenses is a plugin that eases adding license to the top of the buffer. I think it is good practice to confirm your license for the source codes you write. It not only shows your professionalism, but also indicates your respect for the open source movement. But first, understand different open source licenses such as GPL, LGPL, MIT, BSD, Apache, etc. When you uses source codes from others, either non-commercial or commercial, always read its license and behave correspondly.

To be continued…

Awesome Plugins for Vimers – 1

Vim is a flexible and powerful editor. There is always a saying about 3 kinds of editors in the world (Vim, Emacs and the others), and there is always a war between Vim and Emacs.

I am not interested in the battle of world’s best editor, but I can convince you that although Vim comes with a bit steep learning curve, when you are used to it, you will always understand why lots of programmers choose it.

One important feature of Vim is its support for plugins. It is those plugins that enhance Vim for different uses. Here I will recommend several awesome plugins which I believe essential for Vimers.

Vundle

Vundle is a great plugin manager for Vim. It is the first ever plugin a Vimer should install. After that, Vundle takes charge of all the other plugin maintenance taaks, including downloading, installing, loading, updating, cleaning, etc. With Vundle, you only need the vimrc file when swithing computers, Vundle ensures you always getting the same configuations and plugins.

The NERD Tree

Nerdtree is a plugin for file system exploration in Vim. You can navigate through the filesystem tree with keyboard or mouse easily with the plugin. You can also bookmark certain folders or files in Nerdtree for quick access.

tagbar

Tagbar is the famous taglist alternative. Like taglist, tagbar internally uses ctags to generate at realime tags for the file, but tagbar has more support for OO languages such as c++.

a.vim

a.vim is used for quick switch between source and header. For example, when you are editing foo.c, simply type :A and you will be editing foo.h, or :AS makes a split window for editing foo.h.

To be continued…

Useful Development Tools – 3

This article continues my last blog.

Source Navigation

cscope and ctags

Cscope and ctags can assist you in when browsing source codes. You can use ctags with Vim plugins like tagbar or taglist, and Vim also supports cscope jumping. Both cscope and ctags are good alternative to commercial software like Source Insight, Scitools Understand and Crystal Flow, and they are always available in Linux and Windows.

Searcher

grep and grepWin

Grep is an essential tool in Linux system. And if you are working on Windows, you can consider using the alternative grepWin, it has a decent UI as well.

Ag

Ag is called the silver searcher, and can be integrated with Vim using ag.vim. I find ag very fast when searching codes, because perhaps it is smart in its searching, like ignoring files flagged in .gitignore. I will recommend you to use it instead of grep tools for source codes. For general regex search, using grep instead.

everything

Everything works only on Windows. Well, if you read my posts, you will find that I prefer cross-platform tools, that is because sometimes I have to work on both platforms (Linux and Windows), and I enjoy having the same experience. However, everything is so great tool that I cannot ignore it here. It is super-fast when searching NTFS files, in a blink of eyes, but it only searches by file name. You will find it very useful when you try to find a file that buried in SOME direcoty that you have forgot.

Offline Documentation Browser

Zeal

Zeal is a quite new tool, featuring offline documentation browsing. Mac programmers always find Dash indispensable, now zeal is an open source alternative to Dash and works on both Linux and Windows. Actually, zeal uses api docsets from Dash I suppose, and it now supports 198 docsets. Zeal can be integrated with Vim with zeavim, and you can cross-reference from your source code to its api documentation easily with your defined hot keys.

Useful Development Tools – 2

This article continues my last blog.

Console Multiplexer

GNU screen – Effectively uses your console!

GNU screen is a magic. It allows you simply create multiple “tabs” inside a session, and switch between them without using a mouse (WHY bothering to use mouse if you can use your keyboard more efficiently?). This suits console well. Besides, the detach and restore helps remote users especially with link failure!

cmder

GNU screen is for Linux. If you are working on Windows, you should replace cmd with Cmder! It enhances the Windows console with a lot of features, and it has tabs and if configured properly, a closer experience to GNU screen. Besides, since cmder has git embedded (I mean cmder not cmder_mini), you have those basic Linux commands available, as well as Git.

SSH Client and Tool

PuTTY

Putty is my favorite SSH client and serial terminal (I mention it in serial terminal too as you will see). No installations, free, cross-platform, putty has all the features you need as a SSH client. Putty is a very good alternative to commercial software SecureCRT. But if you want SSH file transfer, see below.

FileZilla

Putty also provides file transfer with PSFTP, but I find it more convenient with some GUI clients like FileZilla. FileZilla support FTP as well as SFTP, and it is cross-platform too.

Serial Terminal

PuTTY

Hey Putty again! The serial terminal provided with Putty will meet your needs most of the time, but it lacks hex support. If you want hex support, you should consider following tools.

CoolTerm and AccessPort

Both of the tools support displaying hex for received serial data, but CoolTerm seems not able to send hex string. If you want to send hex as well, use AccessPort. AccessPort has not been updated for a some time, but per my test, it works well with even Windows 10. AccessPort only works on Windows, while CoolTerm is cross-platform, supporting Windows, Mac and Linux.

Packet Sniffer

Wireshark – Powerful Sniffer for Ethernet, ZigBee, etc.

Wireshark is cross-platform and on Linux, it enhances tcpdump with clear UI (Wireshark can open tcpdump files). Wireshark supports ethernet sniffering well, features powerful filtering, and lots of protocol decoding built in.

With a compatible ZigBee dongle, Wireshark also supports ZigBee packet sniffer to ZCL level. Actually, any 802.15.4 packets, thus even 6LowPan, or any protocols built upon that, like Thread, should be supoorted by Wireshark as well. With an active community behind, Wireshark is continuouslly being add more protocols to expand parsing capability. Think about Ubiqua, the commercial ZigBee protocol analyzer software, it costs $999 per license!

Case Sensitive Files in Git Windows

There are cases which cannot happen with Linux, but could happen when you use Git in windows:

e.g.

In remote Git repo contains 2 files:

Log.c and log.c

When you clone the repo using Git windows, you will only have log.c in your working copy, but when you issue git status,

it will always tell you a modified, unstaged, Log.c

So it is a BAD PRACTICE to have 2 files with the same(only case-different) name. This is NOT cross platform.

To delete either one from the remote repo, you can use a Linux machine, or, use following steps on Windows: (In this example, rm Log.c)

Steps

  1. git mv Log.c CASESENSITIVE.c
  2. git commit -m “xxx”
  3. git reset –hard HEAD
  4. git rm CASESENSITIVE.c
  5. git commit -m “xxx”

Useful Development Tools – 1

Open source has changed a lot of things, notably, abundant tools that are of quality, usability and activeness. Here I will list a number of them which change my life doing development.

Editor

Vim – the ultimate editor

I have tried many editors, which includes, sublime text, ultraedit, notepad++, and those heavy ones like Eclipse, Visual Studio, etc., and I have to admit that the one fits me best is the vim, of course, vim with suitable plugins.

Vim is availble in all platforms including Linux, Windows, with both x86 and x64 versions, thus I can always have the same experience, the hotkeys, and without the mouse.

Eric S. Raymond in his book “The Art of UNIX Programming”, however, insists that emacs be better. Everyone is free to choose, but I believe the word that Andrew Hunt and David Thomas once said in their book “The Pragmatic Programmer”:

Use a Single Editor Well

Diff Tool

Meld – A decent choice

I have tried Beyond Compare, which I think is the best in the field, yes the best. WinMerge, P4Merge, tortoise Diff, vimdiff, they are good but for some reasons I do not like them. But Beyond Compare is not free or open source, and meld, in my point of view, works as a decent alternative to Beyond Compare. I like its visual interface, and its easy integration with SCM like git.

Besides, meld is also cross-platform, which I will always have it, no matter which platform I am working on.

SCM

Git – Believe Linus

When I started development, I used CVS to track my codes, then Subversion, which is way better than that. But it was until Git that I thought a modern version control had come. Thanks to Linus Torvalds, the creator of Linux, contributed to the community the simple yet powerful toolsets. Every developer should start using Git in their daily work, even without a remote repository.

Git also enables never-so-easy collaboration between developers. The pull request, branch, rebase, merge, all act as interesting but socialized things, much much better than the days developers sending patches.

Use it!

转变

最近我在读希阿荣堪布写的《透过佛法看世界-给寻找答案的人》,获得了很多启迪。 我最印象深刻的,是书中所提到的: 出离心、菩提心和空性慧(P166)。这是一步一步逐渐提高的。 出离心,即厌倦轮回,希求解脱之心。 菩提心,即在出离心基础之上,不仅满足于个人的超脱,而是希望一切众生安稳快乐、永断烦恼,为了这个理想而精进修行,通过布施、持戒、忍辱等不断完善自己的修持,并帮助众生。 空性慧,即在菩提心的摄持下逐步圆满闻慧、思慧和修慧。

而另一个启迪是, 一定要静下心来闻思和实修。生活即是修行,把佛法的正见落实到起居应对中,在日常小事上也谨慎取舍因果。从善护身语意、远离十恶业开始,行动上尽量避免杀生、盗窃、邪淫等恶业,言语上尽量避免恶口、两舌(挑拨离间)、妄言(说谎)、绮语(无意义的琐谈),尽量避免贪心、害心,以及执着恒常等极端见解。 同时,在日常生活中,要抱有慈悲心(P141)。 慈是希望对方快乐,通过友善、关爱、分享等来表现。悲是愿意分担乃至代受对方的苦,这需要莫大的勇气和温柔。 观修慈悲心通常从亲近的人开始,因为你与他们的因缘很近,如果你愿意,你能更深切地理解、感受他们的苦乐、希冀,而理解是慈悲的基础。

是的,生活就是一场修行,而转变应该从现在开始。要尽量摒除杂念这个萦绕于现代人的东西,更加自律和简单地处理生活。

不知是不是巧合,周五早上我在班车上刚读到书中所说的“灌顶”,周五访问水木社区首页就出现了“灌顶”的热帖。妈妈刚说约不到五官科的医生,周五上午太太就帮我妈妈约到了;周五晚上岳母说要约一个中医,刚查微医就发现有最近的日子可以预约(应该是有病人取消了预约),而我们刚刚约好这个医生就约满了。也许只是巧合,但我更愿意相信,这是对我转变的鼓励,鼓励我不断的自我修行!

更巧的是,到5月底前,静安寺有佛指舍利的瞻礼。我准备在下周去静安寺,希望有缘可以感受佛的提示。 是的,生活就是一场修行。我的心被污染了很多,需要努力地作出转变。

我就是一个感性的码农zz

时间会带走一切吗?  时隔当时已经2年了。
你告诉我你不会来北京了,你把我送你的NOKIA5800丢了,你保留了新买的y460,你说我们不合适了。

我在想,我什么好的,我只是时常给你买麻辣烫吃,我记得你喜欢吃的东西,细粉,甜不辣,鸽肚,肥肠,金针姑,香菜。。。你还喜欢吃龙锦东一区门口的羊肉串,记得有一次我加班到十一点多,那天风很大,可是你非要我去给你买,我就连家也没回,直接去买,可是人家没开门,回家你一点也不理解,非说我没去,就不想让你吃。

跟你在一起,我不够好,我没能买得起房子,车子,只能把工资卡交给你,买个破手机给你,买个笔记本给你,我把我觉得最好的都给你。你玩游戏,充值要三百三百地充,你买衣服多贵我都舍得。

你走了,我很无奈,我骗大家说,你出国了,你的手机丢了以后,你把我的QQ也加入黑名单了,我 再也联系不上你了,我心想,我们老死不相往来了。我心灰意冷,以为自己还能很镇定,可是我真的去了酒吧,刷爆了几张信用卡。我以为那样我自己就会开心。我花了好几千块去珍爱网,以为从此可以解脱。

2年了,今年你又加我QQ了,上个月,上上个月, 你都说你家给你介绍了新的男朋友。上周,你说你分手了,你说没有一个人是像我一样真正的对你好的,我很感激。我说我给你买情人节礼物,我给你买鞋子。。。我想去看你,你说好啊。

结果是,票买好了,又退了,你又消失了。一周后,你又在QQ上告诉我,我们不合适,你不要来找我了。
我表示,我很伤心,我已经伤不起了,我现在对任何人都一点感觉没有,究竟我是怎么了

转自水木

那些精神上的翳障[zz]

    今年北京有这么一件交通肇事逃逸事故,一对情侣晚饭前拉着手沿着马路遛弯时被一辆超速行驶的汽车撞倒,双双毙命。在他们租住的远郊区民房里,择好的豆角盛 放在不锈钢盆中,但适才摆弄过它们的手不会再来炒熟它们了。在和平年代,还有什么比生命更值得珍惜,又有什么比年轻生命的无辜逝去更让人惋惜呢?而在这一 起事故中,逝去的还有不远千里前来相聚的爱情。

    我对文化有个简单的理解,文化就是人所做的一切事情。而人总是希望自己活得更好些。我心中 的幸福图景是:自己和家人身体都好好的,家庭氛围和谐,工作顺利,女儿能够健康快乐地成长……当然我曾经也是一个有着其他“远大理想”的人,做过科学家的 梦以及文学梦,心思一直都在半空飞着,但近些年算是降落到地面上,能够接到地气了。

    但上述看似简朴的幸福图景要实现其实也不易。有的人父 母早亡,俗语说:家有一老胜似一宝,而他们却只能看着他人的父母而默默伤感。有的人早殇,就犹如那些尚未绽开即遭昆虫啃食的花蕾;或者身患先天性重疾,一 生都在与潜伏在自身体内的病患做斗争,他也会对去医院的路很熟悉。很多年轻人受不到好的教育,我因为工作的关系常去南方的工厂出差,看到众多20多岁的年 轻人规规矩矩地守在机械化生产流水线旁边,不停地劳作,沉默寡言,他们对都市的繁华也有眼见,但并不丰厚的薪水却支撑不起在此安家的希望。有了爱情,也结 婚了就一定幸福么?据说中国目前34.7%的家庭存在家庭暴力。中国目前患有各种疾病的人数占比惊人,比如中国现在乙肝携带者与患者数量超过一亿;不孕不 育的发生率由20年前的3%提高至12%,目前数量已超过4000万;糖尿病患者数量目前是9200万;慢性肾脏病患者可能也超过了一亿;计及其他各种各 样的重症如癌症、白血病、艾滋病、心血脏病等等,估计累积总和会超过总人口的一半,这些看似冰冷的数字轻易地就击碎了都市表面的繁华景象而揭示出现实生活 的本来面目。即使是那些在旁人眼里一身光鲜的人,也有着种种烦恼与隐忧。俗话说得好:人生在世,不如意事十有八九。除了自己会犯错之外,我们有时还需要承 受他人带来的痛苦与麻烦,人活着难免不会遇到骗子、盗贼以及其他引诱。人生总是坎坷的,当然也只有挫折与磨难中人才能成长。而他人的经验也很难直接移植到 自己身上,往往是不吃一堑难长一智。

转载自:水木社区 newsmth.net
作者:Trakl (灰喜鹊), 信区: Essay
标题: 那些精神上的翳障

« Older posts Newer posts »

© 2025 A Life Climber

Theme by Anders NorenUp ↑

error: Content is protected !!