반응형

SELECT TO_CHAR(SYSDATE, 'YYYYMMDD') FROM DUAL
ps. pgsql이랑 똑같다.
반응형
반응형

declare @regdate = 1069807106
DATEADD(hh, 9, DATEADD(s, @regdate, '1970-01-01'))

유닉스타임을 timestamp로 .(mssql에선 datetime이지..)
반응형
반응형

오래전에 kldp에서 봤는데..

http://kldp.org/HOWTO/html/Program-Library-HOWTO/
반응형

'Tip & Tech > Linux | Unix' 카테고리의 다른 글

Linux Shell MOTD(로그인 후 배너)  (0) 2019.07.15
Jenkins 다른 계정으로 구동  (0) 2019.07.15
PHP 확장모듈 만들기  (0) 2010.10.21
shell scripting - date 사용하기  (0) 2010.10.21
AVR-GCC 설치법...  (0) 2010.10.21
반응형
반응형

'Tip & Tech > Linux | Unix' 카테고리의 다른 글

Jenkins 다른 계정으로 구동  (0) 2019.07.15
GCC .so만들기  (0) 2010.10.21
shell scripting - date 사용하기  (0) 2010.10.21
AVR-GCC 설치법...  (0) 2010.10.21
Solaris 에서의 pkgadd 사용 예  (0) 2010.10.21
반응형

date 쓰기

#!/bin/bash
# 'date' 명령어 연습

echo "올해가 시작한 뒤로 지금까지 `date +%j` 일이 지났습니다."
# 날짜를 형식화 하려면 포매터 앞에 '+'를 써야 됩니다.
# %j 는 오늘이 연중 몇 번째 날인가를 알려줍니다.

echo "1970/01/01 이후로 지금까지 `date +%s` 초가 지났습니다."
#  %s 는 "UNIX 에폭(epoch)"이 시작한 뒤로 현재까지 몇 초가 지났는지를 알려줍니다.
#+ 이걸 도대체 어디다 써 먹죠?

prefix=temp
suffix=`eval date +%s`  # 'date'의 "+%s" 옵션은 GNU 전용 옵션입니다.
filename=$prefix$suffix
echo $filename
#  "유일한" 임시 파일 이름으로 $$ 를 쓰는 것 보다 더 훌륭합니다.

# 더 많은 형식화 옵션을 보려면 'date' 맨 페이지를 읽어 보세요.

exit 0




---------------
참고 '=' 앞뒤로 띄어쓰기 안됨.

http://kr.blog.yahoo.com/sdsduck/87.html
http://wiki.kldp.org/HOWTO//html/Adv-Bash-Scr-HOWTO/timedate.html

반응형

'Tip & Tech > Linux | Unix' 카테고리의 다른 글

GCC .so만들기  (0) 2010.10.21
PHP 확장모듈 만들기  (0) 2010.10.21
AVR-GCC 설치법...  (0) 2010.10.21
Solaris 에서의 pkgadd 사용 예  (0) 2010.10.21
MySQL 리플리케이션 로그 핸들링  (0) 2010.10.20
반응형

EX)
IS 라는 테이블


select * from "IS"    .................. OK
select * from "is"    .................. ERROR


즉,
쌍따옴표를 쓰되
테이블명의 대 소문자를 구분한다는 것!


cf)
MSSQL은 []괄호를 쓴다..
대소문자는 M$의 특성상 구분하지 않음.
반응형
반응형

1. 기본

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: DialogShowSdRegisterUserEx                                      //
//                                                                           //
//  Purpose: This function displays the user registration dialog.            //
//                                                                           //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdRegisterUserEx()
    NUMBER nResult;
    STRING szTitle, szMsg;
    STRING firl, endl;
    NUMBER sum;
    NUMBER firn, endn;
begin


  svName    = "";
  svCompany = "";

  szTitle = "";
  szMsg   = "";
  nResult = SdRegisterUserEx( szTitle, szMsg, svName, svCompany, svSerial );

  MessageBox(svSerial, 0);


    // s/n 체크
    // 10자리이어야 하며 앞 두자리 / 뒷 두자리 의 합이 33의 배수이어야만 한다.
    // 10자리 이상은 추가 코딩으로 가능.

    firl = "";
    endl = "";
    StrSub(firl, svSerial,  0, 2);
    StrSub(endl, svSerial, StrLength(svSerial)-2, StrLength(svSerial));
    MessageBox(firl, 0);
    MessageBox(endl, 0);


    if(StrLength(svSerial) != 10) then
        MessageBox("유효하지 않은 제품번호 입니다.\n설치를 종료합니다.", 0);
        abort;
    endif;

    //sum = StrToNum(firl) + StrToNum(endl);
    StrToNum(firn, firl);
    StrToNum(endn, endl);
    sum = firn + endn;

    if(sum % 33 != 0) then
        MessageBox("유효하지 않은 제품번호 입니다.\n설치를 종료합니다.", 0);
        abort ;
    endif;


  return nResult;
