除IE和EDGE外,Chrome Firefox 和 iOS系统不再信任StartSSL提供的免费证书……

来自StartSSL官方的回复如下:

SSL Certificates issued after 21.10.2016 are distrusted in Chrome 56+, Firefox 51+,safari and latest version of IOS system. All certificates are distrusted in chrome 57. Official document about distrust > https://blog.mozilla.org/security/2016/10/24/distrusting-new-wosign-and-startcom-certificates/
     We are working hard on remediation plan (https://bugzilla.mozilla.org/show_bug.cgi?id=1311832), and we are doing everything to regain trust ASAP.
We create new root certificate now, You need to wait the root certificate audit by the main browser so it can be trusted in the main browser,it will take several months.
As an interim solution, if you pass the class 3 validation or EV validation(with full payment) you can get 1 trusted certificate(issued by Camerfirma)  that can be trusted in all browser.

Android 导入android源码有错,R.java文件不能自动生成解决方法

情况一:
   
千万不要重启Eclipse、也不自己创建R.java 类文件
   
右击你的工程(项目)——>Android Tools——>Fix Project Properties
   
将会再次创建出R文件,数据不丢失
情况二:
    工程中没有R
文件,主要的原因是我们的工程没有编译,所以我们要手动编译导入的工程。
   
就是要将整个工程完全build一遍, R文件就会出来了。
情况三:
   
若为API导入,则方法如下:   
 
   
file->New->android sample Project->api->finish即可

======================
首先确定你的SDK是新的。

其次接下来检查你的.xml文件,文件名不能大写。

如果xml文件太多 ,那么clean一下你的项目,这时候注意看Console的提示。

Console会提示你xml文件错误在哪里

修改完xml文件之后

clean你的项目,再build你的项目

R.java会重新出现或更新
=============

1、选择菜单  Project >> Clean ,前提是勾选上 Bulid
Automatically(自动构建部署) ,
点Clean后会重新构建项目,因为一般情况下,R.java文件在这个时候会重新更新生成一边,如果工程有错,就不会自动生成。
2、选择工程,右键 Android Tools >> Fix Project Properties
这个操作有时候可以修正一些错误,但我的不行。
3、还有的说法是重新建一个空的工程,然后把这里面的代码,资源文件按照对应的包路径什么的拷进去,然后重新生成一边,这种方法,也想当于是第一种方法,都是重新构建部暑,性质一样的。

  
以上几种方法都试了,R.java依旧没出现,整个工程还是一大堆错误。随便点了一个有错误的布局XML文件,看到这样一个错误代码
android:layout_height=”match_parent” , 之前我都用1.5/1.6/2.1 版本的SDK
layout_height里面没有看到match_parent这个属性,然后问群一个兄弟说这个属性是2.X版本的,想了下,是不是因为工程的SDK
版本和eclipse默认的SDK版本问题呢,于是选择工程,右键 Properties >> Android
然后看到右边的一块 Target Name, 我的是选中 Android 1.5,然后换了一个 2.1 的 ,点击Appply
,工程自动构建,看到错误少了一些,换到2.2,重新构建,错误没了,久未解决的问题解决了,R.java也出来了,一个字高兴啊,启动模拟器一切正常。

 
总结下当导入其它源码时候,首先要保证源码的SDK版本和你eclipse默认版本是否一致。
查看源码版本办法:打开default.properties 文件,看target=android-7 这后面这个数是多少。
版本对应关系:target=android-3 <—> android 1.5 
,target=android-4 <—> android 1.6 ,
target=android-7 <—> android 2.1 
,target=android-8 <—> android 2.2 其它的自己测试下。

Android模拟器分辨率收集

模拟器分辨率收集

QVGA = 320 * 240;
WQVGA = 320 * 480;
WQVGA2 = 400 * 240;
WQVGA3 = 432 * 240;
HVGA = 480 * 320;
VGA = 640 * 480;
WVGA = 800 * 480;
WVGA2 = 768 * 480;
FWVGA = 854 * 480;
DVGA = 960 * 640;
PAL = 576 * 520;
NTSC = 486 * 440;
SVGA = 800 * 600;
WSVGA = 1024 * 576;
XGA = 1024 * 768;
XGAPLUS = 1152 * 864;
HD720 = 1280 * 720;
WXGA = 1280 * 768;
WXGA2 = 1280 * 800;
WXGA3 = 1280 * 854;
SXGA = 1280 * 1024;
WXGA4 = 1366 * 768;
SXGAMINUS = 1280 * 960;
SXGAPLUS = 1400 * 1050;
WXGAPLUS = 1440 * 900;
HD900 = 1600 * 900;
WSXGA = 1600 * 1024;
WSXGAPLUS = 1680 * 1050;
UXGA = 1600 * 1200;
HD1080 = 1920 * 1080;
QWXGA = 2048 * 1152;
WUXGA = 1920 * 1200;
TXGA = 1920 * 1400;
QXGA = 2048 * 1536;
WQHD = 2560 * 1440;
WQXGA = 2560 * 1600;
QSXGA = 2560 * 2048;
QSXGAPLUS = 2800 * 2100;
WQSXGA = 3200 * 2048;
QUXGA = 3200 * 2400;
QFHD = 3840 * 2160;
WQUXGA = 3840 * 2400;
HD4K = 4096 * 2304;
HXGA = 4096 * 3072;
WHXGA = 5120 * 3200;
HSXGA = 5120 * 4096;
WHSXGA = 6400 * 4096;
HUXGA = 6400 * 4800;
SHV = 7680 * 4320;
WHUXGA = 7680 * 4800;

回顾Facebook历次改版:均遭用户反对

Facebook今晚将召开f8开发者大会

导语:Facebook今天将召开f8开发者大会,预计将对网站进行大规模改版,并增添多项新功能。美国IT网站PCWorld今天撰文,回顾了Facebook历次的改版过程,每次都会遭到用户反对。

以下为文章概要:

Facebook用户历来反对改版,最新的News Feed改版同样引发了用户的不满。新版News
Feed将会按照算法给一些状态更新赋予更高的权重,而不是单纯按照时间顺序排列。

事实上,遭遇用户反对完全在意料之中,倘若没有反对反倒会令人意外。在Facebook的发展历程中,曾经多次因为改版引发用户不满,这一次只是其中之一。以下则是Facebook历次改版引发的用户不满:

2006年9月:Facebook推出News
Feed,可以按照时间顺序展示好友最近的活动。“状态更新”当时尚未大行其道,因此该信息流中展示的消息都来自用户的个人资料页面。

反对者组织了“停用Facebook一天”的活动,借此表达对隐私被侵犯的不满。而当Facebook允许用户在News
Feed中隐藏自己活动后,他们则宣称“任务完成”。但这项功能现在似乎已经不存在了。

2008年9月:Facebook面向用户推出了新版页面,用多个独立且可以定制的标签对网站分区。用户认为这一设计“非常非常丑”,并且组织了数万用户抗议。最终,标签被转移到Facebook的侧边栏,但这一理念至今依然存在。

2009年3月:Facebook再次进行大规模改版,这一次主要围绕状态更新展开,目的是更好地与Twitter竞争。信息可以实现实时更新,并且在屏幕右侧突出显示(这与Facebook最新的改版恰好相反)。

这一次改版引发了用户空前的抗议,共有170万用户要求Facebook放弃本次改版。为了安抚用户,Facebook进行了一些小规模的调整,但仍然坚持使用新的设计,至少暂时如此。

2009年10月:Facebook再次对主页改版,推出了一种算法,以便对状态更新进行排序,而不仅仅是按照时间排序。同年早些时候移除的一些内容又被恢复,包括好友申请是否被接受以及关系现状。换句话说,Facebook对2009年3月的用户抗议做出了让步。

但用户仍然不满,共有超过100万Facebook用户要求其恢复原先的版面。部分用户甚至要求Facebook将News
Feed更新重新按照时间顺序排列。

2010年11月:Facebook悄然缩小了News
Feed更新的字号,用户在Twitter上抱怨这一行为,而Facebook同样在Twitter上回应。

2010年12月:Facebook对资料页面进行改版,最主要的是将用户信息浓缩成一份摘要,并展示在页面顶端。文字上方还附带一张用户图片。Facebook官方博客的评论几乎都是负面的。

2011年6月:Facebook针对部分用户测试了一项名为“Happening
Now”的功能,在屏幕右侧展示了一个独立的信息流。很多参与测试的用户都很讨厌这项功能,其中部分用户甚至组建了一个名为“Facebook
Happening Now仇恨者”的小组。

Happening Now功能最终演变成了News Ticker,并于本周面向所有用户推出。(鼎宏)

Ubuntu, Ruby, RVM, Rails, and You

http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
http://www.iloopai.com/blogs/11
http://ivanbernat.com/guides/install-rails-3-with-sqlite3-mysql-ubuntu-10/

25 Dec 2010

This beginner’s guide will set up with Ruby 1.9.2, RVM
and Rails 3.0.7 and is specifically written for a
development environment on Ubuntu 10.10, but will probably
work on many other operating systems, including older versions of
Ubuntu and Debian. YMMV.

If you’re looking for a way to set this up on a
production server then I would recommend the use of the railsready script
which installs all the necessary packages for Ruby 1.9.2p136 and
then that version of Ruby itself, Bundler and Rails. Then it leaves
it up to you to install Apache or nginx to get your application
online.

If you’re not using Ubuntu then try
Wayne E. Seguin’s rails_bootstrap_script
which probably gets a
version of Rails working for you, albeit with 1.8.7 rather than
1.9.2.

Under no circumstance should you install Ruby, Rubygems or any
Ruby-related packages from apt-get. This system is out-dated and
leads to major headaches. Avoid it for Ruby-related packages. We do
Ruby, we know what’s best. Trust us.

Still not convinced? Read this.

This guide will go through installing the RVM (Ruby Version Manager),
then a version of Ruby (1.9.2), then Rails and finally Bundler.

By the end of this guide, you will have these things installed
and have some very, very easy ways to manage gem dependencies for
your different applications / libraries, as well as having multiple
Ruby versions installed and usable all at once.

We assume you have sudo access to your machine, and
that you have an understanding of the basic concepts of Ruby, such
as “What is Rubygems?” and more importantly “How do I turn this
computer-thing on?”. This knowledge can be garnered by reading the
first chapter of any Ruby
book
.

Housekeeping

First of all, we’re going to run sudo apt-get
update
so that we have the latest sources on our box so that
we don’t run into any package-related issues, such as not being
able to install some packages.

Next, we’re going to install Git
(a version control system)
and curl which are both
required to install and use RVM, and build-essential
which is required to compile Ruby versions, amongst other
compilable things. To install these three packages we use this
command:

sudo apt-get install build-essential git-core curl

RVM

RVM is a Ruby Version
Manager
created by Wayne E. Seguin and is extremely helpful for
installing and managing many different versions of Ruby all at
once. Sometimes you could be working on a project that requires an
older (1.8.7) version of Ruby but also need a new version (1.9.2)
for one of your newer projects. This is a problem that RVM solves
beautifully.

Another situation could be that you want to have different sets
of gems on the same version of Ruby but don’t want to have to do
deal with Gem Conflict Hell. RVM has gemsets for
this. This is a feature you wouldn’t have if you used the
packaged Ruby
.

We’re going to use it to install only one version of Ruby, but
we can consult the
documentation
if we want to install a different version of
Ruby.

With git-core and curl installed we’ll
be able to install RVM with this command:

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

The beautiful part of this is that it installs Ruby to our home
directory, providing a sandboxed environment just for us.

Once that’s done, we’re going to need to add a line to
~/.bashrc file (the file responsible for setting up
our bash session) which will load RVM:

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc 

Then we’ll need to reload the ~/.bashrc file which
we can do with this small command:

. ~/.bashrc

The next command we run will tell us what other packages we need
to install for Ruby to work:

rvm notes
...
# For Ruby (MRI & ree)  you should install the following OS dependencies:
ruby: aptitude install build-essential bison openssl libreadline6 libreadline6-dev
curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0
libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf

A couple of these packages we’ve already installed, such as
git-core and curl. They won’t be
re-installed again.

These packages will lessen the pain when we’re working with
Ruby. For example, the libssl-dev package will make
OpenSSL support in Ruby work, libsqlite3-0 and
libsqlite3-dev are required for the
sqlite3-ruby gem and the libxml2-dev and
libxslt-dev packages are required for the
nokogiri gem. Let’s install all these packages now
using this command:

sudo aptitude install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g
zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf

This command *must* be written on a single line, otherwise
some of the packages will not install.

Now our Ruby lives will be as painless as possible.

Ruby

With RVM and these packages we can install Ruby 1.9.2:

rvm install 1.9.2

This command will take a couple of minutes, so grab your
$DRINKOFCHOICE and go outside or something. Once it’s done, we’ll
have Ruby 1.9.2 installed. To begin using it we can use this lovely
command:

rvm use 1.9.2

Are we using 1.9.2? You betcha:

ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]

