반응형

Visual Studio Setup 프로젝트를 통해 배포파일을 만들어야 하는 경우가 있다.


배포파일 만드는 방법은 검색해보면 많이 나오므로 참고하면 되고 (키워드 : Visual Studio Installer)


dll 포함시켜주고 빌드를 걸면 아래와 같은 오류가 뜨는 경우가 있다.


ERROR: Unrecoverable build error


이문제도 역시 검색을 해보면 된다.


구글링 결과 mergemod.dll 라는 dll를 윈도우에 등록시키면 된다.


등록 명령은 아래와 같다.


regsvr32.exe "C:\Program Files (x86)\Common Files\Microsoft Shared\MSI Tools\mergemod.dll"

관리자 권한이 필요하므로 Window Power Shell(관리자권한)을 이용하거나 cmd를 관리자권한으로 실행해서 하면된다.

반응형

C++에서 XML 문서를 파싱하거나 생성해야할 때가 있다.


물론 DOM형식이지만 텍스트 파일에서 보이므로 하나씩 토크나이징하면서 하나하나 파싱하는 방법도 있겠지만


필요이상의 작업이 들어가고 속도도 느리다.


따라서 Paser를 이용하여 쉽고 빠르게 문서 내용을 파싱해야한다.


C++에서는 기본적으로 제공하는 클래스가 없다. ㅠㅠ (C#이 왜 강려크한지 그 이유..)


오픈소스를 찾아보니 CMarkup이라는 클래스가 있다.


사이트에 들어가 다운받으면 아래와 같은 두 파일이 보인다.


Markup.cpp 

Markup.h

위 두 파일을 프로젝트에 추가시키고


 #include "Markup.h"



CMarkup xml;

bool bSuccess = xml.Load( "C:\\Temp\\hello.xml" ); 

이런식으로 CMarkup 클래스 생성해서 사용하면 된다.


홈페이지에 상세 API가 잘 되어 있으니 참고해서 활용하면 될듯하다.


반응형

전화권유판매 수신거부 등록이란

  • 전화권유판매 사업자가 전화권유판매 영업을 하기 전, 본 시스템에 수신거부의사를 등록한 휴대전화번호를 사업자의 영업대상목록에서 제외시킬 수 있도록 하는 기능입니다.
  • 소비자는 수신거부 신청 시 모든 전화권유판매 사업자에 대한 거부의사를 표명한 것이며, 특정 사업자에 대한 수신거부 해제를 하고자 할 경우 본 시스템의 수신거부 조회 및 수정 메뉴를 통하여 진행이 가능합니다.
  • 등록하신 전화번호는 업체에서 시행하는 수신거부대조를 통하여 각 업체에 반영됩니다.수신거부 대조는 30일 내에 1회 이상 시행하도록 되어있으며 업체별로 수신거부 등록반영에 시간이 걸릴 수 있습니다.
  • 전화권유판매업자는 방문판매 등에 관한 법에 의거하여, 전화권유판매의 대상과 방법, 전화권유판매 수신동의 철회방법 등을 소비자에게 고지하고 미리 동의를 받은 경우에만 전화권유판매 수신거부의사 등록시스템에서 소비자의 수신거부의사를 확인하지 아니하고 전화권유판매를 할 수 있습니다.
  • 이에 따라 소비자가 동의를 철회하고 수신거부의사를 밝히고 싶을 경우, 소비자는 전화권유판매업자가 개인정보관리·보호방침에 고지하고 있는 철회방법에 따라 철회할 수 있습니다.



'Action' 카테고리의 다른 글

Customs Clearance Information(개인고유통관번호)  (0) 2019.11.11
수영 영법별 자세 아레나 움짤  (0) 2019.04.11
해외 배송정보 번역  (0) 2017.01.04
사업자 등록 신청요령  (0) 2013.01.06
1인 창조기업 해당 업종  (1) 2013.01.02
반응형

크롬 이용중 웹사이트의 텍스트박스(ex. ID입력, 검색어 입력)를 클릭했을 때 과거 입력했었던 내용들이 리스트업 되는데


이를 삭제하려면 다음과 같이 하면 된다.



1. 크롬 브라우저 화면에서 단축키 Ctrl + H 또는 크롬 우측 상단의 메뉴버튼(점3개) 클릭 -> 방문기록 클릭


2. 인터넷 사용기록 삭제 클릭 또는 바로가기(chrome://settings/clearBrowserData)


3. 고급탭에서 "양식 데이터 자동 완성" 체크 후 인터넷 사용 기록 삭제 클릭




반응형

리눅스 계열 OS에서 많이 사용되는 쉘스크립트의 형식(인덴트:indent 와 같은 줄맞춤?)을 자동으로 해주는 파이썬 라이브러리가 있어 스크랩한다.


쉘스크립트 경우 대부분 작성을 vim이나 notepad같은 별도의 IDE를 사용하지 않기때문에 여타  IDE처럼 인덴트를 자동으로 잡아주는 기능이 없다.


파이썬 파일로 아래 내용을 저장후 해당파일을 실행해주면 된다.


공식사이트는 https://arachnoid.com/python/beautify_bash_program.html 이며 라이센스는 GNU General Public License.



실행명령:

python beautify_bash.py file1.sh


파일:

beautify_bash.py


소스코드:

 
#!/usr/bin/env python
# -*- coding: utf-8 -*-

#**************************************************************************
#   Copyright (C) 2011, Paul Lutus                                        *
#                                                                         *
#   This program is free software; you can redistribute it and/or modify  *
#   it under the terms of the GNU General Public License as published by  *
#   the Free Software Foundation; either version 2 of the License, or     *
#   (at your option) any later version.                                   *
#                                                                         *
#   This program is distributed in the hope that it will be useful,       *
#   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
#   GNU General Public License for more details.                          *
#                                                                         *
#   You should have received a copy of the GNU General Public License     *
#   along with this program; if not, write to the                         *
#   Free Software Foundation, Inc.,                                       *
#   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
#**************************************************************************

import re, sys

PVERSION = '1.0'

class BeautifyBash:

  def __init__(self):
    self.tab_str = ' '
    self.tab_size = 2

  def read_file(self,fp):
    with open(fp) as f:
      return f.read()

  def write_file(self,fp,data):
    with open(fp,'w') as f:
      f.write(data)

  def beautify_string(self,data,path = ''):
    tab = 0
    case_stack = []
    in_here_doc = False
    defer_ext_quote = False
    in_ext_quote = False
    ext_quote_string = ''
    here_string = ''
    output = []
    line = 1
    for record in re.split('\n',data):
      record = record.rstrip()
      stripped_record = record.strip()
      
      # collapse multiple quotes between ' ... '
      test_record = re.sub(r'\'.*?\'','',stripped_record)
      # collapse multiple quotes between " ... "
      test_record = re.sub(r'".*?"','',test_record)
      # collapse multiple quotes between ` ... `
      test_record = re.sub(r'`.*?`','',test_record)
      # collapse multiple quotes between \` ... ' (weird case)
      test_record = re.sub(r'\\`.*?\'','',test_record)
      # strip out any escaped single characters
      test_record = re.sub(r'\\.','',test_record)
      # remove '#' comments
      test_record = re.sub(r'(\A|\s)(#.*)','',test_record,1)
      if(not in_here_doc):
        if(re.search('<<-?',test_record)):
          here_string = re.sub('.*<<-?\s*[\'|"]?([_|\w]+)[\'|"]?.*','\\1',stripped_record,1)
          in_here_doc = (len(here_string) > 0)
      if(in_here_doc): # pass on with no changes
        output.append(record)
        # now test for here-doc termination string
        if(re.search(here_string,test_record) and not re.search('<<',test_record)):
          in_here_doc = False
      else: # not in here doc
        if(in_ext_quote):
          if(re.search(ext_quote_string,test_record)):
            # provide line after quotes
            test_record = re.sub('.*%s(.*)' % ext_quote_string,'\\1',test_record,1)
            in_ext_quote = False
        else: # not in ext quote
          if(re.search(r'(\A|\s)(\'|")',test_record)):
            # apply only after this line has been processed
            defer_ext_quote = True
            ext_quote_string = re.sub('.*([\'"]).*','\\1',test_record,1)
            # provide line before quote
            test_record = re.sub('(.*)%s.*' % ext_quote_string,'\\1',test_record,1)
        if(in_ext_quote):
          # pass on unchanged
          output.append(record)
        else: # not in ext quote
          inc = len(re.findall('(\s|\A|;)(case|then|do)(;|\Z|\s)',test_record))
          inc += len(re.findall('(\{|\(|\[)',test_record))
          outc = len(re.findall('(\s|\A|;)(esac|fi|done|elif)(;|\)|\||\Z|\s)',test_record))
          outc += len(re.findall('(\}|\)|\])',test_record))
          if(re.search(r'\besac\b',test_record)):
            if(len(case_stack) == 0):
              sys.stderr.write(
                'File %s: error: "esac" before "case" in line %d.\n' % (path,line)
              )
            else:
              outc += case_stack.pop()
          # sepcial handling for bad syntax within case ... esac
          if(len(case_stack) > 0):
            if(re.search('\A[^(]*\)',test_record)):
              # avoid overcount
              outc -= 2
              case_stack[-1] += 1
            if(re.search(';;',test_record)):
              outc += 1
              case_stack[-1] -= 1
          # an ad-hoc solution for the "else" keyword
          else_case = (0,-1)[re.search('^(else)',test_record) != None]
          net = inc - outc
          tab += min(net,0)
          extab = tab + else_case
          extab = max(0,extab)
          output.append((self.tab_str * self.tab_size * extab) + stripped_record)
          tab += max(net,0)
        if(defer_ext_quote):
          in_ext_quote = True
          defer_ext_quote = False
        if(re.search(r'\bcase\b',test_record)):
          case_stack.append(0)
      line += 1
    error = (tab != 0)
    if(error):
      sys.stderr.write('File %s: error: indent/outdent mismatch: %d.\n' % (path,tab))
    return '\n'.join(output), error

  def beautify_file(self,path):
    error = False
    if(path == '-'):
      data = sys.stdin.read()
      result,error = self.beautify_string(data,'(stdin)')
      sys.stdout.write(result)
    else: # named file
      data = self.read_file(path)
      result,error = self.beautify_string(data,path)
      if(data != result):
        # make a backup copy
        self.write_file(path + '~',data)
        self.write_file(path,result)
    return error

  def main(self):
    error = False
    sys.argv.pop(0)
    if(len(sys.argv) < 1):
      sys.stderr.write('usage: shell script filenames or \"-\" for stdin.\n')
    else:
      for path in sys.argv:
        error |= self.beautify_file(path)
    sys.exit((0,1)[error])

# if not called as a module
if(__name__ == '__main__'):
  BeautifyBash().main()


반응형

휘발유를 영어로 쓰면 가솔린(Gasoline)이며, 경유는 디젤(Diesel)이다.


처음 차량 운전을 시작하는 초보운전자이거나, 첫차를 운전하는 사람들은


주유소에 들어가면 혼동하기 쉬운 용어이다.


쉽게 숙지하기 위해 아래 내용을 참고바란다.



휘.발.유.  =  가.솔.린.

둘다 3글자

경.유.  =  디.젤.

둘다 2글자


휘발유와 가솔린, 경유와 디젤 모두 글자수가 각각 같기 때문에


위처럼 숙지하는것이 쉽고 편하다.


+ Recent posts