end;


2. InstallShield 7 developer 버전 용.

////////////////////////////////////////////////////////////////////////////////
//                                                                            
//  File Name:        Setup.rul                                                  
//                                                                            
//  Description:        InstallShield script                                        
//                                                                            
//  Comments:        This script was generated based on the selections you made in
//                   the Project Wizard.  Refer to the help topic entitled "Modify      
//                   the script that the Project Wizard generates" for information
//                                on possible next steps.
//
////////////////////////////////////////////////////////////////////////////////


// Include header files
    
#include "ifx.h"
    
////////////////////// string defines ////////////////////////////

//////////////////// installation declarations ///////////////////

// ----- DLL function prototypes -----


    // your DLL function prototypes


// ---- script function prototypes -----


    // your script function prototypes

    // your global variables



//////////////////////////////////////////////////////////////////////////////
//                                                                          
//  FUNCTION:   OnFirstUIBefore                                            
//                                                                          
//  EVENT:      FirstUIBefore event is sent when installation is run for the first
//              time on given machine. In the handler installation usually displays
//              UI allowing end user to specify installation parameters. After this
//              function returns, FeatureTransferData is called to perform file
//              transfer.
//                                                                          
///////////////////////////////////////////////////////////////////////////////
function OnFirstUIBefore()
    number  nResult,nSetupType;
    string  szTitle, szMsg;
    string  szLicenseFile, szQuestion;
    string  szName, szCompany;
    string  szTargetPath;
    string  szDir;
    string  szfolder;
    string  szFeatures, szTargetdir;
    number  nLevel;
    LIST    listStartCopy;
    number  nvSize;
    number  nUser;    
    string svSerial;
begin        
    // TO DO: if you want to enable background, window title, and caption bar title                                                                    
    // SetTitle( @PRODUCT_NAME, 24, WHITE );                                        
    // SetTitle( @PRODUCT_NAME, 0, BACKGROUNDCAPTION );                           
    // Enable( FULLWINDOWMODE );                                                  
    // Enable( BACKGROUND );                                                          
    // SetColor(BACKGROUND,RGB (0, 128, 128));                                          
    
    SHELL_OBJECT_FOLDER = @PRODUCT_NAME;
    
    nSetupType = TYPICAL;        
    szDir = INSTALLDIR;
    szName    = "";
    szCompany = "";

Dlg_Start:
    // beginning of dialogs label

Dlg_SdWelcome:
    szTitle = "";
    szMsg   = "";
    nResult = SdWelcome( szTitle, szMsg );
    if (nResult = BACK) goto Dlg_Start;

Dlg_SdLicense:
    szLicenseFile = SUPPORTDIR ^ "license.txt";
    szTitle    = "";
    szMsg      = "";
    szQuestion = "";
    nResult    = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile );
    if (nResult = BACK) goto Dlg_SdWelcome;

Dlg_SdCustomerInformation:
    szMsg   = "";
    szTitle = "";                                                                
    nResult = SdCustomerInformationEx( szTitle, szName, szCompany, svSerial, nUser );    
   //nResult = SdCustomerInformation( szTitle, szName, szCompany, nUser );
    if (nResult = BACK) goto Dlg_SdLicense;

Dlg_SdAskDestPath:
    szTitle = "";
    szMsg   = "";
    nResult = SdAskDestPath( szTitle, szMsg, szDir, 0 );
    INSTALLDIR = szDir;
    if (nResult = BACK) goto Dlg_SdCustomerInformation;

Dlg_SetupType:  
    szTitle    = "";
    szMsg      = "";
    nResult = SetupType ( szTitle , szMsg , "" , nSetupType , 0 );
    if (nResult = BACK) then
        goto Dlg_SdAskDestPath;
    else
        nSetupType = nResult;
        if (nSetupType != CUSTOM) then
               szTargetPath = INSTALLDIR;
               nvSize = 0;
               FeatureCompareSizeRequired(MEDIA,szTargetPath,nvSize);
               if (nvSize != 0) then      
                       MessageBox( szSdStr_NotEnoughSpace, WARNING );
                   goto Dlg_SetupType;
            endif;
        endif;  
    endif;

