2019년 12월 1일 일요일

업무 Case Study

1. 평균 비교
a. A 회사의 카메라를 B 회사에서 사용하고 있다.
b. B 회사는 차량 OEM 으로 Left, Right Mirror에 A 회사의 카메라를 사용하고 있다.
c. 그런데 Right Mirror 에서 각도의 편차가 Spec을 벗어 나는 것을 확인하였다.
d. 하지만 Left 에서는 각도의 편차가 Spec을 벗어나지 않았다.
e. 이 내용을 증명하기 위해서 Minitab 을 사용하였다.
f. 2 표본 t 검증 사용하였다.
g. Test 결과는 아래와 같았다.



h. 결과를 해석하는 것은 Minitab Web Page 에 설명되어 있다.(Link)
i. 직접 해석하자면 (1/2)
Left1 과 Left2 에 대해서 각각 수량, 평규, 표준편차를 보여준다.
평균의 표준오차는 익숙하지 않은 개념인데
평균의 표준 오차는 표본 간의 변동성을 추정하는 반면, 표준 편차는 단일 표본 내의 변동성을 측정합니다.
를 의미하며
평균의 표준 오차를 사용하여 표본의 평균이 모평균을 얼마나 정확하게 추정하는지 확인할 수 있습니다. 평균의 표준 오차의 하한 값은 모집단 평균의 더 정확한 추정치를 나타냅니다. 일반적으로, 표준 편차가 클수록 평균의 표준 오차가 더 크고 추정치가 덜 정확합니다. 표본 크기가 클수록 평균의 표준 오차가 더 작고 추정치가 더 정확하게 됩니다.
이라고 합니다.
그러면 궁금한 것은 표준오차가 어느정도 되어야 믿을 수 있는 것인가 인데 이부분은 남겨두고
j. 귀무 가설과 대립 가설
연구에서 검증하는 가설을 귀무가설이라고 하고 이와 대립되는 가설을 대립 가설이라고 한다.
P 값이 알파값(보통 0.05)보다 작으면 이 귀무가설을 따르지 않는다고 하고 알파값 보다 크면 귀무가설을 따른다고 한다.
k. 위에서는 귀무가설은 두 그룹의 평균이 0.01 차이가 난다(0.01이내로)
이때의 P 값은 Left 가 0.035 으로 귀무가설을 채택하지 않는다.
이때의 P 값은 Right 가 01.00 으로 귀무가설을 채택 한다.




2019년 10월 29일 화요일

matlab file load, save

1. what is mat file
MAT-files are binary MATLAB® files that store workspace variables.
matlab 에서 사용하는 binary 파일이다. 세부 형식은 matlab 고유의 방식이지 않을까

Starting with MAT-file Version 4, there are several subsequent versions of MAT-files that support an increasing set of features. MATLAB releases R2006b and later all support all MAT-file versions.
지금까자 여러 버전의 mat 파일이 존재하며 R2006b 부터는 모든 mat 파일이 지원된다고 하니 이후에는 업데이트 된 것이 없다고 봐야 하는 것인가.


2. load function
load('filename') 일 때는 filename 에 확장자가 명시되어 있으며 확장자를 따른다. mat 형식이나 ascii 형식이 있을 수 있다. 그래서 mat 이라고 적혀있지 않으면 ascii 형식으로 load 한다.
그래서 load('filename', '-mat') 으로 하면 확장자에 구애하지 않고 mat 파일을 load 한다.

3. save function
save('filename', '-struct', structName) 일 때 structName 구조체의 값들을 filename 에 개별 변수로 저장한다.
이 때 이렇게 저장한 filename 을 tmp_name = load('filename', 'mat') 으로 load 하면 tmp_name 이 structName 의 모든 변수를 가진 구조체가 된다.

2019년 7월 21일 일요일

MATLAB

단축키
    - 여러줄 주석 처리 ctrl + r
    - 여러줄 주석 해제 ctrl + t

2019년 7월 20일 토요일

Visual Studio Code - Python

1. python 실행파일 경로 연결할 때
    - settings.json 에서 경로를 지정해 준다.
{
"python.pythonPath": "C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python36\\python.exe",
"scm.alwaysShowActions": true,
"window.zoomLevel": -1,
"python.jediEnabled": false
}

