1. win 10系统98版五笔替换方法

    https://www.likecs.com/show-204128429.html

    2022/10/10 Blog

  2. Git Guide

    git实用guide 一、git之https或http方式设置记住用户名和密码的方法 https方式每次都要输入密码,按照如下设置即可输入一次就不用再手输入密码的困扰而且又享受https带来的极速 设置记住密码(默认15分钟): $git config --global credential.helper cache 如果想自己设置时间,可以这样做: $git config credential.helper 'cache --timeout=3600' 这样就设置一个小时之后失效 长期存储密码: $git config --global credential.helper store 重置存储的密码: $git config --global --unset credential.helper 注意 : --global是针对全局的设置,如果有不同的仓库对应不同的用户名和密码,推荐不要用--global 增加远程地址的时候带上密码也是可以的。(推荐) http://yourname:password@git.oschina.net/name/project.git 补充:使用客户端也可以存储密码的。 如果你正在使用ssh而且想体验https带来的高速,那么你可以这样做: 切换到项目目录下 : cd projectfile/ 移除远程ssh方式的仓库地址 $git remote rm origin 增加https远程仓库地址 $git remote add origin http://yourname:password@git.oschina.net/name/project.git 二、配置diff,merge,editor $git config --global diff.tool p4merge $git config --global merge.tool p4merge $git config --global merge.tool core.editor vim $git config --global core.editor "vim" 三、提交代码 $git status $git add xxx $git commit -m "xxx" 四、上传代码 $git push origin HEAD:refs/for/tizen_4.0 (for review.tizen.org) $git push origin master (for github) 五、撤销提交 $git reset commid_id 保留更改 $git reset --hard commit_id 不保留 六、不生成新的提交 $git status $git add xxx $git commit --amend 七、保存本地改动到栈中 $git stash 从栈中恢复保存的改动: $git stash pop 八、将gerrit的patch拉到本地 $git check 九、查看某个指定文件的提交记录 $git log --pretty=oneline filepath $git show 命令查看具体的修改详情了 $git show commid_id filepath $git 十、Git撤销已经提交到gerrit的某个文件 $git reset commid_previous_id file_to_uncommit $git checkout -- file_to_uncommit $git commit --amend -s $git push… 十一、查看某个commit改动了哪些文件并简化显示 $git show <commit-id> --stat 其中 –stat 选项用于简化显示,不展开文件修改细节~ From https://zhidao.baidu.com/question/583706356145608645.html 十二、git改变分支名称 本地分支重命名(还没有推送到远程) $git branch -m oldName newName 远程分支重命名 (已经推送远程-假设本地分支和远程对应分支名称相同) a. 重命名远程分支对应的本地分支 $git branch -m oldName newName b. 删除远程分支 $git push --delete origin oldName or $git push origin :oldName (删除远程origin中的oldName分支) or $git push upstream :oldName (删除远程upstream中的oldName分支) c. 上传新命名的本地分支 $git push origin newName:newName (往远程origin中传newName分支) or $git push upstream newName:newName (远程upstream中传newName分支) d. 把修改后的本地分支与远程分支关联 $git branch --set-upstream-to origin/newName From https://blog.csdn.net/weixin_42082222/article/details/88765419 十三、git代码迁移 $git clone --mirror <URL to my OLD repo location> $cd <New directory where your OLD repo was cloned> $git remote set-url origin <URL to my NEW repo location> $git push -f origin 十四、Cherry picking a pull request For example you want to cherry pick https://github.com/fgrehm/vagrant-cachier/pull/164 • Copy the pull request url, append “.patch” and open it in a browser. e.g. https://patch-diff.githubusercontent.com/raw/fgrehm/vagrant-cachier/pull/164.patch • It will automatic resolve as something like below https://patch-diff.githubusercontent.com/raw/fgrehm/vagrant-cachier/pull/164.patch • Use the new url for cherry picking the patch on your local repository $ curl https://patch-diff.githubusercontent.com/raw/fgrehm/vagrant-cachier/pull/164.patch | git am Cherry picking a commit: • Get url for the commit example: https://github.com/LalatenduMohanty/vagrant-cachier/commit/081c809fc369210c6bb06ad9786b8f9be4fb8570 • Append “.patch” and and use it for patch the local code. $ curl https://github.com/LalatenduMohanty/vagrant-cacrhier/commit/081c809fc369210c6bb06ad9786b8f9be4fb8570.patch | git am From https://lalatendu.org/2015/12/02/cherry-pick-a-pr-pull-request-from-github/

    2020/05/21 Blog

  3. Ubuntu 16.04 install python-2.7.17

    Ubuntu 16.04 install python-2.7.17 1. 安装依赖 sudo apt-get install build-essential checkinstall sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev 2. 下载并解压缩 wget https://www.python.org/ftp/python/2.7.17/Python-2.7.17.tgz tar -xvf Python-2.7.17.tgz 3. 编译安装 ,一路回车安装完成 ./configure --enable-optimizations make sudo checkinstall 安装位置:/usr/lib/python2.7 4. 安装 PIP wget https://bootstrap.pypa.io/get-pip.py sudo python get-pip.pytar -xvf Python-2.7.17.tgz 5. 显示版本信息 python --version 6. 卸载 python sudo dpkg -r python 7. 错误解决 Error Compiling /usr/local/lib/python2.7/xml/dom/xmlbuilder.py ... Listing /usr/local/lib/python2.7/xml/etree ... Compiling /usr/local/lib/python2.7/xml/etree/ElementInclude.py ... Compiling /usr/local/lib/python2.7/xml/etree/ElementPath.py ... Compiling /usr/local/lib/python2.7/xml/etree/ElementTree.py ... Compiling /usr/local/lib/python2.7/xml/etree/__init__.py ... Compiling /usr/local/lib/python2.7/xml/etree/cElementTree.py ... Listing /usr/local/lib/python2.7/xml/parsers ... Compiling /usr/local/lib/python2.7/xml/parsers/__init__.py ... Compiling /usr/local/lib/python2.7/xml/parsers/expat.py ... Listing /usr/local/lib/python2.7/xml/sax ... Compiling /usr/local/lib/python2.7/xml/sax/__init__.py ... Compiling /usr/local/lib/python2.7/xml/sax/_exceptions.py ... Compiling /usr/local/lib/python2.7/xml/sax/expatreader.py ... Compiling /usr/local/lib/python2.7/xml/sax/handler.py ... Compiling /usr/local/lib/python2.7/xml/sax/saxutils.py ... Compiling /usr/local/lib/python2.7/xml/sax/xmlreader.py ... Compiling /usr/local/lib/python2.7/xmllib.py ... Compiling /usr/local/lib/python2.7/xmlrpclib.py ... Compiling /usr/local/lib/python2.7/zipfile.py ... Makefile:1098: recipe for target 'libinstall' failed make: *** [libinstall] Error 1 **** Installation failed. Aborting package creation. Restoring overwritten files from backup...OK Cleaning up...OK Bye. Solution I saw this (and reported this issue in SF’s tracker) at some time around 2.2/2.3 (just cann’t recall). I don’t know what causes this problem exactly, but in my case the installation succeeded if I removed prevoius python’s library directory (/usr/lib/python2.x or /usr/local/lib/python2.x). The module that stopped installation was exactly the same. sudo rm -rf /usr/lib/python2.x sudo rm -rf /usr/local/lib/python2.x Referrence http://www.firstsolver.com/wordpress/?p=4370 https://bytes.com/topic/python/answers/691250-python-dies-make-install

    2020/04/09 Blog

  4. Assembly GetTypes Exception

    在使用C#的反射的功能时,我们需要加载某一个DLL,然后去获取其中的属性或方法。如果AAA.dll中引用了BBB.dll,我们在加载AAA.dll后,再去获取所有的Types,代码如下: Assembly asb = Assembly.LoadFile(@"X:\xxx\bin\Debug\AAA.dll"); Type[] types = asb.GetTypes(); The following exception reported: System.Reflection.ReflectionTypeLoadException: ‘Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.’ 这种情况出现时,我们不好排查具体的原因。 如果我们换另一个方法GetExportedTypes,则会报另一个错误,代码如下: Assembly asb = Assembly.LoadFile(@"X:\xxx\bin\Debug\AAA.dll"); Type[] types = asb.GetExportedTypes(); The following exception reported: System.IO.FileNotFoundException: ‘Could not load file or assembly ‘BBB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.’ 这时候我们可以确定,在加载AAA.dll时,没有找到其引用的BBB.dll,所以我们不妨尝试把BBB.dll拷贝到我们运行的exe目录,再次执行,发现都运行通过! 原因可以确定了。

    2020/04/07 Blog

  5. libpng12-0 installation

    How to install libpng12-0 in Ubuntu 18.04 Add a line into your /etc/apt/sources.list: deb http://security.ubuntu.com/ubuntu xenial-security main then sudo apt-get update -y sudo apt-get install -y libpng12-0 OK. Referrence: https://packages.ubuntu.com/xenial/amd64/libpng12-0/download

    2020/04/07 Blog

  6. 利用Python对PDF文件做OCR识别

    利用Python对PDF文件做OCR识别 原文请见 https://python.freelycode.com/contribution/detail/344 Hi朋友们!你们可能听说过使用Python进行OCR识别操作。在Python中,最出名的库便是Google所资助的tesseract。利用tesseract可以很轻松地对图像进行识别。现在问题来了,如果想对一个PDF文档进行OCR识别,该怎么做呢? 我现在所从事的一个项目,需要将PDF文件作为输入,从中输出文本,然后将文本存入数据库中。为此,我找寻了很久的解决方案,最终才确定使用tesseract。所以不要浪费时间了,我们开始吧。 1.安装tesseract 在不同的系统中安装tesseract非常容易。为了简便,我们以Ubuntu为例。在Ubuntu中你仅仅需要运行以下命令: 这将会安装支持3种不同语言的tesseract。 2.安装PyOCR 现在我们还需要安装tesseract的Python接口。幸运的是,有许多出色的Python接口。我们采用最新的一个: 3.安装Wand和PIL 在我们开始之前,还需要另外安装两个依赖包。一个是Wand。它是Imagemagick的Python接口。我们需要使用它来将PDF文件转换成图像: 我们也需要PIL因为PyOCR需要使用它。你可以查看官方文档以确定如何将PIL安装到你的操作系统中。 4.热身 让我们开始我们的脚本吧。首先,我们需要导入一些重要的库: 注意:我将从PIL导入的Image模块改名为PI了,因为如果不这样做的话,它将和wand.image模块发生重名冲突。 5.开始 现在我们需要获得OCR库(在本例中,即tesseract)的句柄以及我们在PyOCR中将使用的语言: 我们使用tool.get_available_languages()里的第二种语言,因为之前我曾尝试过,第二种语言就是英语。 接着,我们需要建立两个列表,用于存储我们的图像和最终的文本。 下一步,我们需要采用wand将一个PDF文件转成jpeg文件。让我们试一试吧! 注意:将PDF_FILE_NAME替换成当前路径下的一个可用的PDF文件名。 wand已经将PDF中所有的独立页面都转成了独立的二进制图像对象。我们可以遍历这个大对象,并把它们加入到req_image序列中去。 现在,我们仅仅需要在图像对象上运行OCR即可,非常简单: 现在,所有识别出的文本已经加到了final_text序列中了。你可以任意地使用它。我希望这个教程能够帮助到你们! 6.问题 https://stackoverflow.com/questions/52699608/wand-policy-error-error-constitute-c-readimage-412

    2020/03/16 Blog

  7. 专利检索网站

    一、主要国家、组织官方专利数据库

    2020/03/13 Blog

  8. valgrind usage

    install: sudo apt-get install valgrind valgrind -tool=memcheck ./your-prog

    2020/03/12 Blog