sqlserver百分比运算

select ltrim(Convert(numeric(9,2),25*100.0/30))+'%' As 百分比
- 得到百分比小数
select Cast(Convert(numeric(9,2),25*100.0/30) as decimal(18,2)) As 百分比小数

说明

NUMERIC(P,S) P的默认值是:38 S的默认值是:-84~127
numeric(a,b)函数有两个参数,前面一个为总的位数,后面一个参数是小数点后的位数,例如numeric(5,2)是总位数为5,小数点后为2位的数,也就是说这个字段的整数位最大是3位。

java1.8可以使用stream()流的方法,如下

List<Integer> numbers = Arrays.asList(1,2,3,4,5,6,7,8,9,10);
int chunkSize = 20;   //3 ok
AtomicInteger counter = new AtomicInteger();

Collection<List<Integer>> resultList = numbers.stream()
      .collect(Collectors.groupingBy(it -> counter.getAndIncrement() / chunkSize))
      .values();

System.out.println(resultList);

使用第三方工具类的方法:

  • Google Guava has Lists.partition(List list, int size) method (docs)
  • Apache Commons Collections has ListUtils.partition(List list, int size) method (docs)

举例说明:
Check out Lists.partition(java.util.List, int) from Google Guava:
Returns consecutive sublists of a list, each of the same size (the final list may be smaller). For example, partitioning a list containing [a, b, c, d, e] with a partition size of 3 yields [[a, b, c], [d, e]] -- an outer list containing two inner lists of three and two elements, all in the original order.

近日,腾讯在苹果应用商城上线了一款名叫“猫呼”的视频社交软件。
腾讯社交猫呼

该软件主打陌生人视频社交聊天,并支持美颜功能。同时,还可以进行实施面具匹配,介绍上说可以佩戴好看的面具和有趣的灵魂聊天;还有附近人功能,可以通过附近功能发现周围用户;支持在视频的时候进行美颜美妆,从介绍上可以发现,美型、美颜、瘦脸、瘦鼻、大眼等一系列针对性美化;还可以智能优化周围环境,保证隐私安全;同时在暗光下可以自动补光,保证视频效果。

在猫呼,所有的一切都是为了最后的相见而准备。让你遇见真正有趣的人,开启零距离在线视频邂逅。

目前处于冷启动阶段,已在App Store上线。仅支持通过QQ与微信两个通道进行注册。注册后,可设定交友意向,诸如“随便聊聊”、“单身交友”等作为匹配意向标签。用户添加好友后,仅能通过视频聊天,而无法使用文字或图片。

腾讯内部正孵化其他两款社交类产品,目前均处于保密阶段。其中一款Slogan为“记录认真生活的你”的产品,或对标小红书/绿洲,;另一款主打“高品质脱单”的恋爱交友App,目前正在腾讯内部秘密测试。

appstore 链接:https://apps.apple.com/cn/app/猫呼/id1471632106

免责声明
本博客部分内容来自于互联网,不代表作者的观点和立场,如若侵犯到您的权益,请联系[email protected]。我们会在24小时内进行删除。