- 编程杂记——积跬步至千里
Pweng-Rocky
编程杂记其他
文章目录MySQL概念理解MySQLmysql修改数据库文件存储路径后,会初始化数据库文件;所以要将老的数据文件拷贝到新的数据文件目录概念理解分布式:分开部署的方式将一个应用的不同功能分开进行部署集群:一群集合将每个功能进行冗余部署,就形成了集合,所有的功能都进行冗余部署,就形成了集群领域驱动设计(DDD):按领域的思想去设计领域:以最小的单元形成自己的领域,自己的事自己干,形成了一个最小单元的自
- RDMA编程杂记
可姆可汗
RDMARDMA
目录编程杂记什么是P_Key建链基于SocketAPI的建链基于CMAPI的建链编程杂记什么是P_KeyP_Key(PartitionKey)用于提供InfiniBand网络的隔离机制,只有在一个分区内的节点可以互相通信。P_Key是一个16位的值,有两部分msb位:membershipbit,0表示limitiedmembership,1表示fullmembership低15位是定义分区的key
- python基础与速成
Marcos_ZJU
pythonpython开发语言
python基础与速成python学习中的两大工具函数数据类型语句函数面向对象编程杂记python学习中的两大工具函数dir():打开查看工具箱及分支dir(torch)dir(torch.cuda)help():查看帮助help(torch.cuda.is_available)#注意在此要省去()数据类型数字(number):用于存储数值,属于不可变数据类型。字符串(string):可以使用引号
- 编程杂记
weixin_30650859
c#数据库操作系统
编程杂记本文主要用于记录一些小知识点,至于为何要这么做,这里可能没说的那么详细,欢迎大家补充!另外这篇文章会一直追加下去,什么时候有了新的东西都会加入。首先给出一句很经典的话:任何一件有几率发生的事情,最后一定会发生!1、【ASP.NET】在调用ComboBox.Items.Add()方法的时候,尽量使用传递string类型的值,即ComboBox.Items.Add(obj.ToString()
- 编程小知识 之 杂记两则
tkokof1
语言字符串字面量C++C#合并
本文简述了之前遇到的两则编程杂记隐式字符串字面量合并之前看到一段C/C++代码:voidfunc(constchar*str){//implementation...}func("string""params");代码定义了一个参数为字符串指针的函数func,调用时却使用了“string”“params”这种字符串连写的方式(中间没有逗号分隔符),初看时我一直怀疑调用代码存在"笔误",甚至认为这种
- 编程中上下文切换的理解
Rocky_鹏举
编程杂记
主题:上下文切换作者:Rocky_Yu时间:2019/3/617:16:14分类:9.1-编程杂记Version:1.0.0******************************************************Eveninthedarkness,you’llseethetruth.************************************************
- 【程序猿硬核科普】Linux下Shell编程杂记
浩Coding
linuxshell脚本语言
本篇文章主要讲一些常用的Shell编程知识,包括:date日期格式化、清空文件内容、Shell字符串截取、Shell中使用运算符、RANDOM随机数、强制对一个变量进行算术操作(加减)、特殊字符进行转义等等。date日期格式化1、各种date日期格式转换格式:2020-02-24 11:50实例:显示当前时间命令:datedate'+%c'date'+%D'date'+%x'date'+%T'da
- 编程杂记(一些容易忘记的笔记)
KSD给力熊
笔记
1、#pragmawarning(disable:4996):老版本警告去除2、库导入、导出#ifdef_WIN32#ifdef_WINDLL#defineHSDEVICE_API_declspec(dllexport)///(“FrameData”);qRegisterMetaType(“FrameData&”);使用信号、槽传递自定义类型时,得先注册类型
- C#实现局域网UDP广播------C#网络编程杂记[1]
tt03030576
『C#』
学校开课C#网络编程,今天就研究了一下"C#实现局域网UDP广播,这一块设置到局域网"飞鸽"类似的通讯软件编程,需要用到的主要命名空间是:System.Net和System.Net.Scoket:接收端:Socketsocket=newSocket(AddressFamily.InterNetwork,SocketType.Dgram,ProtocolType.Udp);//初始化一个Scoket
- 编程杂记
_寒鸦
在渐渐的工作和学习当中,很自然的,会积攒一些关于编程和一些其他方面的心得和知识,本来一开始以为就存于脑袋中就可以了,会变成一种经验的积累,后来当我看MIT和一些其他名校的公开课,或者讲座之后,我觉得把当时的想法和心得以笔记的形式积累起来简直太重要了,因此,就有了这个文集的诞生,甚至不光是编程范围中的,一些在生活中发现的东西,语言,我都会记录于此,包括我以前用纸笔和备忘录写下的一些东西.当做对自身的
- 【程序猿硬核科普】Linux下Shell编程杂记
浩Coding
linuxshell脚本语言
本篇文章主要讲一些常用的Shell编程知识,包括:date日期格式化、清空文件内容、Shell字符串截取、Shell中使用运算符、RANDOM随机数、强制对一个变量进行算术操作(加减)、特殊字符进行转义等等。date日期格式化1、各种date日期格式转换格式:2020-02-24 11:50实例:显示当前时间命令:datedate'+%c'date'+%D'date'+%x'date'+%T'da
- Java并发编程杂记(2)
DaveM
对象共享synchronized设定原子性确定临界区+内存可见性要解决如下问题防止一个线程在使用对象状态而另一个线程在修改对象状态;且当一个线程修改了对象状态后,对其他线程可见。可见性多线程情况下的读写,无法保证在执行读操作时能够看到其他线程写入的值---同步机制解决造成可见性的原因之一:指令重排序----产生失效数据在32为机器执行double和long的问题Jvm会拆分为两个32为的操作,在读
- Java并发编程杂记(1)
DaveM
高并发:cpu--缓存--内存资源利用率公平性便利性生活举例---串行任务中的异步性:我在烧水的时候看书---平衡点安全性问题---产生竞态条件共享数据---共享相同的内存地址,并且并行执行不可破坏---永远不要发生最糟糕的事情活跃性问题---某个正确的事情最终会发生某个操作无法执行下去性能问题---频繁的上下文切换,CPU花更多的时间在线程调度上编写安全的多线程代码,核心在于对状态访问操作进行管
- 并发编程杂记
DSLZTX
1、在并发环境中,假设有一个被并发存取的资源,在任何时刻,你读取该资源得到的只是该资源的某个瞬时的值而已。即动态值的某个瞬间的静态值而已。2、在并发环境中,存在“强一致性”和“弱一致性”之分。“强一致性”的优点是:过程正确,结果正确;缺点是:由于需要采用加锁等机制,降低系统吞吐量。“弱一致性”的优点是:结果正确,相对“强一致性”来说,系统吞吐量高;缺点是:过程不正确。
- Java编程杂记
java编程
13 Java Date 日期的使用方法 注意: 月份的设定要-1。0-代表1月;1代表2月,11代表12月。
Calendar cal = new GregorianCalendar(2013,00,11,11,11,0);
java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("/yy
- 编程杂记
编程
本文主要用于记录一些小知识点,至于为何要这么做,这里可能没说的那么详细,欢迎大家补充!另外这篇文章会一直追加下去,什么时候有了新的东西都会加入。
首先给出一句很经典的话:任何一件有几率发生的事情,最后一定会发生!
1、【ASP.NET】在调用ComboBox.Items.Add()方法的时候,尽量使用传递string类型的值,即ComboBox.Items.Add(obj.ToString()
- ZooKeeper编程
myhadoop
编程zk
阅读更多ZooKeeper编程杂记ZooKeeper的用途:distributedcoordination;maintainingconfigurationinformation,naming,providingdistributedsynchronization,andprovidinggroupservices.Zookeeper的节点都是存放在内存中的,所以读写速度很快。更新日志被记录到了磁
- ZooKeeper编程
myhadoop
编程zk
ZooKeeper编程杂记ZooKeeper的用途:distributedcoordination;maintainingconfigurationinformation,naming,providingdistributedsynchronization,andprovidinggroupservices.Zookeeper的节点都是存放在内存中的,所以读写速度很快。更新日志被记录到了磁盘中,以
- c语言mysql编程杂记
penyunwudong
sqlcmysql语言includemakefile
1. MakefileINCLUDE=/usr/include/mysql/LIBS=/usr/lib/mysqlall: gcc -I$(INCLUDE) -L$(LIBS) -lmysqlclient xxx.c -o xxxclean: rm -f xxx2. mysql的头文件和库文件配置如果mysql是默认安装的,在Makefile里配置INCLUDE=/us
- [置顶] Linux C/C++(或标准C++或标准C)编程杂记
helonSY
编程C++clinux
1.perror:打印上一个函数调用的错误信息。2.ungetc:回到调用getc函数之前。3.getcwd:获取程序执行的当前目录。4.isdigit:判断是否是数字。5.fstring::is_open:判断文件是否正确打开了。6.isalnum:判断是否为数字或字母。7.isspace:判断是否为空格。8.nanosleep:以毫秒为单位9.usleep:睡一段时间,以为微秒为单位。详情请参
- [置顶] 编程杂记2
helonSY
sql编程数据库windowsserverstructureTSQL
1.编译的时候输出信息:#pragmamessage("Compiling:ThreadModel.h..........")2.操作系统版本不对输出出错信息:#ifndef_WINDOWS_#errorwindows.hshouldbeincludedfirst!#endif3.InterlockedIncrement对32为的数据进行原子级的加某个数操作,如果要对64为数进行类似处理请用Int
- APUE,网络编程杂记1
flyingV
多线程编程应用服务器socket网络应用
C程序的内存分配图(APUE) 一个进程地址空间中包含的内容(也称为Core Image): 1.文本段(Text Segment,只读,程序的代码),为了节省空间,同一个程序的多个进程共享该段; 2.数据段(Data Segment),即全局变量段,细分为初始化的和未初始化的数据,APUE上没有提到静态变量,静态变量应该也是存放在这里 3.栈,所有的函数的局部变量,形参,函数调用的返回地址等等都
- html页面js获取参数值
0624chenhong
html
1.js获取参数值js
function GetQueryString(name)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = windo
- MongoDB 在多线程高并发下的问题
BigCat2013
mongodbDB高并发重复数据
最近项目用到 MongoDB , 主要是一些读取数据及改状态位的操作. 因为是结合了最近流行的 Storm进行大数据的分析处理,并将分析结果插入Vertica数据库,所以在多线程高并发的情境下, 会发现 Vertica 数据库中有部分重复的数据. 这到底是什么原因导致的呢?笔者开始也是一筹莫 展,重复去看 MongoDB 的 API , 终于有了新发现 :
com.mongodb.DB 这个类有
- c++ 用类模版实现链表(c++语言程序设计第四版示例代码)
CrazyMizzz
数据结构C++
#include<iostream>
#include<cassert>
using namespace std;
template<class T>
class Node
{
private:
Node<T> * next;
public:
T data;
- 最近情况
麦田的设计者
感慨考试生活
在五月黄梅天的岁月里,一年两次的软考又要开始了。到目前为止,我已经考了多达三次的软考,最后的结果就是通过了初级考试(程序员)。人啊,就是不满足,考了初级就希望考中级,于是,这学期我就报考了中级,明天就要考试。感觉机会不大,期待奇迹发生吧。这个学期忙于练车,写项目,反正最后是一团糟。后天还要考试科目二。这个星期真的是很艰难的一周,希望能快点度过。
- linux系统中用pkill踢出在线登录用户
被触发
linux
由于linux服务器允许多用户登录,公司很多人知道密码,工作造成一定的障碍所以需要有时踢出指定的用户
1/#who 查出当前有那些终端登录(用 w 命令更详细)
# who
root pts/0 2010-10-28 09:36 (192
- 仿QQ聊天第二版
肆无忌惮_
qq
在第一版之上的改进内容:
第一版链接:
http://479001499.iteye.com/admin/blogs/2100893
用map存起来号码对应的聊天窗口对象,解决私聊的时候所有消息发到一个窗口的问题.
增加ViewInfo类,这个是信息预览的窗口,如果是自己的信息,则可以进行编辑.
信息修改后上传至服务器再告诉所有用户,自己的窗口
- java读取配置文件
知了ing
1,java读取.properties配置文件
InputStream in;
try {
in = test.class.getClassLoader().getResourceAsStream("config/ipnetOracle.properties");//配置文件的路径
Properties p = new Properties()
- __attribute__ 你知多少?
矮蛋蛋
C++gcc
原文地址:
http://www.cnblogs.com/astwish/p/3460618.html
GNU C 的一大特色就是__attribute__ 机制。__attribute__ 可以设置函数属性(Function Attribute )、变量属性(Variable Attribute )和类型属性(Type Attribute )。
__attribute__ 书写特征是:
- jsoup使用笔记
alleni123
java爬虫JSoup
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.7.3</version>
</dependency>
2014/08/28
今天遇到这种形式,
- JAVA中的集合 Collectio 和Map的简单使用及方法
百合不是茶
listmapset
List ,set ,map的使用方法和区别
java容器类类库的用途是保存对象,并将其分为两个概念:
Collection集合:一个独立的序列,这些序列都服从一条或多条规则;List必须按顺序保存元素 ,set不能重复元素;Queue按照排队规则来确定对象产生的顺序(通常与他们被插入的
- 杀LINUX的JOB进程
bijian1013
linuxunix
今天发现数据库一个JOB一直在执行,都执行了好几个小时还在执行,所以想办法给删除掉
系统环境:
ORACLE 10G
Linux操作系统
操作步骤如下:
第一步.查询出来那个job在运行,找个对应的SID字段
select * from dba_jobs_running--找到job对应的sid
&n
- Spring AOP详解
bijian1013
javaspringAOP
最近项目中遇到了以下几点需求,仔细思考之后,觉得采用AOP来解决。一方面是为了以更加灵活的方式来解决问题,另一方面是借此机会深入学习Spring AOP相关的内容。例如,以下需求不用AOP肯定也能解决,至于是否牵强附会,仁者见仁智者见智。
1.对部分函数的调用进行日志记录,用于观察特定问题在运行过程中的函数调用
- [Gson六]Gson类型适配器(TypeAdapter)
bit1129
Adapter
TypeAdapter的使用动机
Gson在序列化和反序列化时,默认情况下,是按照POJO类的字段属性名和JSON串键进行一一映射匹配,然后把JSON串的键对应的值转换成POJO相同字段对应的值,反之亦然,在这个过程中有一个JSON串Key对应的Value和对象之间如何转换(序列化/反序列化)的问题。
以Date为例,在序列化和反序列化时,Gson默认使用java.
- 【spark八十七】给定Driver Program, 如何判断哪些代码在Driver运行,哪些代码在Worker上执行
bit1129
driver
Driver Program是用户编写的提交给Spark集群执行的application,它包含两部分
作为驱动: Driver与Master、Worker协作完成application进程的启动、DAG划分、计算任务封装、计算任务分发到各个计算节点(Worker)、计算资源的分配等。
计算逻辑本身,当计算任务在Worker执行时,执行计算逻辑完成application的计算任务
- nginx 经验总结
ronin47
nginx 总结
深感nginx的强大,只学了皮毛,把学下的记录。
获取Header 信息,一般是以$http_XX(XX是小写)
获取body,通过接口,再展开,根据K取V
获取uri,以$arg_XX
&n
- 轩辕互动-1.求三个整数中第二大的数2.整型数组的平衡点
bylijinnan
数组
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class ExoWeb {
public static void main(String[] args) {
ExoWeb ew=new ExoWeb();
System.out.pri
- Netty源码学习-Java-NIO-Reactor
bylijinnan
java多线程netty
Netty里面采用了NIO-based Reactor Pattern
了解这个模式对学习Netty非常有帮助
参考以下两篇文章:
http://jeewanthad.blogspot.com/2013/02/reactor-pattern-explained-part-1.html
http://gee.cs.oswego.edu/dl/cpjslides/nio.pdf
- AOP通俗理解
cngolon
springAOP
1.我所知道的aop 初看aop,上来就是一大堆术语,而且还有个拉风的名字,面向切面编程,都说是OOP的一种有益补充等等。一下子让你不知所措,心想着:怪不得很多人都和 我说aop多难多难。当我看进去以后,我才发现:它就是一些java基础上的朴实无华的应用,包括ioc,包括许许多多这样的名词,都是万变不离其宗而 已。 2.为什么用aop&nb
- cursor variable 实例
ctrain
variable
create or replace procedure proc_test01
as
type emp_row is record(
empno emp.empno%type,
ename emp.ename%type,
job emp.job%type,
mgr emp.mgr%type,
hiberdate emp.hiredate%type,
sal emp.sal%t
- shell报bash: service: command not found解决方法
daizj
linuxshellservicejps
今天在执行一个脚本时,本来是想在脚本中启动hdfs和hive等程序,可以在执行到service hive-server start等启动服务的命令时会报错,最终解决方法记录一下:
脚本报错如下:
./olap_quick_intall.sh: line 57: service: command not found
./olap_quick_intall.sh: line 59
- 40个迹象表明你还是PHP菜鸟
dcj3sjt126com
设计模式PHP正则表达式oop
你是PHP菜鸟,如果你:1. 不会利用如phpDoc 这样的工具来恰当地注释你的代码2. 对优秀的集成开发环境如Zend Studio 或Eclipse PDT 视而不见3. 从未用过任何形式的版本控制系统,如Subclipse4. 不采用某种编码与命名标准 ,以及通用约定,不能在项目开发周期里贯彻落实5. 不使用统一开发方式6. 不转换(或)也不验证某些输入或SQL查询串(译注:参考PHP相关函
- Android逐帧动画的实现
dcj3sjt126com
android
一、代码实现:
private ImageView iv;
private AnimationDrawable ad;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout
- java远程调用linux的命令或者脚本
eksliang
linuxganymed-ssh2
转载请出自出处:
http://eksliang.iteye.com/blog/2105862
Java通过SSH2协议执行远程Shell脚本(ganymed-ssh2-build210.jar)
使用步骤如下:
1.导包
官网下载:
http://www.ganymed.ethz.ch/ssh2/
ma
- adb端口被占用问题
gqdy365
adb
最近重新安装的电脑,配置了新环境,老是出现:
adb server is out of date. killing...
ADB server didn't ACK
* failed to start daemon *
百度了一下,说是端口被占用,我开个eclipse,然后打开cmd,就提示这个,很烦人。
一个比较彻底的解决办法就是修改
- ASP.NET使用FileUpload上传文件
hvt
.netC#hovertreeasp.netwebform
前台代码:
<asp:FileUpload ID="fuKeleyi" runat="server" />
<asp:Button ID="BtnUp" runat="server" onclick="BtnUp_Click" Text="上 传" />
- 代码之谜(四)- 浮点数(从惊讶到思考)
justjavac
浮点数精度代码之谜IEEE
在『代码之谜』系列的前几篇文章中,很多次出现了浮点数。 浮点数在很多编程语言中被称为简单数据类型,其实,浮点数比起那些复杂数据类型(比如字符串)来说, 一点都不简单。
单单是说明 IEEE浮点数 就可以写一本书了,我将用几篇博文来简单的说说我所理解的浮点数,算是抛砖引玉吧。 一次面试
记得多年前我招聘 Java 程序员时的一次关于浮点数、二分法、编码的面试, 多年以后,他已经称为了一名很出色的
- 数据结构随记_1
lx.asymmetric
数据结构笔记
第一章
1.数据结构包括数据的
逻辑结构、数据的物理/存储结构和数据的逻辑关系这三个方面的内容。 2.数据的存储结构可用四种基本的存储方法表示,它们分别是
顺序存储、链式存储 、索引存储 和 散列存储。 3.数据运算最常用的有五种,分别是
查找/检索、排序、插入、删除、修改。 4.算法主要有以下五个特性:
输入、输出、可行性、确定性和有穷性。 5.算法分析的
- linux的会话和进程组
网络接口
linux
会话: 一个或多个进程组。起于用户登录,终止于用户退出。此期间所有进程都属于这个会话期。会话首进程:调用setsid创建会话的进程1.规定组长进程不能调用setsid,因为调用setsid后,调用进程会成为新的进程组的组长进程.如何保证? 先调用fork,然后终止父进程,此时由于子进程的进程组ID为父进程的进程组ID,而子进程的ID是重新分配的,所以保证子进程不会是进程组长,从而子进程可以调用se
- 二维数组 元素的连续求解
1140566087
二维数组ACM
import java.util.HashMap;
public class Title {
public static void main(String[] args){
f();
}
// 二位数组的应用
//12、二维数组中,哪一行或哪一列的连续存放的0的个数最多,是几个0。注意,是“连续”。
public static void f(){
- 也谈什么时候Java比C++快
windshome
javaC++
刚打开iteye就看到这个标题“Java什么时候比C++快”,觉得很好笑。
你要比,就比同等水平的基础上的相比,笨蛋写得C代码和C++代码,去和高手写的Java代码比效率,有什么意义呢?
我是写密码算法的,深刻知道算法C和C++实现和Java实现之间的效率差,甚至也比对过C代码和汇编代码的效率差,计算机是个死的东西,再怎么优化,Java也就是和C