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 --- ..안드로이드만 바꿔도 되는건가?

[git] gitignore에 새로 추가했는데 적용이 안될 때

 gitignore에 새로 추가했는데 적용이 안될 때 캐시를 지우고 다시 커밋해준다 https://jojoldu.tistory.com/307

[flutter] Navigator operation requested with a context that does not include a Navigator.

 Navigator operation requested with a context that does not include a Navigator. https://stackoverflow.com/questions/50124355/flutter-navigator-not-working/50125296 void main() => runApp(MaterialApp(home: FooClass(),)); 로 고쳐서 해결

flutter sqlite에서 리턴 했는데 Instance of 'Future'라고 뜸

future는 기다려서 받아야하는데 await 쓰는 걸 잊어버렸다 https://stackoverflow.com/questions/55744894/instance-of-futuredynamic-in-flutter

flutter sqlite database storage location 플러터 db위치

  I want to have an SQLite db in my flutter app, so i followed this flutter cookbook:   https://flutter.dev/docs/cookbook/persistence/sqlite I open the database with the following path:  join(await getDatabasesPath(), 'doggie_database.db')  exactly like the tutorial. I ran the app on my Android phone (not emulator). Now i want to inspect the database file on my PC, but i cannot find the file on my phone. I debugged the above statement and it resolves to  /data/user/0/*mypackage*.*app-name*/databases/doggie_database.db , but i can't find the folder  /data  (only  Android/data ) or the file in my file manager neither on my phone nor on my pc. Where is the file and how can i extract it from my phone? I found the solution that works on Android. It is possible to extract the database file by using adb. Connect the phone via USB use the adb shell type  run-as *mypackage*.*app-name* you are in the  /data/data/*mypackage*.*app-name*  folder...

[dart] 숫자 빈자리를 0으로 채우기 zero padding

.padLeft(2, '0' );  하면 왼쪽 빈만큼 0 들어간다 Dart 1.3   introduced a   String.padLeft   and a   String.padRight   you can use : String intToString( int i, { int pad 0 }) => i.toString().padLeft(pad, '0' );

[안드로이드] gps 권한을 요청 If you need access to FINE location, you must request both ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION

 안드로이드에서 gps 권한을 요청하기 manifest에  <uses-permission android :name ="android.permission.ACCESS_FINE_LOCATION" /> 를 추가했더니 If you need access to FINE location, you must request both ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION 가 나왔는데 <uses-permission android :name ="android.permission.ACCESS_COARSE_LOCATION" /> 를 같이 써주면 해결. fine은 자세한 위치 coarse는 대략적 위치를 가져오는 권한인데 coarse는 무조건 권한 선언되어야 하기 때문 https://developer.android.com/training/location/permissions?hl=ko https://rkdxowhd98.tistory.com/127

windows can't stop your samsung android adb interface: 컴퓨터에서 안드로이드 폰 safe remove 안될 때

 컴퓨터에서 안드로이드 폰 safe remove 안될 때 task manager에서 adb.exe를 종료시키면 된다 참고 https://stackoverflow.com/questions/16089037/unable-to-eject-android-phone 무시해도 상관 없을 듯하다

obj mtl 파일

 obj mtl 파일은 세트다 mtl에 텍스쳐 위치 등등 저장

[android] ringtone 소리내기

Uri uriNotification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM); Ringtone ringtone = RingtoneManager.getRingtone(getApplicationContext(), uriNotification); AudioAttributes audioAttributes = new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_ALARM).build(); ringtone.setAudioAttributes(audioAttributes); ringtone.play();

[android] Failed to compile values file.

Failed to compile values file. values > string.xml 에서 스트링에 '가 \'로 표시되지 않았지 때문이었다 관련 링크 https://stackoverflow.com/questions/64296448/failed-to-compile-values-file

[android] 설정값 저장

설정값을 저장할 때 값이 간단하니 db가 아니라 SharedPreference를 쓴다. 저장은  apply commit 이 있는데 commit은 저장하고 저장 여부를 반환. apply는 그냥 저장

[java]빈자리 만큼 0으로 채우기

String.format( "%02d" , 1 ) 01로 출력

[android] 그래프 그리기

MPAndroidChart   AChartEngine 

[android] activity textview에 settext 했는데 nullpointerror

 초기화를 안해서 그런듯

[android] db테이블 gui로 확인하기

여기 참고  https://codechacha.com/ko/android-studio-browse-database/   Android Studio에서  [View] -> [Tool Windows] -> [Device File Explorer] Device File Explorer에서  /data/data/[package name]/databases/ 에서 db 파일 찾아서 sql 브라우저에 넣고 보면된다. sqlite db browser에 그대로 드래그앤드롭

[android]안드로이드 db ??

 sqlite로 db 할 때 나중에 콘솔모드로 하는지 코드로 하는지 아니면 브라우저 설치해서 하는지 비교하기 

[android]OnClickListener와 OnClick의 차이점

  OnClickListener와 OnClick의 차이점: OnClickListener는 구현해야 하는 인터페이스이며 Java 코드에서 보기로 설정할 수 있습니다. OnClickListener는 누군가가 실제로 클릭하기를 기다리는 것이고, onclick은 누군가가 클릭할 때 어떤 일이 일어나는지를 결정합니다. 최근에 Android는 인터페이스를 구현할 필요 없이 보기의 활동에서 직접 클릭을 처리하는 데 사용할 수 있는 android:onclick이라는 xml 속성을 보기에 추가했습니다. 필요한 경우 하나의 리스너 구현을 다른 리스너 구현으로 쉽게 바꿀 수 있습니다. OnClickListener를 사용하면 이벤트를 트리거하는 보기에서 클릭 이벤트의 동작/동작을 분리할 수 있습니다.  간단한 경우에는 그렇게 큰 문제가 아니지만 복잡한 이벤트 처리의 경우 코드의 가독성과 유지 관리 가능성이 향상될 수 있습니다. OnClickListener는 인터페이스이기 때문에 이를 구현하는 클래스는 이벤트를 처리하는 데 필요한 인스턴스 변수와 메서드를 결정하는 데 유연성이 있습니다.  다시 말하지만, 이것은 간단한 경우에는 큰 문제가 아니지만 복잡한 경우에는 이벤트 처리와 관련된 변수/메서드를 이벤트를 트리거하는 View의 코드와 혼동하고 싶지 않습니다. XML 레이아웃에서 함수 바인딩이 있는 onClick은 onClick과 호출할 함수 간의 바인딩입니다.  onClick이 작동하려면 함수에 하나의 인수(View)가 있어야 합니다. 둘 다 같은 방식으로 작동하지만 하나는 Java 코드를 통해 설정되고 다른 하나는 xml 코드를 통해 설정됩니다. 출처:  https://stackoverflow.com/questions/21319996/android-onclick-in-xml-vs-onclicklistener/21326604 다른 글이나 댓글을 보니까 onclick을 쓰는 코드는 많이 없다는 말이 있다. 코드 읽는데 헷갈린다고함. 위에 다른...

[visual studio][c++] 외부기호를 확인할 수 없습니다.

 예제 파일을 실행했더니  외부기호를 확인할 수 없습니다.  'x86' 라이브러리 컴퓨터 종류가 'x64' 대상 컴퓨터 종류와 충돌합니다. 라고 떠서  구성 관리자에서 x86으로 바꿨더니 실행된다.