코딩/딥 러닝2021. 3. 30. 10:19

윈도우에 파이썬이 여러 버전 설치되어 있는 경우, 사용하는 버전을 변경하는 방법

 

단계1  시스템 환경 변수 편집 실행

단계 2  환경 변수 클릭

단계 3  시스템 변수 -> Path 편집 클릭

단계 4  환경 변수 편집에서 사용할 파이썬 경로를 위로 이동

단계 5   "확인"으로 창을 닫은 후, 커맨드 창 새로 띄워서 버전 확인. 끝

 

Posted by foon
코딩/Android2021. 3. 24. 23:15

ConstraintLayout (제약 레이아웃)

  • 위젯이 어느 것과 연결되어 있는지 명시를 해줘야
  • 연결 , 연결
    • 연결 점과 연결 선을 이용해서 화면을 배치하는 레이아웃
  • 가이드
    • 추가하여, 연결할 있음
  • convert view
    • 마우스 우클릭 메뉴로 다른 레이아웃으로 변경
  • dp
    • 밀도 독립적 픽셀
    • 해상도에 따라 픽셀 수가 다른데, 그에 맞게 맞춰
    •  px 절대 픽셀

 

Button layout_gravity

  • gravity 중력
    • 책받침, 철가루
      • 자석을 따라감
  • 정렬을 의미함
    • 다른 언어의 Alignment

 

  • center
    • 가로 세로 모두 가운데
  • center_horizontal
    • 가로 센터
  • 자체의 속성
    • 버튼의 위치

 

Button gravity

  • layout_ 아니면, 안에서의 속성
    • 버튼 안의 텍스트의 위치

 

Button textSize

  • 글자 크기는 sp 권장함
    • 30

 

LinearLayout baselineAligned

  • true
    • 텍스트를 기준으로 뷰들을 배치해줌
    • 버튼의 "텍스트를 기준으로" 같은 라인 배치

 

 

LinearLayout 공간 분할

  • weight
    • 여유 공간을 분할해서 배치
  • 정확히 3분할 방법
    • 버튼의 layout_height 0dp
    • 버튼의 layout_weight 1
      • 정확히 3분할해서 배치
  • 4:1:1 분할 방법
    • 버튼의 layout_height 0dp
    • 버튼 1 layout_weight 4
    • 버튼 2 layout_weight 1
    • 버튼 3 layout_weight 1

 

RelativeLayout

  • 버튼 1 (id: button)
    • layout_alignParentTop true
  • 버튼 2 (id: button2)
    • layout_alignParentBottom true
  • 버튼 3
    • layout_below @id/button
    • layout_above @id/button2

 

FrameLayout

    • 버튼
  • 아래
    • 이미지 두개를 번갈아 보도록
  • 이미지 파일 위치
    • res/drawable
    • 탐색기에서 Ctrl+C, 스튜디오의 res/drawable Ctrl+V
  • 배치
    • LinearLayout
      • Button 상단 배치 "이미지 바꾸기"
      • Layouts/FrameLayout 하단 배치
      • ImageView FrameLayout 추가
    • imageView.setVisibility(View.VISIBLE)
    • imageView2.setVisibility(View.INVISIBLE)

'코딩 > Android' 카테고리의 다른 글

안드로이드 스튜디오 삭제 및 기본 설정  (0) 2021.03.24
Posted by foon
코딩/Android2021. 3. 24. 07:36

안드로이드 스튜디오 클린 삭제

  • c:\Program Files\Android\Android Studio 이동
    • uninstall.exe 실행
  • c:\Users\<사용자계정폴더>\AppData\Local\Android\Sdk 폴더 삭제

 

기본 설정

  • 글자 크기 바꾸기
    • File -> Settings -> Editor
      • -> Font
        • "Consola", 13

 

  • 자동 임포트
    • File -> Settings -> Editor
      • -> General
        • -> Auto Import
          • 체크 Add unambiguous imports on the fly
          • 체크 optimize imports on the fly

 