Or, even better, would be to make this the default for
our user! Oooh, yes!

rvm --default use 1.9.2

Now whenever we open a new bash session for this user we’ll have
Ruby available for us to use! Yay!

Rails

Now that RVM and a version of Ruby is installed, we can install
Rails. Because RVM is installed to our home directory, we don’t
need to use that nasty sudo to install things; we’ve
got write-access! To install the Rails gem we’ll run this
command:

gem install rails

This will install the rails gem and the other 22
gems that it and its dependencies depend on, including Bundler.

MySQL

If you’re planning on using the mysql2 gem for your
application then you’ll want to install the
libmysqlclient16-dev package before you do that.
Without it, you’ll get an error when the gem tries to compile its
native extensions:

Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

/home/ryan/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

PostgreSQL

Similar to the mysql2 gem’s error above, you’ll
also get an error with the pg gem if you don’t have
the libpq-dev package installed you’ll get this
error:

    Building native extensions.  This could take a while...
ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.

/home/ryan/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb
checking for pg_config... no
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Fin.

And that’s it! Now you’ve got a Ruby environment you can use to
write your (first?) Rails application in with such minimal effort.
A good read after this would be the official guides for Ruby on
Rails
. Or perhaps the documentation on the RVM site which goes into using
things such as gemsets and the
exceptionally helpful per-project
.rvmrc file
. A quick way to generate an .rvmrc
file is to run a command like this inside the project

