小编ete*_*rps的帖子

在Twitter Bootstrap 2中,如何在缩小屏幕时让正确的列移动到顶部?

我在Twitter Bootstrap中使用了2列流体布局.左列是主要内容(span10),右列是小部件的侧边栏(span2).目前,在调整浏览器窗口大小时,Bootstrap会通过创建一个列来响应,最左边的部分位于顶部,最右边的部分位于底部.我反过来喜欢它.

这是我的html的要点:

<body>
  <div id="content" class="container-fluid">
    <div id="content-row-1" class="row-fluid">
      <div id="mainContainer" class="span10"> Lots of content goes here </div>
      <div id="sidebar" class="span2"> Widgets   </div>
    </div>  <!-- content-row-1 -->
  </div>  <!-- content -->
</body>
Run Code Online (Sandbox Code Playgroud)

mainContainer左侧是否有任何方法可以在宽窗口中显示右侧的小部件,但是sidebar当窗口缩小时会对齐顶部?

html css twitter-bootstrap

39
推荐指数
3
解决办法
3万
查看次数

在ColdFusion中,如果为0,是否有一个numberFormat()掩码来删除小数?

我正在尝试格式化数字,以便显示2位小数,除非它是一个整数 - 然后我不希望显示小数点.我试过0.00,_.__,9.99和几个组合.是否有numberFormat可以获得此结果的函数的掩码?

coldfusion number-formatting coldfusion-9

10
推荐指数
4
解决办法
9379
查看次数

为什么$ .when().pipe().then()工作,但不是$ .when().then().then()?

我仍然试图使用JQuery的Deferred对象来解决问题,并且正在抓住一个特定的问题.在下面的代码中,我最初尝试链接deferred.then()但它从未起作用.所有三个功能一次执行.只有在我的同事向我指出这个pipe功能后,事情就会落到实处.问题是,为什么pipe()工作,但不是then()

var otherDefer = function(msg){return function(){return testDefer(msg)}};
var there = otherDefer("there,");
var guy = otherDefer("guy.");                       

function testDefer(msg) {
    var deferred = $.Deferred();
    pretendAjaxCall( function() {
        $('<li>'+msg+'</li>').appendTo('#msgOut');
        deferred.resolve();
    });
    return deferred.promise();  
}

function pretendAjaxCall(callback) {
    setTimeout(callback,1500);
} 

$.when(testDefer("Hi")).pipe(there).then(guy);?
Run Code Online (Sandbox Code Playgroud)

我也试过return deferred而不是return deferred.promise()在使用时when().then().then().

以上代码的jsFiddle:http://jsfiddle.net/eterpstra/yGu2d/

javascript jquery jquery-deferred

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

是否可以使用CFLDAP从仅具有组电子邮件地址的通讯组中检索所有用户?

我想使用CFLDAP来检索Exchange使用的某个通讯组中的所有用户.如果可以,我将如何使用CFLDAP的"过滤器"属性?此外,如果我拥有该组的电子邮件地址(例如'sales@example.com'),我仍然可以获取用户信息,还是需要使用该电子邮件地址的组的名称?

例如,我将在下面的块中添加什么?

<cfldap server = "foo.example.com"
        action = "query"
        name = "ldap2"
        start = "dc=foo,dc=example,dc=com"
        attributes = "givenName,sn,sAMAccountName,mail,employeeID,dn"
        filter="?????????????"
        username="BAR\eterps"
        password="12345" >
Run Code Online (Sandbox Code Playgroud)

coldfusion ldap active-directory

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

在Javascript中,ColdFusion的listFindNoCase函数的最快实现是什么?

我已经被ColdFusion的列表宠坏了,并且遇到了一个或两个以逗号分隔的列表出现在Javascript中的情况.是否有相当于listFindNoCase('string','list')或在Javascript中实现它的高效方法?

哦,它应该能够用逗号处理列表项,例如:("Smith,John","Doe,Jane","etc ......")

这才是真正让我失望的原因.

javascript algorithm coldfusion

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

如何使用源映射调试模块化TypeScript?

我正在尝试使用Chrome开发工具中的TypeScript调试工作.我为所有.ts文件生成了源映射,javascript看起来正确,但Chrome只加载index.html中引用的js文件并忽略所有模块.这有点意义,因为Typescript编译器似乎没有对我的模块做任何事情.如果有人可以在下面的例子中解释我做错了什么,那就太好了.

我的项目设置如下:

root/
  src/
    Company.ts
    User.ts
  app.ts
  index.html
Run Code Online (Sandbox Code Playgroud)

Company.ts

module Company {

    export class Job {
        public title:string;
        public description:string;

        constructor(title:string, desc:string){
            this.title = title;
            this.description = desc;
        };
    }
}
Run Code Online (Sandbox Code Playgroud)

User.ts

 ///<reference path="Company.ts"/>

module User {
    export class Person {
        public first:string;
        public last:string;
        private myJob:Company.Job;
        private myAccount:User.Account;

        constructor(firstName:string, lastName:string){
            this.first = firstName;
            this.last = lastName;
        }

        public getName():string{
            return this.first + ' ' + this.last;
        }

        public setJob(job:Company.Job){
            this.myJob = job;
        }

