header

Saving dictionary of header information using numpy.savez()

流过昼夜 提交于 2020-02-27 06:30:47
问题 I am trying to save an array of data along with header information. Currently, I am using numpy.savez() to save the header information (a dictionary) in one array, and the data in another. data = [[1,2,3],[4,5,6]] header = {'TIME': time, 'POSITION': position} np.savez(filename, header=header, data=data) When I try to load and read the file, however, I can't index the header dictionary. arrays = np.load(filename) header = arrays('header') data = arrays('data') print header['TIME'] I get the

Boost库-Chrono

会有一股神秘感。 提交于 2020-02-26 22:20:53
//不编译使用system库 #define BOOST_ERROR_CODE_HEADER_ONLY //不编译使用chrono库 #define BOOST_CHRONO_HEADER_ONLY //使用chrono库的扩展项 #define BOOST_CHRONO_EXTRNSIONS /* chrono中定义了时间长度表达duration duration的类摘要如下: //默认模板参数单位是秒 template<class Rep,class Period = rario<1>> class duration { public: //内部类型定义 typedef Rep rep; typedef Period period //成员 private: //时间单位计数 rep rep_; // public: //构造函数 constexpr duration( ); constexpr explicit duration(const Rep& r); constexpr duration(const duration &d); constexpr rep count( ) const; duration& opreator++( ); duration& opreator+=(const duration& d); duration& opreator*=(const

FFmpeg从入门到出家(FLV文件结构解析)

我是研究僧i 提交于 2020-02-26 12:29:24
FLV(FLASH VIDEO),是一种常用的文件封装格式,目前国内外大部分视频分享网站都是采用的这种格式。其标准定义为《Adobe Flash Video File Format Specification》。RTMP协议也是基于FLV视频格式的。 FLV的文件格式在该规范中已阐述清楚,本章节不再重复描述,而是结合下面的示例具体阐述如何分析FLV文件。 图3. FLV文件结构示例1 图4. FLV文件结构示例2 FLV文件的分析工具有很多,这里给大家推荐FLV Parser这个小软件,通过它可以很容易的看到文件的组成结构。 3.1 文件结构 从整个文件上看,FLV是由Header和File Body组成,如下图所示: 图5. FLV文件总体结构 1.FLV Header - 长度为9,其结构的标准定义参见标准定义见E.2 The FLV header; FLV File Body - 由一连串的PreviousTagSize + Tag构成。previousTagSize是4个字节的数据,表示前一个tag的size。标准定义参见E.3 The FLV File Body。 以图3. FLV文件结构示例1为例分析整体结构: 1.位置0x00000000 - 0x00000008, 共9个字节,为FLV Header,其中: ◦0x00000000 - 0x00000002 :

React-Navigation 使用笔记

て烟熏妆下的殇ゞ 提交于 2020-02-26 10:36:08
React-Native 的新版本取消了 navigator,使用了新的 React-Navigation 组件。这个组件非常强大。 但是有的时候我们需要自定义 Header,又不想在每个 View 上附带 Header,而是想要实现原生的效果(即 Header 是一个独立的层,和视图无关)。 参考官方文档: 普通用法:在每个 StackNavigator 管理的视图 class 中加入 static 属性 static navigationOptions = { title: 'Home', } 自定义用法:这里的 Header 是一个自定义组件 static navigationOptions = () => ( { header: () => <Header title="首页" showBack={false}></Header> } ) 注意,如果用 Redux 管理了 navigation,那么自定义的 Header 中需要 connect 一下 nav 中的 dispatch 方法。 自定义用法的参数传递: 传递 NavigationActions.navigate({ routeName: "AMap", params: { title: "地图" } }); // 结合 redux this.props.dispatch(NavigationActions

qcow2快照原理