2. Argument 줄 때
    - launch.json 에서 아래와 같이 args 안에 순서대로 입력

"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"args": [
"-s",
"00003521"
],
"cwd": "${fileDirname}"
},

3. file explorer 부를 때
    - ctrl + shift + E

4. 모든 커맨드를 실행할 때
    - ctrl + shift + p
    - show all command 라고 부른다.

5. 특정 파일을 부를 때
    - show all command 한 다음 launch.json 이나 settings.json 을 친다.

6. debug 진행
---
A debug toolbar appears along the top with the following commands from left to right: continue (F5), step over (F10), step into (F11), step out (Shift+F11), restart (Ctrl+Shift+F5), and stop (Shift+F5).
---
 
7. python version check
python -V

8. pyhton computer check
$ python-32 -c 'import sys;print("%x" % sys.maxsize, sys.maxsize > 2**32)'
('7fffffff', False)
$ python-64 -c 'import sys;print("%x" % sys.maxsize, sys.maxsize > 2**32)'
('7fffffffffffffff', True)

9. turtle 로 그림 그리기
    1) turtle 로 라인 그리기
    2) turtle 의 screen size 조정하기
    3) turtle 의 origin 설정하기
    4) pen  color 설정하기
    5) svg 이미지로 저장하기
    6) svg 이미지를 png 로 변환하기 https://pypi.org/project/svglib/













2019년 5월 19일 일요일

MFC C++ Note

특정 Cotrol 의 색을 변경하고 싶을 때
1. Dialog 의 Window Message 중 WM_CTLCOLOR 을 Enable 한다.
2. OnCtlColor 함수가 자동으로 생긴다.
3. OnCtlColor 함수는 Control이 보여주는 이벤트가 생길 때(Test 를 쓰거나 등) 불리게 된다. (참조: Link)
4. OnCtlColor 함수를 적어준다. (참조: Link)
5. 내가 원하는 특정 Control 만을 변경시키고 싶으면 각 case 안 해당 코드에 if 를 넣어주면 된다.



No 4
HBRUSH Cxxxxxx::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO:  Change any attributes of the DC here
switch(nCtlColor){
case CTLCOLOR_DLG:   /// 다이얼로그 배경색을 white로.
{        return (HBRUSH)GetStockObject(WHITE_BRUSH);
        break;
}
case CTLCOLOR_BTN :    // 버튼의 배경색을 투명으로...
{
        pDC->SetBkMode(TRANSPARENT);
                  return (HBRUSH)::GetStockObject(NULL_BRUSH);
        }
         case CTLCOLOR_STATIC:
        {
               pDC->SetTextColor(RGB(0,255,255));  // static text 글자색 변경
                 pDC->SetBkMode(TRANSPARENT);   // static text 배경색 투명
                 return (HBRUSH)::GetStockObject(NULL_BRUSH);
        }
}
// TODO:  Return a different brush if the default is not desired
return hbr;
}

2019년 4월 22일 월요일

Matlab

   
CSV 로 출력할 때
simulation_results = [FP_2_x(h,i), FP_2_y(h,i), R_2(1,i), R_2(2,i)-Da];
dlmwrite('C:\simulaton_results.csv', simulation_results, '-append');

dlmwrite('C:\FP_2_x__h_i.csv', FP_2_x(h,i));

2019년 3월 1일 금요일

Visual Studio 2017 노트

목적: Visual Studio 2017(이하 vs17) 로 opencv 를 사용하고 싶다.

1. opencv library를 찾아야 한다.
    1) 어떤 opencv version 을 사용할 것인지 정한다  
        - 기본 기능이 동작하는지 확인하는 것이므로 아무 version 상관없다.
        - vs17을 사용해야 하므로 vs17 지원하는 version이 필요하다. 
             + vs17 은 vc15(Visual Studio Compiler 15?) 를 써야 한다.
        -> 3.4.3 은 vs17 지원하므로 사용하기로 했다.
    2) opencv를 빌드 한다.
        - 배포되는 opencv 들은 필요한 binary 가 모두 빌드된 것이 아니라 추가된 기능한 빌드된 것이기 때문에 직접 빌드를 해야한다.
        - x64 컴퓨터라고 x64 실행하려고 하면 안된다 왜냐하면 dll 들이 거의 다 x86 이기 때문?
        - CMake/vs17 로 빌드하면 vs17 프로젝트 generate 가능하며 이 프로젝트로 빌드하면 필요한 dll 들을 생성할 수 있다. 이것들로 프로그램 실행하면 된다.
         - cmake 사용 방법
             https://stackoverflow.com/questions/43786856/how-can-i-install-configure-opencv3-2-0-with-c-visual-studio-2017
