注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

阿弥陀佛

街树飘影未见尘 潭月潜水了无声 般若观照心空静...

 
 
 

日志

 
 
关于我

一直从事气象预报、服务建模实践应用。 注重气象物理场、实况场、地理信息、本体知识库、分布式气象内容管理系统建立。 对Barnes客观分析, 小波,计算神经网络、信任传播、贝叶斯推理、专家系统、网络本体语言有一定体会。 一直使用Java、Delphi、Prolog、SQL编程。

网易考拉推荐

24小时时间分组排序  

2018-03-21 14:40:34|  分类: Scala |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
def testTArr(): Unit ={
val tz:String="201801140000"
val H24 = 24
val t_as2: Array[Array[String]] = mkTimeArr(tz,nTime4fore).grouped(H24).toArray
prn(t_as2)

val nH = nTime4fore / H24
require(nH * H24 == nTime4fore,"nTime4fore 需要为24的倍数。")
//将t_as2分配到0..23个时间区
val g24s = Array.fill[String](nH,H24)("")
for (
i <- 0 until nH;
h <- 0 until H24;
ti = t_as2(i)(h);
hi = getHours(ti)
){
g24s(i)(hi) = ti
}
prn(g24s)
}
201801110100,201801110200,201801110300,201801110400,201801110500,201801110600,201801110700,201801110800,201801110900,201801111000,201801111100,201801111200,201801111300,201801111400,201801111500,201801111600,201801111700,201801111800,201801111900,201801112000,201801112100,201801112200,201801112300,201801120000
201801120100,201801120200,201801120300,201801120400,201801120500,201801120600,201801120700,201801120800,201801120900,201801121000,201801121100,201801121200,201801121300,201801121400,201801121500,201801121600,201801121700,201801121800,201801121900,201801122000,201801122100,201801122200,201801122300,201801130000
201801130100,201801130200,201801130300,201801130400,201801130500,201801130600,201801130700,201801130800,201801130900,201801131000,201801131100,201801131200,201801131300,201801131400,201801131500,201801131600,201801131700,201801131800,201801131900,201801132000,201801132100,201801132200,201801132300,201801140000
==================
201801120000,201801110100,201801110200,201801110300,201801110400,201801110500,201801110600,201801110700,201801110800,201801110900,201801111000,201801111100,201801111200,201801111300,201801111400,201801111500,201801111600,201801111700,201801111800,201801111900,201801112000,201801112100,201801112200,201801112300
201801130000,201801120100,201801120200,201801120300,201801120400,201801120500,201801120600,201801120700,201801120800,201801120900,201801121000,201801121100,201801121200,201801121300,201801121400,201801121500,201801121600,201801121700,201801121800,201801121900,201801122000,201801122100,201801122200,201801122300
201801140000,201801130100,201801130200,201801130300,201801130400,201801130500,201801130600,201801130700,201801130800,201801130900,201801131000,201801131100,201801131200,201801131300,201801131400,201801131500,201801131600,201801131700,201801131800,201801131900,201801132000,201801132100,201801132200,201801132300
==================

  评论这张
 
阅读(10)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018