21 Nov 2016

The Hardest 8-Puzzle

收藏到CSDN网摘
If you are working on any 8-puzzle related tasks, try your method with the following initial board which is considered to be the hardest to solve. Actually, it requires 31 moves to solve.

8 6 7
2 5 4
3 0 1

Someone may prefer empty/space rather than using 0. But the concept keeps the same.

8 Nov 2016

matplotlib tips: draw circle, rectangle, save figure and maxmize figure

收藏到CSDN网摘
matplotlib是一个非常强大的python库,拥有众多作图函数与matlab类似的语法,使用非常方便.但是经常有一些小问题需要处理.这里记下解决方案,涉及到: 画圆, 画矩形, 保存图片, 和图片默认最大化. 以后如果碰到其他问题再添加.

25 Oct 2016

批处理文件对字符串中空格的处理

收藏到CSDN网摘
在执行UG 2 ICEM tin几何模型转换时,文件路径带有空格时,处理不小心就会造成各种问题.以前写过UG2TIN的过程分析(见 链接1, 链接2).最近在没有部署ICEM或者没有Admin账户权限的机器上执行模型转换时遇到了各种问题.如之前分析过的,这个过程需要调用一个UG的probe函数来返回UG版本号,然后判断对应的vendor文件夹是否已经存在于ICEM的安装路径之中.由于UG版本更新非常快,远超ICEM,因此就造成ICEM的对应文件夹下找不到对应UG版本的vendor文件夹.被这个问题困扰了几周之后,决定重拾之前的分析,彻底搞清楚ug2tin的转换步骤.

14 Oct 2016

Add 'My Computer' to Taskbar in Windows7

收藏到CSDN网摘
Usually, the Windows Explorer in taskbar of Windows 7 leads to the 'Library', which is very annoying. All I need is to open 'My Computer' by default rather than bothering me by the stupid 'Library' thing. To make it work properly, you can unpin the default explorer from taskbar. Then create a new shortcut and pin it to taskbar using the following address. It worked very well for me.

5 Oct 2016

Extend Taskbar to Multiple Monitors in Windows7

收藏到CSDN网摘
If you have multiple monitors it's easier to compare or edit files side by side. The default setting in Windows - even the latest version of Windows, aka Win10 - doesn't extend the taskbar however. The workaround can spot the truth that this can be done in Win8 afterwards OS very easily as it has been implemented in them already - although it's not the default setting. But how can you do the same thing in Windows7 or ealier version of OS?

18 Aug 2016

c++ tip: 逆序迭代vector时下标类型选取不当引起的程序错误

收藏到CSDN网摘
vector无疑是c++中非常有用的数据结构,实现了通用的迭代器iterator,配合很多STL库函数与算法更是如虎添翼.正序逆序迭代既支持begin(),end(),rbegin(),rend()迭代器遍历,也支持类似于数组的下标遍历[i].今天写代码时遇到程序错误便是由于下标类型选取不当引起的问题.

2 Aug 2016

Fragile WiFi Connectivity on Linx10 Tablet

收藏到CSDN网摘
I have a Linx10 tablet for about 1 year now when it's on sale. It came with Windows8 with Bing. I have to admit that it worked very well actually - for a ~50 quids toy after trading my old hp webos tablet for 30. I got it updated to Windows8.1 - then Win10 when it became available on 29 July 2015. It serves me smoothly until ... well, it's difficult to remember. But the WiFi connectivity became more and more unreliable. After using it for a while, the wifi connection disappears and it claims 'limited access' or 'no internet connection'. I have to disable/re-enable the wifi adaptor ~10 times per hour - pain in the ass! I decided to find the reason why it started this shitty work.

25 Jul 2016

9 Jun 2016

Key Fob Cannot Lock/Unlock Car Remotely

收藏到CSDN网摘

Recently, my 10-years old Chevrolet Tacuma refused to start one day. All indicating lights on the instruments panel disappeared - engine light, break light, safety warning light, even the remote key fob LCD! It's clearly that the battery is dead - I have to say it's an amazing period of service. Even the guy who replaced the battery admitted it as well. He told me that all new batteries could run about 2-5 years depending on brands. After replacing the battery, everything goes back to normal - well, at that moment!

18 Jan 2016

Word VBA: 根据cell内容修改cell背景色

收藏到CSDN网摘
项目需要做用户指南,需要做个表格来描述各个功能是否支持当前对象.最开始的想法是用vba枚举表格,判断caption是否是所需表格,然后枚举cell,判断内容并修改背景色.可惜截至word2013(包括以前版本),table caption并没有单独作为一个对象来使用,而是普通文本,只是使用了caption样式而已.换句话说:word表格caption与表格对象无关!你可以在表格caption与表格之间插入任何内容,包括另外一个表格,并不影响word显示和使用.但是对自动化操作(例如vba)造成了不小的影响.怎么解决这个问题呢?

5 Jan 2016

删除word文件个人信息

收藏到CSDN网摘
word文件会保存(2007之后的版本?)创建者及最后编辑者的信息,有时候不想显示这些信息给其他人,该怎么办?

C++获得文件日期信息

收藏到CSDN网摘

写代码时,需要获得文件的日期信息.c++的sys/stat.h文件中定义了struct _stat,保存了这些信息,具体内容可以通过调用函数_stat()获取.
函数的定义如下: