update

「POI2011」Meteors

余生长醉 提交于 2020-01-24 00:07:52
「POI2011」Meteors 传送门 整体二分,树状数组实现区间修改单点查询,然后注意修改是在环上的。 参考代码: #include <cstdio> #include <vector> #define rg register #define file(x) freopen(x".in", "r", stdin), freopen(x".out", "w", stdout) using namespace std; template < class T > inline void read(T& s) { s = 0; rg int f = 0; rg char c = getchar(); while ('0' > c || c > '9') f |= c == '-', c = getchar(); while ('0' <= c && c <= '9') s = s * 10 + c - 48, c = getchar(); s = f ? -s : s; } const int _ = 9e5 + 5; int n, m, k, p[_], tr[_], ans[_]; vector < int > pos[_]; int num; struct node { int opt, l, r, x, id; } t[_], tt1[_], tt2[_]; inline

用update把一张表的信息更新到另外一张表里面

梦想与她 提交于 2020-01-23 20:31:21
更新表可以用很多方法,最省空间的方法就是直接update,有时候数据来自于其他表,所以我们可以直接从其他表取数来更新 如现在有2张表,table_student(stu_No,name,age,class_No,class_name),table_class(class_No,stu_qty,class_name) 现在需要将class表的class_name更新到student表上,可以用如下语句: update table_student set ts.class_name=tc.class_name from table_student ts,table_class tc where ts.class_No=tc.class_No 如果表在同服务器另外一个数据库里面,则可用[db].[table_class]来替代 如果表在不同的服务器,则可用[serverName].[db].[table_class]来替代,注意先链接一下,链接方法如下: EXEC sp_addlinkedserver @server='ServerName',--被访问的服务器别名 @srvproduct='', @provider='SQLOLEDB', @datasrc="10.1.0.8" --要访问的服务器 EXEC sp_addlinkedsrvlogin 'ServerName', -

docker命令

孤街浪徒 提交于 2020-01-23 17:56:14
#docker安装 https://docs.docker.com/install/linux/docker-ce/ubuntu/ docker node inspect --pretty prod-1|grep com. #进入docker容器 docker exec -it wuneng-user-web-test_wuneng-user-web-test.rl97ebqo6s2l1po8cv9ppd6gm.uin8lup8u0f03wwfnb5sv3hvw bash docker logs -f tax-crawler-test_tax-crawler-test.rl97ebqo6s2l1po8cv9ppd6gm.ulvh1aekesygo51ip3mk39ie6 docker node inspect prod-1 | grep com docker node inspect --pretty prod-2 |grep com.we docker node update --label-add com.weifeng18.test1=true prod-2 docker node update --label-add com.weifengqi18.wuneng-woodpecker-web-test=true prod-2 docker node update -

MySQL必知必会——第20章 更新和删除数据 读书笔记

眉间皱痕 提交于 2020-01-23 14:23:06
本章介绍如何利用update和delete进一步操纵表数据。 1 更新数据 为了更新(修改)表中数据,可使用update语句。可采用两种方式使用update: ①更新表中特定行; ②更新表中所有行。 基本的update语句由三部分组成: ①要更新的表; ②列名和它们的新值; ③确定要更新行的过滤条件。 举例:客户10005现在有了电子邮件地址,因此它的记录需要更新 update customers set cust_email='elmer@fudd.com' where cust_id =10005; update语句总是以要更新的表的名字开始。set命令用来将新值赋给被更新的列。update语句以where子句结束,它告诉MySQL更新哪一行。没有where子句,MySQL会更新表中的所有行。 更新多个列: update customers set cust_name='Cindy' cust_email=‘111@qq.com’ where cust_id =10005; 在更新多个列时,只需要使用单个SET命令,每个“列=值”对之间用逗号分隔(最后一个不需要逗号)。 update语句中可以使用子查询,使得能用select语句检索出的数据更新列数据。 如果用update语句更新多行,并且在更新这些行中的一行或者多行时出现一个错误,则整个update操作被取消

POST Update 注入

