Thursday, December 13, 2007

Give a ticket number to your subversion commit message when you are using trac

If you give a number when you commit your changes to subversion

    svn commit -m "Fixed Ticket #456"

then Trac will connect the changeset to the Ticket, Wonderful feature, isn't it.

Friday, December 07, 2007

Migrate PostgreSQL 8.1 Data to PostgreSQL 8.2

Install PSQL 8.2

Felix:~ sunfmin$ sudo port install postgresql82

Dump all the PSQL 8.1 Databases to a file

Using The new installed PSQL 8.2 's pg_dumpall to dump all the PSQL 8.1 databases

Felix:~ sunfmin$ /opt/local/lib/postgresql82/bin/pg_dumpall > ~/pg81_all_dump

Initialize PSQL 8.2 Database instance

Felix:~/Developments sunfmin$ sudo su postgres -c '/opt/local/lib/postgresql82/bin/initdb -D /opt/local/var/db/postgresql82/defaultdb'
Password:
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale C.

creating directory /opt/local/var/db/postgresql82/defaultdb ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers/max_fsm_pages ... 32MB/204800
creating configuration files ... ok
creating template1 database in /opt/local/var/db/postgresql82/defaultdb/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

    /opt/local/lib/postgresql82/bin/postgres -D /opt/local/var/db/postgresql82/defaultdb
or
    /opt/local/lib/postgresql82/bin/pg_ctl -D /opt/local/var/db/postgresql82/defaultdb -l logfile start

Start your database

Felix:~/Developments sunfmin$ sudo su postgres -c "/opt/local/lib/postgresql82/bin/pg_ctl -D /opt/local/var/db/postgresql82/defaultdb -l /opt/local/var/log/postgresql82/postgres.log start"
server starting

You may encounter some problem like this following

Felix:~/Developments sunfmin$ sudo su postgres /opt/local/lib/postgresql82/bin/postgres -D /opt/local/var/db/postgresql82/defaultdb
Password:
/opt/local/lib/postgresql82/bin/postgres: /opt/local/lib/postgresql82/bin/postgres: cannot execute binary file

Felix:~/Developments sunfmin$ sudo  /opt/local/lib/postgresql82/bin/postgres -D /opt/local/var/db/postgresql82/defaultdb
"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise.  See the documentation for
more information on how to properly start the server.


Felix:~/Developments sunfmin$ psql
psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Restore all the data

Felix:~ sunfmin$ /opt/local/lib/postgresql82/bin/psql -f pg81_all_dump template1 -U postgres
You are now connected to database "postgres".
SET
SET
SET
CREATE ROLE
ALTER ROLE
CREATE ROLE
ALTER ROLE
CREATE ROLE
ALTER ROLE
CREATE ROLE
ALTER ROLE
CREATE ROLE
ALTER ROLE
CREATE DATABASE

Failed system call was shmget

When I try to setup PostgreSQL 8.2 on Mac OS X 10.4 , I get the following error.

Felix:~ sunfmin$ sudo su postgres -c '/opt/local/lib/postgresql82/bin/initdb -D /opt/local/var/db/postgresql82/defaultdb'
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale C.

creating directory /opt/local/var/db/postgresql82/defaultdb ... ok
creating subdirectories ... ok
selecting default max_connections ... 10
selecting default shared_buffers/max_fsm_pages ... 400kB/20000
creating configuration files ... ok
creating template1 database in /opt/local/var/db/postgresql82/defaultdb/base/1 ... FATAL:  could not create shared memory segment: Cannot allocate memory
DETAIL:  Failed system call was shmget(key=1, size=1646592, 03600).
HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space. To reduce the request size (currently 1646592 bytes), reduce PostgreSQL's shared_buffers parameter (currently 50) and/or its max_connections parameter (currently 10).
The PostgreSQL documentation contains more information about shared memory configuration.
child process exited with exit code 1
initdb: removing data directory "/opt/local/var/db/postgresql82/defaultdb"

Following http://brilliantcorners.org/node/tag/osx

I changed: /etc/rc

sysctl -w kern.sysv.shmmax=4194304 kern.sysv.shmmin=1 kern.sysv.shmmni=32 kern.sysv.shmseg=8 kern.sysv.shmall=1024

