24
Ruby中常用MD5或者SHA1加密方法
MD5加密方式:
require ‘md5′
puts MD5.hexdigest(”)
SHA1加密方式:
require ‘digest/sha1′
puts Digest::SHA1.hexdigest(”)
MD5加密方式:
require ‘md5′
puts MD5.hexdigest(”)
SHA1加密方式:
require ‘digest/sha1′
puts Digest::SHA1.hexdigest(”)
![]()
My First AppEngine Product Released!
Actually this product is released by yesterday evening. But today is the announced day for this product. This is some kind of the web game. The idea is we are blind before the thousands of the informations, but try this game, you can find the internal connection from one with another!
I am still working on the clues of the game, asking friends for the testing,after that I will announce the url to all of you.
我在用Ruby2.0的Restful风格开发中,由于缺少文档,走了不少弯路,不过现在终于搞清楚了。简单的我就不说了,通过ruby script/generate scaffold …命令可以很方面的生成rest风格的GRUD,因为我现在是在作一个后台管理平台,希望rest生成的control能够放到admin的命空间下面。有如下几个关键点:
首先要修改该route.rb中的路由配置:
map.namespace :admin do |admin|
admin.resources :users
end
通过使用命令rake routes可以查看到所有的路径和便利函数
最大的难点是在update中与form_for配合,我是这么做的
<% form_for(:user,@user,:url=>admin_user_path(@user),:html=>{:method=>:put}) do |f| %>
…
<% end%>
这样就可以指定相关的path用form模拟put操作了
Python 中函数参数的传递是通过“赋值”来传递的。但这条规则只回答了函数参数传递的“战略问题”,并没有回答“战术问题”,也就说没有回答怎么赋值的问题。函数 参数的使用可以分为两个方面,一是函数参数如何定义,二是函数在调用时的参数如何解析的。而后者又是由前者决定的。函数参数的定义有四种形式:
1. F(arg1,arg2,…)
2. F(arg2=
3. F(*arg1)
4. F(**arg1)
跳转后阅读Python 函数参数的传递(转)的完整内容
也许是习惯了RoR下面那种通过generator自动生成网站框架。为了更好的帮助我自己秘密产品的开发。我准备顺手开发一些辅助工具来帮助组织代码什么的,我会逐渐的发布一些代码,希望最终能够整理成一个完整的工具包
generator.py 就是我用来自动生成网站框架的文件。只要使用generator.py <your appname>,就能自动生成网站框架。当然有一段日子没有用python写过东西了,所以这个文件写的相当的简陋。又由于我的主要精力会放在产品开发上,所以暂时也没有准备对这个文件做升级哈的。如果哪位大大对这个粗糙的拿不出手的东西感兴趣的话,欢迎在网站上和我留言联系。
Orz
FCKEditor可以说是目前最好的在线HTML编辑器了。官方FCKEditor好像只支持python,php,.NET还有Java等等。不过rubyforge上有一个Fckeditor的插件。
我在公司的网络上不能在线安装这个插件,只能通过下载到本地安装了,安装方法非常简单:
就可以使用了。
Yesterday, I have blogged a post saying that I am going to transfer my current project from Ruby to AppEngine. Strange thing is that, the hit number of this post is very high. So it means the google appengine is really hot.
Let’s turn back to my “secrete” project. I named it as “OneEyeCat”, I promise it as a very cool online service provided. But I will not tell you what it is now. During the development of this project. I will share all my experiences of using GAE. Hoping this can enjoy you all my readers of this site.