烂漫一生 提交于 2020-01-23 10:47:42
POST Update 注入 1.Mysql update介绍 2.过滤内容介绍 function check_input ( $value ) { if ( ! empty ( $value ) ) { // truncation (see comments) $value = substr ( $value , 0 , 20 ) ; //获得下标从0到20的字符串 } // Stripslashes if magic quotes enabled if ( get_magic_quotes_gpc ( ) ) //判断是否存在反斜杠 { $value = stripslashes ( $value ) ; //去除字符串中的反斜杠 } // Quote if not a number if ( ! ctype_digit ( $value ) ) //检验$value是否是纯数字 { $value = "'" . mysql_real_escape_string ( $value ) . "'" ; //函数转义SQL语句中使用的字符串中的特殊字符(\x00,\n,\r,\,' , " , \ x1a ) } else { $value = intval ( $value ) ; //获取变量的整数值 } return $value ; } 3.Mysql update注入

insert与update在加了Selective的区别与不同---通用mapper

…衆ロ難τιáo~ 提交于 2020-01-23 10:04:40
稍微有一段时间不接触通用mapper就把这俩货给忘了以下是—针对通用mapper的解释: 通用mapper中Selective只是做出了对null的检测,如下: insert 会插入所有字段 insertSelective 只会插入数据不为null的字段 updateByExample根据条件修改所有字段,如果字段为空值接添加数据为null updateByExampleSelective 根据条件只会修改数据不为null的字段 updateByPrimaryKey 根据主键修改所有字段,如果字段为空值接添加数据为null updateByPrimaryKeySelective 根据主键只会修改数据不为null的字段 insert好理解,update给个例子吧: 原数据:user:username=1,password=2,sex=null 传入数据为: username=1,password=null,sex=2 通过updateByPrimaryKey 修改,结果为: user:username=1,password=null,sex=2 通过updateByPrimaryKeySelective 修改,结果为: user:username=1,password=2,sex=2 Selective:淘汰 你传进来的数据是空的(null)我就不修改 <if test="name

互动编程习作——表现随机行为及牛顿运动学

感情迁移 提交于 2020-01-23 04:45:08
第一章 随机游走与概率分布 以上所有素材都取自这里! 为了实现随机游走,我采用了: rect(0,0,width,height); position.add(velocity); ellipse(mouseX,mouseY,16,16); 生成一个随鼠标移动的球体,并在背景板留下轨迹。 生成一个在不间断运动的球体: if ((position.x > width) || (position.x < 0)) { velocity.x = velocity.x * -1; } if ((position.y > height) || (position.y < 0)) { velocity.y = velocity.y * -1; } 运动规律是按照速度前进,遇到边界则改变速度方向。 为了使运动的物体和鼠标交互,我采用: if ((mouseX > position.x) && velocity.x<=0) { velocity.x = velocity.x * -1; } if ((mouseX < position.x) && velocity.x>=0) { velocity.x = velocity.x * -1; } 让物体根据鼠标的位置移动,向鼠标靠拢。 效果如图: 第二章 Processing中的向量。 我模拟的中心是一个带磁性的球体,无数的小铁球靠近磁体: 引用了两个类

update :This must be accepted explicitly before updates for this repository can be applied

时间秒杀一切 提交于 2020-01-23 03:24:58
参考网络资源 https://www.jianshu.com/p/5de3a2e688b4 ,安装samba,在执行sudo apt-get install samba时出现如下的错误信息: E: Failed to fetch http://raspbian.raspberrypi.org/raspbian/pool/main/s/samba/samba-common_4.9.5+dfsg-4_all.deb 404 Not Found [IP: 93.93.128.193 80] E: Failed to fetch http://raspbian.raspberrypi.org/raspbian/pool/main/s/samba/samba-common-bin_4.9.5+dfsg-4_armhf.deb 404 Not Found [IP: 93.93.128.193 80] E: Failed to fetch http://raspbian.raspberrypi.org/raspbian/pool/main/s/samba/samba_4.9.5+dfsg-4_armhf.deb 404 Not Found [IP: 93.93.128.193 80] E: Failed to fetch http://raspbian.raspberrypi.org

Cassandra cqlsh命令大全

北城以北 提交于 2020-01-23 01:01:11
一:CQL 简介 CQL是Cassandra Query Language的缩写,目前作为Cassandra默认并且主要的交互接口。CQL和SQL语法很相似,主要的区别是cql不支持join和子查询,相对来说没有sql那么强大。 二:Shell 命令 // 登录shell D:\Java\apache-cassandra-3.11.0\bin>cqlsh D:\Java\apache-cassandra-3.11.0\bin>cqlsh --help D:\Java\apache-cassandra-3.11.0\bin>cqlsh --version // 使用用户名和密码登录,默认用户名和密码都是cassandra D:\Java\apache-cassandra-3.11.0\bin>cqlsh -u 'cassandra' -p 'cassandra' // 启动时执行cql(可用于导入数据,或者执行文件中的cql) D:\Java\apache-cassandra-3.11.0\bin>cqlsh --file="D:\users.cql" // 帮助命令 cqlsh> help // 捕获命令,所有的select查询的结果都将保存在output文件中 cqlsh> capture 'D:\Java\apache-cassandra-3.11.0\data\output'

玩转乌班图-python

大城市里の小女人 提交于 2020-01-22 20:52:41
让python3.6变为默认 sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100 python2为默认。 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150 python3为默认。 sudo update-alternatives --config python 更改优先级 来源: CSDN 作者: 暴躁的铝合金键盘 链接: https://blog.csdn.net/qq_42393921/article/details/104072288