Dlg_SdFeatureTree:
    if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType;
    szTitle    = "";
    szMsg      = "";
    szTargetdir = INSTALLDIR;
    szFeatures = "";
    nLevel = 2;
    if (nSetupType = CUSTOM) then
                    nResult = SdFeatureTree(szTitle, szMsg, szTargetdir, szFeatures, nLevel);
                    if (nResult = BACK) goto Dlg_SetupType;  
    endif;

Dlg_SdSelectFolder:
    szfolder = SHELL_OBJECT_FOLDER;
    szTitle    = "";
    szMsg      = "";
    nResult    = SdSelectFolder( szTitle, szMsg, szfolder );
    SHELL_OBJECT_FOLDER = szfolder;
    if (nResult = BACK) goto Dlg_SdFeatureTree;
  
Dlg_SdStartCopy:
    szTitle = "";
    szMsg   = "";
    listStartCopy = ListCreate( STRINGLIST );
    //The following is an example of how to add a string(szName) to a list(listStartCopy).
    //eg. ListAddString(listStartCopy,szName,AFTER);
    nResult = SdStartCopy( szTitle, szMsg, listStartCopy );        
    ListDestroy(listStartCopy);
    if (nResult = BACK) goto Dlg_SdSelectFolder;

    Enable(STATUSEX);

    return 0;
end;

///////////////////////////////////////////////////////////////////////////////
//
//  FUNCTION:   OnMaintUIBefore
//
//  EVENT:      MaintUIBefore event is sent when end user runs installation that
//              has already been installed on the machine. Usually this happens
//              through Add/Remove Programs applet. In the handler, installation
//              usually displays UI allowing end user to modify existing installation
//              or uninstall application. After this function returns,
//              FeatureTransferData is called to perform file transfer.
//
///////////////////////////////////////////////////////////////////////////////
function OnMaintUIBefore()
    NUMBER nResult, nType;
    STRING szTitle, szMsg, svDir, svResult, szCaption;
begin
    // TO DO: if you want to enable background, window title, and caption bar title                                                                   
    // SetTitle( @PRODUCT_NAME, 24, WHITE );                                        
    // SetTitle( @PRODUCT_NAME, 0, BACKGROUNDCAPTION );                          
    // SetColor(BACKGROUND,RGB (0, 128, 128));                                        
    // Enable( FULLWINDOWMODE );                                                
    // Enable( BACKGROUND );                                                        
        
Dlg_Start:
    Disable(BACKBUTTON);
    nType = SdWelcomeMaint(szTitle, szMsg, MODIFY);
    Enable(BACKBUTTON);

    if (nType = REMOVEALL) then
        svResult = SdLoadString(IFX_MAINTUI_MSG);
        szCaption = SdLoadString(IFX_ONMAINTUI_CAPTION);
        nResult = SprintfBox(MB_OKCANCEL,szCaption,"%s",svResult);
        if (nResult = IDCANCEL) goto Dlg_Start;
    endif;

    nResult = NEXT;

Dlg_SdFeatureTree:
    if (nType = MODIFY) then
        szTitle = "";
        szMsg = "";
        nResult = SdFeatureTree(szTitle, szMsg, TARGETDIR, "", 2);
        if (nResult = BACK) goto Dlg_Start;
    endif;

    switch(nType)
        case REMOVEALL: ComponentRemoveAll();
        case REPAIR:    ComponentReinstall();
    endswitch;
    
    Enable(STATUSEX);
end;

3. InstallShield For VC++ 6.0 용 풀소스  
////////////////////////////////////////////////////////////////////////////////
//
//  IIIIIII SSSSSS
//    II    SS                          InstallShield (R)
//    II    SSSSSS      (c) 1996-1997, InstallShield Software Corporation
//    II        SS      (c) 1990-1996, InstallShield Corporation
//  IIIIIII SSSSSS                     All Rights Reserved.
//
//
//  This code is generated as a starting setup template.  You should
//  modify it to provide all necessary steps for your setup.
//
//
//    File Name:  Setup.rul
//
//  Description:  InstallShield script
//
//     Comments:  This template script performs a basic setup on a
//                Windows 95 or Windows NT 4.0 platform. With minor
//                modifications, this template can be adapted to create
//                new, customized setups.
//
////////////////////////////////////////////////////////////////////////////////


  // Include header file
#include "sdlang.h"
#include "sddialog.h"

////////////////////// string defines ////////////////////////////

#define UNINST_LOGFILE_NAME      "Uninst.isu"

