Windows10 에서 Linux 를 사용하는 글을 발견하여 링크를 남깁니다.


https://medium.com/@rkttu/start-java-dev-with-win-10-402cb91126fd


https://medium.com/@rkttu/windows-10%EC%97%90%EC%84%9C-%EB%A6%AC%EB%88%85%EC%8A%A4%EC%9A%A9-%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%A8-%EC%84%A4%EC%B9%98%ED%95%98%EA%B3%A0-%EC%8B%A4%ED%96%89%ED%95%98%EA%B8%B0-2cb0d7892d12

오늘도 Visual Studio Extension 입니다. ㅎㅎ


오늘은 검색하다가 발견한 링크하나만 투척합니다.


https://hmemcpy.com/2015/10/7-open-source-visual-studio-extensions-to-make-your-life-easier/

정말 오래간만에 블로그에 왔네요..

방금 휴면상태를 풀었다는... ㅋ


오늘은 Visual Studio Extension 중에 제가 사용하는 extension 하나를 소개할까 합니다.


Debug Command Line 입니다.

Link : https://marketplace.visualstudio.com/items?itemName=SamHarwell.DebugCommandLine


기능은 Debug 시작시 넘기는 arguments 를 toolbar 에 추가하고

필요시에 toolbar 에서 선택해서 arguments 를 쉽게 변경하여 실행할 수 있게 해주는 기능입니다.


지원하는 버전은 Visual Studio 2012 ~ 2017 까지 지원하니 참고하세요~






개발자라면 언젠가는 사용하게되는 것이 버전관리툴(svn, git, ...)과 Issue Tracker 죠.


오늘은 TortoiseGit 과 issue tracker 를 연동하는 법을 소개하겠습니다.(단순히 issue 번호에 link 거는 정도 까지만 입니다.)


TortoiseGit 으로 Local 저장소를 준비해주세요.


그리고 연동할 Issue Tracker 도 있어야겠죠?


윈도우 탐색기에서 Local 저장소를 선택 후 우클릭 하고 


TortoiseGit -> Settings 클릭하면 아래와 같은 화면이 뜹니다.






- Hook Scripts/Issue Tracker Config 를 선택

- Config source 는 공통적으로 적용할 예정이므로 Global 을 선택했습니다.

- bugtraq.url : http://my_mantis/view.php?id=%BUGID% <- (요건 제가 사용중인 MantisBt 이니, 각자가 사용하고자 하는 IssueTracker 의 url 을 넣으셔야 합니다)

- bugtraq.message : %BUGID%

- bugtraq.logregex : Test 버튼 눌러서 입력합니다.


  


