2006년 12월 26일 화요일

flex관련 자료

flex 예제 파일 링크 : http://www.adobe.com/go/as3examples

flex 메뉴얼 묶음 : http://www.adobe.com/go/flex_documentation_zip

매칭 정보 배열에 저장

my @order_ids;
       @order_ids = m/orderId=([0-9]{7})\&/g;

       foreach my $ids ( @order_ids )
       {
               print "ids=>" . $ids . "\n";
       }

2006년 12월 22일 금요일

1천원짜리 1년에 3억개씩 판매한다라..

“1천원짜리라고 싸구려라고 생각하면 안 됩니다. 다이소는 싸구려 물건을 모아 파는 곳이 아니라 좋은 물건을 싸게 파는 노하우를 갖춘 곳입니다.” 다이소아성 박정부 사장의 이야기다. 그가 강동구 천호점에 1호 매장을 냈던 때가 1997년 4월, 그로부터 10년 만에 매장은 345개로 늘어났고 매출은 지난해 1월부터 12월 12일까지 1천억원을 넘어섰다.

다이소는 1천원짜리 생활용품을 파는 이른바 균일가 판매점이다. 1천원짜리 제품이 대부분이고 일부 2천원과 3천원짜리 제품이 있다. 1천억원 매출이면 연간 판매개수가 8100만개나 된다. 국민 한 사람이 다이소에서 1.72개 정도 구매를 했다는 이야기다. 하루 판매개수는 22만2천개, 구매고객은 7만5천명에 이른다.

다이소의 본사는 일본에 있다. 우리나라와 달리 일본에서는 일찌감치 100엔샵이 백화점과, 할인매장, 편의점에 이어 제4의 유통채널로 확고하게 자리를 잡았다. 지난해 기준으로 시장 규모가 5조원 정도, 다이소는 이 가운데 3조8천억원, 70%의 시장점유율을 보이고 있다. 얼추 우리나라보다 시장 규모가 30배 이상 크다는 이야기다.

박 사장은 일본 다이소에 생활용품 등을 납품하는 한일맨파워라는 회사의 사장이었다. 이 회사는 아직도 일본 다이소에서 판매되는 생활용품의 30% 정도를 납품하고 있다. 그러던 중 바다 건너 일본에만 팔 게 아니라 우리나라에서도 한번 해보자고 만든 회사가 다이소아성산업이었다. 일본의 다이소도 기꺼이 34%의 지분 참여를 했다.

“돈 벌자고 생각했으면 이 짓 못합니다. 재미가 있으니까 하죠. 예를 들어볼까요? 벨기에에서 들여온 냅킨이 있는데 한 세트에 시중가격이 5천원 정도 합니다. 그런데 우리는 그걸 1천원에 팝니다. 러시아 도기 세트도 시중에서는 3만원 이상 줘야겠지만 우리는 도기 하나에 1천원씩, 5천원이면 한 세트를 장만할 수 있습니다. 그게 바로 다이소의 경쟁력이죠.”

가격을 1천원에 맞추기 위해 때로는 사이즈를 줄이기도 하고 디자인을 바꾸기도 한다. 품질을 떨어뜨리지 않으면서 가격을 최대한 낮추고 끝내 가격 조건이 맞지 않을 때는 결국 포기하는 수밖에 없다. 박 사장은 세계 전역을 돌면서 다이소에서 판매할 제품을 사들인다. 다이소가 취급하는 제품은 모두 4만여종, 해마다 4천종 이상의 신제품이 쏟아져 나온다.

박 사장에 따르면 지난해 다이소에서 가장 많이 팔린 제품은 방향제다. 무려 127만1000개, 21억4700만원어치가 팔렸다. 4개 들이 건전지 세트도 104만 개, 13억6500만원어치가 팔렸고 발 매트(52만2000개, 12억5000만원어치), 냄비(50만6000개, 12억1270만원어치) 등이 인기 상품으로 꼽혔다. 모두 1천원이나 비싸봐야 2천~3천원짜리 제품들이다.

다이소는 가맹점들에게 매출의 30%를 마진으로 보장한다. 1천원짜리를 하나 팔면 3백원이 남는다는 이야기다. 30평짜리 가맹점 한 곳에서 1천원짜리 제품을 하루 1천개, 100만원 이상 팔면 하루에 30만원씩, 한 달이면 이익이 1천만원이 된다. 월세가 500만원이라면 순이익이 500만원 정도, 제법 짭짤한 편이다.

문제는 박리다매의 특성상 매장 규모가 크면 클수록 좋겠지만 서울의 경우 임대료가 너무 비싸다는 것. 규모가 작으면 매출이 충분하지 않고 규모가 크면 임대료를 감당하지 못하는 경우가 많다. 그래서 아직까지 대부분 매장이 구멍가게 수준에 머물러 있고 소비자들의 인식도 그렇다. 박 사장은 새해부터 공격적으로 대형 매장을 늘려나간다는 계획이다.

다이소아성 본사의 마진은 1%도 채 안 된다. 마진을 늘리려고 하면 그만큼 제품의 질이 떨어지고 결국 소비자들의 외면을 받게 되기 때문이다. 그래서 다이소는 그야말로 손해 보지 않을 정도로만 판다. 그러려면 품질을 확보하는 것 못지 않게 소비자들의 구매 성향을 제대로 파악하고 악성 재고를 줄이는 것도 관건이다.

