레이블이 개발환경인 게시물을 표시합니다. 모든 게시물 표시
레이블이 개발환경인 게시물을 표시합니다. 모든 게시물 표시

2008년 3월 28일 금요일

일 줄이기

어떤 작업을 시작하기 전에 명확한 역할과 역할에 걸맏는 책임이 있어야 한다.

2000스텝이 넘는 바보 같은 job이 설계 되어 있고 2000줄이 넘는 엑셀에 50컬럼이 넘는 항목이 빼곡하게 기입 되어 있고 그 엑셀을 개발팀에서 넘겨 받아서 그걸 인프라 작업멤버 4명이 금요일 저녁 9시가 다 되가도록 설정하고 있다.(난 그옆에서 블로깅...ㅋㅋㅋ)
작업확인 은 엑셀과 오퍼레이션 메니저 라는 툴에서 설정 정보를 하나씩 비교해 가는것...

설정 정보를 확인은 할수 있지만 변경할수 없는 유저 권한을 생성하고 설정정보 확인을 의뢰가 온 개발팀으로 넘기면 않되냐니까..한놈은 그것좋은 생각이다 하다가 고객쪽에서 그런거 못한다고 한마디 나오니까 180도 입장 변경...배신...늘상 있는 일이라 별로 의식도 않된다..ㅋㅋㅋ

현재 프로세스
작업 의뢰(개발팀) > 설정작업(환경구축팀_인프라)>확인작업(환경구축팀_인프라)>최종확인(환경구축팀_인프라)>완료 메일
작업 의뢰팀이 뭘 기준으로 작업이 완료 된것을 확인 하는가?

[참조 권한만 가진 유저 설정후 최종확인은 의뢰를 한곳에서 한다.]는 개선후
작업 의뢰(개발팀) > 설정작업(환경구축팀_인프라)>확인작업(환경구축팀_인프라)>최종확인(개발팀)>완료 메일

설정후 돌려보고 에러 나면 다음날 고치면 된다는..안일 주의..어디서 저런 생각이 나오는 걸까ㅋㅋㅋ
다들 일이 없어 한가 한가 보다..자동화를 고려 하자..시력저하를 방지하기 위해서라도..

그래 엑셀이랑 눈싸움들 많이 하시라...엑셀이랑 눈싸움은 그 엑셀을 만들어준곳으로 넘기시고 정시에 퇴근 하는게 건강에도 좋을텐데.

2008년 3월 21일 금요일

정신차리자.

컨설팅 펌에 입사해서 2번째 프로젝트에 첫관문을 2월에 돌파했다.
맡겨진 부분에서 스케쥴지연 없이 서비스를 릴리스 한덕분에 못쓸 인재는 아니라는 평가를 받았다.그후에 주어진 일이 전임자가 진행을 하다 과로로 병이나(외면적으로 알려진 정보.내부적으론...) 지연상태로 내버려지 있지만 3월말까지는 완료가 되어야 하는 2000개 정도의 시스템 JOB설계 변경 롤관리 까지...

까라면 까야하는 처지라 (전 프로젝트에서 그리 하지 않았더니 중간이하에 평가를 주더군..ㅋㅋ)까고는 있는데 하면 할수록 가관인것이 전임자 가 만들어 놓은 문서는 많은데 뭐하나 재대로 결정나 있는 것이 없다.(문서는 많은데 전부다 껍대기 정책밖에 없는)
서버간 통신을 하는 사용자 정책은 있는데 그 사용자를 등록하고 운용해가는 부분에서 실제적으로 필요한 승인이나 작업지시서 등이 하나도 없는 그리고 서버 설정이랑 문서내용이 전혀 다른..
설정작업은 다 되어있고 문서는 이거에용...이것만 해주시면 되요.라고 듣고 시작해서 점점 말려들어 가는 이느낌은 뭘까.
어찌 해쳐 나가야 하나
정신 차리자.이게 컨설팅인가?ㅋㅋ

 

2008년 3월 17일 월요일

바보들의 행진

프로젝트 내부에서 30대도 않되는 서버에 모니터링에 관해 매니저급 5명이 퇴근시간 후에 네 앞에서 이런 저런 잡담을 하고 있다.
서버 관리에서 가장 기본이 되는 트레이스 정보보존 기간이 이틀..ㅋㅋㅋ(설마 조정이 가능하겠지만..영업으로 와있는 후.. 쪽 사람이 넘 모르는듯 하다.)장난하는 것도 아니고..
후..사에 센.. 메니저라는 제품으로 모니터링을 한다는데...
전에 근무하던회사에서 도입했던 제품(도입한 이유가 싸다는 것과 시스템 관련 모니터링을 외주 계약한곳이 후..사에 계열사라서..)
써본 느낌으로는 ...모니터링 관점에서 많이 부족...설정방법이 수작업이 너무 많음..
오픈 툴인 cacti쪽이 더 쓰기 편하고 모니터링 관점에서 본다면 트레이스도 훌륭하다고 할수 있다.(설정해준 동료 김..씨가 넘 쓰기 편하게 해줘서 그랬던 것도 있었다고 생각 한다.)
암튼..바보들에 행진..발맞춰 가기가 힘들다..ㅋ_______




2008년 2월 22일 금요일

스케줄관리

동질감에서 예기한 사내 연수에서 타입별로 사람을 분류하는 세션이 있었다.
난 완벽주의자,이상주의자 라는 타입..

