小编Sub*_*Rao的帖子

什么是词汇范围?

有人可以给我一个关于词汇范围的简要介绍吗?

javascript scoping lexical-scope

645
推荐指数
14
解决办法
16万
查看次数

Backbone.js el无法正常工作

App.Views.VideoView = Backbone.View.extend({
    initialize: function() {
        _.bindAll(this, 'render');
        this.model = this.options.model;
        this.render();
    },
    render: function() {
        JST.video({
            model: this.model
        });
        return this;
    }
});

App.Views.PlayListView = Backbone.View.extend({
    el: $("#playlistWrapper"),
    initialize: function(videos) {
        _.bindAll(this, 'render');
        this.modelViews = $.map(videos.models, function(model, i) {
            return new App.Views.VideoView({
                model: model
            });
        })
        this.render();

    },
    render: function() {
        var that = this;
        $(this.el).clear();
        $.each(this.modelViews, function(i, modelView) {
            $(that).el.append(modelView.render().el);
        });

        return this;
    }
});
Run Code Online (Sandbox Code Playgroud)

我总是低于错误

$(this.el).clear is not a function
[Break On This Error] $(this.el).clear(); 
Run Code Online (Sandbox Code Playgroud)

看来我的PlayerListView是空的.

我有div与id …

backbone.js

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

facebook无法识别我的元标记

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:og="http://ogp.me/ns#"
      xmlns:fb="http://www.facebook.com/2008/fbml">
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="Content-Language" content="en" />
        <title></title>
            <meta property="og:title" content="Katha Screenplay Darsakatvam (KSD) Appalaraju "/>
        <meta property="og:type" content="movie"/>
        <meta property="og:url" content="http://reviewumpire.com/movies/54-katha-screenplay-darsakatvam-ksd-appalaraju-"/>

        <meta property="og:image" content="http://reviewumpire.com/images/uploads/movie/vertical/54/vert.jpg"/>
        <meta property="og:site_name" content="ReviewUmpire"/>
        <meta property="fb:app_id" content="162180660488445" />
        <meta property="fb:admins" content="57728908711" />
        <meta property="og:description" content="23% scored on reveiwumpire."/>

        <meta name="google-site-verification" content="RXjWilEYk0eC_6ulYSV_AaFVSQe8nHI6Zw4_W9dVR5I" />
        <script src="/javascripts/vendor/jquery.min.js?1306239220" type="text/javascript"></script>
    <script src="/javascripts/vendor/quote.rotator.js?1306239220" type="text/javascript"></script>

    <script src="/javascripts/vendor/scroll.js?1306239220" type="text/javascript"></script>
    <script src="/javascripts/vendor/rails.js?1306239220" type="text/javascript"></script>
    <script src="/javascripts/application.js?1306239220" type="text/javascript"></script>
        <link href="/stylesheets/compiled/grid.css?1306239220" media="screen" rel="stylesheet" …
Run Code Online (Sandbox Code Playgroud)

facebook opengraph

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

如何在Rails中计算下一个工作日?

如何计算Rails中的下一个和上一个工作日?

ruby ruby-on-rails

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

无法从Sequel gem连接mysql

当我尝试从Sequel连接MySQL时.我收到这些错误:

require 'rubygems'
        require 'sequel'
        DB = Sequel.connect(:adapter => 'mysql', :user => 'root', :host => 'localhost', :database => 'scanty',:password=>'xx')
        DB.tables
    Sequel::DatabaseConnectionError: NameError uninitialized constant Mysql::CLIENT_MULTI_RESULTS
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/adapters/mysql.rb:98:in `connect'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/database.rb:92:in `initialize'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/connection_pool.rb:166:in `call'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/connection_pool.rb:166:in `make_new'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/connection_pool.rb:153:in `available'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/connection_pool.rb:144:in `acquire'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/connection_pool.rb:143:in `synchronize'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/connection_pool.rb:143:in `acquire'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/connection_pool.rb:105:in `hold'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/database.rb:471:in `synchronize'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/adapters/mysql.rb:128:in `execute'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/dataset.rb:314:in `execute'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/adapters/mysql.rb:342:in `execute'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/adapters/mysql.rb:298:in `fetch_rows'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/dataset.rb:185:in `each'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/dataset/convenience.rb:156:in `map'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/dataset/convenience.rb:156:in `map'
        from /opt/local/lib/ruby/gems/1.8/gems/sequel-3.2.0/lib/sequel/adapters/shared/mysql.rb:60:in `tables'
        from …
Run Code Online (Sandbox Code Playgroud)

ruby mysql sequel

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

如何在ruby中实现curry(部分函数)

我需要一些在ruby中实现curry函数的例子(1.8.6或1.8.7而不是1.9).

ruby currying

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

在ios 8中未调用NSURLSessionDataDelegate didReceiveChallenge回调

我正在使用NSURLSession进行https网络呼叫.但是在ios 8中没有调用回调,但ios 7/ios 7.1中的回调相同.与此相关的ios 8是否有任何变化.

public func URLSession(session: NSURLSession, task: NSURLSessionTask, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential!) -> Void) {
Run Code Online (Sandbox Code Playgroud)

ios nsurlsession

6
推荐指数
0
解决办法
654
查看次数

在ios 8上使用无效的ssl证书,随机CFNetwork SSLHandshake失败(-9806)

我在ios 8上收到CFNetwork SSLHandshake失败(-9806)错误.相同的代码在ios 7上工作正常但在ios 8上随机失败.

ios8

6
推荐指数
0
解决办法
421
查看次数

postgresql在lion os x上失败并出现以下错误

 Failed system call was shmget(key=5432001, size=16498688, 03600).
HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMMAX.  To reduce the request size (currently 16498688 bytes), reduce PostgreSQL's shared_buffers parameter (currently 1536) and/or its max_connections parameter (currently 104).
    If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case …
Run Code Online (Sandbox Code Playgroud)

postgresql macos osx-lion

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

为什么自动测试不起作用?

我更改了我的.autotest文件以使用基于Ruby的项目.

之后,当我想将它用于Rails时,它使用.autotest我用于Ruby项目的配置设置.

我卸载了自动测试并重新安装它没有运气.我还删除了.autotest根目录中的文件,但它无法正常工作.

ruby ruby-on-rails autotest

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

如何创建基于Sinoku的Sinatra应用程序

我试图创建基于Sinatra的heroku应用程序没有任何运气?

ruby heroku sinatra

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