Programming/C++ STL2016. 6. 22. 13:24

변수들에 붙는건 뻔하지만

const가 cpp에서 확장된 내용

멤버 함수일때 멤버 변수를 수정하지 못하도록 하는 기능 추가


return_type fuction_name(val ...) const


[링크 : http://blog.daum.net/coolprogramming/60]

'Programming > C++ STL' 카테고리의 다른 글

cpp 클래스 구성  (0) 2016.07.11
cpp enum in class  (0) 2016.07.01
const 멤버 변수 초기화(member variable initializer)  (0) 2016.06.22
std::endl  (0) 2015.06.24
c++ 현변환 연산자(cast operator in c++)  (0) 2015.01.26
Posted by 구차니
프로그램 사용/gcc2016. 6. 22. 12:25

-f 니까 플래그고

PIC(Position Independent Code)

[링크 : http://devanix.tistory.com/198]


-shared 하면 자동으로 -fpic나 -fPIC가 설정되는건 아닌듯?

아무튼. .x86에는 연관이 없지만, 다른 아키텍쳐에서는 GOT 크기 문제로 -fpic와 -fPIC가 다르게 적용된다고 한다.

-shared

Produce a shared object which can then be linked with other objects to form an executable. Not all systems support this option. For predictable results, you must also specify the same set of options that were used to generate code (-fpic, -fPIC, or model suboptions) when you specify this option.[1]


-fpic

Generate position-independent code ( PIC ) suitable for use in a shared library, if supported for the target machine. Such code accesses all constant addresses through a global offset table ( GOT ). The dynamic loader resolves the GOT entries when the program starts (the dynamic loader is not part of GCC ; it is part of the operating system). If the GOT size for the linked executable exceeds a machine-specific maximum size, you get an error message from the linker indicating that -fpic does not work; in that case, recompile with -fPIC instead. (These maximums are 8k on the SPARC and 32k on the m68k and RS/6000 . The 386 has no such limit.)

Position-independent code requires special support, and therefore works only on certain machines. For the 386, GCC supports PIC for System V but not for the Sun 386i. Code generated for the IBM RS/6000 is always position-independent.


When this flag is set, the macros "__pic__" and "__PIC__" are defined to 1.


-fPIC

If supported for the target machine, emit position-independent code, suitable for dynamic linking and avoiding any limit on the size of the global offset table. This option makes a difference on the m68k, PowerPC and SPARC .

Position-independent code requires special support, and therefore works only on certain machines.


When this flag is set, the macros "__pic__" and "__PIC__" are defined to 2.


-fpie

-fPIE

These options are similar to -fpic and -fPIC, but generated position independent code can be only linked into executables. Usually these options are used when -pie GCC option will be used during linking.

-fpie and -fPIE both define the macros "__pie__" and "__PIE__". The macros have the value 1 for -fpie and 2 for -fPIE. 

[링크 : http://linux.die.net/man/1/gcc]




Pseudo-assembly:


PIC: This would work whether the code was at address 100 or 1000

100: COMPARE REG1, REG2

101: JUMP_IF_EQUAL CURRENT+10

...

111: NOP


Non-PIC: This will only work if the code is at address 100

100: COMPARE REG1, REG2

101: JUMP_IF_EQUAL 111

...

111: NOP


If your code is compiled with -fPIC, it's suitable for inclusion in a library - the library must be able to be relocated from its preferred location in memory to another address, there could be another already loaded library at the address your library prefers. 

[링크 : http://stackoverflow.com/questions/5311515/gcc-fpic-option?rq=1]

'프로그램 사용 > gcc' 카테고리의 다른 글

gcc 매크로 확장 define stringfication  (0) 2017.01.02
gcc make CFLAGS=-D 관련  (0) 2016.11.17
gcc dependency .d 파일?  (0) 2016.03.28
gcc -M -MM  (0) 2015.12.17
gcc 초기화 관련  (0) 2015.10.21
Posted by 구차니
Programming/C++ STL2016. 6. 22. 11:04

const 변수들의 경우 생성자(constructor)에서 초기화 불가능 하므로

(생성시에 이미 const로 만들어져 수정이 불가하니까)

문법적 허용을 위한 우회책으로 initializer 가 존재해야만 한다.


class Something

{

private:

    int m_value1;

    double m_value2;

    char m_value3;

 

public:

    Something() : m_value1(1), m_value2(2.2), m_value3('c') // directly initialize our member variables

    {

    // No need for assignment here

    }

 

    void print()

    {

         std::cout << "Something(" << m_value1 << ", " << m_value2 << ", " << m_value3 << ")\n";

    }

};

 

int main()

{

    Something something;

    something.print();

    return 0;

[링크 : http://www.learncpp.com/cpp-tutorial/8-5a-constructor-member-initializer-lists/]



[링크 : http://pacs.tistory.com/entry/C-클래스에서의-멤버-변수-멘버-함수의-상수화-const의-사용법]

[링크 : http://pacs.tistory.com/4] const란



+

처음에는 다중상속인줄... 망할 -_-

'Programming > C++ STL' 카테고리의 다른 글

cpp enum in class  (0) 2016.07.01
cpp const  (0) 2016.06.22
std::endl  (0) 2015.06.24
c++ 현변환 연산자(cast operator in c++)  (0) 2015.01.26
functor / 펑터  (0) 2014.04.16
Posted by 구차니
embeded/raspberry pi2016. 6. 21. 21:17

'embeded > raspberry pi' 카테고리의 다른 글

beowulf / openMPI  (0) 2016.06.28
redmine on raspberrypi  (9) 2016.06.23
라즈베리 파이 카메라(rpi cam) 렌즈 교체..  (2) 2016.06.18
raspivid - H264 SPS PPS?  (0) 2016.06.10
raspistill 빠르게 사진 찍기  (0) 2016.06.09
Posted by 구차니

ubuntu 12.04 LTS의 경우

기본 값이 비어 있어서 편집기가 제대로 실행하질 못해서 바보 되는 듯..

기본 값은 editor로 되어 있는데.. ubuntu 특성인진 모르겠으나.

svn에서 무언가 엉겨서 nano나 editor로 연결되면서 부터 바보가 됨

vi로 설정해주어도 화면 출력이 이상하게 엉겨서 먹통이 되어버리니 주의..


$ cat ~/.bashrc

export SVN_EDITOR=/usr/bin/vim


$ cat $HOME/.subversion/config

### This file configures various client-side behaviors.

###

### The commented-out examples below are intended to demonstrate

### how to use this file.


### Section for authentication and authorization customizations.

[auth]

### Set password stores used by Subversion. They should be

### delimited by spaces or commas. The order of values determines

### the order in which password stores are used.

### Valid password stores:

###   gnome-keyring        (Unix-like systems)

###   kwallet              (Unix-like systems)

###   keychain             (Mac OS X)

###   windows-cryptoapi    (Windows)

# password-stores = gnome-keyring,kwallet

###

### Set KWallet wallet used by Subversion. If empty or unset,

### then the default network wallet will be used.

# kwallet-wallet =

###

### Include PID (Process ID) in Subversion application name when

### using KWallet. It defaults to 'no'.

# kwallet-svn-application-name-with-pid = yes

###

### The rest of this section in this file has been deprecated.

### Both 'store-passwords' and 'store-auth-creds' can now be

### specified in the 'servers' file in your config directory.

### Anything specified in this section is overridden by settings

### specified in the 'servers' file.

###

### Set store-passwords to 'no' to avoid storing passwords in the

### auth/ area of your config directory.  It defaults to 'yes',

### but Subversion will never save your password to disk in

### plaintext unless you tell it to (see the 'servers' file).

### Note that this option only prevents saving of *new* passwords;

### it doesn't invalidate existing passwords.  (To do that, remove

### the cache files by hand as described in the Subversion book.)

# store-passwords = no

### Set store-auth-creds to 'no' to avoid storing any subversion

### credentials in the auth/ area of your config directory.

### It defaults to 'yes'.  Note that this option only prevents

### saving of *new* credentials;  it doesn't invalidate existing

### caches.  (To do that, remove the cache files by hand.)

# store-auth-creds = no


### Section for configuring external helper applications.

[helpers]

### Set editor-cmd to the command used to invoke your text editor.

###   This will override the environment variables that Subversion

###   examines by default to find this information ($EDITOR,

###   et al).

# editor-cmd = editor (vi, emacs, notepad, etc.)

### Set diff-cmd to the absolute path of your 'diff' program.

###   This will override the compile-time default, which is to use

###   Subversion's internal diff implementation.

# diff-cmd = diff_program (diff, gdiff, etc.)

### Set diff3-cmd to the absolute path of your 'diff3' program.

###   This will override the compile-time default, which is to use

###   Subversion's internal diff3 implementation.

# diff3-cmd = diff3_program (diff3, gdiff3, etc.)

### Set diff3-has-program-arg to 'yes' if your 'diff3' program

###   accepts the '--diff-program' option.

# diff3-has-program-arg = [yes | no]

### Set merge-tool-cmd to the command used to invoke your external

### merging tool of choice. Subversion will pass 4 arguments to

### the specified command: base theirs mine merged

# merge-tool-cmd = merge_command


### Section for configuring tunnel agents.

[tunnels]

### Configure svn protocol tunnel schemes here.  By default, only

### the 'ssh' scheme is defined.  You can define other schemes to

### be used with 'svn+scheme://hostname/path' URLs.  A scheme

### definition is simply a command, optionally prefixed by an

### environment variable name which can override the command if it

### is defined.  The command (or environment variable) may contain

### arguments, using standard shell quoting for arguments with

### spaces.  The command will be invoked as:

###   <command> <hostname> svnserve -t

### (If the URL includes a username, then the hostname will be

### passed to the tunnel agent as <user>@<hostname>.)  If the

### built-in ssh scheme were not predefined, it could be defined

### as:

# ssh = $SVN_SSH ssh -q -o ControlMaster=no

### If you wanted to define a new 'rsh' scheme, to be used with

### 'svn+rsh:' URLs, you could do so as follows:

# rsh = rsh

### Or, if you wanted to specify a full path and arguments:

# rsh = /path/to/rsh -l myusername

### On Windows, if you are specifying a full path to a command,

### use a forward slash (/) or a paired backslash (\\) as the

### path separator.  A single backslash will be treated as an

### escape for the following character.


### Section for configuring miscelleneous Subversion options.

[miscellany]

### Set global-ignores to a set of whitespace-delimited globs

### which Subversion will ignore in its 'status' output, and

### while importing or adding files and directories.

### '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'.

# global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo

#   *.rej *~ #*# .#* .*.swp .DS_Store

### Set log-encoding to the default encoding for log messages

# log-encoding = latin1

### Set use-commit-times to make checkout/update/switch/revert

### put last-committed timestamps on every file touched.

# use-commit-times = yes

### Set no-unlock to prevent 'svn commit' from automatically

### releasing locks on files.

# no-unlock = yes

### Set mime-types-file to a MIME type registry file, used to

### provide hints to Subversion's MIME type auto-detection

### algorithm.

# mime-types-file = /path/to/mime.types

### Set preserved-conflict-file-exts to a whitespace-delimited

### list of patterns matching file extensions which should be

### preserved in generated conflict file names.  By default,

### conflict files use custom extensions.

# preserved-conflict-file-exts = doc ppt xls od?

### Set enable-auto-props to 'yes' to enable automatic properties

### for 'svn add' and 'svn import', it defaults to 'no'.

### Automatic properties are defined in the section 'auto-props'.

# enable-auto-props = yes

### Set interactive-conflicts to 'no' to disable interactive

### conflict resolution prompting.  It defaults to 'yes'.

# interactive-conflicts = no


### Section for configuring automatic properties.

[auto-props]

### The format of the entries is:

###   file-name-pattern = propname[=value][;propname[=value]...]

### The file-name-pattern can contain wildcards (such as '*' and

### '?').  All entries which match (case-insensitively) will be

### applied to the file.  Note that auto-props functionality

### must be enabled, which is typically done by setting the

### 'enable-auto-props' option.

# *.c = svn:eol-style=native

# *.cpp = svn:eol-style=native

# *.h = svn:keywords=Author Date Id Rev URL;svn:eol-style=native

# *.dsp = svn:eol-style=CRLF

# *.dsw = svn:eol-style=CRLF

# *.sh = svn:eol-style=native;svn:executable

# *.txt = svn:eol-style=native;svn:keywords=Author Date Id Rev URL;

# *.png = svn:mime-type=image/png

# *.jpg = svn:mime-type=image/jpeg

# Makefile = svn:eol-style=native 


[링크 : http://stackoverflow.com/questions/6506653/change-svn-message-editor]



+

SVN_EDITOR=gedit 하거나 하면 우회는 가능하지만..

아무튼 STDOUT tty 문제로 보이긴 한데.. 해결책은 없는건가..

svn과 검색을 해도 도통안나옴..


Vim: Warning: Output is not to a terminal

[링크 : http://stackoverflow.com/questions/19290604/how-to-set-svnignore-without-opening-an-editor]

[링크 : http://stackoverflow.com/questions/1690274/how-do-i-launch-an-editor-from-a-shell-script]


[링크 : http://stackoverflow.com/../getting-error-trying-to-commit-using-subversion-on-mac-os-x]

'프로그램 사용 > Version Control' 카테고리의 다른 글

svn+ssh 실패 -_-  (0) 2016.07.29
svn list 에러 generic failure  (0) 2016.06.23
svn relocate / ubuntu  (0) 2016.06.21
svn merge... 두근두근  (6) 2016.02.17
tortoiseSVN merge 페이지 번역  (0) 2015.12.02
Posted by 구차니

계륵이로다...


22mm 로 f2.0 맞추면 밝은데.. AF가 느린데다 심도가 얕아서 놓치고(물론 코앞에 똥강아지...)

18-55mm로 하면 f5.0 정도인데.. AF는 빠르지만 셔터속도가 확보가 안되서 놓치고(게다가 배터리 광탈)


결론은 멀 하던 놓침 ㅋㅋㅋ

아버지의 eos 550d를 써보면.. 역시 망할 캐논 contrast AF..

광학뷰파인더의 위상차 AF는 잘만 칼로 LTE 속도로 잡아 내더니만...




+

플래시 해보면.. 멀하던 느림 ㅋㅋㅋ

셔터랙이라고 해야하나.. 전환속도에 놓치고

저장랙이라고 해야하나? 후 딜레이에 또 놓치고 ㅋㅋㅋ



그럼에도 불구하고 22mm 꽂아놓고 쓰면

가볍고 화질 좋고(극히 드물게 한두장 겨우 건지지만 어짜피 한두장 겨우 건지는건 언제나 똑같으니?ㅋㅋ)

부담없는 똑딱이 느낌으로? ㅋㅋ

'하드웨어 > 캡쳐보드 카메라' 카테고리의 다른 글

수평계 악세사리  (0) 2016.08.22
eos m 리모컨 bulb 촬영  (0) 2016.08.12
심심해서 플래시 테스트  (0) 2016.05.31
EF-M / EF-S 마운트의 표기...?  (0) 2016.05.30
eos m 20일 사용 중간정산(?)  (0) 2016.05.30
Posted by 구차니

ubuntu 10.04 LTS 사용중이라 그런지 버전이 낮아서 svn relocate가 안보인다!

$ svn help

사용법: svn <subcommand> [options] [args]

Subversion 명령행 클라이언트 버전 1.6.17.

'svn help <subcommand>'를 사용하여 특정 명령에 대하여 도움말을 얻으십시오.

'svn --version'를 사용하여 버전과 원격접속 모듈에 대한 정보를 얻으십시오.

 또는 'svn --version --quiet'를 사용하여 버전 정보만 얻으십시오.


대부분의 부속 명령어들은 재귀적으로 수행하면서 파일이나 디렉토리를 인자로 취합니다.

명령들에 인자가 주어지지 않으면 현재 디렉토리를 포함하여 재귀적으로 수행하게

됩니다.


가능한 명령:

   add

   blame (praise, annotate, ann)

   cat

   changelist (cl)

   checkout (co)

   cleanup

   commit (ci)

   copy (cp)

   delete (del, remove, rm)

   diff (di)

   export

   help (?, h)

   import

   info

   list (ls)

   lock

   log

   merge

   mergeinfo

   mkdir

   move (mv, rename, ren)

   propdel (pdel, pd)

   propedit (pedit, pe)

   propget (pget, pg)

   proplist (plist, pl)

   propset (pset, ps)

   resolve

   resolved

   revert

   status (stat, st)

   switch (sw)

   unlock

   update (up)


Subversion은 형상관리를 위한 도구입니다.

더 상세한 정보를 위해서는 http://subversion.tigris.org/ 를 방문하세요. 


$ svn --version

svn, 버젼 1.6.17 (r1128011)

    Aug 20 2015, 15:17:45에 컴파일 됨



svn switch --relocate http://old-url https://new-url

[링크 : http://stackoverflow.com/questions/1396368/how-can-i-switch-a-subversion-repository-using-only-command-line-tools]

'프로그램 사용 > Version Control' 카테고리의 다른 글

svn list 에러 generic failure  (0) 2016.06.23
svn 콘솔 에디터(주석)  (0) 2016.06.21
svn merge... 두근두근  (6) 2016.02.17
tortoiseSVN merge 페이지 번역  (0) 2015.12.02
svnadmin dump로 덤프/합치기  (0) 2015.11.26
Posted by 구차니
하드웨어/Storage2016. 6. 20. 15:13


공식적으로는 미지원

[링크 : https://www.synology.com/en-global/knowledgebase/DSM/help/SVN/svn]


ipkg를 이용해서 강제로 설치는 가능 한 듯

[링크 : http://www.deviak.com/2690163]

[링크 : https://en.wikipedia.org/wiki/Ipkg]



'하드웨어 > Storage' 카테고리의 다른 글

synology opensource  (0) 2016.06.23
synology ds215+ cpuinfo  (4) 2016.06.23
synology MFP 복합기(삼성 SCX-4623) 스캔  (0) 2016.06.14
synology ds215+ 설치  (0) 2016.06.10
synology redmine...  (0) 2016.06.10
Posted by 구차니
embeded/raspberry pi2016. 6. 18. 15:19

회사에 굴러 다니는 것들이 있어서 바꿔보니..

은근 화각 차이가 크다는걸 느낌..

확실히 숫자가 적을 수록 광각이네


rpicam 기본 렌즈 (한.. 5~6mm 되려나?)

Camera specifications

  • CCD size : 1/4inch
  • Aperture (F) : 2.0
  • Focal Length : 6MM (adjustable)
  • Diagonal : 75.7 degree
  • Sensor best resolution : 1080p

[링크 : http://eleparts.co.kr/EPXD4BBD]


4.5mm lens 1/2.7


4.0mm lens 1/2.7


정체불명의 렌즈.. (3mm 쯤 하려나?)



표준은 S마운트 M12 0.5mm pitch 짜리

[링크 : https://en.wikipedia.org/wiki/S-mount_(CCTV_lens)]

[링크 : https://en.wikipedia.org/wiki/C_mount]



+

막상 사려니 비싸네.. 회사꺼 뽀릴까?

센서 크기가 1/4 인치래서.. 2mm 짜리 박아도(1.5만 ㅠㅠ) 화각이 122도..

3.6mm 정도는 되어야 60도 화각이 나오는구나..


[링크 : http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=A700563953]

'embeded > raspberry pi' 카테고리의 다른 글

redmine on raspberrypi  (9) 2016.06.23
gsteamer rtspsink  (0) 2016.06.21
raspivid - H264 SPS PPS?  (0) 2016.06.10
raspistill 빠르게 사진 찍기  (0) 2016.06.09
라즈베리 파이 gstreamer / vlc ... 실패?  (0) 2016.05.27
Posted by 구차니

pipeline 다음 룰은 순서대로

이걸 이용하면 병렬처리 룰도 간단해질지도?



release:

    $(MAKE) clean

    $(MAKE) test1


release: | clean test1

[링크 : http://stackoverflow.com/questions/8496135/parallel-makefile-require-depency-ordering]


Occasionally, however, you have a situation where you want to impose a specific ordering on the rules to be invoked without forcing the target to be updated if one of those rules is executed. In that case, you want to define order-only prerequisites. Order-only prerequisites can be specified by placing a pipe symbol (|) in the prerequisites list: any prerequisites to the left of the pipe symbol are normal; any prerequisites to the right are order-only:


targets : normal-prerequisites | order-only-prerequisites

[링크 : https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html]


'프로그램 사용 > make, configure' 카테고리의 다른 글

cmake 옵션 확인  (0) 2021.01.20
cmake 빌드 에러시  (0) 2021.01.19
make /bin/sh: 1: pushd: not found 에러  (0) 2016.06.08
make 기본셸  (0) 2016.06.08
makefile := = 차이점  (0) 2016.06.04
Posted by 구차니