A (1, 1)
B (1, 0)

1. A outer product B
| 1 0 |
| 1 0 |

2. |A cross product B| => determinant
|ab -bc| => |1 * 0 - 1 * 1| = |-1|

보통 흔히 말하는 A와 B가 이루는 면적은 cross product의 크기가 된다. outer product와는 관련이 없다.
그리고 A,B 가 이루는 면은 삼각형이 아니라 평행 사변형이다.

참고로, cross product는 determianat 계산법으로 계산이 된다.
https://en.wikipedia.org/wiki/Cross_producthttps://en.wikipedia.org/wiki/Determinant

 

 

Cross product - Wikipedia

From Wikipedia, the free encyclopedia Jump to navigation Jump to search Mathematical operation on two vectors in three-dimensional space In mathematics, the cross product or vector product (occasionally directed area product to emphasize the geometric sign

en.wikipedia.org

| i  j  k|
| a b c|
| d e f| 로 두고, determinant를 구하면 i(bf - ce) - j(af - cd) + k(ae-bd) 가 되고 각각의 괄호안에 있는 값이 바로 i, j, k가 된다.

det를 구하는 방법의 원리는 아래 링크에서 라플라스 전개를 보면 이해가 쉽다.
https://ko.wikipedia.org/wiki/%ED%96%89%EB%A0%AC%EC%8B%9D

블로그 이미지

시간을 거스르는자

,

Socket broken pipe

TCP/IP 2019. 2. 20. 19:18

보통 이런 에러가 나는경우는, 한쪽에서는 끊었는데 다른 한쪽에서 메시지를 보낸경우 이런 에러를 리턴하게 된다.


한쪽에서 먼저 끊은 이유야 여러가지겠지만, 


본인은 대량의 로드 테스트 클라이언트를 돌리고 있었고, 로직에서 커스텀 핑 체크를 하고있는데, 핑 패킷을 서버가 못받아서 서버에서 일방적으로 끊은 이유였다.


그런데 이 현상은 와이파이를 쓸때만 일어나고, 유선으로 하면 발생하지 않았다.


이유가 무엇일까?


와이파이 네트웤 속도가 느려서 로드 테스트를 돌리는 대량의 패킷들이 병목으로 쭉 쌓였다가 한방에 서버한테 넘어가는 것이다.


서버에서는 bufferevent_setwatermark 로 맥스 버퍼 사이즈를 정해놓고 있는데, 이 수치를 넘어가는 패킷들이 몰려오니까 나머지는 짤려서 패킷이 유실되는 경우가 발생하고 있던 것이다.


그래서 클라이언트는 아무리 핑을 보내도 서버가 받지 못해서 not alive 유저로 판단해서 끊어 버리기 때문에, 클라에서 다음 패킷을 보낼때 socket bronken pipe가 전달되었던 것이다.

'TCP/IP' 카테고리의 다른 글

sockaddr vs sockaddr_in  (0) 2015.08.01
블로그 이미지

시간을 거스르는자

,

'ejabberd' 카테고리의 다른 글

[solution] ejabberd join_cluster no_ping error  (0) 2018.07.25
mod_pottymouth  (0) 2018.07.11
블로그 이미지

시간을 거스르는자

,

1. If you didn't open required ports,
    please check https://stackoverflow.com/questions/36862874/erlang-ejabberd-join-cluster-error-no-ping
    FIREWALL_WINDOW=4200-4210  in ejabberdctl.cfg setting is mandatory.


2. You already opened all required ports, but you are getting no_ping error,
    set hosts config. /etc/hosts -> add your ejabbered node hostname. (in my case, node1, node2)

ex)
...
node1    10.0.100.1
node2    10.0.100.2

How to set ejabberd cluster. step by setp

1. ejabberd.yml -> use same file config
2. ejabberdctl.cfg ->
  use same all but
  ERLANG_NODE=ejabberd@each-node-hostname
  FIREWALL_WINDOW=4200-4210

3. add node1, node2 on /etc/hosts
4. node1) ejabberdctl start
5. node2) ejabberdctl start
6. node2) ejabberdctl --no-timeout join_cluster 'ejabberd@node1'



'ejabberd' 카테고리의 다른 글

How to configure ejabberd web admin  (0) 2018.07.25
mod_pottymouth  (0) 2018.07.11
블로그 이미지

시간을 거스르는자

,

mod_pottymouth

ejabberd 2018. 7. 11. 17:06