rvm use 1.9.2@rails3 --rvmrc

RVM is such a powerful tool and comes in handy for day-to-day
Ruby development. Use it, and not the packages from apt to live a
life of development luxury.

Credits

Thanks to krainboltgreene for
pointing out that the guide needed to install the packages
specified by rvm notes. He’s got a similar write up here for Ubuntu
10.04
. Some of the instructions in this guide were “inspired”
by that post.

1、先安装gcc,mysql和一些库

sudo apt-get update
sudo apt-get upgrade
sudo dpkg-reconfigure tzdata
date

sudo apt-get install gcc
sudo apt-get install build-essential
sudo apt-get install git-core
sudo apt-get install libcurl4-openssl-dev libssl-dev zlib1g-dev libreadline5-dev

sudo apt-get install mysql-server mysql-client
 

2、编译ruby1.9.2 :

先下载源代码:http://www.ruby-lang.org/en/downloads/

tar vfxz ruby-1.9.2-p180.tar.gz  
cd ruby-1.9.2-p180
sudo ./configure --prefix=/usr/local/ruby-1.9.2

sudo make
sudo make install  

#添加路径
sudo gedit /etc/profile
#加入如下内容并且保存,注销就可以了
if [ -d "/usr/local/ruby-1.9.2/bin" ] ; then  
    export PATH=/usr/local/ruby-1.9.2/bin:$PATH
