标签: segment

Changing segment content onPress

I have segments and I want them to act as tabs. I tried using react-navigation onPress of each segment but it doesn't look nice.

I want the segments to stay fixed at the top and on clicking each one the content should change or call a specific component without reloading or noticing that the screen has changed.

<Segment>
  <Button first>
    <Text>Puppies</Text>
   </Button>
   <Button>
    <Text>Kittens</Text>
    </Button>
    <Button last active>
      <Text>Cubs</Text>
    </Button>
</Segment>
<Content>
  <Text>Awesome segment</Text>
</Content>
Run Code Online (Sandbox Code Playgroud)

segment react-native native-base

1
推荐指数
1
解决办法
3447
查看次数

FFMPEG:在一段时间后输出到带有创建时间戳的新文件?

假设我有一个命令:

ffmpeg -f v4l2 -framerate 30 -video_size 640x480 -i /dev/video1 -c:v libx265 -x265-params bitrate=60:vbv-maxrate=60:vbv-bufsize=16:keyint=10:qcomp=0.5 -tune zerolatency -s 640x480 -preset ultrafast -pix_fmt yuv420p -r 5 -strict experimental -f somedate.ts
Run Code Online (Sandbox Code Playgroud)

我想要做的是,30 分钟后 ffmpeg 开始将流写入新文件,文件名作为新文件的创建时间。

ffmpeg segment output

0
推荐指数
1
解决办法
2355
查看次数

为什么在加载附近的代码字节时会出现意外的"0xcc"字节?是因为段寄存器%es?

我得到了一些不一致的教学结果.
我不知道为什么会这样,所以我怀疑%es寄存器做的很奇怪,但我不确定.

请看下面的代码段.

08048400 <main>:
 8048400:   bf 10 84 04 08          mov    $HERE,%edi     
 8048405:   26 8b 07                mov    %es:(%edi),%eax  # <----- Result 1
 8048408:   bf 00 84 04 08          mov    $main,%edi
 804840d:   26 8b 07                mov    %es:(%edi),%eax  # <----- Result 2

08048410 <HERE>:
 8048410:   11 11                   adc    %edx,(%ecx)
 8048412:   11 11                   adc    %edx,(%ecx)
Run Code Online (Sandbox Code Playgroud)


结果1:

%eax : 0x11111111 
Run Code Online (Sandbox Code Playgroud)

看到这个结果,我猜想 mov %es:(%edi),%eax有点像mov (%edi),%eax.
因为0x11111111存储在HERE.


结果2:

%eax : 0x048410cc  
Run Code Online (Sandbox Code Playgroud)

但是,结果2的结果完全不同.
我假设%eax是0x048410bf …

debugging x86 assembly segment

0
推荐指数
1
解决办法
81
查看次数

使用lazy_static!符号表中定义变量的大小为0

以下 Rust 代码,在 x86_64 平台编译。

#[macro_use]
extern crate lazy_static;

use std::collections::HashMap;

lazy_static! {
    static ref HASHMAP: HashMap<u32, &'static str> = {
        let mut m = HashMap::new();
        m.insert(0, "foo");
        m.insert(1, "bar");
        m.insert(2, "baz");
        m
    };
}

fn main() {
    // First access to `HASHMAP` initializes it
    println!("The entry for `0` is \"{}\".", HASHMAP.get(&0).unwrap());

    // Any further access to `HASHMAP` just returns the computed value
    println!("The entry for `1` is \"{}\".", HASHMAP.get(&1).unwrap());
}
Run Code Online (Sandbox Code Playgroud)

我使用readelf命令查看符号表中HASHMAP变量的大小:

readelf -sW target/debug/deps/section_test-4d7d6a03c56fdde3.o

Symbol table '.symtab' contains 590 …
Run Code Online (Sandbox Code Playgroud)

symbols elf segment rust lazy-static

0
推荐指数
1
解决办法
61
查看次数