박 사장은 1천원숍을 유통혁명이라고 강조한다. “1천원짜리 제품이 1천억원이면 20피트 컨테이너 기준으로 모두 3300대 분량입니다. 우리는 2~3년 내에 매출액을 3천억원 이상으로 끌어올릴 계획입니다. 1천원짜리 제품을 해마다 3억개 이상 팔겠다는 이야기죠. 이제 누구나 슈퍼에 가듯이 1천원숍을 찾는 그런 시대가 올 겁니다.”

윈도 사이즈를 해상도에 상관없이 화면 전체로 키우는 스크립트

<script language="JavaScript  ">
<!--
top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
//-->
</script>

원하시는 페이지 상단에 넣으시면됩니다.

또 다른 스크립
-------------------------------------------------------------------------------
<script language="javascript ">
function maxWin() {
if (parseInt(navigator.appVersion)>3) {if (navigator.appName=="Netscape"){
if (top.screenX>0 || top.screenY>0) top.moveTo(0,0);
if (top.outerWidth < screen.availWidth) top.outerWidth=screen.availWidth;
if (top.outerHeight < screen.availHeight) top.outerHeight=screen.availHeight;}
else{top.moveTo(-4,-4);top.resizeTo(screen.availWidth+8,screen.availHeight+8);}}}
maxWin();
</script>

2006년 12월 21일 목요일

Array of Hash of Array 흠...왜 이딴게 이리 아무 생각 없이 된다지..제길..

@trans_corp = (
  {
      name         => "daehan",
      confirm_url  => "vvv",
      fail_url        => "bbb",
      status        =>  0,
      confirm_str  => "택배사원집화|택배사원입고|타점발송",
      fail_str        => "검색된 결과값이 없습니다",
      userlist       => ["a","b"],
  },
  );
 
  printf "검증 시작\n";


for $href ( @trans_corp ) {
   while ( ($key, $value) = each %$href ) {
     
     if ( $key eq "userlist" )
     {        
         for $i ( 0 .. $#{ $value } ) {
              print "        $i = $href->{userlist}[$i] \n";
          }
      }
        else
        {
         print "$key=$value \n";
         }
    }
   
}

2006년 12월 19일 화요일

Linux에서 find로 문자열 찾기 욜~~

문자열찾기 방법 1 - 영어만 주로 가능
# grep -rw "찾는문자열" ./

문자열찾기 방법 2 - 대/소문자 구분 안하고 검색
# grep -i -l "찾는문자열" * -r 2> /dev/null

문자열찾기 방법 3 - 한글, 영어 모두 가능
# find . -exec grep -l "찾는문자열" {} \; 2>/dev/null

문자열찾기 방법 4 - 한글,영어, 대소문자 안가리고 검색
# find . -exec grep -i -l "찾을문자열" {} \; 2>/dev/null

문자열찾은 후 치환
# find . -exec perl -pi -e 's/찾을문자열/바꿀문자열/g' {} \; 2>/dev/null

파일명 찾기
# find / -name 파일명 -type f

파일명 찾기(대소문자 구별없음)
# find / -iname 파일명 -type f

디렉토리 찾기
# find / -name 파일명 -type d

디렉토리 찾기(대소문자 구별없음)
# find / -iname 파일명 -type d

특정 사용자 소유의 모든 파일을 찾을때는?
# find / -user "사용자 ID" -print

두세가지 문자열을 동시에 찾아야 할때는 egrep을 쓰면 아주 편합니다.
예를 들어
만약 그냥 grep으로 문자열1,2 를 찾으려면
ps -ef | grep 문자열1; ps -ef | grep 문자열2
와 같이 해야하는것을 egrep를 이용하면

ps -ef | grep '문자열1|문자열2'
와 같이 간단해집니다.

# egrep '(pattern1|pattern2|pattern3)' file.txt

perl Hash 기본

# 선언 부분
my %_list = (
   'key1' => 0, # 대한통운
   'key2' => 0, # 한진택배
  );
 
  printf "작업 시작\n";
 
# 작업 부분
  while ( my ($key, $value) = each( %_list ) ) {
      print "$key => $value\n";
  }


# 소멸
delete $hash{$key};


# 사이즈
print "size of hash:  " . keys( %hash ) . ".\n";

# function ref return
sub foo
   {
       my ( $login, $p, $uid, $gid, $gecos, $dir, $s );

       my %HoH = ();

       my $file = '/etc/passwd';
       open( PASSWD, "< $file" ) or die "Can't open $file : $!";

       while( <PASSWD> ) {
           ( $login, $p, $uid, $gid, $gecos, $dir, $s ) = split( ':' );

           $HoH{ $login }{ 'uid' } = $uid;
           $HoH{ $login }{ 'gid' } = $gid;
           $HoH{ $login }{ 'dir' } = $dir;
       }

       close PASSWD;

       return \%HoH;
   }

try catch를 사용하여 system command실행

# system failure가 발생해도 죽지 않고 실행 됨.^^;

