可以去掉^M, 例如: 在终端下敲命令: dos2unix a.c 直接转换成unix格式,这样就可以去掉^M •$dos2unix filename •vim filename :%s/^M$//g ^M = Ctrl+v+m 著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处.作者:小幕链接:http://www.zhihu.com/question/22130727/answer/33814375来源:知乎 基于 DOS/Windows 的文本文件在每一行末尾有一个 CR(…
原文:windows phone xaml文件中元素及属性(10) Textblock xaml文件和隐藏文件 在设计界面的时候我们可以通过xaml中进行设计,这种设计是所见即所得的,很是方便,由于xaml中使用到的元素都是其实质都是类文件,比如textblock类,textblock在xaml文件中展示的特性都是该类的属性及方法:所以我们也可以在隐藏文件完成对可视化元素的构建,例如我们实现如下的效果: 那么我们在MainPage.xaml 部分文件代码如下:  <!--ContentPanel…
本文由荒原之梦原创,原文链接:http://zhaokaifeng.com/?p=624 问题描述: 之前在使用Fedora系统时遇到过在使用 sudo 时提示"YourUserName不在sudoers文件中.此事将被报告"的问题,当时的博文在这里.这次是在Ubuntu上遇到了这样的问题.该问题发生之前我在Ubuntu上新建了一个管理员类型的用户,结果我在原来的用户下 使用 sudo 就产生了如上报错.当我尝试使用之前在Fedora上解决该问题所使用的方法时却发现不只是 sudo 不…
将原来的hosts文件删除,在C:\Windows\System32\drivers\etc目录下,新建一个新的hosts文件(记住文件不要后缀,不要命名为.txt,本人在此踩过坑,或者可以百度搜索下载一份hosts文件), 并加上对应的域名, 参考如下 10.10.3.236 newliber.com 127.0.0.1 www.jr.vc 即可以解析成功,ping不通域名是因为DNS解析不成功.…
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; using SmartDeviceProject1.WebReference; using System.Reflection; nam…
之前主要是参考https://www.cnblogs.com/chason95/articles/9760291.html 一般使用 python test.py > ./log.txt 或 python test.py | tee ./log.txt 然后就会缓存很多输出后才能在屏幕或log中查到,就很难受. 后来领导给我了一条命令 srun --partition=GTX1080 --mpi=pmi2 --gres=gpu:1 -n1 --ntasks-per-node=1 --job-na…
经常在部署tomcat时需要替换配置文件中的ip,find命令批量替换还是很方便的 查找需要替换的ip,看看哪些文件有配置这个ip,执行下面命令: find ./ -type f -regex ".*\.xml\|.*\.js.*\|.*\.properties" | xargs grep "118.190.73.218" 查找完成后进行替换为139.129.208.20,执行下面命令: find ./ -type f -regex ".*\.xml\|.…
代码很简单: #include <stdlib.h> #include <fcntl.h> #include <stdio.h> #include <unistd.h> #include <string.h> int main(int argc, char **argv) { int fd; fd = open("sam1", O_RDWR|O_CREAT|O_APPEND, S_IRWXU); printf("pl…
COORD 具体为 typedef struct COORD{ short X; short Y; } COORD,*PCOORD;     可以用来记录坐标. #include <iostream> #include <windows.h> using namespace std; int main(void) { HANDLE consolehwnd; consolehwnd = GetStdHandle(STD_OUTPUT_HANDLE); cout<<&quo…
shell程序如下所示: # cat xarg.txt #! /usr/bin/ksh for logfile in `find . -name "*.log*"` do echo "$logfile:" sed -n '/error/=' $logfile done files=($(find . -name "*log*")) echo "The length is ${#files[@]}" for file in ${…