linux skill
linux console终端乱码解决
1、console终端乱码 在/etc/profile文件的最后一行添加如下内容:
export LC_ALL="zh_CN.GB18030"
2、xwindow终端乱码 在/etc/sysconfig/i18n文件的最后一行添加如下内容:
export LC_ALL="zh_CN.GB18030"
Read the man page carefully. If you see the following error:
Bad owner or permissions on /home/mirandam/.ssh/config
This means you did not properly set the permissions on the config file. To fix:
# chmod 600 ~/.ssh/config
scanf vs printf
float var1;
double var2;
scanf("%f",&var1);
scanf("%lf",&var2);
printf("%f",var1);
printf("%f",var2);
printf("%.4f",var1);
printf("%.4f",var2);
也就是对于读取float和double,前者用%f后者用%lf
而对于输出,float和double都使用%f
printf的%f说明符的确既可以输出float型又可以输出double型。 根据"默认参数提升"规则(在printf这样的函数的可变参数列表中 ,不论作用域内有没有原型,都适用这一规则)float型会被提升为double型。因此printf()只会看到双精度数。参见问题15.2。
对于scanf,情况就完全不同了,它接受指针,这里没有类似的类型提升。(通过指针)向float存储和向double存储大不一样,因此,scanf区别%f和%lf。
python 和c++处理文件
python以wb+\n方式写入文件,生成wangfujing.txt
def save_result(result,outfile):
with open(outfile,'wb') as f:
for d in result:
strline = "%s %.6f %.6f %.6f %.6f %.6f %.6f %.6f %.6f\n" % (d["shot_time"],float(d["baidu_lng"]),float(d["baidu_lat"]),float(d["tengxun_lng"]),float(d["tengxun_lat"]),float(d["center_lng"]),float(d["center_lat"]),float(d["lng"]),float(d["lat"]))
f.write(strline)
linux上c++中以wb+\n方式写入文件,生成new_wangfujing.txt
那么结果new_wangfujing.txt和wangfujing.txt内容完全一致。
linux skill的更多相关文章
- 【鸟哥的Linux私房菜】笔记2
Linux的应用 学习资源整理 安装记录 >< 1.Linux的应用: 网络服务器 数据库 学术机构的高效运算任务 嵌入式系统 ... 2.挂载与磁盘分区 学习资源整理 学习 1.书上的网 ...
- Linux 驱动开发
linux驱动开发总结(一) 基础性总结 1, linux驱动一般分为3大类: * 字符设备 * 块设备 * 网络设备 2, 开发环境构建: * 交叉工具链构建 * NFS和tftp服务器安装 3, ...
- Linux终止进程的工具kill/killall/pkill/xkill/skill用法区别(转)
一. 终止进程的工具kill .killall.pkill.xkill 终止一个进程或终止一个正在运行的程序,一般是通过kill .killall.pkill.xkill等进行.比如一个程序已经死掉, ...
- [skill] mmap / fwrite / write linux磁盘读写的分层结构
转自:http://www.cnblogs.com/zhaoyl/p/5901680.html 看完此文,题目不言自明.转自 http://blog.chinaunix.net/uid-2710571 ...
- linux homebrew skill 技巧
$ cat /usr/bin/gitdiffH0#!/bin/bashgit diff HEAD $(git ls-files| grep '\.py$\|\.py\.in$') | osflake8 ...
- linux commands
abrt-cli --since ;查看abrt捕捉的异常 alias ;别名,alias rm='rm -i':使用“ \rm ” 使用原命令 alsamixer ;图形音量调节,q 增加左声道, ...
- I'm an artist who loves linux (转)
My father got me a computer for graduation with 512MB RAM and a Pentium processor. It came with Wind ...
- delphi 开发者 linux 实务(转)
Linux Essentials for Delphi Developers There is currently no way using Delphi to target Linux. Lon ...
- Linux常用命令(三)
1.top 说明:即时显示 process 的动态 语法格式:top [-] [d delay] [q] [c] [S] [s] [i] [n] [b]基本参数:d : 改变显示的更新速度,或是在交谈 ...
随机推荐
- Java并发编程核心方法与框架-CyclicBarrier的使用
CyclicBarrier类似于CountDownLatch也是个计数器,不同的是CyclicBarrier数的是调用了CyclicBarrier.await()进入等待的线程数,当线程数达到了Cyc ...
- ServletContext中常用方法
..获取Tomcat的Context的初始化参数. 1.获取Tomcat的server.xml中设置Context的初始化参数. 例如: <Context path="/testcon ...
- [asp.net core]project.json(2)
摘要 上篇文章介绍了project.json中的一部分属性.属性真的比较多,所以分开了,考虑到其中的英文比较简单,也不再进行翻译了,从英文原文中,直接粘贴过来了. project.json(1) pr ...
- Memcached存储命令 - replace
Memcached replace 命令用于替换已存在的 key(键) 的 value(数据值). 如果 key 不存在,则替换失败,并且您将获得响应 NOT_STORED. replace 命令的基 ...
- UnicodeDecodeError: 'utf8' codec can't decode
数据库存了些中文字符, 比如'处理脚本'这样的汉字, 结果导致一个python程序报错. 下面记录处理过程和相关结论. ===========================dal.py 程序片段,p ...
- 【AngularJS】—— 4 表达式
前面了解了AngularJS的基本用法,这里就跟着PDF一起学习下表达式的相关内容. 在AngularJS中的表达式,与js中并不完全相同. 首先它的表达式要放在{{}}才能使用,其次相对于javas ...
- Windows Phone 开发环境的搭建
1. 系统 系统:Windows 7(32 位).Windows 7(64 位).Windows Vista SP2(32 位)和 Windows Vista(64 位)或者更高版本. 不支持 :Wi ...
- apache2 多站点虚拟主机配置
<VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot /var/www/ ServerN ...
- hadoop 之 kafka 安装与 flume -> kafka 整合
62-kafka 安装 : flume 整合 kafka 一.kafka 安装 1.下载 http://kafka.apache.org/downloads.html 2. 解压 tar -zxvf ...
- cocoapods pod install 安装报错 is not used in any concrete target
低版本的cocoa pods在编写Podfile文件时这样写就可以了 platform :ios, '8.0'pod 'AFNetworking' 高版本的cocoa pods在编写Podfile文件 ...