//////////////////// installation declarations ///////////////////

  // ----- DLL prototypes -----


     // your DLL prototypes


  // ---- script prototypes -----

     // generated
     prototype ShowDialogs();
     prototype MoveFileData();
     prototype HandleMoveDataError( NUMBER );
     prototype ProcessBeforeDataMove();
     prototype ProcessAfterDataMove();
     prototype SetupRegistry();
     prototype SetupFolders();
     prototype CleanUpInstall();
     prototype SetupInstall();
     prototype SetupScreen();
     prototype CheckRequirements();
     prototype DialogShowSdWelcome();
     prototype DialogShowSdRegisterUserEx();
     prototype DialogShowSdAskDestPath();
     prototype DialogShowSdSelectFolder();
     prototype DialogShowSdFinishReboot();

     // your prototypes


  // ----- global variables ------

     // generated
     BOOL        bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup;
     STRING      svDir;
     STRING      svName, svCompany, svSerial;
     STRING      szAppPath;
     STRING      svSetupType;


     // your global variables


///////////////////////////////////////////////////////////////////////////////
//
//   MAIN PROGRAM
//
//      The setup begins here by hiding the visible setup
//      window.  This is done to allow all the titles, images, etc. to
//      be established before showing the main window.  The following
//      logic then performs the setup in a series of steps.
//
///////////////////////////////////////////////////////////////////////////////
program
    Disable( BACKGROUND );

    CheckRequirements();

    SetupInstall();

    SetupScreen();

    if (ShowDialogs()<0) goto end_install;

    if (ProcessBeforeDataMove()<0) goto end_install;

    if (MoveFileData()<0) goto end_install;

    if (ProcessAfterDataMove()<0) goto end_install;

    if (SetupRegistry()<0) goto end_install;

    if (SetupFolders()<0) goto end_install;


  end_install:

    CleanUpInstall();

     // If an unrecoverable error occurred, clean up the partial installation.
     // Otherwise, exit normally.

    if (bInstallAborted) then
        abort;
    endif;

endprogram

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function:  ShowDialogs                                                    //
//                                                                           //
//  Purpose:  This function manages the display and navigation               //
//            the standard dialogs that exist in a setup.                    //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function ShowDialogs()
    NUMBER  nResult;
begin

    Dlg_Start:
        // beginning of dialogs label

    Dlg_SdWelcome:
        nResult = DialogShowSdWelcome();
        if (nResult = BACK) goto Dlg_Start;

    Dlg_SdRegisterUserEx:
        nResult = DialogShowSdRegisterUserEx();
        if (nResult = BACK) goto Dlg_SdWelcome;

    Dlg_SdAskDestPath:
        nResult = DialogShowSdAskDestPath();
        if (nResult = BACK) goto Dlg_SdRegisterUserEx;

    Dlg_SdSelectFolder:
        nResult = DialogShowSdSelectFolder();
        if (nResult = BACK) goto Dlg_SdAskDestPath;

    return 0;

end;

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: ProcessBeforeDataMove                                           //
//                                                                           //
//  Purpose: This function performs any necessary operations prior to the    //
//           actual data move operation.                                     //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function ProcessBeforeDataMove()
    STRING svLogFile;
    NUMBER nResult;
begin

  InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY );

  svLogFile = UNINST_LOGFILE_NAME;

  nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 );
  if (nResult < 0) then
      MessageBox( @ERROR_UNINSTSETUP, WARNING );
  endif;

  szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir

  if ((bIs32BitSetup) && (bIsShellExplorer)) then
      RegDBSetItem( REGDB_APPPATH, szAppPath );
      RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY );
      RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME );
  endif;

  // TODO : update any items you want to process before moving the data
  //

  return 0;
end;

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function:  MoveFileData                                                   //
//                                                                           //
//  Purpose:  This function handles the data movement for                    //
//            the setup.                                                     //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function MoveFileData()
    NUMBER nResult, nDisk;
begin

  nDisk = 1;
  SetStatusWindow( 0, "" );
  Disable( DIALOGCACHE );
  Enable( STATUS );
  StatusUpdate( ON, 100 );
  nResult = ComponentMoveData( MEDIA, nDisk, 0 );

  HandleMoveDataError( nResult );

  Disable( STATUS );

  return nResult;

end;


///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: HandleMoveDataError                                             //
//                                                                           //
//  Purpose: This function handles the error (if any) during the move data   //
//           operation.                                                      //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function HandleMoveDataError( nResult )
    STRING szErrMsg, svComponent , svFileGroup , svFile;
begin

  svComponent = "";
  svFileGroup = "";
  svFile = "";

  switch (nResult)
  case 0:
       return 0;
  default:
       ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult );
       szErrMsg = @ERROR_MOVEDATA  + "\n\n" +
                  @ERROR_COMPONENT + " " + svComponent + "\n" +
                  @ERROR_FILEGROUP + " " + svFileGroup + "\n" +
                  @ERROR_FILE      + " " + svFile;
       SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult );
       bInstallAborted = TRUE;
       return nResult;
  endswitch;