eval{
           ### try block
    system( "perl xxx\n" ) == 0;
   };


### catch block
 if ($@){
  print "Failed ($?): $! \n";
 };

localtime() 을 사용한 현재 시간 가져오기


현재 시간 가져오기..괜히 Time::Format을 썼나? ㅋㅋ

       my $sec;
       my $min,
       my $hour,
       my $mday,
       my $mon,
       my $year,
       my $wday,
       my $yday,
       my $isdst;

       ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
       my $current = sprintf ("%4d-%02d-%02d %02d:%02d:%02d", $year+1900,$mon+1,$mday,$hour,$
min,$sec);

2006년 12월 18일 월요일

[일요일] 익현이와 혜승이와 쇼핑가다

가족들이 모두 이마트에 쇼핑 갔다.

익현이가 졸린지 옷을 벗겠다고 잉잉~~와 하얀색 내복에 핑크색 운동화를 신고 어찌나 좋다고 뛰어 다니던지.

달라빛을 내서라도 캠코더를 장만 하고 싶었다. 가끔 애들이 크는게 싫다. 혜승이, 익현이의 "안아줘" 모드...너무 좋다, 안아줄 수 있을때 많이 안아주고 싶어서 난 얘들이 않아달라고 하기도 전에 안아주곤 한다.

프로스펙스 매장에서 혜승이는 신을 사고 익현인 진열대 사이에서 아빠랑 숨바꼭질 하던거 이 녀석이 어찌나 즐거워 하던지, 재빠르긴 어찌나 재 빠른지 잡을 수가 없었다 ㅋㅋ

나중에 아빠가 안 보이니 "아빠" 하면서 찾으러 다니는 모습, 뛰어와 안기는모습..^^;
행복했다.

하얀 내복에 핑크색 운동화를 신고서...ㅋㅋㅋ

익현이 얘기만 많이 해서 혜승이가 삐질까? ㅎㅎㅎ

perl에서 exec와 system의 차이가 있나?

Read your doc carefully.
On unix or Linux shell scripts, "exec" means "execute what I tell you and exit immediately after that".
This means that, in Unix, all the lines after the exec instruction are ignored


Use the system() function to execute a program without saving the program's output. The return value of the system() function is the program's exit status or you could check the special $? variable which will have it as well.

The exit value 0 means the program exited successfully and anything else probably means there was a problem. If there was an error then it will be stored in $!.

system("myprogram --foo $bar") == 0 or die "myprogram failed ($?): $!";
print "myprogram ran successfully.\n";

이제 DBD::DBI 로 개발 하기로 함

설치 해야 할 모듈
1. DBI
2. DBI-mysql


요거 참 좋으네..ㅋㅋㅋ
$numrows = $sth->rows;
$numFields = $sth->{'NUM_OF_FIELDS'};


#!/usr/bin/perl

  use strict;
  use DBI();

  # Connect to the database.
  my $dbh = DBI->connect("DBI:mysql:database=test;host=localhost",
                        "joe", "joe's password",
                        {'RaiseError' => 1});

  # Drop table 'foo'. This may fail, if 'foo' doesn't exist.
  # Thus we put an eval around it.
  eval { $dbh->do("DROP TABLE foo") };
  print "Dropping foo failed: $@\n" if $@;

  # Create a new table 'foo'. This must not fail, thus we don't
  # catch errors.
  $dbh->do("CREATE TABLE foo (id INTEGER, name VARCHAR(20))");

  # INSERT some data into 'foo'. We are using $dbh->quote() for
  # quoting the name.
  $dbh->do("INSERT INTO foo VALUES (1, " . $dbh->quote("Tim") . ")");

  # Same thing, but using placeholders
  $dbh->do("INSERT INTO foo VALUES (?, ?)", undef, 2, "Jochen");

  # Now retrieve data from the table.
  my $sth = $dbh->prepare("SELECT * FROM foo");
  $sth->execute();
  while (my $ref = $sth->fetchrow_hashref()) {
  print "Found a row: id = $ref->{'id'}, name = $ref->{'name'}\n";
  }
  $sth->finish();

  # Disconnect from the database.
  $dbh->disconnect();

2006년 12월 16일 토요일

Linux에서 CPAN 모듈 설치..

date: 2008.4.22
10번 서버에 모듈 설치 중
DBD::mysql에서 오류 발생
* DBD-mysql-3.0002 까지 version을 내려서 설치함 - 아래 설명이 있었음.

date: 2007.4.20
새로운 Linux서버에 모듈 설치 중
DBI는 설치가 됐는데..DBD::mysql 가 설치가 안된다. 버젼을 낮춰야 할까?

Q. 뭐냐? Time::Format이 오류가 발생해서 Time::Simple로 대체 함
A. Date::Manip 을 설치한 후 Time::Format을 설치하면 됨

Q. Net::MySQL 설치가 안되네
Try:  
     install Digest::SHA1 설치 해보려 한다.
     install YAML 설치
Result:
    설치는 되지만 뭔가 이상이 있음 아래의 case실행 하려 함

Q. install Bundle::DBD::mysql 설치 안됨
Try:
  install Digest::SHA

* DBD-mysql-3.0002 까지 version을 내려서 설치함
  mysql root의 password를 없애야 설치 가능함