to

sysctl -w kern.sysv.shmmax=167772160 kern.sysv.shmmin=1 kern.sysv.shmmni=32 kern.sysv.shmseg=8 kern.sysv.shmall=65536

And Then the problem solved.

Felix:~/Developments sunfmin$ sudo su postgres -c '/opt/local/lib/postgresql82/bin/initdb -D /opt/local/var/db/postgresql82/defaultdb'
Password:
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale C.

creating directory /opt/local/var/db/postgresql82/defaultdb ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers/max_fsm_pages ... 32MB/204800
creating configuration files ... ok
creating template1 database in /opt/local/var/db/postgresql82/defaultdb/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

    /opt/local/lib/postgresql82/bin/postgres -D /opt/local/var/db/postgresql82/defaultdb
or
    /opt/local/lib/postgresql82/bin/pg_ctl -D /opt/local/var/db/postgresql82/defaultdb -l logfile start

Monday, December 03, 2007

Update itself with single command

It is cool that like gem and MacPorts could update itself with just a single command.

sudo gem update --system
sudo port selfupdate

and also when you can not find software you want in port, don't forget to do a


sudo port -d sync

Saturday, December 01, 2007

Write your blog in Markdown with Emacs and post it directly to Google Blogger

For those who using Emacs, Markdown and Blogger

You write your blog entry in Emacs and with Markdown format Then you issue a M-x blogger-post command in emacs, It convert the markdown to html and post it to your Blogger blog.

How to Install

The code