end;

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: ProcessAfterDataMove                                            //
//                                                                           //
//  Purpose: This function performs any necessary operations needed after    //
//           all data has been moved.                                        //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function ProcessAfterDataMove()
begin

  // TODO : update self-registered files and other processes that
  //        should be performed after the data has been moved.


  return 0;
end;

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: SetupRegistry                                                   //
//                                                                           //
//  Purpose: This function makes the registry entries for this setup.        //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function SetupRegistry()
NUMBER nResult;

begin

  // TODO : Add all your registry entry keys here
  //
  //
  //    RegDBCreateKeyEx, RegDBSetKeyValueEx....
  //

  nResult = CreateRegistrySet( "" );

  return nResult;
end;

///////////////////////////////////////////////////////////////////////////////
//
// Function: SetupFolders
//
//  Purpose: This function creates all the folders and shortcuts for the
//           setup.  This includes program groups and items for Windows 3.1.
//
///////////////////////////////////////////////////////////////////////////////
function SetupFolders()
NUMBER nResult;

begin


  // TODO : Add all your folder (program group) along with shortcuts (program items)
  //
  //
  //    CreateProgramFolder, AddFolderIcon....
  //

  nResult = CreateShellObjects( "" );

  return nResult;
end;

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: CleanUpInstall                                                  //
//                                                                           //
//  Purpose: This cleans up the setup.  Anything that should                 //
//           be released or deleted at the end of the setup should           //
//           be done here.                                                   //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function CleanUpInstall()
begin


  if (bInstallAborted) then
      return 0;
  endif;

  DialogShowSdFinishReboot();

  if (BATCH_INSTALL) then // ensure locked files are properly written
      CommitSharedFiles(0);
  endif;

  return 0;
end;

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: SetupInstall                                                    //
//                                                                           //
//  Purpose: This will setup the installation.  Any general initialization   //
//           needed for the installation should be performed here.           //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function SetupInstall()
begin

  Enable( CORECOMPONENTHANDLING );

  bInstallAborted = FALSE;

  if (bIs32BitSetup) then
      svDir = PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME;
  else
      svDir = PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names
  endif;

  TARGETDIR  = svDir;

  SdProductName( @PRODUCT_NAME );

  Enable( DIALOGCACHE );

  return 0;
end;

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function:  SetupScreen                                                    //
//                                                                           //
//  Purpose:  This function establishes  the screen look.  This includes     //
//            colors, fonts, and text to be displayed.                       //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function SetupScreen()
begin

  Enable( FULLWINDOWMODE );
  Enable( INDVFILESTATUS );
  SetTitle( @TITLE_MAIN, 24, WHITE );

  SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text.

  Enable( BACKGROUND );

  Delay( 1 );
end;

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function:  CheckRequirements                                              //
//                                                                           //
//  Purpose:  This function checks all minimum requirements for the          //
//            application being installed.  If any fail, then the user       //
//            is informed and the setup is terminated.                       //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function CheckRequirements()
    NUMBER  nvDx, nvDy, nvResult;
    STRING  svResult;

begin

  bWinNT           = FALSE;
  bIsShellExplorer = FALSE;

  // Check screen resolution.
  GetExtents( nvDx, nvDy );

  if (nvDy < 480) then
      MessageBox( @ERROR_VGARESOLUTION, WARNING );
      abort;
  endif;

  // set 'setup' operation mode
  bIs32BitSetup = TRUE;
  GetSystemInfo( ISTYPE, nvResult, svResult );
  if (nvResult = 16) then
      bIs32BitSetup = FALSE; // running 16-bit setup
      return 0; // no additional information required
  endif;

  // --- 32-bit testing after this point ---

  // Determine the target system's operating system.
  GetSystemInfo( OS, nvResult, svResult );

  if (nvResult =  IS_WINDOWSNT) then
      // Running Windows NT.
      bWinNT = TRUE;

      // Check to see if the shell being used is EXPLORER shell.
      if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then
          if (nvResult >= 4) then
              bIsShellExplorer = TRUE;
          endif;
      endif;

  elseif (nvResult = IS_WINDOWS95 ) then
      bIsShellExplorer = TRUE;

  endif;

end;


///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: DialogShowSdWelcome                                             //
//                                                                           //
//  Purpose: This function handles the standard welcome dialog.              //
//                                                                           //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdWelcome()
    NUMBER nResult;
    STRING szTitle, szMsg;
begin

  szTitle = "";
  szMsg   = "";
  nResult = SdWelcome( szTitle, szMsg );

  return nResult;
end;


