bigint

开发者工具又加了什么好东西?(Chrome 68)

本秂侑毒 提交于 2019-12-03 08:06:15
本文转载于: 猿2048 网站➵ https://www.mk2048.com/blog/blog.php?id=hc0jbj10hj 转载自 https://blog.vvvvvvvvvvvvvvv.com/2018/05/28/whats-new-in-devtools-Chrome-68/index.html 由 Chrome官方文章 翻译, 建议查看英文原文, 作为程序员, 读懂官方文档应当是必备的技能(因为译文包含了译者的思维, 不一定能精确的表达原文想要表达的思维). 能拿到这些 '核心数据' 也是必备的技能 Notes: 这些发布说明的视频版本大约在 2018.7 月底左右发行 新的 Chrome 68 开发者工具: Eager Evaluation(即刻求值). 当你键入表达式时, 控制台会预览结果. Argument hints(参数提示). 当你键入函数, 控制台会向你展示该函数期望的参数. Function autocompletion(函数自动补全). 在你键入一个函数调用后, 如 document.querySelector('p') , 控制台会向你展示返回值支持的函数和属性. ES2017 keywords in the Console(ES2017 控制台关键词). 关键字, 如 await , 现在已经支持在控制台的自动补全. Lighthouse

mysql中int、bigint、smallint 和 tinyint的区别与长度

