我阅读了有关md5哈希的维基百科文章,但我仍然无法理解哈希如何不能"重构"回到原始文本.
有人可以向对密码学知之甚少的人解释这是如何工作的吗?该功能的哪一部分使其成为单向的?
几个星期前我读了这个问题.当我第一次看到iPad时,我想到了这一点.
您认为可以在iPad上设置开发环境吗?我认为如果有一个InstantRails应用程序,一个Django应用程序,甚至280 North的Atlas可以在它上面运行,那将是非常棒的:).
你会使用屏幕键盘和10英寸屏幕开发吗?
史蒂夫乔布斯似乎认为触摸屏是网络浏览的未来.未来与编程有什么关系?
看起来有人正在努力! http://dribbble.com/shots/15159-Oh-yes-working-on-a-text-editor-for-iPad
我已经习惯了Django,你可以在查询集上运行多个过滤方法,即Item.all.filter(foo="bar").filter(something="else").
然而,在Rails中这并不容易.Item.find(:all, :conditions => ["foo = :foo", { :foo = bar }])返回一个数组意味着这不起作用:
Item.find(:all, :conditions => ["foo = :foo", { :foo = 'bar' }]).find(:all, :conditions => ["something = :something", { :something = 'else' }])
所以我认为"堆栈"过滤器的最佳方法是修改条件数组然后运行查询.
所以我想出了这个功能:
def combine(array1,array2)
conditions = []
conditions[0] = (array1[0]+" AND "+array2[0]).to_s
conditions[1] = {}
conditions[1].merge!(array1[1])
conditions[1].merge!(array2[1])
return conditions
end
Run Code Online (Sandbox Code Playgroud)
用法:
array1 = ["foo =:foo",{:foo ='bar'}] array2 = ["something =:something",{:something ='else'}] conditions = combine(array1,array2)items = Item. find(:all,:conditions =>条件)
这非常有效.但是我希望能够组合任意数量的数组,或者基本上用于编写简写:
conditions = combine(combine(array1,array2),array3)
Run Code Online (Sandbox Code Playgroud)
有人能帮忙吗?提前致谢.
有没有人在这里使用Google Prediction API?为了什么?它"有效"吗?
当一个人在Facebook上发布链接时,Facebook会自动发现一张照片用作显示在新闻Feed中的缩略图.是否有某种(HTML)标记围绕您想要用作首选的照片?
我的四人开发团队已经面临这个问题一段时间了:
有时我们需要处理同一组数据.因此,当我们在本地计算机上进行开发时,dev数据库将远程连接.
但是,有时我们需要在db上运行操作,这些操作将依赖于其他开发人员的数据,即我们破坏关联.为此,本地数据库会很好.
是否有解决这种困境的最佳做法?有没有像"数据SCM"工具?
以一种奇怪的方式,在git repo中保留SQL插入/删除/更新查询的文本文件会很有用,但我认为这可能非常快速地变慢.
你们怎么处理这个?
我想为Devise编写一个扩展,允许您使用parse_resource作为数据存储区(而不是ActiveRecord).parse_resource是Parse.com的REST api的Ruby包装器.它的界面与ActiveRecord几乎相同,并且是ActiveModel投诉.因此,Devise的扩展似乎可能不需要太多的非样板.
但是,我找不到任何教程.我所依赖的只是其他扩展的来源.从MongoMapper扩展,我认为有两个主要部分:
发电机(不是很需要)
在这里你覆盖DeviseGenerator#(generate_model|inject_devise_content|replace_default_devise_orm)方法.
"胆量 "(非常需要)
我不太确定这里发生了什么.似乎有很多样板,有一些自定义类型转换,在底部有一个声明,我们将使用此扩展而不是默认的ORM.
这就是它的全部吗?我错过了什么?有人可以更详细地解释"胆量"中发生的事情吗?
是否有任何简单的lint测试可以确保与Devise完全兼容?
Rhodes,Phonegap和Appcelerator如何能够使用Javascript或Ruby,并将它们编译成应用程序SDK的二进制文件,这些应用程序SDK通常需要用Obj-C,Java和其他文件编写应用程序?
我目前正在尝试确定Rails应用程序中令人讨厌的重定向错误的原因.这里详细说明了,虽然我不是在StackOverflow上寻找特定的解决方案.相反,当我正在努力解决这个问题时,我想开发一种通用方法来捕获,记录和调查Rails应用程序中的无限重定向循环.
我在这里有一个想法,但我仍然想看看是否有任何经过验证的技术.
我的想法:
覆盖Rails' redirect_to以在会话中"记录"重定向:
def redirect_to(destination)
session[:redirects] << {destination: destination, timestamp: Time.now}
if is_inifinite_redirect?(session[:redirects])
render "a_redirect_error_page"
else
super
end
end
Run Code Online (Sandbox Code Playgroud)
然后,对重定向数组进行某种分析,以确定是否存在无限循环:
def is_inifinite_redirect?(redirects)
recent = redirects.last(21) # 21 is the max redirects allowed by Chrome
return recent.odds.map(&:destination).uniq.length == 1 && \
recent.evens.map(&:destination).uniq.length == 1 && \
(recent.last.timestamp - recent.first.timestamp < 10.seconds)
end
Run Code Online (Sandbox Code Playgroud) 我最近编写了ParseResource,它是Parse.com的 REST api 的Ruby API包装器.
这是一些基本用法:
class Post < ParseResource
fields :title, :author, :body
end
p = Post.create(:title => "Hello world", :author => "Alan", :body => "ipso lorem")
Run Code Online (Sandbox Code Playgroud)
该项目相当年轻,我真正想要实现的功能是关联.像这样的东西:
class Author < ParseResource
has_many :posts
fields :name, :email
end
class Post < ParseResource
belongs_to :author
fields :title, :body
end
a = Author.create(:name => "Alan", :email => "alan@example.com")
p = Post.create(:title => "Associated!", :body => "ipso lorem", :author => a)
p.author.class #=> Author
p.author.name #=> "Alan"
a.posts #=> …Run Code Online (Sandbox Code Playgroud) ruby ×4
activerecord ×2
android ×1
appcelerator ×1
associations ×1
cordova ×1
cryptographic-hash-function ×1
cryptography ×1
database ×1
devise ×1
facebook ×1
ide ×1
ipad ×1
iphone ×1
md5 ×1
mongomapper ×1
parsing ×1
redirect ×1
rest ×1
rhodes ×1
semantic-web ×1