[python] swap하는 법

 파이써닉 한 해결법 x=1 y=2 x,y=y,x 기존에 내가하던 방법 temp = x x = y y = temp 수학적 방법 (신기함) x = x + y       # x = 7, y = 4 y = x - y       # x = 7, y = 3 x = x - y       # x = 4, y = 3 출처 https://datagy.io/python-swap-variables/

m1칩 맥에서 virtualbox 사용불가?

  https://torbjorn.tistory.com/778

딥러닝으로 문장을 이미지로 만들어주는 서비스

구글의 imagen(일반인 공개 안함) Openai의 dall e2

electron에 nedb를 연결...미해결

 electron에 nedb를 연결. https://stackoverflow.com/questions/52235208/how-to-get-electron-app-to-connect-to-nedb 댓글: DB is create but I cannot interact with it from the renderer procss   내거도 db 생성되는 데 실행해서 interact 안됨 관련 링크 찾음 https://bug41.tistory.com/entry/Electron-%EC%9D%BC%EB%A0%89%ED%8A%B8%EB%A1%A0-DB-%EC%97%B0%EB%8F%99-nedb-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0

예쁜 css 바로적용

 예쁜 css 찾고 있었는데 https://codens.info/2466 이 링크 보고 skeleton이랑 miligram 써봤는데 class 수정 거의 없이 바로 수정인데다가  miligram이 예쁘다

[css]Uncaught SyntaxError: Unexpected token '.' css

 Uncaught SyntaxError: Unexpected token '.' css 착각함.. You css file is being processed as a javascript file. Are you sure the file is being included as a css file as in: < link href= "yourstyle.css" rel= "stylesheet" > and not < script src = "yourstyle.css" > </ script > https://stackoverflow.com/questions/65158024/uncaught-syntaxerror-unexpected-token-css

skeleton loading ui

 화면 로딩하는 중에 글을 회색 박스로 표현해주는 것 이게 이름이 있는지 몰랐다 https://velog.io/@eunoia/PureCSS%EB%A1%9C-Skeleton-%EC%A0%9C%EC%9E%91%ED%95%98%EA%B8%B0

농경 로봇

 농경 로봇 https://www.youtube.com/watch?v=97JZMrnRnYM 드론이 열매 따는 것도 있다.

맥북에서 백틱 ` 입력하는 법

좌측 상단 ₩를 누르면 영어 자판 일때 백틱`이 나온다 한글 상태일 때는   ₩로 나온다

[arduino] 평가보드 evaluation board란?

IC 성능 검증 등을 위한 보드 회로의 성능 예측등

[opengl] 직사각형 회전시 찌그러짐

 직사각형을 회전시켰더니 평행사변형으로 일그러지는 현상 https://neevek.net/posts/2017/11/26/opengl-rotating-mapped-texture-in-a-rectangular-viewport.html

TLD gTLD ccTLD SLD

 도메인 관련 보다가 gTLD ccTLD SLD TLD top level domains . 뒤에 오는 도메인 예를 들어 com SLD second level domains . 앞에 오는 도메인 naver.com에서 naver gTLD generic top level domains TLD인데 국가랑 상관 없는 것 com net org 밖에 없다고 함 io kr 같은거는 국가 도메인이니까 ccTLD country code top level domains TLD인데 두글자로 국가를 나타낸다 우리나라는 kr

brute force 무차별 대입

brute force  키 전수조사(exhaustive key search) 또는 무차별 대입(無差別代入)은 조합 가능한 모든 문자열을 하나씩 대입해 보는

js에서 ==와 ===는 다르다

  자꾸 까먹길래 관련링크 https://velog.io/@filoscoder/-%EC%99%80-%EC%9D%98-%EC%B0%A8%EC%9D%B4-oak1091tes JavaScript에서 문자열 비교를 할 때 `==`와 `===` 연산자 모두 사용할 수 있습니다. 하지만 두 연산자는 중요한 차이점을 가지고 있어요: - `==` (동등 연산자)는 값이 같은지 비교하기 전에, 두 비교 대상의 타입을 변환(형변환)해서 같은 타입으로 만든 후 값을 비교합니다. 이 때문에 예상치 못한 결과가 나올 수 있어요. - `===` (일치 연산자)는 값과 타입이 모두 같은지를 비교합니다. 타입 변환 없이 직접 비교하기 때문에, 더 엄격한 비교가 가능해요. ### 문자열 비교에 권장되는 방법: 문자열을 비교할 때는 `===`을 사용하는 것이 좋습니다. 이 방법은 예상치 못한 타입 변환을 방지하고, 값과 타입이 모두 같은 경우에만 `true`를 반환하기 때문에 더 정확한 비교가 가능해요. ### 예시: ```javascript const str1 = "Hello"; const str2 = "Hello"; const str3 = "hello"; console.log(str1 == str2);  // true, 값이 같기 때문에 console.log(str1 === str2); // true, 값과 타입이 모두 같기 때문에 console.log(str1 == str3);  // false, 값이 다르기 때문에 console.log(str1 === str3); // false, 값과 타입이 모두 다르기 때문에 ``` 이 예에서 `str1`과 `str2`는 값과 타입이 모두 같으므로, `==`와 `===` 모두 `true`를 반환합니다. 반면, `str1`과 `str3`은 값이 다르므로 두 연산자 모두 `false`를 반환합니다. 결론적으로, JavaScript에서 문자열을 포함한 모든 타입의 비교를 할 때는 가능한 `===`를 ...

