• sudo yum install libmysqlclient-devel 试下, 可能库名字不对,ubuntu 的我知道,centos 的好像是这个. yum install *mysql*搜索下。

  • bitbucket 出问题了? at October 30, 2014

    #3 楼 @lawrence 开玩笑吧,github 我都遇到过 404.bitbucket 市 py 写的,所以上面 pyer 比较多。

  • #5 楼 @rdongxie 结合 rails 做的就很多了. https://github.com/rails/jquery-ujs/wiki

  • #3 楼 @rdongxie jquery_ujs

  • http://api.rubyonrails.org/#respond_to respond_to(*mimes, &block) 需要同时返回多种 mime_type 的时候这么做才比较好,不然就是多余的. ruby-china 论坛里面大多返回 html,所以直接render html:,api 返回 json,用render json: or render text:

  • PostgreSQL 与 MySQL 的性能 at October 29, 2014

    数据大了肯定要分库分表的,这里建议先分表,3000 万,大概 mod(4),也就是放四张表中,这是一个简单的拆分策略。时间上:理论就是一个取模运算后就去查表,所以肯定会快几倍。 至于索引,创建索引的最主要目的其实就是为了增加查询速度,采用了优化的算法结构,具体的我就是门外汉了,可以查看下索引原理

  • PostgreSQL 与 MySQL 的性能 at October 28, 2014

    #1 楼 @winnie 一楼 +1

  • #1 楼 @huacnlee

    ubuntu 14.04
    rvm 1.25
    ruby 2.1.3
    
    rvm pkg install openssl
    rvm reinstall 2.1.3
    

    还是不行. OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: sslv3 alert handshake failure): 我是使用 rest-client 发送 send-cloud 邮件的时候遇到的。网上多种方式试了都无效。

  • 😄

  • #4 楼 @lgn21st 邮件样本我记得是 553,我的通常匹配度都挺高的. 那意味着目前最好自己 post 方式发送吗?

  • #2 楼 @luckyyang 我最近野在用,基本使用是成功了,但是不知道怎么配置进 rails,本身可以单独使用,但我想结合 rails 的配置。

    # gamil
      config.action_mailer.delivery_method = :smtp
      config.action_mailer.smtp_settings = {
        address:              'smtp.gmail.com',
        port:                 587,
        domain:               'example.com',
        user_name:            '<username>',
        password:             '<password>',
        authentication:       'plain',
        enable_starttls_auto: true
      }
    

    怎么结合下面的对照写上面的?

    #!/usr/bin/env ruby
    require 'rubygems'
    require 'rest_client'
    
    def send_attachment_mail
      response = RestClient.post "https://sendcloud.sohu.com/webapi/mail.send.xml",
      :api_user => "[email protected]",
      :api_key => "password",
      :from => "[email protected]",
      :fromname => "from名称",
      :to => "[email protected];[email protected]",
      :subject => "ruby 调用WebAPI测试主题",
      :html => '欢迎使用<a href="https://sendcloud.sohu.com">SendCloud</a>',
      return response
    end
    
    response = send_attachment_mail 
    puts response.code
    puts response.to_str
    

    能给一个例子最好了。谢谢

  • win7 下安装 Rails at October 26, 2014

    点个赞!其他不知道该说什么

  • 不是基于 session,用 redis记录ip和登陆失败次数.靠谱操作我觉得就两个,要么存到内存数据库 redis,要么持久化到数据库,效率低点。本质市一样的。

  • redis 不错

  • extjs,注意 license 喔。

  • #7 楼 @Peter CDN 是优选,要么自建 CDN,要么租用。但是楼主好像没扯部署,看得出来只是练习。

  • 用 gem 吧,一般来说不推荐 hack core. 另外楼主需要补下 css 知识,內联样式>id>class(多个 class 顺序无关). 所以定制这个与你用那种方式引入 bootstrap 无关,另https://github.com/twbs/bootstrap-sass 这个 gem 也提供了自定义的方式,见 custom 部分,原理也就是覆盖。如果觉得內联和 id 不好,那就用 custom. good lucky.

  • #5 楼 @yfractal 感觉贵圈越来越乱了

  • ml 算法就几个,语言库其实问题不大,真的需要考虑效率,见楼上,个人觉得 java 大法不错,配合各种大数据工具都很方便。clojure 不清楚,感觉比较小众。

  • 又拉黑北上广

  • Rails 里面数据库变更操作 at October 16, 2014

    多试试,手动编辑 migration 文件也是可以的,添加字段rails generate migration AddDetailsToProducts rake -T | grep db:

    rake db:create                          # Creates the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db:c...
    rake db:drop                            # Drops the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db:dro...
    rake db:fixtures:load                   # Load fixtures into the current environment's database
    rake db:migrate                         # Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
    rake db:migrate:status                  # Display status of migrations
    rake db:rollback                        # Rolls the schema back to the previous version (specify steps w/ STEP=n)
    rake db:schema:cache:clear              # Clear a db/schema_cache.dump file
    rake db:schema:cache:dump               # Create a db/schema_cache.dump file
    rake db:schema:dump                     # Create a db/schema.rb file that is portable against any DB supported by AR
    rake db:schema:load                     # Load a schema.rb file into the database
    rake db:seed                            # Load the seed data from db/seeds.rb
    rake db:setup                           # Create the database, load the schema, and initialize with the seed data (use db:reset to also dro...
    rake db:structure:dump                  # Dump the database structure to db/structure.sql
    rake db:version                         # Retrieves the current schema version number
    
  • #8 楼 @string2020 比如说全文检索,一般都用基于 lucene 的,至于是 solr 还是 el 看需要了,折腾 java 快还是 ruby 快?日志分析,大数据吧,不管 hadoop 还是 storm,java 快还是 ruby 快?服务器集群 node 管理,大数据储存数据库 hbase,消息系统等等,当然不一定会用到,但是如果你未来有这方便的业务拓展。那 java 还是完胜。当然你可以用 java 来做服务 provider,rails 做前端。

  • Rails 里面数据库变更操作 at October 16, 2014

    http://guides.rubyonrails.org/migrations.html

    rails generate migration AddDetailsToProducts
    rake db:migrate VERSION=20080906120000
    rake db:drop
    rake db:create
    rake db:migrate
    rake db:seed
    rake db:reset # ==前面四条
    rake db:setup # rake db:create & rake db:migrate & rake db:seed
    

    看看rake -T

  • #6 楼 @string2020 大的项目(互联网项目)按模块划分,肯定 java 方便点,SOA 架构,java 成熟度没的说。你可以看看淘宝的架构体系。我最近也研究。

  • java 场景

    1. 公司的技术沉淀,像淘宝/google 这种大量依赖 java 的,换 ruby 肯定不大可能
    2. java 是静态语言,更容易生产出规范性的代码
    3. java 企业级应用开发的轮子丰富,甩 ruby9 条街
    4. ruby 适合小规模或者单干型,甚至在多人开发上比不上 python
    5. 开发效率:小项目的开发 ruby>python>java,大项目 java>python>ruby
    6. 运行效率上,java>python>=ruby

    twitter 把主语言从 ruby 换到 scala,我感觉这是一家技术叛逆的公司,无论 ruby 还是 scala 都是不适合大型团队协作型项目。

    我钟爱 ruby 于 2014-10-16 早 11.32

  • 有做 BI 相关的吗? at October 15, 2014

    机器学习和数学库 py 走在前面,r+ruby 也不错的搭配。想学习用计算机控制挖掘机炒菜的飘过! 喔,我不是小涛。

  • 写的代码是比较多,但是企业级开发 java 完胜 ruby。还有就是 IDE 用着爽

  • 小项目自己写 ruby 吧,scrapy 作为一个框架,学习成本在那里,又是 py 写的,没事碰他干嘛呢?

  • Atom Editor 有 deb 包了 at October 14, 2014

    我是 ppa 安装的,装了一套很酷的 ui