余生长醉 提交于 2020-02-26 05:30:51
关键术语: cluster 一个Qcow2 img文件由固定大小的单元组成,该单元称为cluster,默认大小为65536bytes/64K sector 数据块读写的最小单元,大小为512字节 host cluster 位于Host上qcow2 img文件的cluster管理名称 guest cluster Guest所看到的virtual disk的cluster管理名称 Qcow2 Header Qcow2 img的文件头信息,占用第一个cluster refcount Qcow2内部用于管理cluster的分配而维护的引用计数 refcount table 用于查找refcount的第一级表 refcount block 用于查找refcount的第二级表 L1 table 用于查找guest cluster到host cluster映射的第一级表 L2 table 用于查找guest cluster到host cluster映射的第二级表 IBA image block address VBA virtual block address Qcow2 Header typedef struct QCowHeader { uint32_t magic; uint32_t version; uint64_t backing_file_offset; uint32_t

Codeforces Round #624 (Div. 3)

末鹿安然 提交于 2020-02-25 19:14:51
挺简单的 题目链接: https://codeforces.com/contest/1311 A: 白给 1 /* basic header */ 2 #include <bits/stdc++.h> 3 /* define */ 4 #define ll long long 5 #define pb emplace_back 6 #define mp make_pair 7 #define eps 1e-8 8 #define lson (curpos<<1) 9 #define rson (curpos<<1|1) 10 /* namespace */ 11 using namespace std; 12 /* header end */ 13 14 int t; 15 16 int main() { 17 scanf("%d", &t); 18 while (t--) { 19 int a, b, cnt = 0; 20 scanf("%d%d", &a, &b); 21 if (a == b) puts("0"); 22 else if (a < b) { 23 if ((b - a) & 1) puts("1"); 24 else puts("2"); 25 } else { 26 if ((b - a) & 1) puts("2"); 27 else puts("1")

Disable Apache http2 announce via htaccess

霸气de小男生 提交于 2020-02-25 06:41:06
问题 I have a website on a shared host, responding with these HTTP headers on each page request: HTTP/1.1 200 OK Date: Thu, 21 Sep 2017 14:34:46 GMT Server: Apache X-Powered-By: PHP/5.6.31 Access-Control-Allow-Origin: * Upgrade: h2,h2c Connection: Upgrade, Keep-Alive Keep-Alive: timeout=5, max=400 Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 As you note, there is the Upgrade header that is an announce from Apache about the support of HTTP2 protocol. For some reason, I need to

Cache-control使用:header(\'Cache-control:private\')

帅比萌擦擦* 提交于 2020-02-25 02:39:18
网页的缓存是由 HTTP消息头中的“Cache-control”来控制的,常见的取值有private、no-cache、max-age、must- revalidate等,默认为private。其作用根据不同的重新浏览方式分为以下几种情况: (1) 打开新窗口 值为private、no-cache、must-revalidate,那么打开新窗口访问时都会重新访问服务器。 而如果指定了max-age值,那么在此值内的时间里就不会重新访问服务器,例如: Cache-control: max-age=5(表示当访问此网页后的5秒内再次访问不会去服务器) (2) 在地址栏回车 值为private或must-revalidate则只有第一次访问时会访问服务器,以后就不再访问。 值为no-cache,那么每次都会访问。 值为max-age,则在过期之前不会重复访问。 (3) 按后退按扭 值为private、must-revalidate、max-age,则不会重访问, 值为no-cache,则每次都重复访问 (4) 按刷新按扭   无论为何值,都会重复访问 Cache-control值为“no-cache”时,访问此页面不会在Internet临时文章夹留下页面备份。 另外,通过指定“Expires”值也会影响到缓存。例如,指定Expires值为一个早已过去的时间

sap --- ABAP 内表(internal table) 标题行(header line) 工作区(work area) 简介

偶尔善良 提交于 2020-02-24 06:45:41
刚开始学ABAP的时候,学到iternal table时,感觉一阵混乱. 搞不清楚什么是work area,什么是header line,以及occurs是干什么用的. 今天终于差不多搞明白了(我还是太弱啊...BS自己一下) 所以还是记录下来..省得自己以后再忘记... 先是用TYPES关键字定义一个行(row)的类型.如下: TYPES: BEGIN OF line, field1 TYPE i, field2 TYPE i, END OF line. 这里的line,就相当于一个自定义的类型,表示一行(row)的字段(field). 这里一行有两个字段field1和field2. 然后是声明一个work area: DATA wa TYPE line. 我用C++(还是对cpp最有好感^^)的概念理解就是, line是一个class,而wa是一个object. 接着是声明一个每一行的类型是line的internal table: DATA itab TYPE line OCCURS 0. 我在暂时把OCCURS作为了区别工作区和内表的标志. OCCURS应该有更深层次的意义,但我目前只能领悟至此... 当我们用以上这个方法来声明一个iternal table时,可以选择是否有无header line. 上面这句就是没有header line的.改成如下就有了: DATA

css布局 - 常规上中下分左右布局的一百种实现方法(更新中...)

蓝咒 提交于 2020-02-24 04:32:39
一、 上中下左固定 - fixed+margin 概括: 如图,此种布局就是顶部、底部和左侧固定不动,只有中间右侧超出可滚动。 html: <header>我是头部position: fixed;z-index: 9;</header> <section class="flexModal fixedLeft"> <nav> <ul> <li>section.flexModal nav ul>li*5</li> <li>栏目一</li> <li>栏目二</li> <li class="active">栏目三</li> <li>栏目四</li> <li>栏目五</li> </ul> </nav> <article> <h3> 内容区域 section.flexModal articel </h3> <p> section{ padding: 60px 0; } </p> <p> section.flexModal{ display: flex; } </p> <p> section.flexModal nav{ width: 200px; } </p> <p> section.flexModal article{ flex: 1; } </p> </article> </section> <footer>底部版权同头部 position: fixed;z-index: 9;<