It can be difficultly installed with https://github.com/processone/ejabberd-contrib/tree/master/mod_pottymouth


Instructions

mkdir -p $EJABBERD_HOME/erlang-lib/bitarray
cd $EJABBERD_HOME/erlang-lib/bitarray
clone https://github.com/ferd/bitarray git repo
run: /usr/lib/erlang/bin/escript rebar get-deps
run: /usr/lib/erlang/bin/escript rebar compile
run: /usr/bin/install -c -d /usr/local/lib/bitarray-1.0.0/ebin
run: /usr/bin/install -c -d /usr/local/lib/bitarray-1.0.0/priv
run: /usr/bin/install -c -m 644 ./ebin/bitarray.app /usr/local/lib/bitarray-1.0.0/ebin/bitarray.app
run: /usr/bin/install -c -m 644 ./ebin/bitarray.beam /usr/local/lib/bitarray-1.0.0/ebin/bitarray.beam 
run: /usr/bin/install -c -m 644 ./priv/bitarray.so /usr/local/lib/bitarray-1.0.0/priv/bitarray.so

What is $EJABBERD_HOME? default may be ~/ folder.
So, export EJABBERD_HOME=/user/yourhome
in bittarray/rebar.conf, change proper version 1.0 -> 1.2

And Let's get mod_pottymouth

mkdir -n ~/.ejabberd-modules/sources cd ~/.ejabberd-modules/sources git clone https://github.com/processone/ejabberd-contrib.git cd mod_pottymouth make sure ejabberd is running run: ejabberdctl module_install mod_pottymouth run: ejabberdctl restart module will be installed in: ~/.ejabberd-modules/mod_pottymouth

May be you cannot module_install mod_pottymouth

1. remove -include("ejabberd.hrl"). line of mod_pottymouth.erl

2. add this. end of mod_pottymouth.erl

mod_options(_) -> [{blacklists, []}, {charmaps, []}].

3. add this. end of mod_pottymouth.erl -export([ here]) 

mod_options/1


After this module_install mod_pottymouth will be work.

I created pull request about this. 
https://github.com/processone/ejabberd-contrib/pull/253

'ejabberd' 카테고리의 다른 글

How to configure ejabberd web admin  (0) 2018.07.25
[solution] ejabberd join_cluster no_ping error  (0) 2018.07.25
블로그 이미지

시간을 거스르는자

,

고루틴의 CS 시점

시스템 콜이 발생하면 고루틴의 CS가 이루어진다는 것을 알았습니다. 그러면 정확히 어느 시점에서 고루틴의 CS가 이루어질까요? 고루틴의 CS는 다음 시점에서 이루어집니다:

  • unbuffered 채널에 접근할 때(읽거나 쓸 때)
  • 시스템 I/O가 발생했을 때
  • 메모리가 할당되었을 때
  • time.Sleep() 코드 실행(python asyncio에서 asyncio.sleep()을 이용해 yield하는 것과 유사합니다)
  • runtime.Gosched() 코드 실행

https://tech.ssut.me/2017/08/20/goroutine-vs-threads/

'Go' 카테고리의 다른 글

How to run go app in heroku by your own project (with github)  (0) 2017.02.24
LITE IDE setup  (0) 2015.01.28
cannot download, $GOPATH not set  (0) 2015.01.28
블로그 이미지

시간을 거스르는자

,
블로그 이미지

시간을 거스르는자

,

pytz localize vs normalize

python 2018. 2. 26. 19:02

If you only want to convert to specific timezone, use localize. and forget normalize.

just use

tz2 = timezone("Asia/Seoul")
dt = datetime.datetime(year=2017, month=4, day=29, hour=8, minute=35, second=10)
dt2 = tz2.localize(dt)

utc_timestamp = dt2.timestamp()

this will calculate including DST time

but If you are going to do arithmetic operation(- or +) to your datetime object and It crosses DST start or end time,

you should use normalize(dt) to fix the utc offset.


refer to

https://github.com/newvem/pytz/blob/master/pytz/tzinfo.py