        public setAccount(acct:User.Account){
            this.myAccount = acct;
        } …
Run Code Online (Sandbox Code Playgroud)

google-chrome-devtools source-maps typescript

3
推荐指数
1
解决办法
3722
查看次数

对于对象属性检测,我应该使用“in”还是“hasOwnProperty”?

我刚刚读了一篇文章,建议使用in运算符进行浏览器功能和对象属性检测。给出的示例是使用:

if("geolocation" in navigator) {
    // Do some stuff
}
Run Code Online (Sandbox Code Playgroud)

而不是:

if(navigator.geolocation) {
    // Do some stuff
}
Run Code Online (Sandbox Code Playgroud)

然而,它没有提到 hasOwnProperty,尽管事实上以下代码似乎工作得很好:

if(navigator.hasOwnProperty('geolocation')) {
    // Do some stuff
}
Run Code Online (Sandbox Code Playgroud)

在某些情况下我应该使用in而不是使用 hasOwnProperty ,反之亦然?或者这只是一种风格选择?

javascript

3
推荐指数
1
解决办法
562
查看次数

如何从长度为“n”的数组中删除等距元素以匹配给定长度“y”?

假设我有数组foo和一个正整数y,其中foo.length> y。我想从中删除元素,foo以便foo.length成为y(或非常接近它)。

另外,我需要保留 的第一个和最后一个元素foo。被删除元素的索引必须尽可能均匀地间隔开。 Foo可以被切片,或者可以用来创建一个新数组。

示例:如果foo=[a,b,c,d,e,f,g,1,2,3,4,5]y= 6,则trimmedfoo可能是[a,c,e,g,2,4,5]或 可能[a,c,e,2,4,5],但不是[a,c,e,g,2,4]因为 的最后一个元素foo丢失。

伪代码解决方案很好,尽管 as3 是我选择的语言。:)

谢谢!

arrays algorithm actionscript-3

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

如何将camelCase转换为带空格的字符串?(例如camelCase为"Camel Case")

使用ColdFusion,我想将camelCase字符串转换为人类可读的字符串,如:

firstName - >名字

此外,理想情况下,这将完成所有内联,例如Ucase(rereplace('myCamelCaseString',[regex]," ")).如果内联不可能,那么UDF也许呢?

regex string coldfusion

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

使用ORM时如何向CFC添加数组属性?

我正在使用Coldfusion ORM(Hibernate),并将cfc映射到数据库表.一切正常,但现在我想将数组属性添加到数据库中不存在的CFC.我需要将哪些属性添加到属性中,以便它不会导致ORM错误?

component extends="_base" persistent="true" accessors="true" table="foo" {

    // Primary Key
    property name='fooID' fieldtype='id' column='fooID' generator='native';

    // Properties  
    property name='fooTypeID' ormtype='int'; 
    property name='fooName' ormtype='string'; 

    // Properties that are not database columns or relationships
    property name='fooArray' type='array' <= causes error


    public array function $toString() output="false" {
        var toStringMessage = 'foo = [ 
        fooID: ' & getFooID() & ' 
        fooTypeID: ' & getfooTypeID() & ' 
        fooName: ' & getfooName() & ' 
            fooArray: ' & getfooArray() & ' 
        ]';

        return toStringMessage;
    }

}
Run Code Online (Sandbox Code Playgroud)

coldfusion orm hibernate coldfusion-9

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

为什么正则表达式将文件名与扩展名分开不适用于ColdFusion?

我正在尝试在ColdFusion中检索没有扩展名的文件名.我使用以下功能: REMatchNoCase( "(.+?)(\.[^.]*$|$)" , "Doe, John 8.15.2012.docx" );

我希望这返回一个数组,["Doe, John 8.15.2012","docx"] 但是我总是得到一个包含一个元素的数组 - 整个文件名:["Doe, John 8.15.2012.docx"]

我在rexv.org上尝试了上面的正则表达式字符串,它按预期工作,但不在ColdFusion上.我从这个SO问题得到了字符串:正则表达式:一次性获取没有扩展名的文件名?

ColdFusion使用不同的语法吗?或者我做错了什么?

谢谢.

regex coldfusion coldfusion-9

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

为什么ColdFusion会在正则表达式上抛出错误来删除特殊字符?

我正在使用reReplace从文件名中删除特殊字符.以下正则表达式在我的代码中抛出异常(见下文).但是,当我在ColdFusion Regex实用程序中测试正则表达式字符串时,它可以正常工作.

这是我的代码:

reReplace(tmpName,"[{}\(\)\^$&%#!@=<>:;,~`'\'\*\?\/\+\|\[\\\\]|\]|\-",'','all')
Run Code Online (Sandbox Code Playgroud)

而错误:

错误消息:第45行第29行找到无效的令牌@.

CFML编译器正在处理:

An expression beginning with !, on line 29, column 44.This message is usually caused by a problem in the expressions structure.
Run Code Online (Sandbox Code Playgroud)

如果我逃避@符号,\@我得到这个错误:

错误类型:模板:[N/A]错误消息:在柱45的ColdFusion一直在寻找在以下文本上线29找到无效CFML构建体:

\\ CFML编译器正在处理:

An expression beginning with !, on line 29, column 44.This message is usually caused by a problem in the expressions structure.
Run Code Online (Sandbox Code Playgroud)

这个正则表达式字符串的原始来源是:正则表达式去除特殊字符

我删除了.,_因为这些字符应该被允许.

regex coldfusion coldfusion-9

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