This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require 'rubygems' | |
require 'hpricot' | |
def find_fields_from_form(form) | |
fields = {} | |
return fields unless form.is_a? Hpricot::Elem | |
set_parameter = Proc.new {|name, value| | |
case name | |
when /^(.+)\[\]$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# convert xml data to hash with hpricot | |
# | |
# by xianhua.zhou@gmail.com | |
require 'rubygems' | |
require 'hpricot' | |
require 'ap' | |
class ConvertXml | |
def initialize(filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = '这是中国和中国的句子,把中国替换成其它的,把中国的替换成另一个'; | |
$str = str_replace('中国的', '<a href="a.php"><中国的</a>', $str); | |
$str = preg_replace('/(中国)([^的])/', '<a href="b.php">$1</a>$2', $str) . "\n"; | |
echo $str; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-Djava.net.preferIPv4Stack=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install hfsplus hfsutils | |
$ sudo mount -t hfsplus /dev/hda /media/cdrom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. /sw/bin/init.sh | |
export CFLAGS=-I/sw/include | |
export LDFLAGS=-L/sw/lib | |
export CXXFLAGS=$CFLAGS | |
export CPPFLAGS=$CXXFLAGS | |
export ACLOCAL_FLAGS="-I /sw/share/aclocal" | |
export PKG_CONFIG_PATH="/sw/lib/pkgconfig" | |
export PATH=/sw/var/lib/fink/path-prefix-10.6:$PATH | |
export MACOSX_DEPLOYMENT_TARGET=10.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
unset SESSION_MANAGER | |
sh /etc/X11/xinit/xinitrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bubble_sort(array) | |
size = array.size - 1 | |
0.upto(size) do |i| | |
i.upto(size) do |j| | |
array[i], array[j] = array[j], array[i] if array[i] > array[j] | |
end | |
end | |
array | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p.normal::selection { | |
background:#cc0000; | |
color:#fff; | |
} | |
p.moz::-moz-selection { | |
background:#cc0000; | |
color:#fff; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fatal error: Call to undefined function safeBitCheck() in /var/www/hfchina.com/mzag2_hfchina/caches/GUI/Smarty/Compiled/%%C8^C8C^C8CE918D%%detail.fairs.tpl.php on line 117 | |
from: http://www.hmf-china.com/index.php?scriptlet=CMS/Start&tpl=fairs&id=783&cID=15 |
OlderNewer