안녕하세요 유성민 대표님, 유익한 강의 잘 듣고 있습니다. 페이스북 광고 입문자라 기초 질문 드리는데요! 제 개인 계정이 현재 재직 중인 회사 비지니스 관리자로 등록이 되어 있습니다. 그래서 본 강의 실습을 위해 비지니스 관리자 메뉴로 들어가면 회사 관련 광고 계정이 떠요ㅠㅠ 제 개인(?) 비지니스 관리자를 추가로 만들고 싶은데 가능할까요? 감사합니다.
멀티 쓰레드를 통해 Batch Insert를 수행하고 있습니다. batch 사이즈를 30으로 설정하였고 table에는 중복 insert를 막기 위해 unique key 설정을 했습니다. 비지니스 로직에서도 중복을 막기위해 unique key를 쿼리메소드를 통해 조회(id를 통한 조회 x)하며 enttiy가 존재하면 entitiy 값을 update하고 없으면 save하고 있습니다. batch를 위해 saveAll을 사용하고 있습니다. 쿼리메소드를 통해 조회를 해도 duplicate entry error가 발생하고 있습니다. 궁극적으로 multi thread에서 동일한 unique key값으로 동시에 insert가 발생하는걸로 보입니다. 동일한 transaction이 아닌 곳에서 duplicate entry error가 발생하지 않기 위해 어떻게 해야할까요? transcation isolation level READ UNCOMMITTED, 2차 캐시 등 찾아봐서 확인해봤는데 어떻게 해결해야할지 막막합니다. 답변 달아주시면 감사하겠습니다~~!!!
I/flutter (30325): 213123123 E/flutter (30325): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The getter 'length' was called on null. E/flutter (30325): Receiver: null E/flutter (30325): Tried calling: length E/flutter (30325): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5) Stream<String> get centerResult => _centerSubject.stream; 이런식으로 쓴 부분에서 게터 부분이 자꾸 오류가 발생하는거 같은데 아무리 찾아봐도 방법이 없어 문의드립니다. 플루터 자체 구조적인 문제라고 봐야되나요?
A server error occurred. Please contact the administrator. def __str__ ( self ): return '{} :: {}' .format( self , self .title , self .author) 이 줄들을 입력하고 cmder 열어서 python manage.py runserver 한 뒤, 창을 열고 Post 를 열어보면 흰 바탕화면에 A server error occurred. Please contact the administrator. 달랑 이 문구만 나옵니다.... 그리고 cmder을 확인해보면 C:\github\django_my_website (master -> origin) (venv) λ python manage.py runserver Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). March 19, 2020 - 15:01:28 Django version 2.2, using settings 'my_site_prj.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. [19/Mar/2020 15:01:30] "GET /admin/blog/ HTTP/1.1" 200 2410 Traceback (most recent call last): File "C:\github\django_my_website\venv\lib\site-packages\django\db\models\options.py", line 565, in get_field return self.fields_map[field_name] KeyError: '__str__' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\github\django_my_website\venv\lib\site-packages\django\contrib\admin\utils.py", line 262, in lookup_field f = _get_non_gfk_field(opts, name) File "C:\github\django_my_website\venv\lib\site-packages\django\contrib\admin\utils.py", line 293, in _get_non_gfk_field field = opts.get_field(name) File "C:\github\django_my_website\venv\lib\site-packages\django\db\models\options.py", line 567, in get_field raise FieldDoesNotExist("%s has no field named '%s'" % (self.object_name, field_name)) django.core.exceptions.FieldDoesNotExist: Post has no field named '__str__' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\base.py", line 145, in _get_response response = self.process_exception_by_middleware(e, request) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\base.py", line 143, in _get_response response = response.render() File "C:\github\django_my_website\venv\lib\site-packages\django\template\response.py", line 106, in render self.content = self.rendered_content File "C:\github\django_my_website\venv\lib\site-packages\django\template\response.py", line 83, in rendered_content content = template.render(context, self._request) File "C:\github\django_my_website\venv\lib\site-packages\django\template\backends\django.py", line 61, in render return self.template.render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 171, in render return self._render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 163, in _render return self.nodelist.render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 937, in render bit = node.render_annotated(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 904, in render_annotated return self.render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\loader_tags.py", line 150, in render return compiled_parent._render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 163, in _render return self.nodelist.render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 937, in render bit = node.render_annotated(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 904, in render_annotated return self.render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\loader_tags.py", line 150, in render return compiled_parent._render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 163, in _render return self.nodelist.render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 937, in render bit = node.render_annotated(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 904, in render_annotated return self.render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\loader_tags.py", line 62, in render result = block.nodelist.render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 937, in render bit = node.render_annotated(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 904, in render_annotated return self.render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\loader_tags.py", line 62, in render result = block.nodelist.render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 937, in render bit = node.render_annotated(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\base.py", line 904, in render_annotated return self.render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\contrib\admin\templatetags\base.py", line 33, in render return super().render(context) File "C:\github\django_my_website\venv\lib\site-packages\django\template\library.py", line 214, in render _dict = self.func(*resolved_args, **resolved_kwargs) File "C:\github\django_my_website\venv\lib\site-packages\django\contrib\admin\templatetags\admin_list.py", line 339, in result_list 'results': list(results(cl)), File "C:\github\django_my_website\venv\lib\site-packages\django\contrib\admin\templatetags\admin_list.py", line 315, in results yield ResultList(None, items_for_result(cl, res, None)) File "C:\github\django_my_website\venv\lib\site-packages\django\contrib\admin\templatetags\admin_list.py", line 306, in __init__ super().__init__(*items) File "C:\github\django_my_website\venv\lib\site-packages\django\contrib\admin\templatetags\admin_list.py", line 229, in items_for_result f, attr, value = lookup_field(field_name, result, cl.model_admin) File "C:\github\django_my_website\venv\lib\site-packages\django\contrib\admin\utils.py", line 275, in lookup_field value = attr() File "C:\github\django_my_website\blog\models.py", line 14, in __str__ return '{} :: {}'.format(self, self.title, self.author) File "C:\github\django_my_website\blog\models.py", line 14, in __str__ return '{} :: {}'.format(self, self.title, self.author) File "C:\github\django_my_website\blog\models.py", line 14, in __str__ return '{} :: {}'.format(self, self.title, self.author) [Previous line repeated 230 more times] RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__ response = response or self.get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner response = response_for_exception(request, exc) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response html = reporter.get_traceback_html() File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html t = DEBUG_ENGINE.from_string(fh.read()) UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__ response = response or self.get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner response = response_for_exception(request, exc) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response html = reporter.get_traceback_html() File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html t = DEBUG_ENGINE.from_string(fh.read()) UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__ response = response or self.get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner response = response_for_exception(request, exc) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response html = reporter.get_traceback_html() File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html t = DEBUG_ENGINE.from_string(fh.read()) UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__ response = response or self.get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner response = response_for_exception(request, exc) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response html = reporter.get_traceback_html() File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html t = DEBUG_ENGINE.from_string(fh.read()) UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__ response = response or self.get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner response = response_for_exception(request, exc) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response html = reporter.get_traceback_html() File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html t = DEBUG_ENGINE.from_string(fh.read()) UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__ response = response or self.get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner response = response_for_exception(request, exc) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response html = reporter.get_traceback_html() File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html t = DEBUG_ENGINE.from_string(fh.read()) UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__ response = response or self.get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner response = response_for_exception(request, exc) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response html = reporter.get_traceback_html() File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html t = DEBUG_ENGINE.from_string(fh.read()) UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\Lee Ji Hyun\anaconda3\lib\wsgiref\handlers.py", line 137, in run self.result = application(self.environ, self.start_response) File "C:\github\django_my_website\venv\lib\site-packages\django\contrib\staticfiles\handlers.py", line 65, in __call__ return self.application(environ, start_response) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\wsgi.py", line 141, in __call__ response = self.get_response(request) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\base.py", line 75, in get_response response = self._middleware_chain(request) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner response = response_for_exception(request, exc) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) File "C:\github\django_my_website\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response html = reporter.get_traceback_html() File "C:\github\django_my_website\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html t = DEBUG_ENGINE.from_string(fh.read()) UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence [19/Mar/2020 15:01:33] "GET /admin/blog/post/ HTTP/1.1" 500 59 너무 길어서 멘붕이 되는데 무슨 소린지 모르겠어서 끝 줄 오류부분 UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence 이것만 검색해서 찾아봤더니 debug.py 에서 비어있던 open method에서 encoding = "utf-8" 도 기입했고 span 은 고칠게 따로 없었고 그랬습니다.. 뭐가 잘못된 것일까요,,, ㅕ
왜 함수에서 넣어야하는 변수가 2개인데 이중포인터가 아닌 그냥 포인터인지 모르겠습니다. int sum2d_3(int* ar, int row, int col) { int tot = 0; for (int r = 0; r < row; r++) for (int c = 0; c < col; c++) tot += *(ar + c + col * r); return tot; } 이 함수를 보면 row와 col 두개를 변수로 가지고있는데 이러면 2차원 배열이랑 비슷한 개념이므로 이중포인터로 해야하는거 아닌가요? 왜 단일 포인터로 하는지 모르겠습니다..
10-14강의해서 선생님꼐서 2차원에서 arr의 기본주소는 &arr[0][0]이 아닌 &arr[0]이라고 하셨는데 이번 강의에서는 int data[ROWS][COLS] = { {1,2,3,4}, {5,6,7,8}, {9,0,1,2} }; printf("%d\n", data[1][2]); int* ptr = &data[0][0]; 여기서 *ptr을 &data[0]이 아닌 왜 &data[0][0]이어야 하는지 모르겠습니다. ㅠ 둘다 주소를 출력했을 때 주소는 같은 주소인데 왜 다른지 이해가 되지 않습니다.
별찍기 강의중 반목문 for 과 관련되어 질문 드립니다. for ( var star = 1; star <= 5; star++1){ console.log('*') } 반복문 끝을 star++1 로 변경해도 괜찮나요? star++1 과 star+=1 은 무슨 차이인가요? 반복문 끝을 지정하는게 아직 개념이 안잡혀 혼란스럽습니다ㅠㅠ
6:08 쯤에 while (status==1)로 하는 반복문 질문입니다. status라는 변수가 scanf("%d",&num)이 되면서 정수형 변수인 num를 받아주는거까지는 이해가 가지만 왜 while(status==1)에서 숫자 '1'이 써진건지 이해가 가지않습니다. 혹시 True,False를 받아주는건가 싶어서 디버그를 할 때 q를 하면 종료가 되지만 다른 알파벳을 넣어도 종료가 되는건가 싶어서 다른 알파벳을 입력하니 반복문이 종료가 되더라고요. 만약 True, False가 맞는거라면 == 이 기호는 동등할 떄 쓰는걸로 알고있는데 status변수에 1을 입력해도 종료가 되지않는건 어떤 이유인지 궁금합니다. #include<stdio.h> int main() { int num, sum = 0; int status = 0; printf("Enter an interger (q to quit) : "); status = scanf("%d", &num); while (status == 1) { sum = sum + num; printf("Enter next integer (q to quit) : "); status = scanf("%d", &num); } printf("Sum=%d\n", sum); return 0; }
가상환경 처음 설정하고 pendulum이나 pytest를 설치하는데 자꾸 (p_study) D:\p_study\Scripts>pip install pendulum Traceback (most recent call last): File "D:\Python\lib\runpy.py", line 193, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\Python\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "D:\p_study\Scripts\pip.exe\__main__.py", line 5, in <module> ModuleNotFoundError: No module named 'pip' (p_study) D:\p_study\Scripts>pip list Traceback (most recent call last): File "D:\Python\lib\runpy.py", line 193, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\Python\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "D:\p_study\Scripts\pip.exe\__main__.py", line 5, in <module> ModuleNotFoundError: No module named 'pip' 같이 에러가 뜹니다. 혹시 어떻게 해결해야 할까요??