///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: DialogShowSdRegisterUserEx                                      //
//                                                                           //
//  Purpose: This function displays the user registration dialog.            //
//                                                                           //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdRegisterUserEx()
    NUMBER nResult;
    STRING szTitle, szMsg;
    STRING firl, endl;
    NUMBER sum;
    NUMBER firn, endn;
begin


  svName    = "";
  svCompany = "";

  szTitle = "";
  szMsg   = "";
  nResult = SdRegisterUserEx( szTitle, szMsg, svName, svCompany, svSerial );

  //MessageBox(svSerial, 0);


    // s/n 체크
    // 10자리이어야 하며 앞 두자리 / 뒷 두자리 의 합이 33의 배수이어야만 한다.
    // 10자리 이상은 추가 코딩으로 가능.

    firl = "";
    endl = "";
    StrSub(firl, svSerial,  0, 2);
    StrSub(endl, svSerial, StrLength(svSerial)-2, StrLength(svSerial));
   // MessageBox(firl, 0);
   // MessageBox(endl, 0);


    if(StrLength(svSerial) != 10) then
        MessageBox("유효하지 않은 제품번호 입니다.\n설치를 종료합니다.", 0);
        abort;
    endif;

    //sum = StrToNum(firl) + StrToNum(endl);
    StrToNum(firn, firl);
    StrToNum(endn, endl);
    sum = firn + endn;

    if(sum % 33 != 0) then
        MessageBox("유효하지 않은 제품번호 입니다.\n설치를 종료합니다.", 0);
        abort ;
    endif;


  return nResult;
end;


///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: DialogShowSdAskDestPath                                         //
//                                                                           //
//  Purpose: This function asks the user for the destination directory.      //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdAskDestPath()
    NUMBER nResult;
    STRING szTitle, szMsg;
begin

  szTitle = "";
  szMsg   = "";
  nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 );

  TARGETDIR = svDir;

  return nResult;
end;


///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: DialogShowSdSelectFolder                                        //
//                                                                           //
//  Purpose: This function displays the standard folder selection dialog.    //
//                                                                           //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdSelectFolder()
    NUMBER nResult;
    STRING szTitle, szMsg;
begin

  if (SHELL_OBJECT_FOLDER = "") then
      SHELL_OBJECT_FOLDER = @FOLDER_NAME;
  endif;

  szTitle    = "";
  szMsg      = "";
  nResult    = SdSelectFolder( szTitle, szMsg, SHELL_OBJECT_FOLDER );

  return nResult;
end;


///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Function: DialogShowSdFinishReboot                                        //
//                                                                           //
//  Purpose: This function will show the last dialog of the product.         //
//           It will allow the user to reboot and/or show some readme text.  //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdFinishReboot()
    NUMBER nResult, nDefOptions;
    STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
    NUMBER bOpt1, bOpt2;
begin

  if (!BATCH_INSTALL) then
      bOpt1 = FALSE;
      bOpt2 = FALSE;
      szMsg1 = "";
      szMsg2 = "";
      szOption1 = "";
      szOption2 = "";
      nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 );
      return 0;
  endif;

  nDefOptions = SYS_BOOTMACHINE;
  szTitle     = "";
  szMsg1      = "";
  szMsg2      = "";
  nResult     = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 );

  return nResult;
end;

// --- include script file section ---

#include "sddialog.rul"


반응형
반응형

ASP.NET 배포시 다른 컴퓨터에...배포시...

1. 가상디렉토리를 생성시와 같이 설정해준다...

ex) 프로그램 세팅이 http://localhost/tree였다면... 그 디렉토리가 http://localhost/tree가 될수 있게..

2. 가상디렉토리 안 모든 구역에 aspx파일이 존재하는 구역은 해당 폴더(디렉토리)명으로 응용프로그램 이름 정의!

반응형
반응형

아주오래전

jin's lab에 남긴거네요 ~_~
잊혀질까봐 무서워서 빼옵니다..

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

자!!! 이제 AVR-GCC를 설치 해봅시다!!! (두둥)

처음에 인터버드 홈페이지에 AVR-GCC설치법을 보고 시작했습니다..
글이 순서가 약간 이상해서 혼자 어젯 밤 상당히 삽질을 했드랩니다..
결국은 성공을 했지만....

물론 윈도우에선 AVR-EDIT라는 강력한 툴이 있긴 하지만..
저같은 사용자는 때로는 리눅스 켜놓고 남에게 방해 받지 않고 코딩을 할 수 있어서 좋습니다...(이상하게 리눅 켜놓고 있으면 아무도 터치를 안하는 분위기가 +_ +)