# .bashrc
# 여기에 mysql의 설치 위치를 정의 해야 함
export LANG=C

PATH=$PATH:/usr/local/mysql/bin
export PATH

Q. WWW::Mechanize 를 설치하기 위해 필요한 모듈 들
        Test::Pod
        Test::Memory::Cycle
        Test::Warn
        Test::Taint
       
Q. install Spreadsheet::ParseExcel
       OLE::Storage_Lite
       Jcode.pm    (if you are using FmtJapan, or FmtJapan2)
       Unicode::Map    (if you are using FmtJapan2 or FmtUnicode)
       IO::Scalar if PERLIO is not available
       Spreadsheet::WriteExcel (to use Spreadsheet::ParseExcel::SaveParser)

Q. install Number::Format

html2xls.pl 을 사용하기 위해 필요한 module - 2007.5.30
Spreadsheet::WriteExcel
 Unicode::String
 install Unicode::Map
 install Date::Manip

========================

The easiest way to install Perl modules on Linux is by using the CPAN module. Login to your server by SSH or Telnet as root. Then type:-
perl -MCPAN -e shell;
If this is the first time you have used this method then you will need to answer a few configuration questions. Make sure you answer these correctly (usually just do what it suggests). If it suggests 'yes' then type 'yes' not 'y' or 'return'. If it offers automatic config then go for it. From now all you have to do to install Perl modules is type:-
install MODULENAME
From the CPAN shell. The CPAN module will do all the installing for you. Most usefully it'll install any dependencies. So if a module requires others in able to work, installing perl modules this way will install them all for you. This can save a lot of time. Note that this method always tests a module before installing. Some modules will pass most tests and fail on some because the module is old but still working perfectly well. If this is the case, for example with the LWP module, you must force the install by typing:-
force install LWP


Suggested modules to install

From time to time you'll need to install or update new perl modules. Here is a list of common modules that you'll probably want to install at some point. Get them done now and you'll save time later. It only takes 2 minutes using the methods above! (Note. if installing on windows, swap :: in module names for - to make DBD-mysql).

  • LWP
  • DBI
  • DBD::mysql
  • DBD::ODBC
  • URI
  • CGI
  • CGI::Carp
  • Image::Size
  • Archive::Zip
  • Compress::Zlib


install HTTP::Response
install DBI


install LWP
install DBI
install DBD::mysql
install DBD::ODBC
install URI
install CGI
install CGI::Carp

install Module::Build::Compat
install Image::Size

install Archive::Zip
install Compress::Zlib

install URI::Escape

install HTTP::Request::Common

instsll Time::Format

install WWW::Mechanize

4.20 추가
install Digest::SHA1
install YAML
install Net::MySQL


install Date::Manip
install Date::Format
install Date::Simple

2006년 12월 14일 목요일

공백 없애는 쿼리

update orders set options = replace(options, ' ', '') where collect_date = '2006-12-14';

2006년 12월 12일 화요일

txt2xls 관련