(require 'gblogger)

(defvar markdown-blogger-new-entry-template
  "<entry xmlns='http://www.w3.org/2005/Atom'>
  <generator url=\"%s\">%s</generator>
  <author> <name>%s </name> </author>
  <title mode=\"escaped\" type=\"text/html\">%s </title>
  <content type='xhtml'>
    <div xmlns=\"http://www.w3.org/1999/xhtml\">
%s
    </div>
  </content>
</entry>"
  "Template for new Blogger entries.")

(defun blogger-post()
  (interactive)

  (markdown)
  (set-buffer (get-buffer "*markdown-output*"))

  (setq post-url "http://www\.blogger\.com/feeds/7841127/posts/default")
  (setq markdown-buffer (current-buffer))
  (setq markdown-content (buffer-string))

  (setq title (read-string "Title: "))

  (setq buffer (get-buffer-create "*markdown-blogger-post*"))

  (declare (special gblogger-auth-handle markdown-blogger-new-entry-template
                    gblogger-generator-name ))

  (g-auth-ensure-token gblogger-auth-handle)




  (set-buffer buffer)
  (erase-buffer)
  (insert (format markdown-blogger-new-entry-template
                  gblogger-generator-name gblogger-generator-name
                  "Felix Sun" title markdown-content))
  (switch-to-buffer buffer)
  (g-app-mode)

  (setq g-app-this-url post-url
        g-app-auth-handle gblogger-auth-handle
        g-app-publish-action 'g-app-post-entry)


  (g-app-publish)
)

Posted from emacs

You can do that also

http://emacspeak.blogspot.com/2007/03/emacs-client-for-google-services.html

Friday, November 30, 2007

Add code formatter to your blog

see: http://code.google.com/p/syntaxhighlighter/

You could format ruby like this.


describe RSpec do
  before(:each) do
    @rspec = RSpec.new
  end

  describe "at release 1.0.8" do
    before(:each) do
      @rspec.version = "1.0.8" 
    end

    it "should not support nested example groups" do
      @rspec.should_not support_nested_example_groups
    end
  end

  describe "at release 1.1.0" do
    before(:each) do
      @rspec.version = "1.1.0" 
    end

    it "should support nested example groups" do
      @rspec.should support_nested_example_groups
    end
  end
end

Thursday, November 29, 2007

Integrate your website with joblet seamlessly

For most of website that integrated joblet like asoboo. right now just link to http://asoboo.joblet.jp

But you may not want your user go out of your own domain. If you want to do so, You need to create a subdomain for you website, because things like http://asoboo.com/jobs simple not very easy to work. (all inside url of joblet is begain with / )

So For Apache, create a virtual host

ServerName jobs.asoboo.com

<Directory proxy:http://asoboo.joblet.jp>
    Order Allow,Deny
    Allow from all
</Directory>

ProxyPass / http://asoboo.joblet.jp/
ProxyPassReverse  / http://asoboo.joblet.jp/

And Then you can point your browser to http://jobs.asoboo.com, :)

Saturday, October 27, 2007

Different ps command in Solaris

What I am interresting is:

why /usr/ucb/ps command is having out put differnet than

/usr/bin/ps

I CAN'T run /usr/bin/ps axuwwww

but I can under /usr/ucb/ps

Or /usr/ucb/ps -ef does not work, but

/usr/bin/ps -ef does work.

Wednesday, October 24, 2007

Put 503 page for your rails application

Put

ErrorDocument 503 /503.html

in apache configuration for you rails application, because when you
deploy , mongrels may take some time to restart.

Monday, October 22, 2007

Fwd: warning: already initialized constant OPTIONS

Something required can not be loaded in your environment file, or in plugins

=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
Exiting
/usr/lib/ruby/gems/1.8/gems/rails-1.2.4/lib/commands/servers/mongrel.rb:15:
warning: already initialized constant OPTIONS
/usr/lib/ruby/gems/1.8/gems/rails-1.2.4/lib/commands/servers/mongrel.rb:18:
undefined method `options' for []:Array (NoMethodError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in
`gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in
`require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.3/lib/active_support/dependencies.rb:495:in
`require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-
1.4.3/lib/active_support/dependencies.rb:342:in `new_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.3/lib/active_support/dependencies.rb:495:in
`require'
from /usr/lib/ruby/gems/1.8/gems/rails- 1.2.4/lib/commands/server.rb:39
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from ./script/server:3

Merge a branch r123:569 to trunk subversion

svn log --stop-on-copy http://svnserver/code/some_project/branches/release_12

to find out when the branch created, you know that at 942 revision, you created the branch

svn merge http://svnserver/code/some_project/branches/release_12 -r942:HEAD .

Sunday, October 21, 2007

Run single test passed, but run all tests as a whole will fail that test

In my situation

I didn't load required fixture on that failed test when run all tests as a whole
when I run that special single test, because you already run all tests before,
and in some tests It loaded the fixture that you special test needed, and didn't clear
test database when you only run that special test. So It pass.

Thursday, October 11, 2007

Read Gmane mailing list with Emacs

C-u M-x gnus # Start gnus and prompt for server

news.gmane.org # The Gmane nntp server

A A # List all groups

C-s scheme.chicken <RET> <RET> # Find the chicken Scheme list

from: http://dharmatech.onigirihouse.com/emacs-gnus-gmane

Saturday, October 06, 2007

Using copy to combine binary file

copy /B somefile.zip.aa+somefile.zip.ab somefile.zip

Friday, September 28, 2007

Outbound Port25 Blocking

sudo postconf -e relayhost=mail.qb3.so-net.ne.jp

Thursday, September 20, 2007

FInd slow actions in a Rails app

# Show a list of actions sorted by time taken. Useful for finding slow actions.
cat log/development.log | awk '/Completed/ { print "[" $3 "] - " $0 }'
| sort -nr

from: http://snippets.dzone.com/posts/show/4440

Thursday, September 13, 2007

Don't override to_json like this

I don't know why our project override this method
class String
def to_json
"'#{self}'"
end
end

Because of this , The RJS totally don't work
and You get "unterminated string literal" because of not escaped javascript.

Wednesday, September 12, 2007

Show all files in the Finder

Show all files in the Finder

Open Terminal, type this command, and press Enter:

defaults write com.apple.Finder AppleShowAllFiles YES

Sunday, September 09, 2007

Ways to run ruby tests

1. rake
2. rake -T test
3. ruby test/unit/product_test.rb
4. ruby test/unit/product_test.rb -v
5. ruby test/unit/product_test.rb -n /create/ -v
6. rake test:units TESTOPTS="-v -n/create/"

Possibility with scoped_proxy

class User < ActiveRecord::Base
scoped_proxy :admins, :find => { :conditions => ['role = ?', 'super_user'] }
scoped_proxy :has_login do |login|
{ :find => { :conditions => ['login = ?', login] } }
end
scoped_proxy :no_op do
nil
end
end

# This gives you the first administrator of the system
User.admins.find(:first)
# This counts the administrators
User.admins.count

# All users with a given login
User.has_login('foo').count
User.has_login('foo').find(:all, :order => 'created_at desc')

# And finally, I give you the no op
User.no_op.find(:all) # => User.find(:all)

Thursday, September 06, 2007

psql: FATAL: IDENT authentication failed for user

Everytime I log in using normal user, I got this message:

$ psql -U gateadmin template1
psql: FATAL: IDENT authentication failed for user "gateadmin"

Why?

It looks like you would rather use password authentication than the
default IDENT-based auth (it's default in Debian distro of postgres
anyway). IDENT will only let you in when you do *not* use -U, ie,
your postgres user name is the same as your Unix user name. Change
this in pg_hba.conf, and don't forget to SIGHUP or restart the
postmaster afterwards.

regards, tom lane

Solution:

Just modify pg_hba.conf like this (change to trust)

local all trust
host all 127.0.0.1 255.255.255.255 trust

Tuesday, July 31, 2007

Unit test with transaction in rails

  uses_transaction :test_something_with_transaction
  def test_something_with_transaction
    ...
  end

Tuesday, July 24, 2007

missing key: categories: Cannot read the portsdb!

[asoboo@turbine-02 /usr/local/sites/asoboo.com/current]$ sudo
portupgrade -a
[Updating the portsdb <format:bdb_btree> in /usr/ports ... - 17433
port entries found
.........1000.........2000.........3000.........4000.........5000.........6000.........7000.........8000.........9000.........10000.........11000.........12000.........13000.........14000.........15000.........16000.........17000....
..... done]
[missing key: categories] [Updating the portsdb <format:bdb_btree> in
/usr/ports ... - 17433 port entries found
.........1000.........2000.........3000.........4000.........5000.........6000.........7000.........8000.........9000.........10000.........11000.........12000.........13000.........14000.........15000.........16000.........17000....
..... done]
missing key: categories: Cannot read the portsdb!
/usr/local/lib/ruby/site_ruby/1.8/portsdb.rb:567:in `open_db':
database file error (PortsDB::DBError)
from /usr/local/lib/ruby/site_ruby/1.8/portsdb.rb:736:in `port'
from /usr/local/lib/ruby/site_ruby/1.8/portsdb.rb:924:in
`all_depends_list'
from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:915:in `tsort_build'
from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:907:in `each'
from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:907:in `tsort_build'
from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:929:in `sort_build'
from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:933:in `sort_build!'
from /usr/local/sbin/portupgrade:694:in `main'
from /usr/local/lib/ruby/1.8/optparse.rb:755:in `initialize'
from /usr/local/sbin/portupgrade:210:in `new'
from /usr/local/sbin/portupgrade:210:in `main'
from /usr/local/sbin/portupgrade:1981


portupgrade moved from /usr/ports/sysutils/portupgrade to
/usr/ports/ports-mgmt/portupgrade, one way to fix this is:

cd /usr/ports/ports-mgmt/portupgrade
make clean all install

Or I think portupgrade -f portupgrade might do.

Monday, July 23, 2007

spawn-fcgi.c.211: child exited with: 127, Unknown error: 127

# ./script/process/spawner fcgi -e staging -p 7000 -i 5
=> Starting FCGI dispatchers
Checking if something is already running on 0.0.0.0:7000...NO
Starting dispatcher on port: 0.0.0.0:7000
exec: /usr/local/sites/somesite/releases/20070723060143/public/dispatch.fcgi:
not found
spawn-fcgi.c.211: child exited with: 127, Unknown error: 127


fixed by changing dispatch.fcgi

#!/opt/local/bin/ruby

to

#!/usr/local/bin/ruby

/tmp/502/nl.uu.phil.SSHAgent.socket (Errno::ENOENT)

ssh login when Capistrano deployment failed with that message. Running
(on Mac OS):

$ ssh-agent bash
$ ssh-add
and then running cap tasks fixed the problem for now.

undefined method 'gem' for main:Object

gem update --system

Sunday, July 22, 2007

Kill all processes with full command name and args

sunfmin@sunfmin-laptop:~$ pgrep -f "ssh -L 8080:google.com:80 sunfmin@localhost"
sunfmin@sunfmin-laptop:~$ pkill -f "ssh -L 8080:google.com:80 sunfmin@localhost"

Thursday, July 12, 2007

link folder to external repository [ svn propedit svn:externals vendor ]

export SVN_EDITOR="mate -w"
svn propedit svn:externals vendor

and input like the following to the popped editor

rails http://dev.rubyonrails.org/svn/rails/tags/rel_1-2-3
radiant http://dev.radiantcms.org/svn/radiant/tags/rel_0-6-2/radiant/

this would make the folder like this.
vendor
  |--rails
  |--radiant


The ownership of a file may only be altered by a super-user

chown -R www:www sandbox/
chown: sandbox//conf/authz: Operation not permitted
chown: sandbox//conf/passwd: Operation not permitted
chown: sandbox//conf/svnserve.conf: Operation not permitted
chown: sandbox//conf: Operation not permitted
chown: sandbox//dav/activities.dir: Operation not permitted
chown: sandbox//dav/activities.pag: Operation not permitted

->

sudo chown -R www:www sandbox/

The ownership of a file may only be altered by a super-user for obvious
     security reasons.


Monday, July 09, 2007

Let BitTorrent works on Ubuntu with Azureus Client.

1. Set Local ASDL Router to allow NAT
    Access 192.168.0.1 or something
2. Let Ubuntu to allow the port Azureus uses.
#iptables -I INPUT -p tcp --dport 57656 -j ACCEPT
#iptables -I INPUT -p udp --dport 57656 -j ACCEPT

Saturday, July 07, 2007

Rails Development On Ubuntu

h1. Installation

Switch to root user

h2. Install Ruby, Rails

apt-get install ruby rdoc irb libyaml-ruby libzlib-ruby ri
apt-get install rubygems
gem update --system
gem install rails -y

h2. Install Mongrel, MySQL

apt-get install mysql-server-5.0

apt-get install build-essential
apt-get install ruby1.8-dev
gem install mongrel
gem install mysql


h2. Install emacs(snapshot 22.0), ruby-mode, emacs-rails


gem install emacs-snapshot
cd  $HOME/.emacs.d/
svn co http://svn.ruby-lang.org/repos/ruby/trunk/misc/ ruby
svn co svn://rubyforge.org/var/svn/emacs-rails/trunk rails


Add this code in $HOME/.emacs


(setq load-path (cons "~/.emacs.d/ruby" load-path))
(setq load-path (cons "~/.emacs.d/rails" load-path))
(require 'rails)



h2. Resources

Install Rails On Ubuntu
Rails On Emacs

Monday, June 11, 2007

Fix [ruby: no such file to load -- ubygems (LoadError)] in E-TextEditor

Go to the cygwin bash prompt. If you don't know how to get there, use Start -> Run -> c:\cygwin\cygwin.bat.

Type:
echo unset RUBYOPT >> .bashrc

Type:
. .bashrc

Type:
irb

If you see:
irb(main):001:0>

Friday, April 27, 2007

Input Japanese with WATIR

One more tip. You better use
$ie.text_field(:name,'txtPcode').value = 'KANJI'
instead of
$ie.text_field(:name,'txtPcode').set('KANJI')

TextField#set method fails on japanese characters.

Tuesday, April 17, 2007

Debug with Eclipse and Tomcat

Add the following line to startup.bat
 
set CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
 
Eclipse
 
Add <Remote Java Application>
Host:localhost, Port 5005
 

Friday, March 23, 2007

You have Office, You have Tools to Edit Database through ODBC - MSQRY32.EXE

C:\Program Files\Microsoft Office\OFFICE11\MSQRY32.EXE
 
メニュー
レコード −> 編集の許可

Friday, March 02, 2007

Archive My Directory for Mediamax - Less than 10M per file ;-)

winrar_path = "C:/sunfmin/Programs/WinRAR"
rar_root_path = "C:/sunfmin/Install/Books"
#Mb
split_size = 8 #Mb

#============================================

require 'find'

split_size_byte = split_size * 1024 * 1024
Find.find(rar_root_path) do |f|

    if File.file?(f) and File.size(f) > split_size_byte
        dirname = File.dirname(f)
        Dir.chdir(dirname)
        file_name = File.basename(f)

       
        rar_file_name = file_name[0, file_name.rindex('.')] + ".rar"
       
        winrar_exe = winrar_path + "/Rar.exe a -o+ -v#{split_size}m \"#{rar_file_name}\" \"#{file_name}\""
        puts "=========================================================="
        IO.popen(winrar_exe) do |out|
            puts "OOOOO======>>> #{rar_file_name}"
            puts out.readlines
        end


    end
end

 

 

Tuesday, February 20, 2007

CSE+PostgreSQL問題

 
現象1:
 
DBエラー詳細:
FATAL: datamase ""test"" does not exist

 
回答1:
下記のURLで公開されている「日本語Windows版 libpq」入れなおしたところ
http://www.interwiz.koganei.tokyo.jp/software/PostgreSQL/libpq-6.5jp.zip
 
現象2:
fe_sendauth: authentication type 5 not supported
回答2:

install_dir\data\pg_hba.confを開いて

# IPv4 local connections:
host    all         all         127.0.0.1/32          md5

# IPv4 local connections:
host    all         all         127.0.0.1/32          trust

 

 

Tuesday, February 13, 2007

移動またはコピーしようとしている数式またはシートには、移動またはコピー先のワークシートに既にある名前'●●●'が含まれています。この名前を使用しますか?……

上記のような現象であるとしても、定義された名前が存在してこそ。

元となるブックで定義があるのではないかと推測します。覚えがなくても。 まずは下記は確認されましたか? >名前定義の確認は元のブックの全てのシートで使用状況も含めて行ってください。 不都合の起こるほうのブックを調べても解決にはなりません。   確認のためにコピー(移動)元のブックで下記のプロシージャを実行してみるのも 良いかもしれません。(アクティブなブックが対象になります)   Sub NameListPrint() Dim i As Long Dim Sh As Worksheet Set Sh = Worksheets.Add With ActiveWorkbook For i = 1 To .Names.Count Sh.Cells(i, 1).Value = .Names(i).Name Sh.Cells(i, 2).Value = "'" & .Names(i).RefersTo Next i End With End Sub   名前定義があれば挿入されたシートに定義状況が列記されます。 あとは、下記で一気に名前定義を削除。 (これもアクティブなブックが対象)   Sub NamesDelete() Dim i As Long With ActiveWorkbook For i = .Names.Count To 1 Step -1 .Names(i).Delete Next i End With End Sub   マクロを使う以外では、 「問題となる名前が名前定義ダイアログボックスでも発見できないときは 挿入>名前>定義 で一度名前を(適当でよいので)定義してみて、 それを削除するとエラーが出なくなる」 という情報もあったけど、現象そのものが再現ができないので未確認。

Sunday, February 11, 2007

Install languages (Chinese, Japanese, Korean) on Fedora 6

After you install finished, remeber to restart.

For Fedora Core 4, 5 and 6, the packages are fonts-Japanese, fonts-Chinese, and fonts-Korean. The command to enable these fonts is

yum install fonts-japanese fonts-chinese fonts-korean


Thursday, January 04, 2007

Change my ip config between office and home

Execute an bat is more convenient than open Internet Protocol(TCP/IP) Properties dialog to change ip config again and again.
  • SetOfficeIP.bat
netsh interface ip set address name="Local Area Connection" source=static addr= 172.16.96.158 mask=255.255.255.0
netsh interface ip set address name="Local Area Connection" gateway= 172.16.96.254 gwmetric=0
netsh interface ip set dns name="Local Area Connection" source=static addr= 172.16.8.3 register=PRIMARY
netsh interface ip add dns name="Local Area Connection" addr= 172.16.8.13 index=2
netsh interface ip set wins name="Local Area Connection" source=static addr=none

  
  • SetHomeIP.bat 
netsh interface ip set address name="Local Area Connection" source=dhcp
netsh interface ip set dns name="Local Area Connection" source=dhcp register=PRIMARY
netsh interface ip set wins name="Local Area Connection" source=dhcp