자~ 이제 본격적으로 설치법을 기술 하기 전에 준비물~~~
1. OS Linux 여야겠죠?
(저는 GNU/Linux Debian Linux사용자라 데비안 3.0 우디 배포본에 필요한 개발 헤더라던지 패키지들을 설치 해서 사용합니다.)

2. 기본적인 개발툴들이 설치 되어있어야 합니다....gcc나 Glibc등등..
(Redhat 사용자께서는 gcc버전이 낮으네 어쩌네 하면 http://rpmfind.net에서 의존성 있는 패키지들 검색하셔서 설치해 주세요...
Debian 사용자라면 apt-get upgrade update한방이면 왠간한건 다 되겠죠?)

3. 땜질과 마찬가지로 리눅스 프로그램 소스컴파일도 상당한 인내와 고뇌 그리고 삽질이 필요합니다(물론 고수분들 제외). Jin님의 말씀을 빌리자면 집에 놔두고 온 떡 생각하면 안되옵나이다 (_ _

[[ 설치에 앞서 필요한 패키지들 ]]
tar, gzip, gunzip : 이건 배포본에 대부분 깔려 있습니다. 파일 묶음/압축 유틸
gcc : 제가 2.95를 사용하는데 괜찮더군요.....
glibc : gcc에 의존관계는 크게 없지만 이거 없으면 일반 C 소스도 컴파일안됩니다...
shell : 음 대부분 bash를 사용하실껍니다...bash를 적극 추천합니다...
make : 없으면 리눅스가 아닐지도...


[[ 설치에 필요한 계정 ]]
root 계정으로 프로그램을 설치 합니다....
그래야 나머지 계정에 ftp로 올려버린 압축 이미지도 풀어 헤칠수 있으니까요... <-- 농담반 진담반
.........원래 프로그램 설치는 root에서 하는 거심.........


[[ 설치에 필요한 소스를 받아봅시다 ]]
힘들게 찾았습니다...
http://multi.ks.ac.kr/~reserve/avr-gcc
필요한것이 binutils와 gcc-core, avr-libc입니다...

binutils-2.14.tar.bz2  
gcc-core-3.3.tar.gz  
avr-libc_20030512cvs-1.tar.gz
를 받으세요

binutil만 왜 tar.gz의 확장자가 아니라 tar.bz2의 확장자냐라고 생각하시는 분은...ftp://ftp.informatik.rwth-aachen.de/pub/gnu/binutils/ 가셔서 tar.gz로 된 걸 받으시면 됩니다 ^-^ 그냥 혹시나 하는 마음에 원래 인터보드 강좌의 파일로 쓴거죠...

이전 버전은 tar.gz로 깔았었는데 잘되었습니다...


[[ 본격적인 설치에 앞서 ]]
리눅스에선 configure  - > make - > make install 의 과정으로 소스 컴파일을 합니다..
configure로 설치할 환경을 세팅하구요(데뱐이면 데뱐, 수세면 수세, 레뎃이면 레뎃, 젠투면 젠투...등등)
make로 실제 바이너리 이미지를 현 디렉토리에 맹글어 둔후..
make install을 하면 해당 설치 경로로 파일을 옮기게 됩니다....
make한 데이터를 싸그리 지우고 싶다...라면 make clean하시면 됩니다....만...그냥 사용한 디렉토리는 rm -rf 디렉토리명 으로 삭제 하시면 되기 때문에 그럴 필요가 거의 없을껍니다...

[[ 설치 과정 ]]

gcc가 설치되어있으므로 그것과 구분 지을수 있도록 /usr/local/atmel이란 디렉토리를 생성하여 거기에 avr-gcc를 설치하도록합니다..

$> mkdir /usr/local/atmel

/usr/local/atmel이라는 디렉토리를 맹글었으면

(1)
어셈블러나 링커등이 있는 binutil을 설치 합니다...
(주 : avr-gcc말고 ARM(XScale)용 gcc또한 binutil 을 사용합니다....이와 유사한 방식으로 설치를 하지요..)

$>  bunzip2 -c binutils-2.14.tar.bz2 | tar xvf -
(주 : tar.gz파일이라면 $> tar xvfz binutils-2.14.tar.gz 로 압축을 해제 한다)
$>  cd binutils-2.14
$>  ./configure --target=avr --prefix=/usr/local/atmel
$>  make
$>  make install  

이렇게 설치가 되었으면 avr-gcc(cc이지만 이녀석은 크로스 컴파일러이죠..)의 라이브러리가 어디에 있는지 정의해 주어야 하는데요..

$> vi /etc/ld.so.conf

로 파일을 여신 후 에디터를 insert 모드로 전환(키보드 i키) 후 원래 있는 라이브러리 패스 밑에 /usr/local/atmel/lib 라인을 추가 시킵니다..
그리고 esc키 를 누르면 insert모드에서 해제되는데요 여기서 :wq (파일에 쓰고 종료)를 눌러 파일에 쓰고 종료를 합니다

*.conf파일은 config파일입니다...바뀐 데이터를 반영하기 위해선

$> /sbin/ldconfig

명령을 수행 하게 되면 됩니다...

but, 여기서 저 명령이 안듣는 모양이더군요..제 리눅스가 문제인건지...커널버전이 너무 많이 올라와 버려서 인건지....
대안입니다...
실행을 시켜보고...리붓해주시길...(꼭입니다..)

리붓 후 다시 root로 로긴합니다

(2)
avr-gcc를 설치 합니다...
gcc-core만 깔면 되더군요..+_ +)

