- 博客(285)
- 资源 (49)
- 收藏
- 关注
原创 HexStrToByte
void HexStrToByte(const char* source, unsigned char* dest, int sourceLen){ short i; unsigned char highByte, lowByte;for (i = 0; i < sourceLen; i += 2){ highByte = source[i]; lowByte = sou...
2020-03-26 19:33:49
1297
原创 NR信道带宽利用率、NR-ARFCN与channel raster
1. NR的信道带宽利用率 相比4G最高仅90%的信道带宽利用率,5G NR进一步提高信道带宽利用率,最高可达98.28%,需要各厂家自主实现对OOB的抑制,可采用filter、windowing技术等。 2. NR-ARFCN与channel raster...
2019-10-31 14:20:17
4535
原创 C++ 之委托构造函数& new(this)的运用
struct Rect{ Rect(){ new(this) Rect(1, 2, 3, 4, 5, 6);// left =1;// top =2; cout <<"left second:" << left <<endl; } Rect(int l, int t, int r, ...
2019-10-14 16:22:53
2254
原创 QT 编译C++11
TEMPLATE = appCONFIG += console c++11CONFIG -= app_bundleCONFIG -= qtSOURCES += main.cppQMAKE_CXXFLAGS += -fno-elide-constructors //禁用编译器优化QMAKE_CXXFLAGS += -std=c++11 //支持C++11...
2019-10-14 15:07:49
860
原创 C++11 std::move 和std::forward
#include <iostream>#include <type_traits>#include <typeinfo>#include <memory>using namespace std;struct A{ A(int&& n) { cout << "rvalue ov...
2019-10-12 15:01:17
135
原创 eclipse 配置boost C++ cygwin
1: 下载eclipse 下载插件CDT2: 下载cygwin 把C:\MinGW\bin 增加到system var里面的path里面 , 可以输入gcc -v 查看。能正确查看就表示OK3: 下载boost c++ eclipse 建立C++ project 编译器选择 GCC,把boost库增加到env里面去,这样就可以使用了. 这种使用针对不需要编译的boost
2018-02-06 15:15:15
590
转载 C语言 中结构体的位域(位段)
有些信息在存储时,并不需要占用一个完整的字节, 而只需占几个或一个二进制位。 例如在存放一个开关量时,只有0和1 两种状态, 用一位二进位即可。 为了节省存储空间并使处理简便,C语言又提供了一种数据结构,称为“位域”或“位段”。所谓“位域”是把一个字节中的二进位划分为几个不同的区域并说明每个区域的位数。每个域有一个域名,允许在程序中按域名进行操作。 这样就可以把几个不同的对象用一个字节的二
2014-08-21 16:47:41
954
转载 Java nio 学习笔记(六)
Java nio 学习笔记(一)http://blog.youkuaiyun.com/tsyj810883979/article/details/6876594Java nio 学习笔记(二)http://blog.youkuaiyun.com/tsyj810883979/article/details/6876599Java nio 学习笔记(三)http://blog.youkuaiyun.com/tsyj810
2014-06-27 13:33:45
890
转载 Java nio 学习笔记(五)
Java nio SocketChannel ServerSocketChannel 以及Selector实现的echo服务器和客户端(暂时有问题)服务器端代码:[java] view plaincopyimport java.io.IOException; import java.net.InetSocketAddress; i
2014-06-26 17:42:27
830
转载 Java nio 学习笔记(四) 淘宝2012校招技术笔试题
实现五:统计一个单词可重复的英文文件(假设4G)中每个单词出现的次数,把结果按照英文排序放入一个文件中。并能够检索特定单词的出现次数。由于文件过大,不重复单词总数有限,需要考虑到执行速度和内存使用情况。(淘宝笔试技术题)[java] view plaincopyimport java.io.File; import java.io.FileNo
2014-06-26 17:24:23
959
转载 Java nio 学习笔记(三)
实现一:使用nio实现文件复制[java] view plaincopypackage study.nio; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileNotF
2014-06-26 16:50:17
1118
转载 Java nio 学习笔记(一) Buffer(缓冲区)与Channel(通道)的相关知识
一.基本概念IO 是主存和外部设备 ( 硬盘、终端和网络等 ) 拷贝数据的过程。 IO 是操作系统的底层功能实现,底层通过 I/O 指令进行完成。所有语言运行时系统提供执行 I/O 较高级别的工具。在java编程中,标准低版本IO使用流的方式完成I/O操作,所有的I/O都被视为单个的字节流动,称为一个Stream的对象一次移动一个字节。NIO是在JDK1.4之后出现的一种新
2014-06-26 16:46:44
1047
原创 java解析XML
import java.io.IOException;import javax.lang.model.element.Element;import javax.xml.parsers.DocumentBuilder;import javax.xml.parsers.DocumentBuilderFactory;import javax.xml.parsers.ParserConfigur
2014-05-30 17:35:29
734
原创 类的指针函数调用方式
class A{public: void set(int x,int y) { this->x=x; this->y=y; }private: int x; int y; };void(A::p)(int x,int y);int main( A a; p=&A::set; //注意类的函数指针调用方式 (a.*p).(1,2);)
2013-08-22 11:32:00
844
原创 []重载可以有效避免内存越界
#includeusing namespace std;class A{ public: A(int lenght) { size=length; str=new char[size]; } virtual ~A() { delete str; } char& operator[](int index) { if(index>=0
2013-08-20 17:35:47
1094
原创 C++ 字符串输入问题
char str[12]方式1: cin>>str比如输入hello world,则str的值只是hello,原因在于cin遇到空格会自动结束方式2:gets(str)比如输入this is c++ prigram,则str全部保存,但是可能引起程序崩溃,缺点: gets不能确定长度方式3: cin.get(str,12) 该方式比较完美,可以解决方式1和方式2遇到的问题
2013-08-20 16:57:48
643
转载 linux cp复制时不提示确认信息
我用的办法是 echo y | cp /a /b--------------------------------------Linux中cp直接覆盖不提示的方法,这是我们希望的理想状态,但是有时加了-f了,怎么还会有提示呢?原来一些服务器会默认增加别名 alias cp='cp -i',当你执行cp时,其实执行的是cp –i。新做了服务器,cp覆盖时,无论加什么
2013-06-19 15:00:11
9563
转载 TCP/IP基础知识
TCP/IP网络协议栈分为应用层(Application)、传输层(Transport)、网络层(Network)和链路层(Link)四层。如下图所示两台计算机通过TCP/IP协议通讯的过程如下所示传输层及其以下的机制由内核提供,应用层由用户进程提供,应用程序对通讯数据的含义进行解释,而传输层及其以下处理通讯的细节,将数据从一台计算机通过一定的路径发送到另一台计算机
2013-06-17 13:11:37
1090
原创 Map with comparator(functor)
#include #include #include using namespace std;class Employee { friend class EmployeeLessThan;public: Employee(const string& first, const string& last) : lastName_(last), firstName_(first
2013-06-14 16:28:04
762
原创 Map comparison
/* The following code example is taken from the book * "The C++ Standard Library - A Tutorial and Reference" * by Nicolai M. Josuttis, Addison-Wesley, 1999 * * (C) Copyright Nicolai M. Josuttis 19
2013-06-14 15:59:30
896
转载 for_each详解
说明:在使用STL算法库的过程中,如果单单就某个函数做一些使用,而不了解其内部的实现原理,在使用过程中将会存在大量的"问题",因此,在最近这段时间里,我将对每个函数深入挖掘定义(vs2010 stl版本)函数功能:对区间[beg,end)执行_Fn1.并返回_Fn1.template<class _InIt, class_Fn1> inline _Fn1
2013-05-30 14:07:58
881
原创 rpm安装
通常情况下 使用rpm -ivh *.rpm就行了但是有的时候,有包的依赖关系。比如A依赖B ,B依赖A,如何解决呢?使用rpm -Fvh a.rpm b.rpm 可以自动推导包的关系查询包的所依赖的包rpm --qpR a.rpm 会查询所依赖的包rpm -ivh --test a.rpm
2013-05-22 11:15:17
589
转载 linux下strace讲解
1、说明strace - trace system calls and signals2、option1)strace -p pid 跟踪某个后台进程2)strace -o filename 把跟踪结果输出到文件3)strace -T 记录每个系统调用花费的时间,可以看看哪个系统调用时间长参考4)strace -t(或者 -tt)记录每个系统调用发生是的时间(时分秒的格式)5)s
2013-05-16 15:26:00
1140
原创 boost学习之uti
#include #include #include #include #include #include #include #include using namespace boost;using namespace std;using namespace boost;class A{ private: A(const A&);
2013-05-08 15:08:16
780
原创 boost学习之pool
#include#include #include #include #include #include using namespace std;using namespace boost;class demo_class{ public: int a,b,c; demo_class(int x=1,int y=2,int z=3):a(
2013-05-08 11:22:07
685
原创 boost学习scoped_ptr,shared_ptr
#include #include #include //#include using namespace std;using namespace boost;struct posix_file{ posix_file(const string& filename) { cout <<"open file" << filename << end
2013-05-07 17:55:51
863
原创 boost之date/time学习
#include#include#include #include#include#include //date headerfile#include //time headerfile#include using namespace std;using namespace boost;using namespace boost::gregorian;using nam
2013-05-07 15:44:13
857
原创 boost之字符串算法库
#include #include #include #include using namespace std;using namespace boost;bool is_exec_filename(string& filename){ return iends_with(filename,".exe") || iends_with(filename,".com");
2013-05-06 10:37:19
667
原创 boost 线程学习bind
// g++ thread.cpp -lboost_system -lboost_thread#include #include #include #include using namespace std; class myclass { public: string str_; int num_; myclass(string s, int n)
2013-05-03 16:50:58
1011
原创 boost序列化
#include #include #include #include #include #include typedef boost::archive::text_iarchive iarchive; typedef boost::archive::text_oarchive oarchive; using namespace std;
2013-05-03 15:55:39
763
原创 Boost
一、概述线程是在同一程序同一时间内允许执行不同函数的离散处理队列,这使得在一个长时间进行某种特殊运算的函数在执行时不阻碍其他的函数时变得十分重要。线程实际上允许同时执行两种函数,而这两者不必相互等待。一旦一个应用程序启动,它仅包含一个默认线程。此线程执行main()函数。在main()中被调用的函数则按这个线程的上下文顺序地执行,这样的程序称为单线程程序。反之,那些创建新的线程的程序就是多线
2013-05-03 13:43:42
1662
1
原创 python文件及函数初步
#-*- encoding: utf-8 -*-'''Created on 2013-*-*@author: ****'''f=open("b.txt")#去掉换行符data =[line.strip() for line in f]print dataf.close()print f.closed#以下是文件的内部属性#file.closed True 表示文件已经被关
2013-04-27 17:46:09
857
原创 python学习一
#-*- encoding: utf-8 -*-'''Created on 2013-*-*@author: ****'''import sysfrom locale import strsys.stdout.writelines("this is test\n")str = "start to learn python"print strstrprint "%s i
2013-04-25 15:31:57
1370
原创 C语言中##的用法以及##在变参的设计
C语言中##称为连接符,其功能是在带参数的宏定义中将两个子串(token)联接起来,从而形成一个新的子串。要注意下面的用法:1、[cpp] #include #define debug(format, args...) fprintf(stderr, format, args) void main(void){ debug("Test \n");
2013-04-24 14:13:12
922
原创 记录的网站
http://www.cnblogs.com/ggjucheng/http://www.boost.org/doc/libs/1_53_0/doc/html/thread.html //bost线程库http://software.intel.com/zh-cn/blogs/2011/09/15/boost1 #inter boost 库整理
2013-04-09 14:21:34
655
转载 tcpdump详解
用简单的话来定义tcpdump,就是:dump the traffic on a network,根据使用者的定义对网络上的数据包进行截获的包分析工具。 tcpdump可以将网络中传送的数据包的“头”完全截获下来提供分析。它支持针对网络层、协议、主机、网络或端口的过滤,并提供and、or、not等逻辑语句来帮助你去掉无用的信息。 实用命令实例默认启动tcpdump
2013-04-09 14:19:14
1722
转载 fcntl系统调用
功能描述:根据文件描述词来操作文件的特性。 用法: int fcntl(int fd, int cmd); int fcntl(int fd, int cmd, long arg); int fcntl(int fd, int cmd, struct flock *lock); 参数: fd:文件描述词。 cmd:操作命令。 arg:
2013-04-07 10:07:24
641
转载 linux下查看进程内存使用情况
动态查看一个进程的内存使用[c-sharp] view plaincopyprint?1、top命令 top -d 1 -p pid [,pid ...] //设置为delay 1s,默认是delay 3s 如果想根据内存使用量进行排序,可以shift + m(Sort by memory usage)
2013-04-02 14:54:36
499
云计算核心技术剖析
2013-04-16
linux shell 编程
2012-11-21
LINUX_sed命令详解
2012-11-21
WCDMA协议与信令分析手册(经典)
2012-11-01
windows下tcl脚本软件
2012-10-22
linux内核之旅.rar
2011-07-21
shell中字符串截取
2011-06-28
makefile相关资料
2011-06-08
kerner_test kerner_test kerner_test kerner_test
2011-06-07
信号pthread_cond_wait
2011-05-17
Linux设备驱动程序第三版2.6.CHM
2011-01-15
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人