ITeye博客

2009 年文章归档

共 19 篇文章

mysql module

One can identify the following modules in the server: • Server Initialization Module • Connection Manager • Thread Manager • Connection Thread • User Authentication Module • Access Control Module • Parser • Command Dispatcher • Query Cache Module • Optimizer • Table Manager • Table Modification Mod…

2009-12-30 22:30 · Cache · MySQL · Access · thread

passenger for nginx configuring

read passenger for nginx configuring , record 1 passenger_root 2 passenger_log_level 0 1 2 3 日志级别 3 passenger_ruby choose ruby 4 passenger_use_global_queue on or off default off 。on or off have 5% minor performance . 5 passenger_user_switching on or off default on 6 passenger_default_user default n…

2009-12-30 20:55 · nginx · Ruby · MySQL · performance · Rails

2009年即将过去,2010即将到来

09年就要过去了,经历了很多,学了一些,也迷茫了很久! 收获了那些呢: ROR不敢说很精通,写一般的应用程序应该是没有问题了,但是还要看代码的质量...总之ROR路还要走下去。 mysql也了解了一下,存储引擎,基本的六种的优化方式.... 在10年还要深入下去,看看是不是要学店点c或c++之类的。 了解了一下python,正则,flex,as3 这些都不能熟练应用。 展望下一年吧.给自己制订一下新的计划 1 向DBA方向发展 2 英语口语的学习(这个的坚持) 3 经济...相关的学习(stock,经济大局观) 4 本身自身的修养(做人,管理时间,和朋友相互沟通) 5 最少阅读6本书(两月一…

2009-12-26 18:27 · C · C++ · Flex · MySQL · Python

add some method for libxml

module Xml def self.load(file) xml = LibXML::XML::Parser.file(file) doc = xml.parse root = doc.root root.create_method return doc.root end end module LibXML module XML class Document end class Node def create_method hash = {} self.children.each do |node| next if node.blank? next if node.name.blank?…

2009-12-08 17:18 · XML

详细学习公司web 架构相关

1 squid 2 apache

2009-11-11 10:36 · Apache

Module define_method

define_method(symbol) { block } => proc Defines an instance method in the receiver. The method parameter can be a Proc or Method object. If a block is specified, it is used as the method body. This block is evaluated using instance_eval, a point that is tricky to demonstrate because define_method i…

2009-11-04 13:12

gem install rmagick

checking for Magick-config... no sudo apt-get install install libmagick*-dev checking for wand/MagickWand.h... no sudo apt-get install libmagickcore-dev libmagickwand-dev

2009-10-30 17:57

netbean 乱码

在/user/share/fonts目录下找到gbsn00lp.ttf,把它拷到/usr/lib/jvm/java-6-sun/jre/lib/fonts/fallback下面。一般,jre里没有fallback目录,你需要建一个。然后再打开netbeans等同样用java环境的软件,界面方块问题就不会再有了

2009-10-29 15:09 · Java · Netbeans · JVM · SUN

named_scope

class Shirt < ActiveRecord::Base named_scope :red, :conditions => {:color => 'red'} named_scope :dry_clean_only, :joins => :washing_instructions, :conditions => ['washing_instructions.dry_clean_only = ?', true] end class Shirt < ActiveRecord::Base named_scope :colored, lambda { |color| { :condition…

2009-10-21 16:54 · ActiveRecord

composed_of

class NetworkResource < ActiveRecord::Base composed_of :cidr, :class_name => 'NetAddr::CIDR', :mapping => [ %w(network_address network), %w(cidr_range bits) ], :allow_nil => true, :constructor => Proc.new { |network_address, cidr_range| NetAddr::CIDR.create("#{network_address}/#{cidr_range}") }, :c…

2009-10-21 13:22 · ActiveRecord

ror 从routing中得到所有的controller_name

ror 从routing中得到所有的controller_name ActionController::Routing.possible_controllers() Returns the array of controller names currently available to ActionController::Routing.

2009-10-15 16:26

mult connection

connection_names = ActiveRecord::Base.configurations.keys.select do |name| name =~ /^well_site/ end Rails::Initializer.run #maybe it's mistake connection_pools = [] connection_pools = connection_names.delete_if{|v|v=="db"}.map do |connection_name| #connection_names.delete_if{|v|v=="db"}.each do |co…

2009-10-15 12:50 · Rails · ActiveRecord

读取excel 用roo plugin

task :get_unit_data => :environment do require 'roo' s = Excel.new("unit.xls") s.default_sheet = s.sheets.first start_row = s.first_row end_row = s.last_row start_column = s.first_column end_column = s.last_column (start_row..end_row).each do |row| unit_name = "" unit_abbr = "" is_defalut = false i…

2009-10-15 12:47 · Excel

undefined method `generate_best_match=' for ActionController::Routing:Module

在2.3.4 如果降到2。2。2 出现undefined method `generate_best_match=' for ActionController::Routing:Module 在 config/initializers/new_rails_defaults.rb中 将ActionController::Routing.generate_best_match = false 注释掉

2009-09-25 12:40 · Rails

r0r

1.安装build工具 sudo aptitude install build-essential linux-headers-$(uname -r) 2.安装readline zlib libncurses5 apt-get install zlib1g-dev apt-get install libreadline5 libreadline5-dev apt-get install libncurses5 libncurses5-dev 3.安装 libssl-dev apt-get install libssl-dev 4安装 mysql 编译包 sudo apt-get instal…

2009-08-15 13:14 · MySQL · Linux

/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.so

如果是先安装ruby 和rails,后安装mysql,可能会出现如下错误 找不到指定的模块。 - c:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.so 实际上是找不到连接所需的dll文件:libmySQL.dll 在mysql安装目录下的bin目录下将此文件复制到ruby的bin目录下即可解决此问题.

2009-08-05 20:21 · C · EXT · Ruby · MySQL · Rails

flash 显示中文问题

cd /etc/fonts/conf.d/ sudo mv 49-sansserif.conf 49-sansserif.conf_backup

2009-04-10 16:44 · Flash

name_scope.rb

1

2009-03-05 14:45

rails 2.2 base.rb

User.create([{ :first_name => 'Jamie' }, { :first_name => 'Jeremy' }]) do |u| u.is_admin = false end people = { 1 => { "first_name" => "David" }, 2 => { "first_name" => "Jeremy" } } Person.update(people.keys, people.values) For the Post with id of 5, decrement the comment_count by 1, and increment …

2009-03-04 14:44 · SQL · Rails