2014년 8월 7일 목요일

Windows 환경에서 grep을 대체하는 findstr

유닉스 계열의 OS에서 제공되는 grep이 Windows 계열 OS에서 제공되지 않아
불편하였는데 아래의 링크를 참조하여

http://hwangmin84.tistory.com/9

Windows 환경에서 grep 대신 findstr을 쓸 수 있다는 것을 알았음.
사용 예제는 아래와 같음

  1. 현재 경로에서 하위 디렉토리를 포함에 위치에 있는 *.cs 파일의 내용 중 SendMessage라는 문자열이 포함된 부분을 찾기 위해서 아래와 같이 실행한다.

    CMD> findstr /s SendMessage *.cs

  2. dir 명령 실행 결과에서 Sample 이라는 문자가 포함된 행을 찾기 위해
    아래와 같이 실행한다.

    CMD> dir |findstr SendMessage


2014년 7월 11일 금요일

실력 있는 프로그래머가 되기 위한 7가지 방법

실력 있는 프로그래머가 되기 위한 7가지 방법 : 여러분의 기술이 성장하도록 도움을 주는 훌륭한 팁들 (from 한빛미디어)
http://www.hanbit.co.kr/network/view.html?bi_id=1950

시간날 때 한번 읽어볼 글...

2014년 3월 14일 금요일

C#에서 Double, Float 변수값이 NaN인지 비교

NaN은 Not a Number의 줄임말.

Double, Float의 기본 값으로 NaN을 사용할 때 == 비교 연산자를 사용하면
false를 리턴하므로 주의가 요망됨

따라서 아래의 방법으로 비교를 해야 함

double d;
float f;

if(double.IsNaN(d) == true)
  ...

if(float.IsNaN(f) == true)
 ...

혹은

if(d.Equals(double.NaN) == true)
...

if(f.Equals(float.NaN) == true)
...

2014년 3월 9일 일요일

Raspberry Pi 팁..

네트워크 설정

출처: http://www.neil-black.co.uk/raspberry-pi-beginners-guide#.Uxxb-Pl_uzg

sudo nano /etc/network/interfaces
This will bring up the network interface configuration file in the nano text editor. The word sudo simply runs this command with super user privileges.
You can save yourself a lot of time at the Linux command prompt by using Tab to auto complete.
You should see:
iface lo inet loopback
iface eth0 inet dhcp
Change this to (your IP details maybe different depending what you got from ipconfig):
iface lo inet loopback
iface eth0 inet static
address 192.168.1.150
netmask 255.255.255.0
gateway 192.168.1.1
Use Ctrl X to exit. Hit Y when prompted to save.
Now restart the network interface to apply changes without a reboot:
sudo /etc/init.d/networking stop
Followed by (can you guess?):
sudo /etc/init.d/networking start
Now your Raspberry Pi will always have the same IP address. Try pinging it from the Windows command Prompt:
ping 192.168.1.150


2014년 3월 8일 토요일

MS-SQL에서 SELECT 결과에서 UPDATE 수행하기

출처: http://stackoverflow.com/questions/2334712/update-from-select-using-sql-server

UPDATE
    Table
SET
    Table.col1 = other_table.col1,
    Table.col2 = other_table.col2
FROM
    Table
INNER JOIN
    other_table
ON
    Table.id = other_table.id