개인적으로 난 스케줄관리를 엄청싫어 한다.(엑셀에 2개월 3개월  Task를 적고 화살표를 찍찍그어 대는 매니저..일주일 치라면 납득해 준다..하루치 라면 더욱더..좋고)
이제껏 내 경험으로 그 2개월3개월 스케쥴이라는게 그어 놓은 선처럼 가는걸 본 경험은 한번도 없다.매니저는 우선 선을 그으려 한다.외 일까...
매니저 머리속에는 Task 새분화 라는 개념이 없다(개념도 없거니와 새분화 할 전문적 지식이 부족한 경우가 대부분이아닐까..).그렇기 때문에 실제 어떤 작업이 필요한지 알지 못하는 두려움이 있다.그래서 매니저는 선을그음으로써 매니저로써의 작업을 커밋해 버리려 하는것이다.
지금 나와 있는곳이 딱 그렇다..
3개월치 선을 긋고 매일 그선을 고쳐 나간다.
고칠때 마다 회의가 있고
회의에 의사결정자가 부재인 경우가 허다 하다.
매니저는 항상 선을 고치고 돌발적 작업이 발생하면 할수록 선의 수도 늘어나고 변경도 많아지고
회의도 많아진다..
시스템을 개발 하다 보면 골은 정해저 있고 그 골을 향해 어떻게 하면 효율적으로 달릴수 있을까를 생각하는 것이 당연한데..
왜들 이리도 개념이 없는걸까..
내가 클라이언트라면  다 죽었다...선 고치는데 드는 부하를 어떻게 하든 줄이는걸 고민해라..
아님 선을 하루 ,시간 단위로 긋던지...시간 ,하루 단위로 커밋해라.




2007년 5월 8일 화요일

SVN+WIKI+TRAC

svn 관련
http://sakura.zzabu.net/tt/63
http://subclipse.tigris.org/install.html
http://yypbd.shung.net/

2006년 4월 24일 월요일

ruby on rails Eclipse 連携

参考サイト
http://www.napcs.com/howto/railsonwindows.html


Setting up a Rails Development Environment on Windows Using EclipseBy Brian Hogan

Last updated on February 10, 2006 10:14 PM

It looks like the current version of RDT works correctly now. I have rebuilt the entire package from scratch once again to ensure that all of the links are up to date. Things are working now with Eclipse 3.1.2 but the Web Tools pieces require more manual work than before.

I also added a Downloads section where I'll be placing some templates and helper files to speed up the process.

Please, as always, provide some feedback. I can't answer emails about issues not directly related to the setup of this plugin.

If you feel so inclined, a small donation would be much appreciated to help cover bandwidth costs. Thanks for the donations so far.


--------------------------------------------------------------------------------

This is a quick yet detailed guide on how to set up a very easy-to-use development environment for Ruby On Rails. This guide is for Windows users but there's no reason that it couldn't be adapted for Linux users as well. The guide assumes that you already have a working database installed or available and that you have Ruby installed to c:
uby.



Lastly, this is not a guide on how to get started with Ruby on Rails! This is simply one method to create a useful IDE for Rails development.

Download and install Ruby and Rails
Install Eclipse
Configure Eclipse for Rails
Install the Ruby Developer Tools package
Configure the RDT plugin
Launching External Rails Scripts within Eclipse (Now with downloadable goodness! )
Configure Eclipse to Create Rails Projects
Configure Eclipse to Launch WEBrick server
Configure Eclipse to Create Rails Models
Configure Eclipse to Create Rails Controllers
Configure Eclipse to Generate Scaffold for Controllers and Views
Setting up the Favorites
Working with Rails Projects in Eclipse
Configure WEBrick's Output for Eclipse
Create a new Rails Project
Show All Files
Install the DBEdit Eclipse plugin
Connect to a Database
Install Web Developer Tools for Eclipse (Updated!)
Configure Eclipse to handle you View files
Add code hints for the views
Debugging within Eclipse
Setting up Breakpointer
Using Breakpointer
Installing SubClipse
Troubleshooting (Updated!)
Downloads (New!)
Screenshots

--------------------------------------------------------------------------------

Download and install Ruby and Rails
I am operating under the assumption that you're going to use the One-Click Ruby Installer created by Curt Hibbs. If you don't, then you're going to have to modify these instructions yourself.

Download and install the One-Click Ruby Installer for Windows
http://rubyforge.org/projects/rubyinstaller/
These instructions assume you have installed this to c:
uby (the default location)
Open a command prompt and type
gem install rails --include-dependencies

--------------------------------------------------------------------------------

Install Eclipse
Download Eclipse 3.1.2 SDK from http://www.eclipse.org/downloads/index.php
Direct Download
Unzip the files to C:javaeclipse
Make a shortcut to C:javaeclipseeclipse.exe
Start Eclipse and set the workspace to C:javaworkspace
One user had trouble with using the default workspace location for Eclipse, and setting it to a simple path with no spaces solved the problem

--------------------------------------------------------------------------------

Configure Eclipse for Rails
Install the Ruby Developer Tools package
The Ruby Developer Tools plugin is a great set of tools that turn Eclipse into a nice Ruby IDE. The current version (0.6.0 as of this writing) now supports Eclipse 3.1. However, I will continue to use the nightly build for this tutorial.