fi 

#查看安装到ruby版本
#sudo用到环境变量没搞清楚...加个-i就行了
sudo -i ruby -v

#安装rails,这儿也用-i
sudo -i gem install rails -y

设置MQSQL的UTF-8编码方式:

$sudo gedit /etc/mysql/my.cnf  #编辑添加如下内容
[mysql]
default-character-set = utf8 
[mysqld]
default-character-set = utf8 
init_connect = 'SET NAMES utf8' 

[client]
default-character-set = utf8

sudo /etc/init.d/mysql restart  #运行
sudo netstat -tap | grep mysql  #检查

#检查MYSQL查看编码,用MYSQL命令: 
show variables like'character%';  
#或者:mysql -u root -p
Enter password: ******
> \s # 查看是否配置成功
Client characterset:    utf8
Server characterset:    utf8
>quit

#Install nginx+passenger

sudo -i gem install passenger
sudo -i passenger-install-nginx-module

用rails new 新建 app

rails new blog -d mysql

现在3.0.7版本的mysql2不能用最新版,需要添加个限制

cd blog
gedit Gemfile

把gem ‘mysql2’改成: gem ‘mysql2′,'<0.3’
然后运行:bundle,如果提示下面到错误就是少了些运行库了:Could not create Makefile due to
some reason, probably lack of necessary libraries and/or
headers.
安装库:

sudo apt-get install libmysql-ruby libmysqlclient-dev 

在运行bundle就能正确安装mysql2了
执行:rake db:create还是出错…这个是rake
0.9版本到问题,这个有人给出了方法:打开刚才新建的app根目录下的Rake文件,在里面添加:

#注意把Blog改成你自己到模块名
module ::Blog
  class Application
    include Rake::DSL
  end
end

module ::RakeFileUtils
  extend Rake::FileUtilsExt
end
#这个是原来rake文件到最后一行,不是添加的,注意这个“Blog”就是你的模块名字
Blog::Application.load_tasks

第二种方法就是卸载0.9版本的rake了:

sudo -i gem uninstall rake -v 0.9
sudo -i gem uninstall rake -v 0.8.7
sudo -i gem install rake -v 0.8.7
 

我的系统里有rake 0.9和rake 0.8.7,把rake
0.9卸载了就找不到rake也许要加个链接到ruby/bin目录,我偷懒直接把2个都卸掉然后再安装0.8.7

这个就是安装mysql2过程中出现的问题:http://blog.csdn.net/linhx/archive/2011/03/29/6286899.aspx

配置ngnix:/opt/nginx/conf/nginx.conf

server {
        listen       80;
        server_name  localhost;
        root /home/xxx/rails_app/blog/public;  #xxx这个就是你刚才新建的app的public目录到完整路径
        passenger_enabled on;  
        rails_env development;     #设置为开发环境,默认是生产环境
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        #location / {
        #    root   /home/leslin123/rorails/helloMySQL/public;
        #    index  index.html index.htm;
        #} 

配置Nginx为启动项:

sudo apt-get install curl#在终端里输入curl,如果提示未安装就用这个命令安装,如果已经存在就跳过
curl -L http://bit.ly/nginx-ubuntu-init-file > nginx
sudo mv nginx /etc/init.d/
sudo chmod +x /etc/init.d/nginx 
sudo /usr/sbin/update-rc.d -f nginx defaults
sudo /etc/init.d/nginx start 

在浏览器里输入:127.0.0.1,看到Welcome to nginx!就是安装成功了,如果已经设置了rails
app的目录应该是rails程序到欢迎界面了
每次修改了nginx配置后需要重启生效:

sudo /etc/init.d/nginx restart 

注:如果提示:Access denied for user ‘root’@’localhost’ (using
password: NO)重启下nginx试试

用到的链接:rvm安装方式,只采用了前面:http://www.yangzhiping.com/tech/ubuntu-ree-nginx-passenger-rails3.blog.html

编译ruby1.9.2以及配置:
http://hi.baidu.com/rikioy/blog/item/57fdfe38b87ce3ccd462256a.html

解决mysql2版本不相容的问题:http://stackoverflow.com/questions/5840742/version-
of-mysql2-0-3-2-doesnt-ship-with-the-activerecord-adapter-bundled-anym

执行rake出错解决方法:http://stackoverflow.com/questions/5287121/undefined-method-task-using-rake-0-9-0-beta-4

安装mysql2不成功:http://blog.csdn.net/linhx/archive/2011/03/29/6286899.aspx