autopep8 이란

 autopep8이란 https://pypi.org/project/autopep8/ autopep8은  PEP 8  스타일 가이드를 준수하도록 Python 코드의 형식을 자동으로 지정합니다.  pycodestyle  유틸리티를 사용하여  형식을 지정해야 하는 코드 부분을 결정합니다.  autopep8은 pycodestyle에서 보고할 수 있는 대부분의 형식  문제  를 해결할 수 있습니다. 자동 포맷팅 해주는 모듈 비주얼 스튜디오 코드 쓰는데 다운하라고 뜨길래  받음

Uncaught TypeError: Failed to resolve module specifier "path". Relative references must start with either "/", "./", or "../".

  Uncaught TypeError: Failed to resolve module specifier "path". Relative references must start with either "/", "./", or "../". https://velog.io/@fgprjs/three.js%EC%97%90%EC%84%9C-index.html1-%EB%9D%BC%EC%9D%B8-%EC%98%A4%EB%A5%98-%EB%B0%9C%EC%83%9D%EC%8B%9C 이 문제 인거 같은데 아직 해결 못함 commonjs랑 esm을 혼용 해서 그런 것 같다

commonjs vs esmodule

  링크 https://yceffort.kr/2020/08/commonjs-esmodules CJS, AMD, UMD, ESM https://defineall.tistory.com/916

깃허브 일부 리포지토리만 다운로드하는 방법

 여기서 링크 입력으로 할 수 있다 https://download-directory.github.io/

css js 파일 경량화

min 붙은 것들이 경량화된것 여기서 할 수 있다 https://www.minifier.org/

bootstrap5에서 dropdown이 클릭시 작동 안함

dropdown은 popper라는 js 파일이 추가로 필요해서 넣었는데도 안되던데 이유는 bootstrap4의 예제를 참고해서 그런거였다 class 태그가 4에서 5로 넘어오면서   data-toggle  -->  data-bs-toggle  로 바뀌었기 때문이었다. 관련링크 https://stackoverflow.com/questions/70910327/why-my-bootstrap-5-dropdown-menu-is-not-working

[3d] z fighting

스티칭(stitching) 또는 플레인파이팅(planefighting)이라고도 하는 Z-파이팅은 2개 이상의 프리미티브가 카메라와 매우 유사한 거리를 가질 때 발생하는 3D 렌더링 현상입니다.

[flutter]No MediaQuery widget ancestor found

 [flutter]No MediaQuery widget ancestor found return scaffold로 해놨었는데 scaffold를 materialapp로 감싸주니 해결됨

early return 패턴

 대충 설명: if ~~ else if ~~elseif ~~else 같이 분기처리 없이 if return if return 으로 하는 방식. 상황에 따라 가독성이 좋아질 수 있다. 순서를 고려해야.. 근데 잘 안쓴다고 한다(?) 읽은 링크 https://jheloper.github.io/2019/06/write-early-return-code/

[django] maximum recursion depth exceeded while calling a Python object

 url.py에서 다른 urls.py include로 연결하는데 경로를 자기 경로로 해서 무한반복하고 있었다.

[django] TemplateDoesNotExist at ~

  TemplateDoesNotExist at ~ 맞게 했는데 에러나서 보니까 setting 에 installed_apps 에 앱을 추가를 안한것이었다 이 실수 두번함

flutter 완성 준비

  앱 아이콘 만들기 https://asufi.tistory.com/entry/Flutter-Flutter-%EC%95%B1-%EC%B6%9C%EC%8B%9C-%ED%95%98%EA%B8%B0-release-build-apk 스플래쉬 스크린 만들기 플러그인 써도 되고 공식문서 참고해도 되고 https://docs.flutter.dev/development/ui/advanced/splash-screen

[colab error] NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

  colab error NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.  Runtime > Change Runtime Type > select GPU

[flutter] text에 노란 줄

 scaffold를 안써서 생김 https://stackoverflow.com/questions/47114639/yellow-lines-under-text-widgets-in-flutter

[flutter http] Error: XMLHttpRequest error

