小编sov*_*014的帖子

Chrome和Firefox之间的flexbox行为差异

该示例可以在http://jsfiddle.net/GGYtM/找到,这里是所要求的内联代码:

<html>
<style type='text/css>
.flex{
  /* old syntax */
  display: -webkit-box;
  display: -moz-box;

  /* new syntax */
  display: -webkit-flex; 
  display: -moz-flex; 
  display: -o-flex; 
  display: -ms-flex; 
  display: flex; 
}

.flex-direction-horizontal{
  /* old syntax */
  -webkit-box-orient: horizontal;
  -moz-box-orient: horizontal;

  /* new syntax */
  -webkit-flex-direction:raw;
  -moz-flex-direction:raw; 
  -o-flex-direction:raw; 
  -ms-flex-direction:raw; 
  flex-direction: raw;
}
.flex-cross-align-stretch{
  /* old syntax */
  -webkit-box-align:stretch;
  -moz-box-align:stretch;

  /* new syntax */
  -webkit-align-items:stretch;
  -moz-align-items:stretch;
  -o-align-items:stretch;
  -ms-align-items:stretch;
  align-items:stretch;
}  
.container{
  border: 1px solid gray;
  padding:5px;
  background:#ecd953;
  -moz-border-radius: 5px;
  border-radius: 5px;
}
.button{ …
Run Code Online (Sandbox Code Playgroud)

html firefox google-chrome css3 flexbox

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

MSI安装程序,Wix和对话框大小值

我注意到在Wix中创建自定义对话框的文章,教程和示例总是使用相同的对话框大小 - 宽度="370"高度="270"(在安装程序单元中),对应于96DPI的494px*360px.该示例是http://blogs.technet.com/b/alexshev/archive/2008/10/16/from-msi-to-wix-part-20-user-interface-required-dialog-boxes.aspx 此外,很多MSI安装程序都使用这个大小的对话框.我想知道这个尺寸值来自哪里?是否有关于安装程序对话框大小的指南?

windows-installer wix

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

React.js:可重用组件与mixin的实用程序功能

假设我的react.js应用程序将显示日期,我想应用客户端浏览器/操作系统中设置的格式.有多个组件显示日期,我可以使用几种方法在它们之间共享代码.

1.可重用的React.js组件,如:

var React = require('react');

module.exports = React.createClass({
    render : function(){
        if(this.props.value === null || this.props.value===undefined)
            return false;
        var formattedValue =  new Date(this.props.value).toLocaleDateString();
        return(
            <span>
                {formattedValue}
            </span>
        );
    }
}); 
Run Code Online (Sandbox Code Playgroud)

然后使用它们:

var DateFormatter = require('./../formatters/Date');
<DateFormatter value={invoice.date} />
Run Code Online (Sandbox Code Playgroud)

2.通过React.js mixins共享的实用功能,即:

module.exports = {
    renderDate : function(dateValue){
        if(dateValue === null || dateValue===undefined)
            return false;
        var formattedValue =  new Date(dateValue).toLocaleDateString();
        return(
            <span>
                {formattedValue}
            </span>
        );
    }
} 
Run Code Online (Sandbox Code Playgroud)

然后只需将mixin添加到组件中并使用类似的东西

{this.renderDate(invoice.date)}
Run Code Online (Sandbox Code Playgroud)

对我而言,目前这两种方法似乎没有太大区别.但我很想听听社区对每个解决方案的利弊的看法.TIA!

javascript architecture mixins reactjs

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

ggplot 条形图图例中的项目顺序出现问题

我的数据看起来像

    language    tone        count   tone_percent    label_pos   pos
1   c           positive    3460    36.16977        18.08488    7
2   c           neutral     2046    21.38825        46.86389    7
3   c           negative    4060    42.44198        78.77901    7
4   c#          positive    3732    41.26949        20.63475    3
5   c#          neutral     1832    20.25876        51.39887    3
6   c#          negative    3479    38.47175        80.76413    3
7   c++         positive    3136    33.13960        16.56980    8
8   c++         neutral     2008    21.21949        43.74934    8
9   c++         negative    4319    45.64092        77.17954    8
Run Code Online (Sandbox Code Playgroud)

我一直在尝试使用 ggplot2 条形图将它们可视化:

p <-ggplot() + theme_bw() + geom_bar(aes(y=tone_percent, x=reorder(language, …
Run Code Online (Sandbox Code Playgroud)

r legend bar-chart ggplot2

-2
推荐指数
1
解决办法
2565
查看次数