旧巷老猫 提交于 2019-12-03 08:00:03
通过创建一张表,来看看 mysql 中 int bigint smallint 和 tinyint的区别与长度 1、在mysql 命令行创建如下表 CREATE TABLE `test_int_1` ( `int_id` int NOT NULL, `bigint_id` bigint DEFAULT NULL, `bigint_25` bigint(25) DEFAULT NULL, `bigint_18` bigint(18) DEFAULT NULL, `int_8` int(8) DEFAULT NULL, `int_3` int(3) DEFAULT NULL, `smallint_id` smallint DEFAULT NULL, `tinyint_id` tinyint DEFAULT NULL, PRIMARY KEY (`int_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 2、desc mysql> desc test_int_1; +-------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+-------------+------+--

Integer division algorithm

允我心安 提交于 2019-12-03 03:43:43
问题 I was thinking about an algorithm in division of large numbers: dividing with remainder bigint C by bigint D, where we know the representation of C in base b, and D is of form b^k-1. It's probably the easiest to show it on an example. Let's try dividing C=21979182173 by D=999. We write the number as sets of three digits: 21 979 182 173 We take sums (modulo 999) of consecutive sets, starting from the left: 21 001 183 356 We add 1 to those sets preceding the ones where we "went over 999": 22

SQL Server : error converting data type varchar to numeric

匿名 (未验证) 提交于 2019-12-03 02:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a table: Account_Code | Desc 503100 | account xxx 503103 | account xxx 503104 | account xxx 503102A | account xxx 503110B | account xxx Where Account_Code is a varchar . When I create a query below: Select cast(account_code as numeric(20,0)) as account_code, descr from account where isnumeric(account_code) = 1 It runs well by returning all record that have a valid numeric value in account_code column. But when I try to add another select, nested to prior sql: select account_code,descr from ( Select cast(account_code as numeric(20, 0))

Is there anything special about -1 (0xFFFFFFFF) regarding ADC?

别来无恙 提交于 2019-12-03 02:03:17
In a research project of mine I'm writing C++ code. However, the generated assembly is one of the crucial points of the project. C++ doesn't provide direct access to flag manipulating instructions, in particular, to ADC but this shouldn't be a problem provided the compiler is smart enough to use it. Consider: constexpr unsigned X = 0; unsigned f1(unsigned a, unsigned b) { b += a; unsigned c = b < a; return c + b + X; } Variable c is a workaround to get my hands on the carry flag and add it to b and X . It looks I got luck and the ( g++ -O3 , version 9.1) generated code is this: f1(unsigned int

Conversion of the nvarchar value &#039;3001822585&#039; overflowed an int column

匿名 (未验证) 提交于 2019-12-03 01:22:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use following to import Excel file to SQL Server. The Excel file has all the values as string. I am able to import the file except Barcode , SalePrice and Price2 . I get error Conversion of the nvarchar value '3001822585'(barcode) overflowed an int column Code: SqlCommand sqlcmd = new SqlCommand (@"MERGE Inventory AS target USING (SELECT LocalSKU, ItemName, QOH, Price, Discontinued,Barcode, Integer2 ,Integer3, SalePrice, SaleOn, Price2 FROM @source) AS Source ON (Source.LocalSKU = target.LocalSKU) WHEN MATCHED THEN UPDATE SET ItemName =

促销管理――优惠券设计与架构

匿名 (未验证) 提交于 2019-12-03 00:22:01
最近公司让写一个优惠卷的demo,最近总结学习了一下,做下总结;大佬们别喷我哈,新人求照顾~ 做促销活动的目的就是增加订单量与知名度等等, 那么对于电商(家具)平台而言,我们采用优惠券的这种方式进行促销。 首先设计数据库表 1. 优惠券基础信息表 说明:任何一个优惠券或者其他促销都是有一个基础的说明,比如:优惠券名称,类型,价格,有效期,状态,说明等等基础信息。 DROP TABLE IF EXISTS `coupon` ; CREATE TABLE `coupon` ( `coupon_id` bigint ( 20 ) unsigned NOT NULL AUTO_INCREMENT COMMENT '自动增加ID' , `coupon_no` varchar ( 32 ) DEFAULT NULL COMMENT '优惠券编号' , `coupon_name` varchar ( 64 ) DEFAULT NULL COMMENT '优惠券名称' , `coupon_send_type` tinyint ( 2 ) DEFAULT NULL COMMENT '优惠券发放类型,1为注册时发送' , `coupon_setting_type` tinyint ( 2 ) DEFAULT NULL COMMENT '优惠券结算类型,1,折抵价,2,满减券,3,折扣券' ,

数据库设计――smallint(5) VS varchar(5)

匿名 (未验证) 提交于 2019-12-03 00:18:01
一个比较有意思的 case,写出来自嘲一下。背景很简单,同事调用我方创建账单接口,创建失败,查日志显示 Data truncation: Out of range value for column 'channel' at row 1 明显,对方传入的 channel字段超过了smallint的最大值。(业务上该值不会超过smallint最大值,对方误传告终)。于是笔者顺手百度了两个点 1、 smallint的最大值。答案从 -2^15 到 2^15 即(-32768到32767) 的整型数据 2、 D b字段中,5的具体含义,同理bigint(20)的20,varchar(255)中的255.这些db设计时经常出现的数字都是限长么?答案no。 正解: 1)对于 int类型而言 ,括号中的数字只是 补位数字 ,对该字段所表示的取值范围并没影响,这个补位的数字只有当你设置该字段为 zerofill 的时候才会体现差别; 测试验证:非 zerofill类型(建表语句,非zerofill时,插入数据查询结果显示如下:) 修改 id为zerofill类型后 可以看出在将bigint类型的id设置为bigint(20) zerofill后,id值自动左补齐20; 此时再insert id到bigint的max值, 9223372036854775807 也成功插入。说明 bigint(20

【原创】大叔经验分享(52)ClouderaManager修改配置报错

匿名 (未验证) 提交于 2019-12-02 23:30:02
Cloudera Manager中修改配置可能报错: Incorrect string value: '\xE7\xA8\x8B\xE5\xBA\x8F...' for column 'MESSAGE' at row 1 这是一个mysql的字符集问题,极有可能创建scm数据库时使用默认的latin1编码导致,涉及的表为: CREATE TABLE `REVISIONS` ( `REVISION_ID` bigint(20) NOT NULL, `OPTIMISTIC_LOCK_VERSION` bigint(20) NOT NULL, `USER_ID` bigint(20) DEFAULT NULL, `TIMESTAMP` bigint(20) DEFAULT NULL, `MESSAGE` longtext, PRIMARY KEY (`REVISION_ID`) 解决方法为: alter table REVISIONS convert to character set utf8; 如果不能修改字符集,也可以手工修改数据库中的配置: update CONFIGS set value = * where config_id = *; 然后重启对应的组件即可

Mybatis之ResultMap的使用详解

匿名 (未验证) 提交于 2019-12-02 22:06:11
Mybatis的定义 MyBatis 是一款优秀的持久层框架,它支持定制化 SQL、存储过程以及高级映射。MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集。MyBatis 可 以使用简单的 XML 或注解来配置和映射原生信息,将接口和 Java 的 POJOs(Plain Old Java Objects,普通的 Java对象)映射成数据库中的记录。 Mybaits如何使用,这里有一篇关于 Mybatis 的介绍,没有使用过的童鞋可以参考,今天主要说的是ResultMap。 ReultMap ResultMap是Mybatis最强大的元素,它可以将查询到的复杂数据(比如查询到几个表中数据)映射到一个结果集当中。 ResultMap包含的元素: <!--column不做限制,可以为任意表的字段,而property须为type 定义的pojo属性--> <resultMap id = "唯一的标识" type = "映射的pojo对象" > <id column = "表的主键字段,或者可以为查询语句中的别名字段" jdbcType = "字段类型" property = "映射pojo对象的主键属性" /> <result column = "表的一个字段(可以为任意表的一个字段)" jdbcType = "字段类型" property =