- 博客(100)
- 资源 (2)
- 收藏
- 关注
原创 内部类的使用以及抽象类的实现
package zhj_test;public class Point { public Point() { //TODO } public Point(String Name, String address) { this.aName = Name; Point.aAddress = address; } public String toString() {
2016-04-19 17:10:44
707
原创 C/C++ 子类调用父类中的私有成员变量(对比JAVA)
C++Person中age为私有的,通过Persron::getAge()可以获取age的值。#include using namespace std;class Person { public: Person(int a) { this->age = a; } int getAge() { return age; } private:
2016-04-08 18:27:31
17317
原创 创建简单的可执行的jar(备忘)
1> 在com/test下创建Test.java文件:package com.test;import java.util.Random;public class Test{ public Test() { //TODO } private String aName; public static int aNum; //static code bloc
2016-04-08 16:33:35
596
原创 mysql导入固定格式的数据 -- load data
例句:./bin/mysql -uroot -p LOAD DATA INFILE '/home/sdb/mysql/seed/web_sales/web_sales1-2.dat'INTO TABLE test.web_salesFIELDS TERMINATED BY '|' LINES TERMINATED BY '\n'说明:导入 '/home/sdb/my
2015-12-31 13:40:53
1353
原创 impala导入数据见表语句脚本
1、将建表语句脚本拷贝到要执行的目录下!2、执行如下 impala-shell -i localhost -f createTable.sql3、createTable.sql样例: use mysql;create tableif notexists dbgen_version( dv_version v
2015-12-31 13:29:14
3225
原创 linux C复习:文件操作(stat获取文件属性)
#include #include #include #include #include typedef struct stat ST;int main(){ //准备结构体 ST s; //调用stat函数 int res = stat("a.txt",&s); if(-1 == res) perror("error:")
2014-08-22 17:30:32
1958
原创 linux C复习:文件操作|(函数fcntl)
1、函数原型 #include #include int fcntl(int fd, int cmd, ... /* arg */ );
2014-08-15 15:02:03
844
原创 linux C复习:#pragma的典型应用
1、使用pragma设置文件依赖 例如: #pragma GCC dependency "hello.c" //设置使用gcc编译时文件hello.c的最后修改时间不能晚于当前文件,否则在编译的时候会警告2、设置文件禁用某一关键字 例如: #pragma GCC poison goto //设置关键字goto有毒,文件中不能出现got
2014-08-12 22:34:48
764
原创 C/C++:友元函数以及友元类的使用总结
1、友元函数1.1为什么要使用友元函数在实现类之间数据共享时,减少系统开销,提高效率。如果类A中的函数要访问类B中的成员(例如:智能指针类的实现),那么类A中该函数要是类B的友元函数。具体来说:为了使其他类的成员函数直接访问该类的私有变量。即:允许外面的类或函数去访问类的私有变量和保护变量,从而使两个类共享同一函数。实际上具体大概有下面两种情况需要使用友元函数:(1)运算符重载的某
2014-08-11 16:16:02
1153
原创 C/C++:递归使用:使用递归反向写文件(例子)以及字符串翻转输出
#include #include void operate(FILE *read,FILE *write){ //准备空间用于保存读取的数据 char buffer[1024] = {0}; //设置结束条件 if(!fgets(buffer,1024,read)) return; //调用自己 operate(read
2014-08-06 16:48:41
2107
原创 C/C++:private私有继承
#include #include class A{public: A(){} A(const QString a,const QString b,const QString c): pubAttr(a), priAttr(b), proAttr(c) {} QString pubAttr; voi
2014-08-06 14:04:17
763
原创 C/C++:public公有继承
#include #include class A{public: A(){} A(const QString a,const QString b,const QString c): pubAttr(a), priAttr(b), proAttr(c) {} QString pubAttr; voi
2014-08-06 11:23:21
743
原创 C/C++:面向对象编程特性:多态(虚函数表原理)
#include #include using namespace std;//定义两个函数指针类型typedef void(*pFunc)(void);typedef int(*pSum)(int,int);//定义测试基类class A{public: //定义虚函数func virtual void func() { printf
2014-08-05 14:54:12
756
原创 Python学习28:类、实例的其它内建函数
#FileName:classMethod.py#类、实例及其它对象的内建方法#定义三个类Parent,Child,gcclass Parent: arr = 1000 ls = ['Hello','Python','World'] def __init__(self): print('Calling parent’s Constructor')
2014-07-31 17:38:24
614
原创 Python学习27:继承以及多重继承方式,MRO(方法解释顺序)
#FileName : baseClass.py#继承的方式,内建函数super的使用,多重继承#定义父类Parentclass Parent(object): def __init__(self): print('Calling Parent‘s Constructor')#定义子类Chaildclass Child(Parent): def __
2014-07-31 16:50:15
1121
原创 Python学习24:偏函数应用(partial)
函数的partial应用 函数在执行时,要带上所有必要的参数进行调用。但是,有时参数可以在函数被调用之前提前获知。这种情况下,一个函数有一个或多个参数预先就能用上,以便函数能用更少的参数进行调用。
2014-07-30 10:42:27
704
原创 Python学习22:列表解析(列表综合深入)
print('列表解析------------------------------------')#列表解析:可用到动态的创建一个列表#内建函数map():对所有的列表成员应用一个操作#内建函数filter():基于一个条件表达式过滤列表成员#列表解析语法:[expr for iter_var in iterable]:核心是for循环,迭代iterable对象的所有条目,expr应用与每
2014-07-29 14:33:42
1222
linux二维码
2014-12-26
Qt5 QFtp普通文件断点续传
2014-06-20
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人