> #!/opt/bin/perl5.6 -w
> ############################################################################
> ###
> # Example of how to use the WriteExcel module
> # Program to convert a text [delim] separated value file into an Excel file.
> # Usage: txt2xls.pl file.txt newfile.xls
>
> use Getopt::Long;
> use Spreadsheet::WriteExcel::Big;
>
> GetOptions ("d=s" => \$delim);
> $delim = "|" if !defined($delim);
> $delim =~ s/\|/\\|/g;
>
> # Check for valid number of arguments
> if (($#ARGV < 1) || ($#ARGV > 2)) {
>    die("Usage: txt2xls file.txt newfile.xls\n");
> };
>
> # Open the Comma Seperated Variable file
> open (TXTFILE, $ARGV[0]) or die "$ARGV[0]: $!";
>
> # Create a new Excel workbook
> my $workbook  = Spreadsheet::WriteExcel::Big->new($ARGV[1]);
> my $worksheet = $workbook->add_worksheet();
>
> # Row and column are zero indexed
> my $row = 0;
>
> while (<TXTFILE>) {
>     chomp;
>     @cols = split(/\s*${delim}\s*/,$_);
>
>     $col = 0;
>     foreach my $token (@cols) {
>             $worksheet->write($row, $col, $token);
>             $col++;
>     }
>     $row++;
> }

I'm trying to get this script to work.  I can't find the
Spreadsheet::WriteExcel::Big module.  I can find
Spreadsheet::WriteExcel::Simple and am trying to
get that to work right now.

I can find the Spreadsheet::WriteExcel::Big
module in google:
http://search.cpan.org/dist/Spreadsheet-WriteExcel/
and wonder why ActiveState does not list it.

I'll probably figure it out, but am open to any
suggestions anybody might have.

I'm using the latest Perl on Win2000.


Mike Flannigan
mikeflan@earthlink.net

2006년 12월 11일 월요일

Skype, FON과 손잡고 wVoIP 보급에 박차

글로벌 VoIP 사업자 Skype가 무료 WiFi 기반 BM으로 주목받고 있는 FON과 제휴를 맺고 더욱 쉽고 편리한 인터넷 전화 서비스를 제공한다.

Skype의 행보는 정말 빠르구나, 한 가지에 집중할 수 있다는 장점이겠지.

양 사는 VoIP를 위해 필요한 모든 상품을 패키지로 번들링해 판매, 컴퓨터가 없어도 VoIP 통화가 가능하게 됐다. 따라서 컴퓨터 스크린에 제한되어 있어 VoIP를 꺼려왔거나 새로운 기술에 생소함을 느꼈던 유저들도 이제 Skype의 온라인 스토어를 통해 번들링된 솔루션을 구입해 쉽고 빠르게 VoIP를 사용할 수 있게 됐다.

Fon도 인프라를 구축한다는 것의 장점을 보여주네. 우리는 나는 무엇을 해야 하나?

2006년 12월 8일 금요일

문서내의 같은 12자리 숫자를 모두 가져오기


my @order_ids = $ie->content =~ m/([\d]{12})/g;

my $i = 0;
       while ( $i < @order_ids  )
       {
               print $order_ids[$i];
               print "\n";
               $i++;
       }

[tutorial] Array관련

1. Array 의 length를 알아 낼때
#!/usr/bin/perl

print "content-type: text/html \n\n"; #HTTP HEADER

@nums = (1 .. 20);
@alpha = ("a" .. "z");

# SCALAR FUNCTION
print scalar(@nums)."<br />";
print scalar(@alpha)."<br />";

# REDEFINE TO SCALAR
$nums = @nums;
$alpha = @alpha;

print "$nums<br />";
print "$alpha<br />";
print "There are $numofnums numerical elements<br />";
print "There are ".scalar(@alpha)." letters in the alphabet!";

#---------결과
20
26
20
26
There are 20 numerical elements
There are 26 letters in the alphabet!

2. Array에서 추가 삭제
#!/usr/bin/perl

print "content-type: text/html \n\n"; #HTTP HEADER

# AN ARRAY
@coins = ("Quarter","Dime","Nickel");

# ADD ELEMENTS
push(@coins, "Penny");
print "@coins";
print "<br />";
unshift(@coins, "Dollar");
print "@coins";

# REMOVE ELEMENTS
pop(@coins);
print "<br />";
print "@coins";
shift(@coins);
print "<br />";

# BACK TO HOW IT WAS
print "@coins";


3. 같은 값을 제거

2006년 12월 7일 목요일

트랙백

트랙백 (Track back)은 블로그에서 사용하는 주요기능 중 한가지로, 간단히 역방향 링크를 자동적으로 생성해 준다. 블로그 이외에 위키위키나 뉴스 사이트에서 제공하기도 한다.

트랙백은 철저한 1인 미디어를 지향하는 블로그들 사이의 연결고리를 만들어 주어 소통 네트워크를 만들어 내는 역할을 한다. 누군가의 블로그를 읽고 그에 대한 의견을 자신의 블로그에 써 넣은 후 트랙백을 주고 받으면 원래 글 아래 새로운 글로의 링크가 붙게 된다.

위키디파아에서 가져온 글...아 몰랐음..

아니..연령별 성관계 횟수 공식이 있었다..나만 몰랐다.

야~~성관계 횟수 공식이란 넘을 봤습니다.
이거 사람 죽이는 룰 같은데? 누가 만들었을까?
여자랑 남자랑 다르지 않나?

기준이 뭘까? ㅋㅋㅋ


물론 사람에 따라 상황에 따라 다르지만 나름대로 일리있는 공식이 있습니다. 학창시절 선배분께 들은 얘기인데 시간이 지나고 보니 상당히 타당성이 있더군요. 예를들어 20대라고 하면 20을 10으로 나누고 다시 9를 곱합니다. 그러면 18이 나옵니다. 즉, 10일에 8번하라는 뜻이라고 하더군요. 따라서 휴일만 빼고하면 되겠습니다. 마찬가지로 연령대별로 적용해보면 다음과 같습니다.

10대 = 10/10*9=9 = 공식을 적용할 수 없음
20대 = 20/10*9=18 열흘에 팔일 = 거의 매일
30대 = 30/10*9=27 이십일에 칠일 = 삼일마다
40대 = 40/10*9=36 삼십일에 육일 = 오일마다
50대 = 50/10*9=45 사십일에 오일 = 팔일마다
60대 = 60/10*9=54 오십일에 사일 = 힘있을 때 아무때나

구글의 도메인용 어플리케이션을 설정 함

admin@pimz.co.kr 생성했고 직원들도 계정을 하나씩 나눠 줌 ㅋㅋㅋ

기분 좋아 졌어~~~

jkryu@pimz.co.kr 로 멜 보내삼

익현의 귀환 ㅋ 장모님이 안동에서 배추를 수십포기 가지고 오셨네..

이 주만에 익현이 안동에서 돌아왔다. 간만의 익현을 안아주지도 못하고 바로 한 차 가득 싣고온 절인 배추를 내려야 했다. 아 추~~반바지 입고 있었는데..킹~

산지에서 100원 이라는 배추를 왜 이리 많이 가져오셨지? 부모님들의 마음이라는게 ㅋㅋㅋ..
여하튼 맛있는 배추면 좋겠는데, 김치 정말 잘 하심

2006년 12월 6일 수요일

스스로 알려하는 자는 늦게 알게 되고 물어서 아는자는 빨리 알게 된다 - 김삿갓

自知는 晩知고 潽知는 早知라.

WWW::Mechanize 사용 헤더보기

my $mech = WWW::Mechanize->new( autocheck => 1 );
   $mech->get( 'http://my.site.com' );
   my $res = $mech->response();
   for my $key ( $response->header_field_names() ) {
       print $key, " : ", $response->header( $key ), "\n";
   }

[WWW::Mechanize] $mechanize->links 예제

#!/usr/bin/perl

# Include the WWW::Mechanize module
use WWW::Mechanize;

# What URL shall we retrieve?
$url = "http://www.example.com/bestselling.html";

# Create a new instance of WWW::Mechanize
my $mechanize = WWW::Mechanize->new(autocheck => 1);

# Retrieve the page
$mechanize->get($url);

# Retrieve the page title
my $title = $mechanize->title;

print "<b>$title</b><br />";

# Place all of the links in an array
my @links = $mechanize->links;

# Loop through and output each link
foreach my $link (@links) {

   # Retrieve the link URL
   my $href = $link->url;

   # Retrieve the link text
   my $name = $link->text;
   
   print "<a href=\"$href\">$name</a>\n";

}

linux에 perl 라이브러리 사용 가능하도록 설정(open-ssl 포함)

2006.12.18
  Test::Pod
  Test::Memory::Cycle
  Test::Warn
  Test::Taint

설치 for WWW::Mechanize
  아니 이 넘이 설치가 안되는 바람에 지금 perl의 version을 올리는 중 너무 최신을 깔려고 하는건가?


2006.12.6
하드가 깨지는 바람에 새로 하드를 설치 함 ㅠ.ㅠ 제길 어제 백업으로 돌리고 밤샘 복구 함 ㅋㅋ

* 결론
  ssl을 지원하기 위해선 open-ssl을 먼저 설치 하고 Crypt::SSLeay설치 후 libwww를 설치해야 한다

2006.12.6
* Excel Download관련
  Spreadsheet::WriteExcel
  Date::Manip 이 있어야 함



* HTTPS관련 작업
openssl-0.9.8a 설치
기본 디렉토리: /usr/local/ssl

흠...

잘 안돼서리
openssl-0.9.6c 로 변경 - jk
Crypt::SSleay가 오류로 인하여 설치되지 않음


openssl의 설치시 config를 아래와 같이 해 준다
>./config --openssldir=/usr --shared

You need either IO::Socket::SSL or Crypt::SSLeay installed.

아띠 설치 했는데도 https 사이트에 접속이 안되는구만..흠

IO::Socket::SSL 만 있으면 될것 같은데..짱나네


3. config를 위에서 처럼 --openssldir로 셋팅한 후 Crypt::SSLeay 를 설치하니 정상적으로 작동함
  아래의 test.pl 이 정상 작동 함

설치해야할 목록을 정리해야 겠음

HTML/TableExtract : 자동 발주 온캣에서 사용

#------------------------------
#
# ssl test example
# date: 2006.12.6
# file: test.pl
#
#!/usr/bin/perl

use WWW::Mechanize;
my $uFld;
my $pFld;
my $url;
my $uNme;
my $pPwd;

my $mech = WWW::Mechanize->new( );

$mech->get( 'https://dnshopadmin.shop.daum.net/bo2/login/Login' );

print $mech->content;

Lunux에서 CPAN을 사용한 자동 모듈 설치

Using CPAN. Otherwise you'll want to use CPAN to install the modules by performing the following steps:

From the root prompt on your server, invoke the CPAN shell:

# perl -MCPAN -e shell

Once the Perl interpreter has loaded (and been configured), you can install modules by issuing the command install MODULENAME.

The first thing you should do is upgrade your CPAN:

cpan> install Bundle::CPAN

Once it's done, type:

cpan> reload cpan

Now, enter the following command to retrieve all of the required modules:

cpan> install DBI
cpan> install DBD::mysql
cpan> install Bundle::DBI ( 2008.4.16 추가 )
cpan> install Digest::MD5 cpan> install Digest::SHA1 cpan> install Image::Size cpan> install MIME::Lite cpan> install MIME::Words cpan> install Compress::Zlib cpan> install MIME::Base64 cpan> install URI::URL cpan> install HTML::Tagset cpan> install HTML::Parser cpan> install LWP::Simple cpan> install LWP::UserAgent cpan> install GD cpan> install Mail::Address cpan> install Unicode::MapUTF8 cpan> install Storable cpan> install Time::HiRes cpan> install IO::WrapTie

And likewise for the optional modules:

cpan> install Net::SMTP
cpan> install GD::Graph
cpan> install Proc::ProcessTable
cpan> install RPC::XML
cpan> install SOAP::Lite
cpan> install XML::RSS
cpan> install String::CRC32

2006년 12월 4일 월요일

이젠 사용자 중심의 개발을 해야겠다.

개뿔이 OOP니 XP니 Spiral이니 UML이니 좋다 이거야..물론 유지 보수 중요하지.
패턴? 물론 중요하지 생각해 보니 중요하군 모두..

개발은 아트야 하지만 무엇보다 사용자가 이해하기 쉬운 프로그램이 짱이야
유지 보수도 중요하지만 노가다를 해서라도 쉬운 인터페이스를 만들기 위해 노력 해야 해

이젠..아래와 같은 순서로 개발을 해야 한다고 봐..

1. 요건 분석

2. 사용자 인터페이스 디자인
3. 사용자의 업무 흐름을 인터페이스에 맞추어 분석
4. 사용자 인터페이스 수정 그 후 다시 2번

5. 여러번의 수정이 끝난 후 아키텍쳐 디자인

훌륭하군...ㅋㅋㅋ

밀양에 묘사를 다녀왔음

7대조 할어버지께서 밀양에 터를 잡으셔서 밀양에 묘사를 다녀왔다.
한 50~60명 정도가 모인듯 처음 오는 사람도 있고 묘사때 마다 보는 사람도 있고

여하튼 이번엔 우리 집안에서도 부자가 나와서 제실을 지었는데 부자는 하늘이 낸다고 하더니 실상 부자는 땅이 낸거였다.

퇴계원에서 공장 하시는 아재인데 그 일대가 재개발 되면서 많은 돈을 버셨다고 한다. ㅋㅋㅋ
이런 기운 빠지는 소리가~~~


2006년 11월 30일 목요일

Net::SSLeay 을 사용한 ssl connection

use Net::SSLeay qw(get_https post_https sslcat make_headers make_form);

# get method 
($page, $response, @headers) = get_https('dnshopadmin.shop.daum.net', 443, '/bo2/login/Login');
  for ($i = 0; $i < $#headers; $i+=2) {
     print "$headers[$i] = " . $headers[$i+1] . "\n";
  }

  print "\n=========================\n";

#post method
($page, $response, @headers) = post_https('dnshopadmin.shop.daum.net', 443, '/bo2/login/LoginCheck', '',
               make_form(
                ret_url  => "/bo2/login/Main",         
         login_type => "comp",
  usrid   => $https_user,
  password  => $https_pass,
               ));
              
  for ($i = 0; $i < $#headers; $i+=2) {
     print "$headers[$i] = " . $headers[$i+1] . "\n";
  }

open-ssl의 version 변경

1.12 interpark도 ssl을 도입했음
1. ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd
설치 후

2. ppm을 사용해서 삭제

3. open ssl 재 설치
perl Configure VC-WIN32 --prefix=c:/openssl
ms\do_ms
nmake -f ms\ntdll.mak

테스트 실행 무지 긴장 된다.
nmake -f ms\ntdll.mak test

설치 중 여기까진 이상이 없군
nmake -f ms\ntdll.mak install

파일들을 복사하고 마지막으로 update까지 실행
perl util\mkdef.pl crypto ssl update

4. 다시 ppm을 사용하여 Crypt::SSleay를 설치
ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd



다음의 open ssl이 바뀌었나?

1. Crypt::SSLeay 을 ppm을 사용해 삭제 함

window용
ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd


2. open ssl 설치
  perl Configure VC-WIN32 --prefix=c:/openssl 을 실행했더니
  c:/som/openssl밑에 설치 됨
  실행 명령 리스트
  ms\do_ms
  nmake -f ms\ntdll.mak
  : 이전에 Crypt를 삭제 하기 전에는 오류가 발생했으나 정상 작동 함
   nmake -f ms\ntdll.mak test
   nmake -f ms\ntdll.mak install

   기존의 디렉토리에 복사
   $ copy /b inc32\openssl\*       c:\openssl\include\openssl
   $ copy /b out32dll\ssleay32.lib c:\openssl\lib
   $ copy /b out32dll\libeay32.lib c:\openssl\lib
   $ copy /b out32dll\ssleay32.dll c:\openssl\bin
   $ copy /b out32dll\libeay32.dll c:\openssl\bin
   $ copy /b out32dll\openssl.exe  c:\openssl\bin

3. Crypt::SSLeay 을 ppm을 사용해 재 설치

   다음은 Server: Apache/1.3.33 (Unix) Resin/2.1.12 mod_ssl/2.8.22 OpenSSL/0.9.7e 를 사용중
   설치된 OpenSSL은 openssl-0.9.8d 임 맞춰 봐야겠음

2006년 11월 28일 화요일

영감님의 전성기는 언제 입니까?

전 지금입니다. 읍~~
농구 정말 좋아 합니다. 읍~~

오늘을 살아가는 나도 매일매일을 전성기로 만들어야겠다. 흠흠

기독교도들에 대한 명언 - 이상봉 ㅋㅋ

블로그 돌아다니면서 본건데 나름 공감이 가네요.

기독교도들은 이승도 모르면서 저승에 대해 다 알고 있는 듯이 설치고,
제 마음도 모르면서 하늘의 뜻을 다 알고 있는 듯이 설치고,
사랑이 뭔지도 모르면서 하느님의 사랑을 알고 있다고 설치고,
같은 인간끼리 대화도 하지 못하면서
하느님과 언제나 대화를 하고 있다고 떠들고,
죄는 사람에게 저질러 놓고서
하느님 앞에 죄인이라고 떠들고,
이세상에 살고 있으면서 이 세상의 잣대로
자기를 판단하지 말라고 떠드는 자들의 집합체이다.

[이상봉-재미 철학자]

javascript 시간표시 분, 초, 밀리세컨드

<SCRIPT LANGUAGE="JAVASCRIPT">
<!--

var d = new Date();
var curr_hour = d.getHours();
var curr_min = d.getMinutes();

var curr_sec = d.getSeconds();
var curr_msec = d.getMilliseconds();

document.write(curr_hour + ":" + curr_min + ":" 
+ curr_sec + ":" + curr_msec);

//-->
</SCRIPT>

2006년 11월 27일 월요일

혜승과 홈에버 다녀 옴

까르프가 홈에버로 바뀌었다길래 다녀왔다.
확실히 예전보다 인테리어나 모든 면이 화려해 진건 사실이었다.

하지만 ..비싸다는거..까르프 돌아와줘~~~

2006년 11월 24일 금요일

Win32::OLE를 사용해 Recordset 객체 생성

#
# date OLE 생성
#
use Win32::OLE::Variant;
  
use Win32::OLE qw(in with);

# global 변수 정의
my $m_RS;

# 초기화
if ( &init() )
{
# 초기화 완료 후 data가져오기 실행해야 함
&queryData();
}

# 초기화
# date: 2006.11.24 - jk.ryu
sub init()
{
print "초기화 시작\n";

eval { $m_RS = Win32::OLE->new('ADODB.Recordset'); };   # creates a recordset
die "Recordset 생성 실패" if $@;

return true;
}

참아야 하느니라..

참아라..

2006년 11월 21일 화요일

Win32::IE::Mechanize 사용한 form 내용 확인

  use Win32::IE::Mechanize;

  my $url = "http://";    
  $ie->get( $url );

  # form의 정보 조회
  @webforms = $ie->forms;
  my $f = $webforms[0] or die "Couldn't get first form!\n";
  my @items = $f->inputs;
 
  #    or die "Couldn't get items in first form!\n";
  #
  ## iterate through items, prompt user, commit actions
  foreach my $item (@items) {
      # show item info
      my $sender = $item->name;
      print "$sender";
      print "\n";
  }

2006년 11월 20일 월요일

미래를 경영하라

PSF (Professional Service Firm) 가 되어라!!!

서비스란 무엇인가? 2006.11.20

흠..온갖 귀챦은 것들이 서비스란 표현으로 설명될 수 있음

GE 인더스트리얼 시스템즈
  차단기를 만들던 GE는 지금은 통합 시설 서비스를 판매하며 차단기를 덤으로 주고 있다.

지멘스
  의료 산업에 프로그램 서비스 제공하는 업체중 세계 최고이다

UPS
  공급 사슬 활동에 필요한 모든 비즈니스 수행

홈디포
  상품판매 업체에서 홈서비스 판매업체로 변화 - 가옥 개조에 들어가는 모든 비용을 긁어모  음 => 잔디와 정원관리, 지안청소, 위락시설 설치및 유지보수, 보안시스템등을 한자리에서 파매한다 이는 일에 찌든 맞벌이 부부에겐 반가운 소식.

건설업체들
  시설관리 서비스(건물에서 발생하는 모든 귀챦은 업무를 대행)를 제공하는 업체들의 시대가 올 것이다, 액센츄어가 EDS의 턴키 IS관리에 맞먹는 턴키 시설 관리 서비스를 제공하고자 힘쓰고 있다.

융합 및 통합에 힘쓰는 업체들..

소유하지 말고 모든걸 빌려 쓰라..? 왜?
  신발까지도 빌려쓰라..비용이 더 드는걸? 흠흠..몰까?

PSF가 제공하는 것
  제약회사 임상 서비스 - 래드언트리서치
  제약회사 리서치
  자동차 프로토타입 제작 서비스
  콜센터 관리
  학교 운영
교도소 운영
  턴키방식의 물류관리
  직원의 복리후생관리
  모든 종류의 시설관리
 
왜 ??
  전자 인사관리 부서가 왜 필요하지?
  모든 정보가 공유되고 개방되어 자신의 일을 스스로 관리하는게 가능?

PSF의 네가지 룰
  1. 상품화
  2. 웹화
  3. 잘할 수 없으면 외주
  4. 정말로 잘할 수 있으면 세계 최고가 되어라.

인사부서가 그냥 인사부서로 남을 것인가?
  세계 최고의 인재를 구성하는 팀...와 멋지다.

=> 시장을 장악해버릴 멋진 통합 서비스..-> 상품화 미친듯이..
    뭐든 상품화 해버려야 한다.

지식산업의 인간의 완성형은 => 프로젝트를 추진하는 인간

마찰없는 조직?
  문제 있는 조직일 수 있다? => 흠흠

[win] 비프음 제거

HKEY_CURRENT_USER\Control Panel\Sound
* Sound 라는 키가 보이지 않으면 새로 만들어 줍니다.
오른쪽 창에서 등록-문자열 값(S)
키 이름: Beep
기본값 : NO

아 첫 글입니다.

첫 글 앞으로 어떻게 채워나가야 할지..
네이버에서 이사왔죠 왠지 네이버는 답답한 기분이 들어서 ..