Launch Eclipse
Choose Help->Software Updates->Find and Install
Choose "Search for new features to install" and select Next
Select "New Remote Site",
Use the name “Ruby Developer Tools”
Use http://updatesite.rubypeople.org/release for the URL
You can use http://updatesite.rubypeople.org/nightly if you wish to use the most current nightly build.
Press OK
Check RDT and push Next
Select the feature RDT and push Next. You should confirm any messages relating to installing unsigned plugins. RDT will be installed and be available after restart.
Configure the RDT plugin
Select Windows > Prefrences > Ruby
Select Installed Interpreters
Click Add
Enter Ruby as the interpreter name (You might want to include the version number if you know it)
Enter the path to your ruby.exe file (usually c:
uby?in
ubyw.exe)
Select OK
Configure the rest of your Ruby settings and then select OK to save the settings.



--------------------------------------------------------------------------------

Launching External Rails Scripts Within Eclipse
You should know that hese settings are tied to your workspace. If you change workspaces then you will need to reconfigure these options. Hopefully the fine developers of RDT will build these into the plugin at some point so they appear on the context menus.

At this point, you're going to want to open the Ruby perspective. To do this, go to Window -> Open Perspective -> Other and choose Ruby

If you don't want to go through the trouble of creating these external tools, you can download this file and unzip it to the root of your c: drive. The files should then extact to c:javaworkspace.metadata.pluginsorg.eclipse.debug.core.launches (assuming you've followed along so far). Be sure to set up the favorites once you import these settings!


Configure Eclipse to Create Rails Projects
Select Run -> External Tools -> External Tools
Select "Program" from the configuration tree
Select New to create a new program
Enter “Create Rails Application in Project” as the name
Enter C:
uby?in
ails.cmd for the Location
Enter ${project_loc} for the Working Directory
Enter ../${project_name} for the Arguments
Select the refresh tab and check Refresh Resources Upon Completion
Select the Common tab
Find the section for Display in Favorites Menu
Check the box next to External Tools
Select Apply
Configure Eclipse to Launch WEBrick server
Select Run -> External Tools -> External Tools
Select "Program" from the configuration tree
Select New to create a new program
Enter “Start WEBrick” as the name
Enter C:
uby?in
uby.exe for the Location
For the Working Directory, use
${project_loc}
Enter scriptserver for the Arguments
Select the refresh tab and check Refresh Resources Upon Completion
Select the Common tab
Find the section for Display in Favorites Menu
Check the box next to External Tools
Select Apply

Configure Eclipse to Create Rails Models
Select Run -> External Tools -> External Tools
Select "Program" from the configuration tree
Select New to create a new program
Enter “Generate Model” as the name
Enter C:
uby?in
uby.exe for the Location
For the Working Directory, use
${project_loc}
Enter for the arguments
script/generate model ${string_prompt:Model name} -f
Select the refresh tab and check Refresh Resources Upon Completion
Select the Common tab
Find the section for Display in Favorites Menu
Check the box next to External Tools
Select Apply
Configure Eclipse to Create Rails Controllers
As many have noted, you could simply duplicate the previous entry and simply change the arguments

Select Run -> External Tools -> External Tools
Select "Program" from the configuration tree
Select New to create a new program
Enter “Generate Controller” as the name
Enter C:
uby?in
uby.exe for the Location
For the Working Directory, use
${project_loc}
Enter for the arguments
script/generate controller ${string_prompt:Controller name} -f
Select the refresh tab and check Refresh Resources Upon Completion
Select the Common tab
Find the section for Display in Favorites Menu
Check the box next to External Tools
Select Apply
(You could just copy the "generate model" example above and change the argument).
Configure Eclipse to Generate Scaffold for Controllers and Views
As many have noted, you could simply duplicate the previous entry and simply change the arguments

Select Run -> External Tools -> External Tools
Select "Program" from the configuration tree
Select New to create a new program
Enter “Generate Scaffold” as the name
Enter C:
uby?in
uby.exe for the Location
For the Working Directory, use
${project_loc}
Enter for the arguments
script/generate scaffold ${string_prompt:Model name} ${string_prompt:Controller name} ${string_prompt:Actions separated with spaces} -f

Select the refresh tab and check Refresh Resources Upon Completion
Select the Common tab
Find the section for Display in Favorites Menu
Check the box next to External Tools
Select Apply
Setting Up the Favorites
Sometimes, all of these external commands won't show up under the External Commands icon. We can fix that by making them "Favorites".

Select Run > External Tools > Organize Favorites
Add each external tool that you want to appear on your menu of External Tools
Select Add...
Select the tools you wish to add to your menu and press OK
Use the Up and Down buttons to change the order of the items in the menu
Select OK to save the items

--------------------------------------------------------------------------------

Working with Rails Projects in Eclipse
Configure WEBrick's Output for Eclipse
For some strange reason, WEBrick's output doesn't always get piped to Eclipse's console. We can hack this a bit to make this work for us. We need to add these two lines to the Rails server script:

Provided that you've installed Ruby to c:
uby as instructed above, you can navigate to

C:
ubylib
ubygems1.8gems
ails-0.13.1?in

and edit the server file with a good text editor (anything except for notepad or wordpad).

Add this to the second line of the script:

$stdout.sync=true
$stderr.sync=true

Alternatively, you could just add these two lines to WEBrick once you've created your Rails project by modifying the server file under /scripts in your Rails project.

