小编Mat*_*ias的帖子

在 C 中使用 Murmurhash

我正在用 C 实现哈希表和哈希函数,并听说 Murmurhash 是用于此目的的适当快速算法。为此查找一些 C 代码:

uint32_t murmur3_32(const char *key, uint32_t len, uint32_t seed) {
    static const uint32_t c1 = 0xcc9e2d51;
    static const uint32_t c2 = 0x1b873593;
    static const uint32_t r1 = 15;
    static const uint32_t r2 = 13;
    static const uint32_t m = 5;
    static const uint32_t n = 0xe6546b64;

    uint32_t hash = seed;

    const int nblocks = len / 4;
    const uint32_t *blocks = (const uint32_t *) key;
    int i;
    for (i = 0; i < nblocks; …
Run Code Online (Sandbox Code Playgroud)

c hash

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

更改此值后,如何确保Bootstrap列扩展为适合其内容的宽度?

我有以下非常简单的Bootstrap网格系统:

<div class="container-fluid">
  <div class="row">
     <div class="col-sm-2" style="border-style:solid; border-color:black; border-width:1px;">    
      <div id="jsme_container"> </div>   
    </div>
    <div class="col-sm-2"  style="border-style:solid; border-color:black; border-width:1px;">
        Arrow
    </div>
    <div class="col-sm-2" style="border-style:solid; border-color:black; border-width:1px;">Compound</div>
    <div class="col-sm-2" style="border-style:solid; border-color:black; border-width:1px;">Arrow</div>
    <div class="col-sm-2" style="border-style:solid; border-color:black; border-width:1px;">Compound</div>
    <div class="col-sm-2" style="border-style:solid; border-color:black; border-width:1px;">Arrow</div>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

当前,出于测试目的,仅第一列填充了内容-这是一个自定义图形对象,其大小可以使用以下Javascript指定:

var width = "200px";
var height = "200px";

function jsmeOnLoad() {

  // width, height
  document.JME = new JSApplet.JSME("jsme_container", width, height, {

    "options": "edit,useopenchemlib", // depict in place of edit removes exterior editor window       

  }); 

}
Run Code Online (Sandbox Code Playgroud)

我已将其包含在以下JSFiddle中: …

html javascript css jquery twitter-bootstrap

2
推荐指数
2
解决办法
5968
查看次数

了解Flexbox如何与Bootstrap配合使用

我有以下HTML和CSS布局:

html {
  position: relative;
  min-height: 100%;
}
body {
  /* Margin bottom by footer height */
  margin-bottom: 100px;
}
.col-md-6 {
  display: flex;
  justify-content: center;
}
.container_flex {
  display: flex;
  align-items: center;
  justify-content: center;
  /* vh refers to viewport height. Very useful! */
  height: 100vh;
  width: 100%;
}
Run Code Online (Sandbox Code Playgroud)
<div class="container-fluid">
  <div class="container_flex">
    <div class="row">
      <div class="col-md-6 col-xs-12" style="border:solid">
        <h1>Column 1</h1>
      </div>
      <div class="col-md-6 col-xs-12" style="border:solid">
        <h1>Column 2</h1>
      </div>
    </div>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

其中提供了以下结果:

Bootply

我使用Flexbox的目的是将容器流体内"行"的内容垂直居中.但是,这会导致列在桌面模式下采用压缩外观.在移动视图中,列按预期堆栈.如果有人能解释为什么会出现这种压缩/粗短的外观,我将不胜感激?

相反,如果我删除行类,则不再显示此粗短压缩外观,如下所示:

Bootply

但是,在移动视图中,列不再堆叠.有什么方法可以纠正这个吗?

如果有人有任何提示/指示如何有效地使用FlexBox和Bootstrap以比我在这里尝试的更有效的方式垂直和水平居中,我将非常感激.

html css css3 flexbox twitter-bootstrap

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

标签 统计

css ×2

html ×2

twitter-bootstrap ×2

c ×1

css3 ×1

flexbox ×1

hash ×1

javascript ×1

jquery ×1