小编dan*_*iel的帖子

哈姆如果还有筑巢

如何在不重复.text.error和.text之后的代码的情况下执行此操作?


     -if f.object.errors.any?
      .text.error 
        = f.label :email 
        = f.text_field :email
        %p#foo= "Escriba el e-mail"
        = render 'shared/error_messages', :object => f.object, :param => :email
    -else
      .text
        = f.label :email 
        = f.text_field :email
        %p#foo= "Escriba el e-mail"
        = render 'shared/error_messages', :object => f.object, :param => :email

    -if f.object.errors.any?
      .text.error
        = f.label :password
        = f.password_field :password
        = render 'shared/error_messages', :object => f.object, :param => :password
    -else
      .text.error
        = f.label :password
        = f.password_field :password
        = render 'shared/error_messages', :object => f.object, :param => :password   

Run Code Online (Sandbox Code Playgroud)

haml ruby-on-rails

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

Facebook FQL获得了facebook页面的粉丝列表

可能重复:
查询"喜欢"我的Facebook页面的用户

目前,该网站上的所有解决方案都不起作用.我是一个Facebook页面的管理员,想把我的粉丝输出ID,这可能吗?

https://api.facebook.com/method/fql.query?query=SELECT的uid FROM page_fan WHERE PAGE_ID = [PAGE_ID&的access_token = [ACCESS_TOKEN]

在此输入图像描述

facebook facebook-graph-api

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

这是RFC 4226错了吗?

RFC的测试值指定:

Appendix D - HOTP Algorithm: Test Values

   The following test data uses the ASCII string
   "12345678901234567890" for the secret:

   Secret = 0x3132333435363738393031323334353637383930

   Table 1 details for each count, the intermediate HMAC value.

   Count    Hexadecimal HMAC-SHA-1(secret, count)
   0        cc93cf18508d94934c64b65d8ba7667fb7cde4b0
   1        75a48a19d4cbe100644e8ac1397eea747a2d33ab
Run Code Online (Sandbox Code Playgroud)

因此,如果我尝试在红宝石中获得0的HMAC,我会得到:

[20] pry(AuthyOTP)> secret_key = "12345678901234567890"
=> "12345678901234567890"
[22] pry(AuthyOTP)> OpenSSL::HMAC.hexdigest(digest, secret_key, "0")
=> "32a67f374525d32d0ce13e3db42b5b4a3f370cce"
Run Code Online (Sandbox Code Playgroud)

我原本应该得到 cc93cf18508d94934c64b65d8ba7667fb7cde4b0

所以我在java中编写了一个实现,我得到了同样的结果:

Calculation OTP for movingFactor = 0
    2. Calculate Hash = 
      32a67f374525d32d0ce13e3db42b5b4a3f370cce
Run Code Online (Sandbox Code Playgroud)

那么当秘密是"12345678901234567890"时,什么是"0"的十六进制SHA1-HMAC?

cryptography rfc rfc-4226

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

由于gem bundler,应用程序无法推送到heroku(无法将主机添加到已知主机列表(/home/group_home/.ssh/known_hosts))

尝试推送狂欢沙箱车来测试我要使用的扩展时,我遇到了这个错误.

我的Gemfile

gem 'spree_flexi_variants', :git=>'git@github.com:jsqu99/spree_flexi_variants.git', :branch => 'pre-deface-stable'
Run Code Online (Sandbox Code Playgroud)

heroku的输出推送:


julio@ubuntu:~/rails/sandboxcart $ git push heroku master
Counting objects: 502, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (475/475), done.
Writing objects: 100% (502/502), 2.63 MiB | 458 KiB/s, done.
Total 502 (delta 44), reused 0 (delta 0)

-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Detected Rails is not set to serve static_assets
       Installing rails3_serve_static_assets... done
-----> Configure Rails 3 to disable x-sendfile
       Installing rails3_disable_x_sendfile... done
----- …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails heroku spree bundler gemfile

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