2. 빌드를 한 후에는 링크에 모든 lib 파일이름을 적어준다.

목적: Visual Studio Debug

debug 시작해도 관련 dll 을 로딩하는데 시간이 걸릴 수 있다.

2019년 2월 12일 화요일

2019년 1월 27일 일요일

Jordan Peterson | Full Address and Q&A | Oxford Union (Script)

Youtube Link: https://www.youtube.com/watch?v=UZMIbo_DxJk&t=2346s

'19/01/27
Open Remark - 00:00:52 ~ 00:11:11

Open Remark
So I'm going to talk to you today a little bit about hierarchy.
it's a small talk that I've been developing as I've been doing my public lectures over the last couple of weeks.
it's an elaboration(정교함) of some of the ideas I put forth in or some of my scientific writing in maps of meaning but more particularly in 12 rules for life and Rule one which is stand up straight with your shoulders back.
and it's in part of meditation on hierarchy
and I want to talk about the political significance of that and that you know how I've been trying to sort that out in my own imagination.
so I am going to put.. and I think it sheds light on(해결의 실마리를 던져주다) on the political on the nature of political debate itself and maybe deeper light on why temperamental(신결질적) factors might contribute to political political Framing and perception.
because we know that people tend to vote their temperament
although there are other reasons that influence their political allegiance(충성) and their voting behavior so let's start with a couple of simple observations

the first is that complex biological creatures and even simple biological creatures for that matter have to move forward in the world and so that's the case for any creature that's mobile and that goes all the way down to one celled organisms the idea that approach and avoidance are the fundamental motivations isn't very old biological idea and seems to apply across levels of analysis in the in the animal kingdom
and it is true for us as well
we have to move forward towards things because we have requirements there are things that we require to Keep Us Alive and to keep us wanting to be alive as well
and and those are different things and we move forward towards things that we value

so the two propositions there
the first is that we have to move forward because there are things to move forward to because there are things we need and want and the
second is that to move forward towards something is simultaneously value it and so one of the implications of that is that we always live in a framework a value there's no escaping that
and it removed for a detail that this out quite substantially in my book maps of meaning but we're always at my place and and and we're always moving towards a place that in principle has some advantage over the place we at
otherwise we move towards it and so what that means is that there's no life without value
at least there's no human life without value out of necessity
and also not only out of necessity at the physiological level but also out of necessity at the psychological level because another thing that you might point out that I think is usually pointed out has been not only do you have to move from point A to B in life but point A is often a very difficult place to be
because we're fragile and bounded and mortal and limited and because we know that and

so one of the implications of that as many great religious Traditions are paint to illustrate or demonstrate or Proclaim is that life is essentially suffering and I believe that to be a fundamental truth but but perhaps not the most fundamental truth because I think the most fundamental truth is that despite the fact that life is suffering people can transcend that and partly the way they transcend that is by pursuing things of value and so that if there is no value proposition at hand then you have no meaning to justify the difficult conditions of your life and that's brutally difficult for people

no Nietzsche said he who has a why can bear any how 

and you see and then I certainly seen this at the clinical practitioner that people who have no purpose in their life are embittered by the difficulties of their life and they become first bitter and then resentful and then revengeful and then cruel and there's plenty of places to go past cruel that's just where you start if you're really on a downhill path all right

so the so this is the first propositions