def normalize():

 '''Correct the timezone information on the given datetime

If date arithmetic crosses DST boundaries, the tzinfo

is not magically adjusted. This method normalizes the

tzinfo to the correct one.

To test, first we need to do some setup

>>> from pytz import timezone

>>> utc = timezone('UTC')

>>> eastern = timezone('US/Eastern')

>>> fmt = '%Y-%m-%d %H:%M:%S %Z (%z)'

We next create a datetime right on an end-of-DST transition point,

the instant when the wallclocks are wound back one hour.

>>> utc_dt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc)

>>> loc_dt = utc_dt.astimezone(eastern)

>>> loc_dt.strftime(fmt)

'2002-10-27 01:00:00 EST (-0500)'

Now, if we subtract a few minutes from it, note that the timezone

information has not changed.

>>> before = loc_dt - timedelta(minutes=10)

>>> before.strftime(fmt)

'2002-10-27 00:50:00 EST (-0500)'

But we can fix that by calling the normalize method

>>> before = eastern.normalize(before)

>>> before.strftime(fmt)

'2002-10-27 01:50:00 EDT (-0400)'

'''



블로그 이미지

시간을 거스르는자

,

출처: http://clien-achive.blogspot.kr/2017/01/uplus-tvg-iptv-omvs.html

uplus tvg iptv에서 omvs 주소 추출시 체크포인트 몇가지

 

제가 약 일주일에 걸쳐서 삽질을 하면서 쉽게 놓칠수 있는 포인트 몇가지를 알리고자 합니다

정말 이것때문에 시간이 오래 걸렸네요

 

일단 제 최종 구성 환경은

 

벽단자 == iptime n8004r (최신펌웨어) == igmp스위칭허브 == iptv, igmp스위칭허브 == nas, igmp스위칭허브 == PC

 

지금은 PC에서 omvs 아주 잘 작동합니다

지금부터 포인트를 하나씩 짚어보겠습니다

 

타사 인터넷회선 등 여러가지 변수가 있을수 있으므로 아래 포인트가 절대적인 것은 아닙니다만

일단 아래 사항부터 챙겨보시라는 의미에서 써보겠습니다

 

omvs의 기본적인 사용법은 알고 오셨다는 가정하에서...

 

1. omvs는 반드시 관리자 권한의 cmd하에서 실행한다

 - 기본중의 기본

 

2. 네트워크 어댑터가 여러개 일때는 반드시 물리적 어댑터를 빼놓고 전부 '사용 안함'으로 변경한다

 - 분명 omvs -i 옵션으로 잘 지정했는데도 안되서 보니 논리 어댑터(루프백이나 기타 가상화 어댑터)가 간섭을 일으켜서 오작동

 - 전부 끄고 omvs -i 0 으로 편안하게 진행하시면 됩니다

 

3. 윈도우 기본 방화벽 및 백신 방화벽은 반드시 끈다

 - 방화벽 켜놓으면 trying to save rdp://.... 만 나오면서 저장은 안됨

 

딱 요 세가지만 지켜주심 되지 싶습니다

다른건 다 자주 언급되는 내용이고 2번은 생각도 못하고 있었는데 이게 제일 큰 복병이었습니다

 

아래 내용도 종종 언급되는데 저한테는 적용 안된 내용들입니다.

 

1. iptime은 omvs가 잘 안된다 : X

 - 처음에 주소가 전혀 안 따지니 공유기탓을 하면서 asus 모델로 변경했으나 동일증상 발생

 

2. 공유기 맥 주소를 uplus에서 제공한 공유기 맥으로 교체해야 한다 : X

 - 역시 변경하나 안하나 동일

 

3. 중간에 스위칭 허브를 쓴다면 igmp지원 모델로 교체해야 한다 : O

 - 이거 지원 안하면 네트워크 마비되고 난리나죠

 

4. pc를 공유기에 직접 꽂아야 한다 : X

 - 보시다시피 주렁주렁 문어발 구성에서도 잘 작동합니다



'분류없음' 카테고리의 다른 글

[cpp] std::move는 단지 캐스팅일 뿐이라고?  (0) 2017.02.08
Same string but different length  (0) 2016.10.28
JIT vs Interpreter  (0) 2016.10.25
git pushed merge cancel  (0) 2015.04.13
[encoding] javascript write to csv  (0) 2015.04.11
블로그 이미지

시간을 거스르는자

,

How to reference

https://docs.mongodb.com/manual/reference/command/convertToCapped/


But,
1. This command makes db global lock while end this command. It takes several minutes or more according to how many data is stored.
2. This command will remove all indexes of target collection


'mongoDB' 카테고리의 다른 글

How to mount mongoDB disk to /data folder  (0) 2018.02.23
mongos setup on centos  (0) 2018.01.12
mongodb profiling 과 AWS EBS IOPS에대한 고찰이라고나 할까?  (0) 2015.05.06
Shading  (0) 2014.04.23
블로그 이미지

시간을 거스르는자

,