phantomjs抓取ajax页面一例

# file: example.coffee
# usage: phantomjs example.coffee
page = require('webpage').create()

console.log 'The default user agent is ' + page.settings.userAgent

page.settings.userAgent = 'Mozilla/5.0 (iPad; CPU OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53'
page.open 'http://www.sina.com.cn/', (status) ->
  if status isnt 'success'
    console.log 'Unable to access network'
  else
    console.log page.content

phantom.exit()

安卓备忘八则

Android Studio中替换图片资源不起作用

删除目录~/AndroidStudioProjects/www/app/build/intermediates/res

Android Studio中导入jar

1、cp jar到~/AndroidStudioProjects/www/app/libs;
2、在libs文件夹中jar文件下鼠标右键,单击菜单 add as library;

设置app版本号

versionCode是真的版本号;
versionName是用户看到的版本号;

1、Eclispe中:
文件src/main/AndroidMainfest.xml里:
package="com.wirelessqa.sqlite"
android:versionCode="1"
android:versionName="1.0">

2、Android Studio中:
文件src/build.gradle里:
defaultConfig {
applicationId “com.hanguomv.www”
minSdkVersion 15
targetSdkVersion 20
versionCode 1
versionName “1.0”
}

Android Studio打包apk时出现missTranslation

文件res/values/*xml里加上
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingTranslation" >

java.io.FileNotFoundException

connection.setDoInput(true);
connection.setDoOutput(true);

这两个设置会导致HTTP使用POST方法,即使明示

connection.setRequestMethod(“GET”);

也无效。

进而导致java.io.FileNotFoundException at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStrea。

去掉这两个设置就可以正确访问了。

未覆盖 java.util.logging.Handler 中的抽象方法

错误现象:
Error:(36, 45) <匿名 com.hanguomv.www.index$1> 不是抽象的,并且未覆盖 java.util.logging.Handler 中的抽象方法publish(java.util.logging.LogRecord)

错误原因:
自动import系统错将java.util.logging.Handler包import进来了;

解决方法:
手动去掉import java.util.logging.Handler;
手动加上import android.os.Handler;

webview旋转不刷新、Activity旋转不重启

参见官方文档:

http://developer.android.com/guide/topics/manifest/activity-element.html

网上的解决方案大多是:
android:configChanges=”orientation|keyboardhidden”
这在android:minSdkVersion和android:targetSdkVersion等于13之前是ok的。

目前,这样设置才行:
android:configChanges=”orientation|screenSize”

去掉TextView之间的空白

有时margin、padding啥的设置为0是没有用的,这时就直接搞成负数就好了……
如:
android:layout_marginBottom=”-5dp”

rails4发布production版备忘

1、编译css和js

执行

  RAILS_ENV=production rake assets:precompile

如果出现错误

  did not recognize your adapter specification

如果multi_json不是版本1.7.9这个有问题的版本,则在Gemfile中增加

  gem 'yajl-ruby', :require => "yajl"

2、设置环境变量

export HANGUOMV_DATABASE_PASSWORD=xxxxx
export SECRET_KEY_BASE=xxxxx

3、初始化production的数据库

RAILS_ENV=productionrake db:create
RAILS_ENV=productionrake db:migrate

4、启动production的thin

rails s -p 3100 -b 127.0.0.1 -e production -P /var/www/rails/site/tmp/pids/server3100.pid -d
rails s -p 3101 -b 127.0.0.1 -e production -P /var/www/rails/site/tmp/pids/server3101.pid -d

5、配置httpd服务

<VirtualHost *:80>
    ServerName www.site.com
    DocumentRoot /var/www/rails/site/public
    ErrorLog logs/www.site.com-error_log
    CustomLog logs/www.site.com-access_log common

    ProxyRequests Off
    <Proxy balancer://site>
        BalancerMember http://127.0.0.1:3100
        BalancerMember http://127.0.0.1:3101
    </Proxy>
    ProxyPass /assets !
    ProxyPass /robots.txt !
    ProxyPass /favicon.ico !
    #ProxyPass / http://127.0.0.1:3100/ connectiontimeout=5 timeout=30
    ProxyPass / balancer://site/
    ProxyPassReverse / balancer://site/
</VirtualHost>

6、启动服务

systemctl restart httpd

7、设置自启动

在/etc/rc.local中添加

cd /var/www/rails/hanguomv && SECRET_KEY_BASE=xxx rails s -p 3100 -b 127.0.0.1 -e production -P /var/www/rails/site/tmp/pids/server3100.pid -d && cd /root
cd /var/www/rails/hanguomv && SECRET_KEY_BASE=xxx rails s -p 3101 -b 127.0.0.1 -e production -P /var/www/rails/site/tmp/pids/server3101.pid -d && cd /root

rails4搭站备忘

1、安装系统依赖

yum install rubygem
yum install ruby-devel
yum install gcc
yum install nodejs
yum install v8
yum install httpd*
yum groupinstall "Development Tools"

gem install postgresql --no-ri --no-rdoc
gem install rake --no-ri --no-rdoc
gem install rails --no-ri --no-rdoc

2、配置httpd

vim /etc/httpd/conf.d/vhosts.conf增加如下内容
<VirtualHost *:80>
    ServerName www.site.com
    ProxyPass / http://127.0.0.1:3000/ connectiontimeout=5 timeout=30
    ErrorLog logs/error_log
    CustomLog logs/access_log common
</VirtualHost>

systemctl start httpd

3、初始化postgresql

su - postgres
createuser sitedbuser
psql
\password sitedbuser
ALTER ROLE "sitedbuser" CREATEDB;

详见CentOS7下初始化PostgreSQL

4、创建站点

rails new site --database=postgresql
cd site

5、配置数据库连接

vim config/database.yml增加以下
  default: &default
  adapter: postgresql
  pool: 5
  host: 127.0.0.1
  port: 5432
  username: sitedbuser
  password: passwd

执行rake db:create

6、配置gem

vim Gemfile增加以下
  gem 'less-rails'
  gem 'therubyracer'
  gem 'twitter-bootstrap-rails'
  gem 'devise'
  gem 'thin'

执行bundle install

7、初始化bootstrap和devise

devise是权限控制插件。

rails g bootstrap:install
rails g devise:install
rails g devise:views
vim app/views/layouts/application.html.erb增加
  <p class="notice"><%= notice %></p>
  <p class="alert"><%= alert %></p>
  <%= yield %>

rails g devise User

如果想往用户表里面加字段则vim  db/migrate/*_devise_create_users.rb,默认不加就不用了。

rake db:migrate

8、汉化devise

cp config/locales/devise.en.yml config/locales/devise.zh.yml,汉化之
vim app/views/devise/sessions/new.html.erb,汉化之
vim app/views/devise/registrations/new.html.erb,汉化之

9、创建一个页面

创建一个控制器:rails g controller welcome index

在config/routes.rb里增加默认路由:root 'welcome#index'

给页面增加权限控制,vim app/controllers/welcome_controller.rb增加一行:
  before_filter :authenticate_user!

10、启动站点,然后创建更多MVC

rails s -p 3000 -b 127.0.0.1 -d
...

CentOS7下初始化PostgreSQL

1、安装epel;

rpm -ivh http://mirrors.hustunique.com/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm

或者

yum install epel-release

2、安装postgresql;

yum install postgresql*

3、初始化数据库;

postgresql-setup initdb

4、启动postgresql并设置为开机自启动;

systemctl restart postgresql
systemctl enable postgresql

5、登进数据库看看状态;(可略)

su - postgres
psql
\du (查看角色)
\l (列出所有数据库)
\q (退出)

6、创建角色(postgresql中的用户)和数据库实例;

su - postgres
createuser dbuser
createdb -e -O dbuser dbname

7、给新用户设定密码

su - postgres
psql
\password dbuser (输入两次密码)
vim /var/lib/pgsql/data/pg_hba.conf

在/var/lib/pgsql/data/pg_hba.conf中,将默认验证方法

host    all             all             127.0.0.1/32            ident

改为密码验证

host    all             all             127.0.0.1/32            md5

8、重启数据库,让新的验证方法生效

systemctl restart postgresql

9、新用户登录数据库;

psql -U dbuser -d dbname -h 127.0.0.1 (输入之前的密码)

10、玩耍;(以下操作皆在postgresql终端中)

\dp (查看当前库中的表)
create table test1 (t1 int, t2 varchar(20));
\dp

\d test1 (查看表结构)

select * from test1 limit 10;

insert into test1 (t1,t2) values (11, 'ccccc'), (22, 'aaaa');

select * from test1 limit 10;

truncate table test1;

select * from test1 limit 10;

drop table test1;

select * from test1 limit 10;

\dp

20140826备忘三则

MySQL在5.6之后innodb支持全文检索

原来只能在myisam上建的fulltext index现在也可以建在innodb上了。
使用myisam的最后一个理由也消失了。

http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html

Full-text indexes can be used only with InnoDB or MyISAM tables, and can be created only for CHAR, VARCHAR, or TEXT columns.

但是5.6.5-5.6.20之间的版本存在BUG。

http://dev.mysql.com/doc/refman/5.6/en/innodb-fulltext-index.html

Due to a bug introduced in MySQL 5.6.5, index tables are created in the InnoDB system tablespace (space 0) when innodb_file_per_table is enabled. The bug is fixed in MySQL 5.6.20 and MySQL 5.7.5

rails4验证插件

目前只有authlogic https://github.com/binarylogic/authlogic 支持rails4

cancan https://github.com/ryanb/cancan 支持到rails3

restful-authentication https://github.com/technoweenie/restful-authentication 支持到rails2

systemd下启动服务

升级到CentOS7之后,/etc/init.d/下的东西都没有了。

取而代之的是这样一段话:

file: /etc/init.d/README
你在运行一个基于systemd的操作系统。传统的init脚本已经被systemd服务文件替代了。
执行"systemctl",你可以看到现在运行的服务。
执行"systemctl list-unit-files",你可以看到所有已知的服务。
使用"systemctl start foobar.service"和"systemctl stop foobar.service"来启动和停止服务。
想知道更多请执行"man systemctl"。
扩展阅读

http://0pointer.de/blog/projects/systemd-for-admins-3.html


http://www.freedesktop.org/wiki/Software/systemd/Incompatibilities

好吧,我听话扩展阅读了一下子。systemctl其实是原来service和chkconfig的合体。
那么原来chkconfig设置自启动现在变成了这样子——

systemctl enable httpd
systemctl disable httpd

查看状态则变成了

systemctl status httpd

Ffmpeg中的文件格式

详见文件”libavformat/allformats.c”。


/*
 * Register all the formats and protocols
 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
 *
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#include "avformat.h"
#include "rtp.h"
#include "rdt.h"
#include "url.h"
#include "version.h"

#define REGISTER_MUXER(X, x)                                            \
    {                                                                   \
        extern AVOutputFormat ff_##x##_muxer;                           \
        if (CONFIG_##X##_MUXER)                                         \
            av_register_output_format(&ff_##x##_muxer);                 \
    }

#define REGISTER_DEMUXER(X, x)                                          \
    {                                                                   \
        extern AVInputFormat ff_##x##_demuxer;                          \
        if (CONFIG_##X##_DEMUXER)                                       \
            av_register_input_format(&ff_##x##_demuxer);                \
    }

#define REGISTER_MUXDEMUX(X, x) REGISTER_MUXER(X, x); REGISTER_DEMUXER(X, x)

#define REGISTER_PROTOCOL(X, x)                                         \
    {                                                                   \
        extern URLProtocol ff_##x##_protocol;                           \
        if (CONFIG_##X##_PROTOCOL)                                      \
            ffurl_register_protocol(&ff_##x##_protocol,                 \
                                    sizeof(ff_##x##_protocol));         \
    }

void av_register_all(void)
{
    static int initialized;

    if (initialized)
        return;
    initialized = 1;

    avcodec_register_all();

    /* (de)muxers */
    REGISTER_MUXER   (A64,              a64);
    REGISTER_DEMUXER (AAC,              aac);
    REGISTER_MUXDEMUX(AC3,              ac3);
    REGISTER_DEMUXER (ACT,              act);
    REGISTER_DEMUXER (ADF,              adf);
    REGISTER_DEMUXER (ADP,              adp);
    REGISTER_MUXER   (ADTS,             adts);
    REGISTER_MUXDEMUX(ADX,              adx);
    REGISTER_DEMUXER (AEA,              aea);
    REGISTER_DEMUXER (AFC,              afc);
    REGISTER_MUXDEMUX(AIFF,             aiff);
    REGISTER_MUXDEMUX(AMR,              amr);
    REGISTER_DEMUXER (ANM,              anm);
    REGISTER_DEMUXER (APC,              apc);
    REGISTER_DEMUXER (APE,              ape);
    REGISTER_DEMUXER (AQTITLE,          aqtitle);
    REGISTER_MUXDEMUX(ASF,              asf);
    REGISTER_MUXDEMUX(ASS,              ass);
    REGISTER_MUXDEMUX(AST,              ast);
    REGISTER_MUXER   (ASF_STREAM,       asf_stream);
    REGISTER_MUXDEMUX(AU,               au);
    REGISTER_MUXDEMUX(AVI,              avi);
    REGISTER_DEMUXER (AVISYNTH,         avisynth);
    REGISTER_MUXER   (AVM2,             avm2);
    REGISTER_DEMUXER (AVR,              avr);
    REGISTER_DEMUXER (AVS,              avs);
    REGISTER_DEMUXER (BETHSOFTVID,      bethsoftvid);
    REGISTER_DEMUXER (BFI,              bfi);
    REGISTER_DEMUXER (BINTEXT,          bintext);
    REGISTER_DEMUXER (BINK,             bink);
    REGISTER_MUXDEMUX(BIT,              bit);
    REGISTER_DEMUXER (BMV,              bmv);
    REGISTER_DEMUXER (BRSTM,            brstm);
    REGISTER_DEMUXER (BOA,              boa);
    REGISTER_DEMUXER (C93,              c93);
    REGISTER_MUXDEMUX(CAF,              caf);
    REGISTER_MUXDEMUX(CAVSVIDEO,        cavsvideo);
    REGISTER_DEMUXER (CDG,              cdg);
    REGISTER_DEMUXER (CDXL,             cdxl);
    REGISTER_DEMUXER (CONCAT,           concat);
    REGISTER_MUXER   (CRC,              crc);
    REGISTER_MUXDEMUX(DATA,             data);
    REGISTER_MUXDEMUX(DAUD,             daud);
    REGISTER_DEMUXER (DFA,              dfa);
    REGISTER_MUXDEMUX(DIRAC,            dirac);
    REGISTER_MUXDEMUX(DNXHD,            dnxhd);
    REGISTER_DEMUXER (DSICIN,           dsicin);
    REGISTER_MUXDEMUX(DTS,              dts);
    REGISTER_DEMUXER (DTSHD,            dtshd);
    REGISTER_MUXDEMUX(DV,               dv);
    REGISTER_DEMUXER (DXA,              dxa);
    REGISTER_DEMUXER (EA,               ea);
    REGISTER_DEMUXER (EA_CDATA,         ea_cdata);
    REGISTER_MUXDEMUX(EAC3,             eac3);
    REGISTER_DEMUXER (EPAF,             epaf);
    REGISTER_MUXER   (F4V,              f4v);
    REGISTER_MUXDEMUX(FFM,              ffm);
    REGISTER_MUXDEMUX(FFMETADATA,       ffmetadata);
    REGISTER_MUXDEMUX(FILMSTRIP,        filmstrip);
    REGISTER_MUXDEMUX(FLAC,             flac);
    REGISTER_DEMUXER (FLIC,             flic);
    REGISTER_MUXDEMUX(FLV,              flv);
    REGISTER_DEMUXER (FOURXM,           fourxm);
    REGISTER_MUXER   (FRAMECRC,         framecrc);
    REGISTER_MUXER   (FRAMEMD5,         framemd5);
    REGISTER_DEMUXER (FRM,              frm);
    REGISTER_MUXDEMUX(G722,             g722);
    REGISTER_MUXDEMUX(G723_1,           g723_1);
    REGISTER_DEMUXER (G729,             g729);
    REGISTER_MUXDEMUX(GIF,              gif);
    REGISTER_DEMUXER (GSM,              gsm);
    REGISTER_MUXDEMUX(GXF,              gxf);
    REGISTER_MUXDEMUX(H261,             h261);
    REGISTER_MUXDEMUX(H263,             h263);
    REGISTER_MUXDEMUX(H264,             h264);
    REGISTER_DEMUXER (HEVC,             hevc);
    REGISTER_MUXDEMUX(HLS,              hls);
    REGISTER_MUXDEMUX(ICO,              ico);
    REGISTER_DEMUXER (IDCIN,            idcin);
    REGISTER_DEMUXER (IDF,              idf);
    REGISTER_DEMUXER (IFF,              iff);
    REGISTER_MUXDEMUX(ILBC,             ilbc);
    REGISTER_MUXDEMUX(IMAGE2,           image2);
    REGISTER_MUXDEMUX(IMAGE2PIPE,       image2pipe);
    REGISTER_DEMUXER (INGENIENT,        ingenient);
    REGISTER_DEMUXER (IPMOVIE,          ipmovie);
    REGISTER_MUXER   (IPOD,             ipod);
    REGISTER_MUXDEMUX(IRCAM,            ircam);
    REGISTER_MUXER   (ISMV,             ismv);
    REGISTER_DEMUXER (ISS,              iss);
    REGISTER_DEMUXER (IV8,              iv8);
    REGISTER_MUXDEMUX(IVF,              ivf);
    REGISTER_MUXDEMUX(JACOSUB,          jacosub);
    REGISTER_DEMUXER (JV,               jv);
    REGISTER_MUXDEMUX(LATM,             latm);
    REGISTER_DEMUXER (LMLM4,            lmlm4);
    REGISTER_DEMUXER (LOAS,             loas);
    REGISTER_DEMUXER (LVF,              lvf);
    REGISTER_DEMUXER (LXF,              lxf);
    REGISTER_MUXDEMUX(M4V,              m4v);
    REGISTER_MUXER   (MD5,              md5);
    REGISTER_MUXDEMUX(MATROSKA,         matroska);
    REGISTER_MUXER   (MATROSKA_AUDIO,   matroska_audio);
    REGISTER_DEMUXER (MGSTS,            mgsts);
    REGISTER_MUXDEMUX(MICRODVD,         microdvd);
    REGISTER_MUXDEMUX(MJPEG,            mjpeg);
    REGISTER_MUXDEMUX(MLP,              mlp);
    REGISTER_DEMUXER (MM,               mm);
    REGISTER_MUXDEMUX(MMF,              mmf);
    REGISTER_MUXDEMUX(MOV,              mov);
    REGISTER_MUXER   (MP2,              mp2);
    REGISTER_MUXDEMUX(MP3,              mp3);
    REGISTER_MUXER   (MP4,              mp4);
    REGISTER_DEMUXER (MPC,              mpc);
    REGISTER_DEMUXER (MPC8,             mpc8);
    REGISTER_MUXER   (MPEG1SYSTEM,      mpeg1system);
    REGISTER_MUXER   (MPEG1VCD,         mpeg1vcd);
    REGISTER_MUXER   (MPEG1VIDEO,       mpeg1video);
    REGISTER_MUXER   (MPEG2DVD,         mpeg2dvd);
    REGISTER_MUXER   (MPEG2SVCD,        mpeg2svcd);
    REGISTER_MUXER   (MPEG2VIDEO,       mpeg2video);
    REGISTER_MUXER   (MPEG2VOB,         mpeg2vob);
    REGISTER_DEMUXER (MPEGPS,           mpegps);
    REGISTER_MUXDEMUX(MPEGTS,           mpegts);
    REGISTER_DEMUXER (MPEGTSRAW,        mpegtsraw);
    REGISTER_DEMUXER (MPEGVIDEO,        mpegvideo);
    REGISTER_MUXER   (MPJPEG,           mpjpeg);
    REGISTER_DEMUXER (MPL2,             mpl2);
    REGISTER_DEMUXER (MPSUB,            mpsub);
    REGISTER_DEMUXER (MSNWC_TCP,        msnwc_tcp);
    REGISTER_DEMUXER (MTV,              mtv);
    REGISTER_DEMUXER (MV,               mv);
    REGISTER_DEMUXER (MVI,              mvi);
    REGISTER_MUXDEMUX(MXF,              mxf);
    REGISTER_MUXER   (MXF_D10,          mxf_d10);
    REGISTER_DEMUXER (MXG,              mxg);
    REGISTER_DEMUXER (NC,               nc);
    REGISTER_DEMUXER (NISTSPHERE,       nistsphere);
    REGISTER_DEMUXER (NSV,              nsv);
    REGISTER_MUXER   (NULL,             null);
    REGISTER_MUXDEMUX(NUT,              nut);
    REGISTER_DEMUXER (NUV,              nuv);
    REGISTER_MUXDEMUX(OGG,              ogg);
    REGISTER_MUXDEMUX(OMA,              oma);
    REGISTER_DEMUXER (PAF,              paf);
    REGISTER_MUXDEMUX(PCM_ALAW,         pcm_alaw);
    REGISTER_MUXDEMUX(PCM_MULAW,        pcm_mulaw);
    REGISTER_MUXDEMUX(PCM_F64BE,        pcm_f64be);
    REGISTER_MUXDEMUX(PCM_F64LE,        pcm_f64le);
    REGISTER_MUXDEMUX(PCM_F32BE,        pcm_f32be);
    REGISTER_MUXDEMUX(PCM_F32LE,        pcm_f32le);
    REGISTER_MUXDEMUX(PCM_S32BE,        pcm_s32be);
    REGISTER_MUXDEMUX(PCM_S32LE,        pcm_s32le);
    REGISTER_MUXDEMUX(PCM_S24BE,        pcm_s24be);
    REGISTER_MUXDEMUX(PCM_S24LE,        pcm_s24le);
    REGISTER_MUXDEMUX(PCM_S16BE,        pcm_s16be);
    REGISTER_MUXDEMUX(PCM_S16LE,        pcm_s16le);
    REGISTER_MUXDEMUX(PCM_S8,           pcm_s8);
    REGISTER_MUXDEMUX(PCM_U32BE,        pcm_u32be);
    REGISTER_MUXDEMUX(PCM_U32LE,        pcm_u32le);
    REGISTER_MUXDEMUX(PCM_U24BE,        pcm_u24be);
    REGISTER_MUXDEMUX(PCM_U24LE,        pcm_u24le);
    REGISTER_MUXDEMUX(PCM_U16BE,        pcm_u16be);
    REGISTER_MUXDEMUX(PCM_U16LE,        pcm_u16le);
    REGISTER_MUXDEMUX(PCM_U8,           pcm_u8);
    REGISTER_DEMUXER (PJS,              pjs);
    REGISTER_DEMUXER (PMP,              pmp);
    REGISTER_MUXER   (PSP,              psp);
    REGISTER_DEMUXER (PVA,              pva);
    REGISTER_DEMUXER (PVF,              pvf);
    REGISTER_DEMUXER (QCP,              qcp);
    REGISTER_DEMUXER (R3D,              r3d);
    REGISTER_MUXDEMUX(RAWVIDEO,         rawvideo);
    REGISTER_DEMUXER (REALTEXT,         realtext);
    REGISTER_DEMUXER (REDSPARK,         redspark);
    REGISTER_DEMUXER (RL2,              rl2);
    REGISTER_MUXDEMUX(RM,               rm);
    REGISTER_MUXDEMUX(ROQ,              roq);
    REGISTER_DEMUXER (RPL,              rpl);
    REGISTER_DEMUXER (RSD,              rsd);
    REGISTER_MUXDEMUX(RSO,              rso);
    REGISTER_MUXDEMUX(RTP,              rtp);
    REGISTER_MUXDEMUX(RTSP,             rtsp);
    REGISTER_DEMUXER (SAMI,             sami);
    REGISTER_MUXDEMUX(SAP,              sap);
    REGISTER_DEMUXER (SBG,              sbg);
    REGISTER_DEMUXER (SDP,              sdp);