기본 XML UI

  • 버튼 넣기
    • 자석 활성화 (auto connection)
  • RelativeLayout에서 버튼 위치 중심에 위치 시키기
    • 버튼의 좌우 상하 점을 다른 버튼 또는 화면의 가장자리로 끌어 연결

'코딩 > Android' 카테고리의 다른 글

Layout/Widjet/Drawable 01  (0) 2021.03.24
Posted by foon
코딩/Docker2021. 3. 16. 13:55

빌드

이미지 빌드
# docker build <옵션> <Dockerfile 경로>
옵션 -t, --tag="": <저장소명>/<이미지명>:<태그> 설정
예 docker build .
예 docker build -t repo01 .
예 docker build -t repo01/server:1.0 ./doc
* Dockerfile
  FROM "기본이미지"
  ADD "이미지에 추가할 파일"
  RUN "실행할 명령어"

사용

이미지 목록 보기
# docker images 또는 docker image ls

이미지 실행
# docker run <이미지명>
docker run image01 

이미지 실행 후 /bin/bash 바로 수행
# docker run -i -t <이미지명> <실행할명령>
인자 -i (interactive), -t 가상 터미널 에뮬레이션, -d 데몬으로 실행
 docker run -i -t ubuntu /bin/bash
    Ctrl+D (/bin/bash 종료)

이미지 실행 후 인위적으로 종료되지 않도록 하기
(작업이 끝나지 않도록 하면 돌고 있게됨)
# docker run -i -t <이미지명> bin/bash
# Ctrl+P+Ctrl+Q (bash 종료하지만 백그라운드로 구동됨)

컨테이너에 접속
# docker attach <컨테이너ID>

삭제

이미지 삭제
# docker rmi <이미지ID>
예 docker rmi 1234
컨테이너 삭제
# docker rm <컨테이너 명>
docker rm abc
모두 삭제
# docker rm `docker ps -a -q`

검색

이미지 검색
# docker search <키워드>
예 docker search ubuntu

이미지 다운로드
# docker pull <이미지>
예 docker pull ubuntu:lastest

Posted by foon
코딩/Visual Studio2017. 11. 10. 07:34

Visual Studio에서 빈 솔루션 생성하는 방법입니다. (VS 2015)


빈번하게 만들지 않기 때문에 한번 만들려면 찾아 헤매는 경우가 있어 기록해둡니다.


"새 프로젝트 -> 설치됨 -> 템플릿 -> 기타 프로젝트 형식 -> Visual Studio 솔루션" 입니다.


Although a project must reside in a solution, you can create a solution that has no projects.

To create an empty solution

  1. On the File menu, click New and then click New Project.

  2. In the left pane, select Installed, select Other Project Types, and then select Visual Studio Solutions from the expanded list.

  3. In the middle pane, select Blank Solution.

  4. Set the Name and Location values for your solution, then click OK.

After you create an empty solution, you can add new or existing projects or items to it by clicking Add New Item or Add Existing Item on the Projectmenu.

출처 - https://msdn.microsoft.com/en-us/library/zfzh36t7.aspx


'코딩 > Visual Studio' 카테고리의 다른 글

c# 프로젝트 참조들이 느낌표로 표시될 때  (0) 2017.11.09
Posted by foon
코딩/Visual Studio2017. 11. 9. 20:52

루션에 프로젝트를 추가하면 참조에 느낌표가 표시되면서 빌드가 안 되는 경우가 있습니다.





이때, 프로젝트 파일 ( Example.csproj )을 열었을 때, 다음 문구가 있다면, 


...


<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />

  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

    <PropertyGroup>

      <ErrorText>이 프로젝트는 이 컴퓨터에 없는 NuGet 패키지를 참조합니다. ... </ErrorText>

    </PropertyGroup>

    <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />

  </Target> 


...


아래와 같이 <!-- ... --> 로 주석 처리를 해주면 됩니다.


 

...


<!--


<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />

  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

    <PropertyGroup>

      <ErrorText>이 프로젝트는 이 컴퓨터에 없는 NuGet 패키지를 참조합니다. ... </ErrorText>

    </PropertyGroup>

    <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />

  </Target> 


-->

...


< END >

Posted by foon