이미지
flutter 앱에서 django 서버에서 http로 api 받아오는 것을 하고 있었다. 그런데  http.get이 작동안함. 코드를 고쳤더니  Error: XMLHttpRequest error. 이런 에러가 뜨는데 영 무슨 에러인지 모르겠어서 검색을 했더니 비슷한 에러 질문 글들에서 CORS에러, 서버에서 접근을 막은 것일 거라는 답글이 많았다. 크롬으로 실행해서 개발자 도구 열어서 확인 했더니 그게 맞음을 확인. 서버에서 cors관련 설정을 추가하고 경로 지정을 할 수 있는데 그냥 전부 허용으로 해서 해결했다

flutter 코드 formatting 자동 완성

 환경 마다 다 다르다 여기서 참고하기 https://docs.flutter.dev/development/tools/formatting beautify 나 formatting 플러그인을 사용해도 되지만 flutter에 해당하는 건 잘 없다 flutter 앱에 기능으로 포함되어 있는데 설정에 들어가서 format 검색해서 format on paste  format on type format on save 를 활성화해 주었더니 해당 상황에서 작동한다.

gitignore 생성 사이트

gitignore 생성 사이트  https://www.toptal.com/developers/gitignore 도중에 추가하는 경우 여기 블로그 참고함 https://landroid.tistory.com/18

export path를 그냥 command line에 적으면 임시로만 저장되니 rc파일을 수정해야 한다.

  export path를 그냥 command line에 적으면 임시로만 저장되니 rc파일을 수정해야 한다. echo $SHELL로 무슨 쉘 쓰는지 확인하고 그거에 따라 rc 파일 수정. zsh로 path 수정해서 해결했다 https://d-dual.tistory.com/8

[mac cmd]xcrun: error: invalid active developer path

xcrun: error: invalid active developer path   $ xcode-select --install 로 해결

mac 노트북에서 유튜브 버벅거리고 작동 안함

 LG 모니터 연결해서 쓰는데 모니터 스피커 쓰니까 뭔가 잘 안 맞는 듯하다 스피커 설정을 블루투스 이어폰이나 본체로 바꾸면 잘 작동한다.

primarySwatch는 Colors.black을 받지 않는다.

The argument type 'Color' can't be assigned to the parameter type 'MaterialColor?'  material color를 받기 때문에 white랑 black을 에러가 난다 https://stackoverflow.com/questions/52577366/error-while-changing-the-flutter-theme-color-to-black

flutter admob 구글 배너 광고 추가

 flutter admob 구글 베너 광고 추가 https://developers.google.com/admob/android/quick-start?hl=ko#import_the_mobile_ads_sdk https://developers.google.cn/admob/flutter/banner?hl=ko#banner_ad_events 공식 튜토리얼 따라해서 성공 코드 import 'package:flutter/material.dart' ; import 'package:google_mobile_ads/google_mobile_ads.dart' ; class adtest extends StatefulWidget { const adtest({Key? key}) : super (key: key) ; @override _adtestState createState () => _adtestState () ; } class _adtestState extends State<adtest> { final BannerAd myBanner = BannerAd ( adUnitId: BannerAd. testAdUnitId , size: AdSize. banner , request: AdRequest () , listener: BannerAdListener () , ) ; @override Widget build (BuildContext context) { myBanner .load() ; final AdWidget adWidget = AdWidget (ad: myBanner ) ; return Scaffold ( body: Container ( alignment: Alignment. center , child: adWidget , width: myBanner . size . width .toDouble() , ...

[flutter]multidex 에러

이걸로 해결 https://282-ground.tistory.com/167  

[flutter]The Google Mobile Ads SDK was initialized incorrectly

 The Google Mobile Ads SDK was initialized incorrectly manifest파일에서 잘못된 위치여서 그랬던 것 https://stackoverflow.com/questions/65633194/the-google-mobile-ads-sdk-was-initialized-incorrectly

[flutter]Your project requires a newer version of the Kotlin Gradle plugin.

  ┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────┐ │ [!] Your project requires a newer version of the Kotlin Gradle plugin.                       │ │ Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then │ │ update ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\android\build.gradle:               │ │ ext.kotlin_version = '<latest-version>'                                                      │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ minsdk 고쳤더니 나온 오류 ext.kotlin_version은  projectName/android/app/build.gradle 쪽이 아니라 projectName/android/build.gradle 여기에 있다 https://stackoverflow.com/questions/70919127/your-project-requ...

[flutter] uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:google_mobile_ads]

 uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:google_mobile_ads]  ..../AndroidManifest.xml as the library might be using APIs not available in 16 Suggestion: use a compatible library with a minSdk of at most 16, or increase this project's minSdk version to at least 19, or use tools:overrideLibrary="io.flutter.plugins.googlemobileads" to force usage (may lead to runtime failures) 에러가 친절하게 minSdk를 고치라고 알려줬다. minSdk는 안드로이드 build gradle에 minsdkversion 고치면 된다고한다. https://stackoverflow.com/questions/52060516/how-to-change-android-minsdkversion-in-flutter-project --- ..안드로이드만 바꿔도 되는건가?