the second proposition would be well if you're going to pursue something of value because you're a social creature you're going to pursue that thing of value in the social space and
that means you're going to compete and cooperate with people around you in the pursuit of that value
what that inevitably means is that given that the pursuit of anything valuable is going to be a collective Enterprise
that you're going to produce a hierarchy or maybe more than one harder to bet
at least A hierarchy of competence in relationship to that Pursuit so it doesn't matter what you decide to pursue
maybe you're going to do that cooperatively run to find that you and other people very in your ability to manage that Pursuit effectively and and efficiently and so there's going to be a hierarchy of people from voting
maybe it's delivering massages maybe it's delivering groceries maybe it's setting up an Enterprise
it doesn't matter but if it's valuable Purdue pursued and you pursue it socially going to produce a hierarchy and the hierarchy is going to be one of confidence

and so if you're going to pursue value then you're going to construct a hierarchy and then there's an implication from that which is that if you construct a hierarchy most of the people within that hierarchical structure are a minority of people are going to be fantastically successful at the pursuit and a very large number going to stack up at the bottom and that's a manifestation of what's known as prices laws map by the Pareto rule distribution it's an expression of what's be known Among The Economist says the Matthew principle from the New Testament

to those who have everything more will be given from those who have nothing everything will be taken away and it's an it's an iron law of the distribution of success in hierarchy

so if you're going to have value and you're going to have hierarchy then you're going to have inequality and that's a problem now

you can't so now you have a clinical divide there so the conservative type say but we need to hierarchies and that's self-evident as far as I'm concerned given that set of propositions because if you don't ever going to pursue something of value which you have to and need to then you're going to produce a hierarchy so if you demolish the hierarchies you demolished value itself and that's not a tenable a tenable move the left wing no says your credit yeah but

you have to be very careful with your hierarchies because they tend towards inequality of distribution that's one problem once they're established they always also tend to a form of tyranny because once a hierarchy of confidence has been established it can be invaded by people who use power as the means to attain status in the hierarchy and that can corrupt and and destroyed even the entire hierarchy so we have to be on guard for that plus if your hierarchy becomes too Steep and its distribution so it's two tiny fraction of people at the top and two great an agglomeration of people at the bottom especially under conditions of genuine privation  then the people at the bottom it's not only unjust, unfair producing  access suffering at the bottom have nothing to lose might as well just put the hierarchy on its end and that's not a good way to produce a sustainable Society you don't want to put people in the position where they have nothing to lose especially if you have something to lose but also with regards to principles of fairness and Justice let's say so it seems to me that that's a decent way of conceptualizing the political landscape and that gives that gives you a conceptual framework within which you can put people on the left and right in their proper position the right
basically is that portion of the population that's temperamentally who's temperamental proclivity is to admire and support hierarchies and work effectively with in them and that's actually the personality traits that make up a conservative because conservatives by temperament are low in trade openness which is a creativity Dimension that's associated with lateral thinking it's not I would say it's a very environmentally underdetermined

it's it's it's a biological predisposition(성향) especially with regards to creativity and high in conscientiousness(성실성) and the conservative temperamental types make very good managers and administrators that's how they manifest themselves in the world essentially if you set up a hierarchy and it runs on algorithmic runs algorithmically then the conservatives will do very well in that structure because they can Implement an algorithm into a very good at implementing where is
the liberal types are very good at generating new hierarchies and so and that's and that's because they're hiring trade open if they're less conscientious(양심적인) so they're not suited as well to do within hierarchy operation but

in a functioning economy and in a functioning democracy I would say you need both types you need to Liberal types to establish new territory and to put out new values so that new hierarchies might be organized so that the effective movement towards those ends might be instantiated and you need the conservatives to actually implement the processes and so a society's only conservatives become Static and that's not good because the environment transforms and you have to keep up with a society that's only composed of the left-leaning liberal types is very good at generating all sorts of new possibilities but very bad at generating all sorts of new actualities and so we should be first of all cognizant(알고 있는) of the fact that hierarchical organization is escapable if you're also going to pursue value second that if you produce hierarchical structures that you're going to produce inequality inevitably and there are negative consequences as a as a function of that and that the end of both sides of that equation let's say need need a voice because both of those functions are are valuable necessary but also add odds with one another and that permanent odds Because it is the case that you need hierarchies because otherwise you have nothing to do and it's also the case that if you have hierarchies then the poor will always be with you and that's a that's a that's a chronic(만성적인) functional problem that has to be addressed and that's the proper place I would say of the left

so that's only 15 minutes