#if CONFIG_RTPDEC
    av_register_rtp_dynamic_payload_handlers();
    av_register_rdt_dynamic_payload_handlers();
#endif
    REGISTER_DEMUXER (SEGAFILM,         segafilm);
    REGISTER_MUXER   (SEGMENT,          segment);
    REGISTER_MUXER   (SEGMENT,          stream_segment);
    REGISTER_DEMUXER (SHORTEN,          shorten);
    REGISTER_DEMUXER (SIFF,             siff);
    REGISTER_DEMUXER (SMACKER,          smacker);
    REGISTER_MUXDEMUX(SMJPEG,           smjpeg);
    REGISTER_MUXER   (SMOOTHSTREAMING,  smoothstreaming);
    REGISTER_DEMUXER (SMUSH,            smush);
    REGISTER_DEMUXER (SOL,              sol);
    REGISTER_MUXDEMUX(SOX,              sox);
    REGISTER_MUXDEMUX(SPDIF,            spdif);
    REGISTER_MUXDEMUX(SRT,              srt);
    REGISTER_DEMUXER (STR,              str);
    REGISTER_DEMUXER (SUBVIEWER1,       subviewer1);
    REGISTER_DEMUXER (SUBVIEWER,        subviewer);
    REGISTER_MUXDEMUX(SWF,              swf);
    REGISTER_DEMUXER (TAK,              tak);
    REGISTER_MUXER   (TEE,              tee);
    REGISTER_DEMUXER (TEDCAPTIONS,      tedcaptions);
    REGISTER_MUXER   (TG2,              tg2);
    REGISTER_MUXER   (TGP,              tgp);
    REGISTER_DEMUXER (THP,              thp);
    REGISTER_DEMUXER (TIERTEXSEQ,       tiertexseq);
    REGISTER_MUXER   (MKVTIMESTAMP_V2,  mkvtimestamp_v2);
    REGISTER_DEMUXER (TMV,              tmv);
    REGISTER_MUXDEMUX(TRUEHD,           truehd);
    REGISTER_DEMUXER (TTA,              tta);
    REGISTER_DEMUXER (TXD,              txd);
    REGISTER_DEMUXER (TTY,              tty);
    REGISTER_MUXDEMUX(VC1,              vc1);
    REGISTER_MUXDEMUX(VC1T,             vc1t);
    REGISTER_DEMUXER (VIVO,             vivo);
    REGISTER_DEMUXER (VMD,              vmd);
    REGISTER_DEMUXER (VOBSUB,           vobsub);
    REGISTER_MUXDEMUX(VOC,              voc);
    REGISTER_DEMUXER (VPLAYER,          vplayer);
    REGISTER_DEMUXER (VQF,              vqf);
    REGISTER_MUXDEMUX(W64,              w64);
    REGISTER_MUXDEMUX(WAV,              wav);
    REGISTER_DEMUXER (WC3,              wc3);
    REGISTER_MUXER   (WEBM,             webm);
    REGISTER_MUXDEMUX(WEBVTT,           webvtt);
    REGISTER_DEMUXER (WSAUD,            wsaud);
    REGISTER_DEMUXER (WSVQA,            wsvqa);
    REGISTER_MUXDEMUX(WTV,              wtv);
    REGISTER_MUXDEMUX(WV,               wv);
    REGISTER_DEMUXER (XA,               xa);
    REGISTER_DEMUXER (XBIN,             xbin);
    REGISTER_DEMUXER (XMV,              xmv);
    REGISTER_DEMUXER (XWMA,             xwma);
    REGISTER_DEMUXER (YOP,              yop);
    REGISTER_MUXDEMUX(YUV4MPEGPIPE,     yuv4mpegpipe);

    /* protocols */
    REGISTER_PROTOCOL(BLURAY,           bluray);
    REGISTER_PROTOCOL(CACHE,            cache);
    REGISTER_PROTOCOL(CONCAT,           concat);
    REGISTER_PROTOCOL(CRYPTO,           crypto);
    REGISTER_PROTOCOL(DATA,             data);
    REGISTER_PROTOCOL(FFRTMPCRYPT,      ffrtmpcrypt);
    REGISTER_PROTOCOL(FFRTMPHTTP,       ffrtmphttp);
    REGISTER_PROTOCOL(FILE,             file);
    REGISTER_PROTOCOL(FTP,              ftp);
    REGISTER_PROTOCOL(GOPHER,           gopher);
    REGISTER_PROTOCOL(HLS,              hls);
    REGISTER_PROTOCOL(HTTP,             http);
    REGISTER_PROTOCOL(HTTPPROXY,        httpproxy);
    REGISTER_PROTOCOL(HTTPS,            https);
    REGISTER_PROTOCOL(MMSH,             mmsh);
    REGISTER_PROTOCOL(MMST,             mmst);
    REGISTER_PROTOCOL(MD5,              md5);
    REGISTER_PROTOCOL(PIPE,             pipe);
    REGISTER_PROTOCOL(RTMP,             rtmp);
    REGISTER_PROTOCOL(RTMPE,            rtmpe);
    REGISTER_PROTOCOL(RTMPS,            rtmps);
    REGISTER_PROTOCOL(RTMPT,            rtmpt);
    REGISTER_PROTOCOL(RTMPTE,           rtmpte);
    REGISTER_PROTOCOL(RTMPTS,           rtmpts);
    REGISTER_PROTOCOL(RTP,              rtp);
    REGISTER_PROTOCOL(SCTP,             sctp);
    REGISTER_PROTOCOL(SRTP,             srtp);
    REGISTER_PROTOCOL(TCP,              tcp);
    REGISTER_PROTOCOL(TLS,              tls);
    REGISTER_PROTOCOL(UDP,              udp);
    REGISTER_PROTOCOL(UNIX,             unix);

    /* external libraries */
    REGISTER_DEMUXER (LIBGME,           libgme);
    REGISTER_DEMUXER (LIBMODPLUG,       libmodplug);
    REGISTER_MUXDEMUX(LIBNUT,           libnut);
    REGISTER_DEMUXER (LIBQUVI,          libquvi);
    REGISTER_PROTOCOL(LIBRTMP,          librtmp);
    REGISTER_PROTOCOL(LIBRTMPE,         librtmpe);
    REGISTER_PROTOCOL(LIBRTMPS,         librtmps);
    REGISTER_PROTOCOL(LIBRTMPT,         librtmpt);
    REGISTER_PROTOCOL(LIBRTMPTE,        librtmpte);
    REGISTER_PROTOCOL(LIBSSH,           libssh);
}