Create a new Rails Project
Select File > New > Other : Ruby > Ruby Project
Enter a name for your project.
This name will be the name you'll use for your Rails project name when you generate the Rails application files
Make sure to use the Eclipse Workspace for the project contents!
Select the project in the Ruby Resources view
Go to Run -> External Tools and choose Create Rails Project. A few seconds later, your Eclipse Console should show the results of the file creation and your file project tree should be populated with your ruby files.
At this point, you'll want to edit your config/database.yml file with your database properties.
Show All Files
Under Ruby Resources, select the down arrow icon and deselect Show Ruby Files Only so you can see all the files in your project and not just the .rb files (If you don't see Ruby Resources, it's most likely because you didn't change to the Ruby perspective. (Eclipse defaults to the Java perspective!)


--------------------------------------------------------------------------------

Install the DBEdit Eclipse plugin
The DBEdit plugin for Eclipse will allow you to view and edit your database tables from Eclipse as well as run various SQL statements against your database.

Shut down Eclipse
Download the DBEdit plugin version 1.0.3_1 from http://prdownloads.sourceforge.net/dbedit/dbedit_1.0.3_1.bin.dist_3.X.zip?download
Unzip the file to your c:javaeclipse folder. The file should place new files in your features and plugins folder.
Download and the appropriate driver for your database
MySQL
http://www.mysql.com/products/connector/j/
Microsoft SQL Server
http://www.microsoft.com/downloads/details.aspx?familyid=9F1874B6-F8E1-4BD6-947C-0FC5BF05BF71&displaylang=en

SQLite:
If anyone gets this to work for Windows, please send me instructions!
Extract the contents of this driver to c:javadrivers
Launch Eclipse
Select Window -> Show View -> Other
Select DBEdit and choose Tables
Connect to a Database
Connecting to a database is pretty straight-forward. I'll use MySQL for an example. In this article, I assume you're using MySQL 4.1 and that you have installed the appropriate driver.

Right-click anywhere in the whitespace of the Tables pallette and select Connection -> Configure from the popup menu
Select New
Enter a name for the connection in the Name field
Select the Classpath tab and press Add to Archive. Navigate to your drivers folder and select the appropriate driver jar file.
For MySQL, choose mysql-connector-java-3.1.12-bin.jar
Select the Commom tab
Select com.mysql.jdbc.Driver for the Driver
Enter jdbc:mysql://host/dbname for your database
Enter your database username
For MySql, remove the entry in the Schema field!
Enter your passwod and select Save Password
Press Connect to save and connect to the database.
You can go to Window -> Show View -> Other ->DBEdit ->Instant SQL to bring up a SQL editor panel. Here you can execute statements against your database!

--------------------------------------------------------------------------------

Install Web Developer Tools Plugin for Eclipse
There is a great plugin bundle for JSP development that we can take advantage of for our Rails development. The WTP plugin has a very versatile CSS, XML, and HTML editor

Download the following files:
EMF SDK version 2.1.1 or higher emf-sdo-xsd-SDK-2.1.1.zip
GEF SDK 3.1.1 or higher GEF-SDK-3.1.1.zip
JEM SDK 1.1.0.1 or higher JEM-SDK-1.1.0.1.zip
Download the Web Tools plugin from http://www.eclipse.org/downloads/download.php?file=/webtools/downloads/drops/R-1.0-200512210855/wtp-1.0.zip (~24 MB)
Unzip each file to C:java, overwriting any files.
Restart Eclipse.
Now, when you open your CSS or HTML files, you'll be able to use auto complete for elements and attributes, as well as create templates.

Opening the Properties view will let you inspect the attributes and properties of the element you select, and opening the Outline view will show you a representation of your document model.

Configure Eclipse to handle your Rails Presentation files
Eclipse can handle your rhtml files with syntax highlighting! All you have to do is associate the .rhtml extention with the JSP editor. Once you do that, you can add templates for all of the ActionView helper functions to make development even easier.

Select Window -> Preferences
Expand the General section
Select the Content Types option
Expand Text
Select JSP
Select Add
Enter *.rhtml and press OK
Select Add
Enter *.rxml and press OK
Press OK to save the changes
Add Code Hints for the Views
Now, let's add the Rails Link_to tag to the templates library

Selct Window -> Preferences
Expand the Web and XML section
Expand the JSP Files section
Select JSP Templates
Select New
Enter link_to for the name
The context should be ALL JSP
Automatically Insert should be checked
Enter the following for the pattern:
<%= link_to "${url}", :controller=>"${controller}", :action=>"${action}", :id=>"${id}" %>

Create a new .rhtml file and press CTRL+Spacebar

Your Link_to tag should be in that list. When you type the < character, your list of options should appear. Type link to filter the list of results.

When the template is first inserted, the cursor is placed at the url variable, if you hit tab, it will cycle to the next variable in the list.

You can repeat these steps with other helper tags to speed up development. To get you started, I've provided this starter template. Import this into the JSP Templates section via the Import button.



Debugging in Eclipse
Ruby on Rails has some interesting techniques to debug projects. One technique is the Breakpointer script. The Breakpointer connects an IRB session to your running web application.

Setting up Breakpointer
Select Run -> External Tools -> External Tools
Select New to create a new program
Enter “Start Breakpointer ” as the name
Enter C:
uby?in
uby.exe for the Location
For the Working Directory, use
${project_loc}
Enter script?reakpointer for the Arguments
Select the refresh tab and check Refresh Resources Upon Completion
Select the Common tab
Find the section for Display in Favorites Menu
Check the box next to External Tools
Select Apply
Using Breakpointer
In your project, place the following line of code in any method where you want to stop code execution:
breakpoint
Start up WEBrick:
Go to Run -> External Tools ->Start WEBrick
Start up Breakpointer
Go to Run -> External Tools ->Start Breakpointer
Open a browser and navigate to your project (should be at port 3000)
Once you hit your breakpoint, return to Eclipse and you should see an IRB console that you can use to inspect your local variables, objects, request data and session data.
To stop processing the breakpoint and allow the application to continue, type exit in the console. Breakpointer will begin waiting for a new breakpoint.

--------------------------------------------------------------------------------

Installing SubClipse
If you use Subversion (and you should if you're serious about Rails development) then you can install the SubClipse SubVersion client plugin.

Visit http://subclipse.tigris.org/install.html and follow their directions, or simply follow the same process as RDT and use their update site at http://subclipse.tigris.org/update

Choose Help->Software Updates->Find and Install
Choose "Search for new features to install" and select Next
Select "New Remote Site ",
Use the name “SubClipse”
Use the URL: http://subclipse.tigris.org/update
Press OK
Check SubClipse and push Next
Select the feature RDT and push Next. You should confirm any messages relating to installing unsigned plugins. RDT will be installed and be available after restart.

--------------------------------------------------------------------------------



Troubleshooting
DBEdit gives me errors when I attempt to connect to MySQL
"Fetching children of MySQL" is a common error that I've seen. It seems to be related to the version of DBEdit that you use. SourceForge isn't very helpful with the proper version; sometimes you get lucky. If you get this error, uninstall DBEdit and redownload a new version.
I used Cygwin and all the paths in your tutoral arewrong. You should change them or make a note about this.
You're on your own. This guide uses a specific method. It can easily be adapted for other uses, such as Cygwin or even Linux. However, please understand that I can't support all of those configurations. Compared to developing useful web applications, configuring these plugins should be pretty easy.
When I try to run one of the external programs, I get an error stating something about "not valid in prolog"
You probably set up all of your external apps as Ant Buids instead of programs.

The breakpointer hangs up on me... I can't exit out
Just hit the red stop button on the console to kill the breakpointer. Do the same for the console that contains WEBrick.

When I run one of the external programs, the message says "variable references empty selection"
It usually means that the project isn't selected. Just click on the project name before you run one of the programs.

I've set up SubClipse but whenever I try to open one of the SubClipse views, it says my workspace path is invalid and needs to be changed. The suggested path for the change is the same path I'm currently using!
SubClipse is picky. It wants the drive letter to be capitalized. Change your workspace path from c:javaworkspace to C:javaworkspace and restart Eclipse
Downloads
externals.zip
External Programs launchers for
Create Rails Structure in Project
Generate Model
Generate Controller
Generate Scaffold for Model and Controller
Generate Migration
Install Plugin via SVN
Rake
Start Breakpointer
Start Webrick Server
Open Explorer in Project Folder
Command Prompt
Start Console
rails-model-controller.xml
Contains code templates for various Ruby on Rails code methods. Import this into Ruby Templates
rails-rhtml.xml
Contains code templates for various Rails helpers used in views. Import into JSP Templates


--------------------------------------------------------------------------------

That about does it. I'll keep looking for other things to add to this procedure since this is the method I am now using for my development environment. If anyone has any feedback that I should add, please send it to railsdev@napcs.com

Thanks to Tom Davies for his comments regarding project locations and his tips about the Rails templates.

Thanks to Chris Williams for the information about WEBrick's output.

Thanks to everyone on the RDT team for working so hard on a great plugin.


--------------------------------------------------------------------------------

Brian Hogan is the owner of New Auburn Personal Computer Services, a small web design company that specializes in standards-based design and accessibility for the disabled. He has been developing web sites for ten years. He also works at the University of Wisconsin-Eau Claire where he oversees development of various web-based applications.


Site design and content copyright © 2003 New Auburn Personal Computer Services, All rights reserved. Unauthorized duplication or republication in any form is not allowed.

2006년 3월 13일 월요일

code generator

http://www.codegeneration.net/
에서 괜찬은 내용 발견.
sql2java는 적용해 보고 있는중.
DB에 PK설정이 없으면 문제가 됨

유니크 키 설정을 PK설정으로 바꿔서 ant실행시 DB에 적용 코드생성
PK삭제

2006년 3월 7일 화요일

2005년 12월 26일 월요일

php4.311+apache2.055+tomcat5.0.28

버전이 너무 마음대로라 연동에 관련된 재대로된 문서를 찻기가 무지 힘들었다.


http://mpcon.org/apacheguide/prerequisites.php
http://salt.air-nifty.com/salt/2005/11/apace__tomcat__3c8e.html

2005년 12월 19일 월요일

유닉스 커멘드

출력 라인 수 카운트 하기
ps -ef | grep apache | wc -l
출력 라인 문자수 카운트 하기
ps -ef | grep apache | wc -c
출력 라인 단어수 카운트 하기
ps -ef | grep apache | wc -w

2005년 9월 20일 화요일

Linux Ant 설정하기

1.http://ant.apache.org/에서 ant download
2.linux 머신 /usr/local/에 upload
3.tar xvfz apache-ant-1.6.5-bin.tar.gz
4./home/loginUser/bash_profile편집
#ANT
export ANT_HOME=/usr/local/apache-ant-1.6.5
export PATH=$ANT_HOME/bin:$PATH
추가.(자바 홈이나 path는 없으면 않되겠죠//)
5.다른 터미널 열어서 ant -version으로 확인

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher
이런 Exception이나면 예전 버전이 인스톨 되어있을 가능성 이 있으므로.

rpm -qa | grep ant
검색
rpm -e antxxxxx
삭제.

2005년 7월 27일 수요일

PHP 를 이용한 SCP,SFTP

A PHP condition & Sample when Using sFtp/scp in PHP script Writtened by Jinsuk,yoon
feedback : udanax@joyon.com


it able to open a SSH connection to use SFTP / SCP without any problems
You need first Extension libssh2, PECL libraries

reference
http://docs.php.net/en/ref.ssh2.html
http://pecl.php.net
http://sourceforge.net/projects/libssh2/)


sftp와 scp를 사용하기위한 PHP환경과 예제입니다.
먼저 sftp와 scp를 사용하기 위해서는 SSH Connection이 가능해야하기때문에, libssh2, PECL라이브러리를 확장하세요. (system()명령으로도 가능은 하지만, 여러가지 고려함에..)

아래의 샘플을 통하여, php스크립트를 통해 원격으로 서버대서버로 sftp프로토콜을 사용하여 파일전송을 할수있습니다.



Example


define('SFTP_ADDR', '211.233.83.189');

$start_time = microtime(true);



// establish connection to FTP over SSH
$connection = ssh2_connect(SFTP_ADDR, 22);
$sftp = ssh2_sftp($connection);


$src_file = '/usr/local/www/data.src';
$dst_sftp_file = 'ssh2.sftp://' . $sftp . '/www/data.dst';
$dst_scp_file = '/www/data.dst';


//use SFTP wrapper
copy($src_file, $dst_sftp_file);


//use SCP
ssh2_scp_send($connection, $src_file, $dst_scp_file);

print 'Total Time: ' . microtime(true) - $start_time;




Expected result:
----------------
Expected: FAST file transfer, over 3MB/sec

Actual result:
--------------
Result: SLOW file transfer, around 30KB/sec

Feedback : udanax@joyon.com

2005년 7월 22일 금요일

CVS 커밋 발생시점에 소스 export 하기

지금 개발 하고 있는 환경이 주로 PHP를 이용한 개발 이라 CVS에서 소스를 가져와서 수정하고 SFTP로 테스트 서버에 전송 확인한 후에
CVS에 커밋을 하는 작업이 발생한다.

이제껏 자바 개발의 경우 소스를 CVS에 커밋 한다고 해도 매번 컴파일작업이 발생하기 때문에 개발 효율은 그리 높지 않았다.
PHP의 생산성은 자바와는 비교가 되지 않을 정도 이지만 위에서 언급한 CVS커밋 작업과 서버에전송작업이 업무 효율을 떨어뜨리는 원인이 되고 있었다.

PHP의 경우 commit한 것을 wep page를 통해 확인 하기 때문에 CVS 와 아파치 DocumentRoot를 연결해 두면 작업한 소스를 CVS 에 커밋 하는 것만으로 확인이 가능해 진다.

이하는 이를 위한 설정 이다.

CVSROOT위치 /home/cvs/
모듈명 bin
아파치 DocumentRoot /home/apache/doc

bin모듈에 소스를 커밋 하면 /home/apache/doc/bin 에 변경한 것이 반영되도록 한다.

[root@xxxx root]# cd /home/cvs
[root@xxxx cvs]# ls
bin CVSROOT cvstest test

만들어 주어야 하는 파일
auto_update.pl
binUpdate.sh

[root@xxxx CVSROOT]# view auto_update.pl
#!/usr/bin/perl
#cvs path
$cvs = '/usr/bin/cvs';
$usage = "usage: auto_update.pl WORKDIR [MODE]";
# process arguments
die $usage, "
" unless $workdir = $ARGV[0];
$chmod = $ARGV[1] ? "; chmod -R $ARGV[1]" : "";
# main update process which must be executed in background.
$cmd = "(cd $workdir; $cvs -q update $chmod) &";
system($cmd);
# last message.
$date = `date`; chomp($date);
$mesg = "$workdir automatically updated at $date";
print "$mesg
";

[root@xxxx CVSROOT]# view binUpdate.sh
#!/bin/sh
/home/cvs/CVSROOT/auto_update.pl /home/apache/doc


수정해 주어야 하는 파일
loginfo에 이하의 내용을 추가해 주면 된다.

bin /home/cvs/CVSROOT/binUpdate.sh bin


[root@xxxx CVSROOT]# view loginfo
# The "loginfo" file controls where "cvs commit" log information
# is sent. The first entry on a line is a regular expression which must match
# the directory that the change is being made to, relative to the
# $CVSROOT. If a match is found, then the remainder of the line is a filter
# program that should expect log information on its standard input.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name ALL appears as a regular expression it is always used
# in addition to the first matching regex or DEFAULT.
#
# You may specify a format string as part of the
# filter. The string is composed of a `%' followed
# by a single format character, or followed by a set of format
# characters surrounded by `{' and `}' as separators. The format
# characters are:
#
# s = file name
# V = old version number (pre-checkin)
# v = new version number (post-checkin)
# t = tag or branch name
#
# For example:
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
# or
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog

bin /home/cvs/CVSROOT/binUpdate.sh bin


---------주의 사항---------
퍼미션 관련 에러에 조심하기만 하면 아무 문제 없이
커밋한 소스를 아파치DocumentRoot 에 밀어주게 된다.

아파치 DocumentRoot의 유저 가 xxx라면
cvs의 그룹에 xxx를 등록해 주면 된다.

[root@xxx CVSROOT]# vi /etc/group
xxx:x:502:cvs사용유저1 ,cvs사용유저1,cvs사용유저2
cvs:x:503:cvs사용유저1,cvs사용유저1,cvs사용유저2,xxx


/home/apache/doc/에서
cvs checkout bin을 먼저 실행해 bin을 체크 아웃 해두는 것도 잊지 말아야 한다.
checkout시 bin 에 lock관련 정보를 write할수 없다는 에러가 발생하면 chgrp -R bin해주면 되겠죠...

2005년 7월 20일 수요일

다국적 언어 처리

황정철님 블로그
http://blog.naver.com/hjc1108.do?edirect=Log&logNo=60011201293
네이버 검색결과
http://search.naver.com/search.naver?where=nexearch&query=ASCII+ORACLE+US7ASCII+jdbc+utf-8&hw=1

2005년 5월 24일 화요일

PHP Eclipse 관련 사이트

7월 부터는 PHP로 개발 하게 될꺼 같다.
PHP관련 개발 환경이나 참고가 될만한 사이트 링크

PHP
http://jp2.php.net/

PHPeclipse
http://www.phpeclipse.de/tiki-view_articles.php
http://www.xored.com/trustudio

한국
http://www.php.pe.kr/
http://www.nzeo.com/
http://www.tood.net/

일본
http://phpyaru.seesaa.net/
http://www.itnavi.com/EclipseDePHP.htm
http://read.seesaa.net/article/3268508.html

PHP리모트 디버깅
http://www.geocities.jp/maple4estry/eclipse_php.html

2005년 4월 19일 화요일

www.codeproject.com ToDoList

한날 님(http://hannal.com/blog/index.php)
의 블로그에 올라와 있는걸 보고 다운받아서 사용해 보았다.

http://www.codeproject.com/tools/
프리툴들이 소스코드 까지 공개되어있는 좋은 사이트..
자바만 하다보니 자카르타나 소스포지 에만 너무 관심을 가졌나보다.
가끔 코드그루 도 보기는 하지만..
기술적 편식은 좋지 않은데...

2005년 3월 31일 목요일

DB 변경사항 반영

아침 출근시간에 근희형과 예기하다가 생각난 아이디어
DBTable Mapper
프로젝트 중에 DB Layout이 변경되면 여타 개발자들에게 메일로 변경내용을 알려주게 된다.
하지만 테이블이 불어나고 구조가 복잡해지기 시작하면 실질적 관련이 없는 부분은 무시하고 테이블 변경을 하지않는 경우가 자주 발생하게 된다.

테이블 명을 클래스명으로 하고 각컬럼을 필드로 가지는 일반적 VO 의 형태를 가진 클레스를 가지고 작업을 한다면 그리고 VO클레스를
매일 저녁 재작성해 CVS에 반영 한다면 layout 변경정보를 모든 개발자 들이 공유 할수 있게 되지 않을까.

만들어 보자.

2005년 2월 17일 목요일

TDD

프로젝트 공통 PageUtil 클래스를 만들었다.
테스트 클래스 만들고 기반 메소드에서 문제가 될듯한 부분을 전부 테스트 했다.같이 일하고 있는 동료에게 사용해 보라고 했는데.(사용법은 테스트 클래스를 보면 알꺼라고..)3일 동안 딴일을 하느라 소스를 점검하지 못했었는데..
어제 저녁 test 리포트 에서 PageUtil관련 테스트 항목이 없어져 있는 것이 아닌가...
테스트 클래스는 삭제 되었고 ,PageUtil클래스는 이상한 방향으로 흘러 가고 있다..(물론 고쳐서 사용해 달라고 했지만..테스트 클래스는 반드시 갱신해 달라고 했는데..)
어쩌면 좋을까...

2005년 2월 3일 목요일

오늘 만든 DBUnit BaseClass

package xxx.framework.test;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Properties;

import org.dbunit.Assertion;
import org.dbunit.database.DatabaseConnection;
import org.dbunit.database.IDatabaseConnection;
import org.dbunit.database.QueryDataSet;
import org.dbunit.dataset.CompositeTable;
import org.dbunit.dataset.FilteredTableMetaData;
import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.ITable;
import org.dbunit.dataset.filter.DefaultColumnFilter;
import org.dbunit.dataset.xml.FlatXmlDataSet;
import org.dbunit.operation.DatabaseOperation;

import junit.framework.TestCase;
public class DBTestCase extends TestCase {

private DBinfo info = DBinfo.getInstance();

/**
* コンストラクタ。
*
*/
public DBTestCase() {
super();

}


/**
* 指定したテーブルのデータでXMLFileを作成します。
* @param arrayTables 対象テーブル名
* @param sFileName xmlファイル名
*/
protected void exportOp(String[] arrayTables, String sFileName)throws Exception {
info.init();
exportTable(arrayTables,new File(info.sExportDir_, sFileName));
}

/**
* XMLFileをDBに書き込みます。
* @param sFileName xmlファイル名
*/
protected void importOp(String sFileName)throws Exception {
info.init();
importTable(new File(info.sExportDir_, sFileName));
}

/**
* 指定したテーブルの現在データとXMLFileを比較します。
* @param arrayTables 対象テーブル名
* @param sFileName xmlファイル名
*/
protected void compareOp(String[] arrayTables, String sFileName) throws Exception{
info.init();
compareTable(arrayTables,new File(info.sExportDir_,sFileName),null);
}
/**
* 指定したテーブルの現在データとXMLFileを比較します。
* @param arrayTables 対象テーブル名
* @param sFileName xmlファイル名
* @param columns 比較対象外とするカラム名
*/
protected void compareOp(String[] arrayTables, String sFileName,String[] columns) throws Exception{
info.init();
compareTable(arrayTables,new File(info.sExportDir_,sFileName),columns);
}

private void compareTable(String[] arrayTables, File file,String[] columns) throws Exception {
IDatabaseConnection connection = null;

try {
connection = getConnection();
QueryDataSet partialDataSet = new QueryDataSet(connection);

for (int i = 0; i < arrayTables.length; i++) {
IDataSet databaseDataSet = getConnection().createDataSet();
ITable actualTable = databaseDataSet.getTable(arrayTables[i]);
IDataSet expectedDataSet = new FlatXmlDataSet(file);
ITable expectedTable = expectedDataSet.getTable(arrayTables[i]);
if(columns == null){
Assertion.assertEquals(actualTable, expectedTable);
}else{
DefaultColumnFilter columnFilter = new DefaultColumnFilter();
for(int x = 0; x < columns.length; x++) {
columnFilter.excludeColumn(columns[x]);
}
FilteredTableMetaData metaData = new FilteredTableMetaData(actualTable.getTableMetaData(), columnFilter);
ITable filteredTable = new CompositeTable(metaData, actualTable);
Assertion.assertEquals(filteredTable, expectedTable);
}
}
}finally {
if (connection != null) {
connection.close();
}
}
}


private void importTable(File file) throws Exception {

IDatabaseConnection connection = null;
try {
connection = getConnection();
FlatXmlDataSet dataSet = new FlatXmlDataSet(file);
DatabaseOperation.CLEAN_INSERT.execute(connection, dataSet);
} finally {
if (connection != null) {
connection.close();
}
}
}

private void exportTable(String[] arrayTables,File file) throws Exception{
IDatabaseConnection connection = null;
try {
connection = getConnection();
QueryDataSet partialDataSet = new QueryDataSet(connection);
for (int i = 0; i < arrayTables.length; i++) {
partialDataSet.addTable(arrayTables[i]);
}
FlatXmlDataSet.write(partialDataSet, new FileOutputStream(file));
} finally {
if (connection != null) {
connection.close();
}
}
}

private IDatabaseConnection getConnection()throws Exception {
Class driverClass =
Class.forName(info.sDriver_);

Connection jdbcConnection =
DriverManager.getConnection(
info.sUrl_, info.sUser_, info.sPassword_);

return new DatabaseConnection(jdbcConnection);
}

private void operation(DatabaseOperation operation,IDataSet dataSet)throws Exception {
IDatabaseConnection connection = null;
try {
connection = getConnection();
operation.execute(connection, dataSet);
} finally {
if (connection != null) {
connection.close();
}
}
}

private static class DBinfo{
private static final DBinfo INSTANCE = new DBinfo();
private boolean initialrized;
private Properties prop;
public String sDriver_;
public String sUrl_;
public String sUser_;
public String sPassword_;
public String sSchema_;
public String sExportDir_;


public void init() throws IOException, ClassNotFoundException {
if (initialrized) {
return;
}
synchronized (this) {
prop = new Properties();
InputStream resourceStream =
ClassLoader.getSystemResourceAsStream("dbunit.properties");

if (resourceStream == null) {
System.err.println("クラスパスにdbunit.propertiesがありません!!");
}
prop.load(resourceStream);
sDriver_ = prop.getProperty("driver");
sUrl_ = prop.getProperty("url");
sUser_ = prop.getProperty("user");
sPassword_ = prop.getProperty("password");
sSchema_ = prop.getProperty("schema");
sExportDir_ = prop.getProperty("exportDir");
Class.forName(sDriver_);
initialrized = true;
}
}

public static DBinfo getInstance() {
return INSTANCE;
}

}
}

2005년 2월 2일 수요일

코더 10명

코더라는 단어를 별로 좋아 하지는 않지만
이번 프로젝트에 참가 한 내 포지션이 PG..
이제까지는 아키텍쳐..(그게 그건가?하지만 선행 개발자 라고 해 두자.)

이번 프로젝트
개발 머신은 *HP*P4-540
모니터가 19인치라 눈이 아프다..어제까지 Thinkpad12인치 노트북 만 보다가 환경이 바뀌니 적응이 잘않된다..
ㅋㅋㅋ
개발 내용은 VOD관리 시스템..
사용자가 요건정의 가 명확히 되지 않은 상태에서 프로토타입 제작이 시작됬다.
개발 관련 툴들도 전부 오픈소스(JBOSS,LINUX,POSTGRES)라
운영인력 교육 같은 부분도 많이 필요 할듯한데..
어찌 하면 좋을까..
버그트레이싱 을 위해서 벽에다 버그 분류 시트를 붇이는데 까지는 성공했다..
일부분 코더 들에게 문제 발생 부분에대한 postit을 붇이는 작업도 요청해 6장을 붙였다.그중에 PM모니터에 2장 내모니터에 1장 나머지 3장은 벽에 붇어있다.
방금도 한장이 늘었다..일본 개발자들은 참 말하기를 싫어 한다..
한국 개발자 들도 그럴까?..