Message part expression : [Ii]ssues?:?(\s*(,|and)?\s*#\d+)+

Bug-ID expression : (\d+)


- 이제 설정이 완료되었습니다.


- git commit log 작성시 Tester 의 Sample text 처럼 입력하면 log 확인창에 아래와 같이 issue 번호에 링크가 걸리게 됩니다.




이제 링크를 클릭하여 Issue Tracker 의 해당 이슈가 보이면 성공이죠~


이상으로 TortoiseGit 에 Issue Tracker 연동 방법에 대한 정리를 마치겠습니다~~ 






   

http://fmtlib.net/3.0.0/index.html

   

c, c++ 에서 프로그래밍을 할 때 printf, sprintf 등과 같은 함수들을 자주 사용하시죠?

로그를 남기거나 문자열을 조합하거나 할 때 전 보통 아래와 같이 쓰곤 했습니다.

   

std::string my_name = "simmanix";
int age = 26;  // 네.. 거짓말입니다... 20 대로 돌아가고 싶네요.. ㅜㅜ

char szMyInfo[256];
sprintf( szMyInfo, "name = %s, age = %d", my_name.c_str(), age );

   

그러다가 가끔 실수로

sprintf( szMyInfo, "name = %s, age = %d", my_name, age );

이렇게 해서 낭패를 보기도 하죠.(컴파일 에러가 안나죠 ;;;;)

조합할 내용이 많을 경우 %s,%d,%c,%u, 등등 타입에 맞게 순서를 지켜야 하는 번거로움도 있습니다.


그리고 저의 경우 format string 을 외부파일로 만들어서

c++ 프로그램과 c# 프로그램이 공용으로 사용해야하는 경우가 있었습니다.

이런 문제들을 해결해야 했고 그렇다고 직접 구현하기는 너무 귀찮았습니다.

(사실 능력이 부족합니다.. ㅜㅜ)

결국 구글링한 끝에 cppformat 이라는 라이브러리를 발견하고는 바로 적용했습니다.


cppformat 은 cross-platform 이며, c의 printf 방식으로도 사용할 수 있고 c# 방식으로도 사용할 수 있습니다.

간단하게 위에서 예를 들었던 코드를 cppformat 으로 써서 c# 방식으로 바꿔보겠습니다.


std::string my_name = "simmanix";
int age = 26;  // 네.. 거짓말입니다... 20 대로 돌아가고 싶네요.. ㅜㅜ
//char szMyInfo[256];

/*
sprintf( szMyInfo, "name = %s, age = %d", my_name, age );
std::string my_string = szMyInfo;
*/

std::string my_string = fmt::format( "name = {}, age = {}", my_name, age );


변화를 감지하셨나요?

%s,%d 가 없어지고 {},{} 로 대체되었습니다.

이제 자료형에 따른 %s,%d 사용 그리고 나열순서에서 해방될 수 있습니다.


이 외에 특별한 형태로 출력해야 하는 경우도 지원하고 있는데

자세한 설명은 link 로 대신하겠습니다.


http://fmtlib.net/latest/api.html

http://fmtlib.net/3.0.0/syntax.html


cppformat 은 window 및 linux 에서도 정상적으로 동작하는 것을 확인했습니다. 

자주 쓰는 프로그램을 빠르게 실행하기 위한 방법을 소개합니다.

   

  • AutoHotKey : 단축키 형식으로 특정프로그램을 등록해서 사용하기 편함.
  • Launchy : 단축키로 등록할 정도는 아니지만 나름 빈번하게 사용하는 프로그램을 실행할 때 사용하면 좋을 듯 함.(www.launchy.net)

   

AutoHotKey 는 이전에 소개한 바가 있으니 참고하시길~(http://simmanix.tistory.com/42)

   

Launchy 는 윈도우에 설치된 프로그램들은 기본적으로 등록되고, 별도로 바로가기(.lnk)들을 모아놓고 해당 폴더를 추가로 지정할 수 도 있습니다.(포터블 프로그램들에 적합.)

   

   

설치

   

http://www.launchy.net/download.php <- 여기 가서 다운로드 받습니다.(설치과정은 생략합니다.)

   

설치가 완료되면 우선 Launchy 실행을 위한 단축키 부터 확인해야 합니다.

   

Tray 에

   

위와 같이 생긴 Icon 에 마우스 우클릭을 하면

   

   

이런 Context Menu 가 뜹니다.

여기서 Options 를 선택합니다.

   

   

   

   

실행

   

자 그럼 Launchy 를 통해 그림판을 실행해보자.(각자 취향의 스킨으로도 변경할 수 있습니다.)

Alt + Space 를 누른 후 Paint 를 입력해보세요.

   

   

   

보는 바와 같이 그림판을 실행하기 위해 Pa까지만 입력해도 Paint 가 목록에 보입니다.(오~~~)

윈도우에 설치된 프로그램은 대부분 적용되지만, 실행파일만 있는 프로그램이나 별도의 설치과정이 없는 Portable 프로그램등은

   

   

위와 같이 Catalog 에 바로가기들을 모아놓은 폴더를 추가하는 방식으로 사용할 수 있습니다.

(위의 경우는 D:\Shortcuts 에 그런 프로그램들의 바로가기를 모아놓고 Catalog 에 추가한 뒤 Rescan Catalog 를 한 경우입니다.)

   

지금까지가 Launcher 의 기본적인 사용법이었습니다.

이 외에도 괜찮은 기능들이 많이 있으니 자신에게 맞는 기능을 찾아서 보다 편하게 사용하시길 바랍니다.


'Util' 카테고리의 다른 글

AutoHotKey example  (0) 2016.05.24
PPTLauncher - 파워포인트 PowerPoint 다중 실행  (0) 2010.06.21

로그파일을 분석할 때 여러 문자열을 동시에 검색하고 싶을 때가 있다.


Start, End, Req, Res 등을 같이 검색하는 경우 등이다.


Notepad++ 에서 아래와 같이 검색하면 된다.


(Start|End) | (Req|Res)


특정문자열로 끝나는 문자열을 검색해보자.


찾고 싶은 것이 예를들어 ".tga" 라면


다음과 같이 검색하면 된다.


^.*.tga$


해석:

 ^

 줄이나 문자열의 시작 

 일반적으로 새 줄을 제외한 모든 문자를 의미한다.

\.tga

 .tga

 $

 줄이나 문자열의 끝



저는 AutoHotKey 는 오래전부터 사용하고 있었습니다.


자주사용하는 문구나 프로그램 등을 단축키 등록하여 사용해왔죠.


제가 현재 사용중인 AutoHotKey.ahk 파일의 내용을 뿌리니 참고하세요~


AutoHotKey.ahk

; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a
; semicolon, such as this one, are comments.  They are not executed.

; This script has a special filename and path because it is automatically
; launched when you run the program directly.  Also, any text file whose
; name ends in .ahk is associated with the program, which means that it
; can be launched simply by double-clicking it.  You can have as many .ahk
; files as you want, located in any folder.  You can also run more than
; one ahk file simultaneously and each will get its own tray icon.

; SAMPLE HOTKEYS: Below are two sample hotkeys.  The first is Win+Z and it
; launches a web site in the default browser.  The second is Control+Alt+N
; and it launches a new Notepad window (or activates an existing one).  To
; try out these hotkeys, run AutoHotkey again, which will load this file.

; # : window key
; ^ : control key
; ! : alt key

; Note: From now on whenever you run AutoHotkey directly, this script
; will be loaded.  So feel free to customize it to suit your needs.

; Please read the QUICK-START TUTORIAL near the top of the help file.
; It explains how to perform common automation tasks such as sending
; keystrokes and mouse clicks.  It also explains more about hotkeys.

; Esc Key 를 더블클릭 했을 때 현재 윈도우 최소화하기.
;~Esc:: 
;if (A_PriorHotkey <> "~Esc" or A_TimeSincePriorHotkey > 400) 
;{ 
;    ; Too much time between presses, so this isn't a double-press. 
;    KeyWait, Esc 
;    return 
;} 
;WinMinimize, A 
;return 

;~LCtrl:: 
;if (A_PriorHotkey <> "~LCtrl" or A_TimeSincePriorHotkey > 400) 
;{ 
;    ; Too much time between presses, so this isn't a double-press. 
;    KeyWait, LCtrl 
;    return 
;} 

;InputBox, InputedString, Google Search, , , , 
;if ErrorLevel = 0
;{
;    Run, C:\Program Files\Internet Explorer\iexplore.exe "http://www.google.com/search?q="%InputedString%""
;}
;return 

;^!n::
;IfWinExist 제목 없음 - 메모장
;	WinActivate
;else
;	Run Notepad
;return

^!NumPad1::
	ret := IME_CHECK("A")
	if %ret% <> 0		; 한글모드일 경우
	{
		Toggle_IME()	; 영문모드로 변경
	}

	Send id{Tab}password{Return}
	if %ret% <> 0
	{
		Toggle_IME()	; 다시 한글모드로 원상복구
	}
return

^!NumPad2::
	ret := IME_CHECK("A")
	if %ret% <> 0		; 한글모드일 경우
	{
		Toggle_IME()	; 영문모드로 변경
	}

	VI_LOG := "cd /Log/ && vi ``ls -tr | grep run | tail -n 1;``"
	SendInput %VI_LOG%

	if %ret% <> 0
	{
		Toggle_IME()	; 다시 한글모드로 원상복구
	}
return

#`::Run C:\Program Files (x86)\Internet Explorer\iexplore.exe

;#c::
;IfWinExist AnalogX PCalc (www.analogx.com)
;	WinActivate
;else
;	Run C:\Program Files (x86)\AnalogX\PCalc\pcalc.exe
;return

#c::
Run C:\Program Files (x86)\SpeedCrunch\SpeedCrunch.exe
return

;#g::Run C:\Program Files (x86)\Internet Explorer\iexplore.exe www.google.com
#g::
InputBox, InputedString, Google Search, , , , 
if ErrorLevel = 0
{
    Run, C:\Users\simmanix\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Chrome\Chrome.lnk http://www.google.co.kr/search?q="%InputedString%"
}
return

#1::Run C:\Program Files (x86)\flyExplorer\flyExplorer.exe
#2::
IfWinExist 꼬마사전
	WinActivate
else
	Run C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Daum\Daum 꼬마사전\Daum 꼬마사전.lnk
return

#3::Run C:\Program Files (x86)\PuTTY\putty.exe
#4::Run D:\Downloads\Utils\SuperPutty-1.3.0.11\SuperPutty-1.3.0.11\SuperPutty.exe

#F1::Run C:\Users\simmanix\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Chrome\Chrome.lnk

#Insert::
FormatTime, TimeString,, yyyy년MM월dd일 HH시mm분
SendInput %TimeString%
return


#Delete::
FormatTime, TimeString,, yyyy-MM-dd HH:mm
SendInput %TimeString%
return

!`:: WinMinimize, A


#n::Run C:\Program Files (x86)\Notepad++\notepad++.exe -multiInst

^#NumpadAdd::
Send {Volume_Up}
return

^#NumpadSub::
Send {Volume_Down}
return

;<--------------------------------------------- 한영전환 스크립트 내용 --------------------------------------------->
; http://www.autohotkey.co.kr/cgi/board.php?bo_table=script&wr_id=357#c_724

Toggle_IME()
{
	Send, {vk15sc138}
}

IME_CHECK(WinTitle)
{
    WinGet,hWnd,ID,%WinTitle%
    Return Send_ImeControl(ImmGetDefaultIMEWnd(hWnd),0x005,"")
}

Send_ImeControl(DefaultIMEWnd, wParam, lParam)
{
	DetectSave := A_DetectHiddenWindows       
	DetectHiddenWindows,ON                          
	SendMessage 0x283, wParam,lParam,,ahk_id %DefaultIMEWnd%
	if (DetectSave <> A_DetectHiddenWindows)
		DetectHiddenWindows,%DetectSave%
	return ErrorLevel
}

ImmGetDefaultIMEWnd(hWnd)
{
	return DllCall("imm32\ImmGetDefaultIMEWnd", Uint,hWnd, Uint)
}

;!vk15sc1F2::                    ; I want Alt-[Eng/Han] key to be "Absolutely Hangul(Korean)" mode key. I hate toggling :(
;    ret := IME_CHECK("A")
;    if %ret% = 0                ; 0 means IME is in English mode now.
;    {
;        Send, {vk15sc138}       ; Turn IME into Hangul(Korean) mode.
;    }
;return
;^vk15sc1F2::                    ; I want Ctrl-[Eng/Han] key to be "Absolutely English" mode key. I hate toggling :(
;    ret := IME_CHECK("A")
;    if %ret% <> 0               ; 1 means IME is in Hangul(Korean) mode now.
;    {
;        Send, {vk15sc138}       ; Turn IME into English mode.
;    }
;return

'Util' 카테고리의 다른 글

[Quick Launcher] Launchy  (0) 2016.05.25
PPTLauncher - 파워포인트 PowerPoint 다중 실행  (0) 2010.06.21

윈도우 탐색기에서는 여러 폴더에 있는 특정 파일들을 복사하는 기능이 없죠.

저의 경우에는 업무상 여러 폴더에 있는 특정파일들을 다른 경로에 동일한 구조로 복사해야 하는 경우가 빈번합니다.


매번 탐색기로 작업을 하자니 너무 번거로와서 파워쉘로 만들어 봤습니다.

복사할 파일이 다를 경우 스크립트를 수정해야 하긴 하지만 하나하나 복사하는 것보다는 좀 더 수월합니다. 


자 스크립트 나갑니다.

# filename : copy_files.ps1
# author : simmanix
# date : 2016-05-18 16:40
 
$ROOT_DIR= $PSScriptRoot
echo $ROOT_DIR
$DEST_PATH="DestPath"
 
$Src_Nation="USA"
 
$Files = New-Object System.Collections.ArrayList
$Files += "TTF\TTFInfo.xml"
$Files += "Config\NationInfo.xml"
 
function fCopyFile ()
{
	$D_PATH=$args[0]
	$File=$args[1]
 
	If ( $args.Count -lt 2 )
	{
		return
	}
 
	echo "cur path = $D_PATH"
	echo "cur file = $File"
	echo "cp $ROOT_DIR\$DEST_PATH\$Src_Nation\$File $ROOT_DIR\$M_TYPE\$D_PATH\$File"
 
	& cp $ROOT_DIR\$DEST_PATH\$Src_Nation\$File $ROOT_DIR\$M_TYPE\$D_PATH\$File
}
 
cd .\$DEST_PATH
 
$ARR_NATION = Get-ChildItem -Directory -Name
 
for( $i = 0 ; $i -lt $ARR_NATION.Count ; $i++ )
{
	$NATION = $ARR_NATION[$i]
 
	If ( $Src_Nation -eq $NATION )
	{
		continue;
	}
 
	for( $j = 0 ; $j -lt $Files.Count ; $j++ )
	{
		fCopyFile $NATION $Files[$j]
	}
 
	cd $ROOT_DIR
}


설명


$Files += "여기에 복사하고자 하는 파일들을 추가합니다.txt"

$ARR_NATION -> 복사하고자 하는 대상 폴더입니다. 위에서는 특정 폴더내의 모든 폴더에 넣는 코드입니다. 여러분들은 $Files 처럼 만들고 사용하는 것이 좋겠죠?


나머지는 충분히 분석가능하리라 생각합니다.



'Programming > PowerShell' 카테고리의 다른 글

VisualStudio 의 빌드이벤트에 Powershell 사용하기  (0) 2016.05.24
PowerShell 설정  (0) 2016.05.24

+ Recent posts