Munging data four bytes at a time

void Munge32( void *data, uint32_t size ) {
    uint32_t *data32 = (uint32_t*) data;
    uint32_t *data32End = data32 + (size >> 2); /* Divide size by 4. */
    uint8_t *data8 = (uint8_t*) data32End;
    uint8_t *data8End = data8 + (size & 0x00000003); /* Strip upper 30 bits. */
    
    while( data32 != data32End ) {
        *data32++ = -*data32;
    }
    while( data8 != data8End ) {
        *data8++ = -*data8;
    }
}

Web BT on Ubuntu

add-apt-repository ppa:deluge-team/ppa
sudo apt-get install deluged deluge-web

http://IP:8112,初始密码是deluge

需要在服务器侧运行deluge-web

iOS 使用 GLES 绘制文字

EAGLContext *contextGL;
contextGL = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
    if (contextGL == nil) {
        NSLog(@"wangsijie, failed to create EAGLContext");
    } else {
        NSLog(@"wangsijie, create EAGLContext OK");
    }
    
    CGRect rectGL = CGRectMake(100, 100, 150, 100);
    GLKView *viewGL = [[GLKView alloc] initWithFrame:rectGL];
    viewGL.context = contextGL;
    viewGL.enableSetNeedsDisplay = NO;
    [self.view addSubview:viewGL];
    [viewGL setDelegate:self];
    CADisplayLink *displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(render:)];
    [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
    
    [viewGL setTag:9];
    [self.mediaControl2 addSubview:viewGL];


- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect {
    UIGraphicsBeginImageContext(_mediaControl2.currentTimeLabel.bounds.size);
    [_mediaControl2.currentTimeLabel.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *layerImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    CIContext *ciContext = [CIContext contextWithEAGLContext:contextGL];
    CIImage *ciImage = [[CIImage alloc] initWithImage:layerImage];
    [ciContext drawImage:ciImage inRect:CGRectMake(0, 0, 150, 100) fromRect:[ciImage extent]];
    
    //glClearColor(1.0, 0.0, 0.0, 1.0);
    //glClear(GL_COLOR_BUFFER_BIT);
}

- (void)render:(CADisplayLink*)displayLink {
    GLKView *view = [self.mediaControl2 viewWithTag:9];
    [view display];
}

wordpress 迁移-域名更改

wordpress文件复制到新服务器

旧数据库导入

修改数据库

请查考这里

修改wordpress配置

  • 编辑wp-config.php文件
  • 在”define”语句后,插入 define(‘RELOCATE’,true);
  • 打开wp-login.php页面
  • 正常登陆

在正常登录后台后检查 “设置 -> 常规选项” 中检查 “wordpress地址”和”站点地址” 是否正确。 最后也是最重要的一点,重置”固定链接”。如果你曾经修改过wordpress的”固定链接”样式,则必须重置成”朴素”样式。否则首页上的所有链接都会返还404 。

All Done!

ref:http://www.wordpress.la/codex-更改网站URL.html ref:https://wordpress.org/support/topic/moved-site-to-different-host-now-getting-404-error ref:http://www.wordpress.la/codex-迁移WordPress.html

H264 SPS & PPS

Alt none