인터보드랑 약간 차이나는 게 여기서 부터라 볼수 있군요..

$>  tar zxvf gcc-core-3.3.tar.gz
$>  cd gcc-3.3
$>  ./configure --target=avr --prefix=/usr/local/atmel --disable-nls --enable-language=c

위와 같이 gcc-core를 configure한 다음 make, make install전에

$>  export CC=avr-gcc  
$>  export AS=avr-as
$>  export AR=avr-ar
$>  export RANLIB=avr-ranlib
$>  export PATH=/usr/local/atmel/bin:${PATH}

위와 같이 환경 변수를 등록합니다...

그 다음

$>  make
$>  make install

로 마무리!!


(3)
여기까지 아무문제 없이 잘 왔다면..대략 성공이 눈앞에 보이는 것입니다.... 나머지는 이제 avr-gcc가 사용할 avr 헤더파일과 라이브러리 파일을 등록시켜주는(파일을 생성후 /usr/local/atmel/ 디렉토리 하부에 집어 넣는) 작업만 남았습니다..

그 것이 avr-libc이죠....
(주: 역시 ARM용 또한 이렇게 존재하는 것이지요 [_ _]*)

$>  tar xvfz  avr-libc_20030512cvs-1.tar.gz
$>  cd avr-libc-200030512cvs
$>  ./configure --prefix=/usr/local/atmel --target=avr --enable-languages=c --host=avr
$>  make
$>  make install

하면 이제 avr-gcc가 동작할 것입니다...ㅠ_-
고난과 역경을 ㅠ_ㅠ 격게 되실 것이므로;;
avr-gcc의 패스가 재로긴 후 사라지기 때문이죠..

Tip하나를....

로그인 후 자신의 홈 디렉토리가
/home/자신의 아이디 일껍니다..
거기에서

$>  vi .bash_profile

을 하시면 Bash쉘의 개인 프로필이 뜨게 되는데요..

export CC=avr-gcc  
export AS=avr-as
export AR=avr-ar
export RANLIB=avr-ranlib
export PATH=/usr/local/atmel/bin:${PATH}

제일 밑에 써 넣으시고 난 뒤 저장 후 종료 하신후

$>  source .bash_profile

하시면....

avr-gcc가 그 사용자에게는 실행이 될 것입니다...^-^ 물론 path에 추가해줘도 괜찮지만...

역시 unix, linux라는 운영체제는...특별 권한에 특별한 아이디를 사용하는 매력이 +_ +)/





인터버드에 있는 AVR-GCC 설치 사용법..
http://www.interboard.co.kr/devel/avr/avr_install.html


======================================================================================================================
avr-libc-1.0.3.tar.tar 가 업데이트 되었습니다 .tar.tar는 .tar.bz입니다... 압축 푸시는건 bunzip2 -c 파일명 | tar xvf - 입니다... atmega32 됩니다 두둥~~~


http://www.avrfreaks.net/AVRGCC/index.php
http://www.lancos.com/ppwin95.html
반응형

'Tip & Tech > Linux | Unix' 카테고리의 다른 글

PHP 확장모듈 만들기  (0) 2010.10.21
shell scripting - date 사용하기  (0) 2010.10.21
Solaris 에서의 pkgadd 사용 예  (0) 2010.10.21
MySQL 리플리케이션 로그 핸들링  (0) 2010.10.20
php full compile options  (0) 2010.10.20
반응형

함수 프로토 타입 정의와 사용에 인자를 명시적으로 기입해 주어야 한다

ex) void ClrLCD(); //정의
     void ClrLCD()
     {...}            
위와 같이 선언 정의시 에러...
sol) void ClrLCD(void); //정의
      void ClrLCD(void)
      {...}            

이렇게 하면 에러 안뜨므로..이렇게 사용하세요..

특히 vc사용자들 조심할것
반응형

+ Recent posts