목록전체 글 (35)
동도리 개발 로그
문제 ====== https://www.hackerrank.com/challenges/diagonal-difference/problem Given a square matrix, calculate the absolute difference between the sums of its diagonals. For example, the square matrix is shown below: 1 2 3 4 5 6 9 8 9 The left-to-right diagonal = . The right to left diagonal = . Their absolute difference is . Function description Complete the function in the editor below. It must ..
package main import ( "fmt" ) //올림 차순 func selectionSortmintomax(array []int) { for i := 0; i < len(array)-1; i++ { min := i for j := i + 1; j < len(array); j++ { if array[j] < array[min] { min = j } } array[i], array[min] = array[min], array[i] } } //내림 차순 func selectionSortmaxtomin(array []int) { for i := 0; i < len(array)-1; i++ { max := i for j := i + 1; j < len(array); j++ { if array[j] < a..
문제 링크 -https://www.hackerrank.com/challenges/crush/problem Starting with a 1-indexed array of zeros and a list of operations, for each operation add a value to each of the array element between two given indices, inclusive. Once all operations have been performed, return the maximum value in your array. For example, the length of your array of zeros . Your list of queries is as follows: a b k 1 ..
GraphQL GraphQL은 페이스북에서 만든 '쿼리 언어'다. SQL 과 같은 역할을 하지만 구조 차이는 매우 크다. 실제 사용하는 방식도 많이 다르다. sql은 데이터베이스 시스템에 저장된 데이터를 효율적으로 가져오는것이 목적이고, gql(GraphQL)은 웹 클라이언트가 데이터를 서버로 부터 효율적으로 가져오는 것이 목적이다. sql의 문장은 백앤드에서 작성되어있고 호출 하지만 gql은 클라이언트가 작성하고 호출하게 되어있다. sql 예시 SELECT id, name, class FROM tbclasses WHERE id = '1'; gql 예시 { qeury{ classes(id:"1"){ id name class } } } sql 은 백앤드에 이미 저장되어 있는 쿼리이고, gql 은 클라이언트..
브라우저는 80 포트가 기본포트로 잡혀있기 때문에 포트번호를 입력하지 않으면 자동으로 80포트를 잡는다. http://****.co.kr = http://****.co.kr:80 하지만 Tomcat 은 8080 포트가 기본포트로 잡혀있기 때문에 Tomcat 서버에 접근하기 위해서는 항상 포트번호를 입력해야 하는 번거로움이 있다. 이것이 평소에는 특별한 문제가 되진 않지만 Tomcat 서버를 실서버로 사용하게 된다면 도메인(http://****.co.kr) 뒤에 포트번호를 입력해야 하므로 웹 사이트를 이용하는 사람들에게는 매우 불편한 일이다. http://****.co.kr:8080 따라서 이런 불편이 없도록 사용자가 80 포트로 접근하는 두가지 해결방법이 있다. 첫번째는 Tomcat 포트를 80 포..
*이글은 https://medium.com/@ehddnjs8989/%EB%B2%88%EC%97%AD-klaytn-token-economy-708ed7e02895 [번역]Klaytn Token Economy 6월 27일 Klaytn 메인넷이 런칭했다. 여러모로 기다려왔던 클레이튼이였고 PoW, PoS 방식에 익숙했던 나에게는 PoC라는 토큰 이코노미가 신선했다. 그에따라 투자도 어려워졌고 PoC에 관련하여 백서를 읽다보니 번역하고 싶은 마음이 생겨서… medium.com 에서 발췌 해옴을 알림니다 6월 27일 Klaytn 메인넷이 런칭했다. 여러모로 기다려왔던 클레이튼이였고 PoW, PoS 방식에 익숙했던 나에게는 PoC라는 토큰 이코노미가 신선했다. 그에따라 투자도 어려워졌고 PoC에 관련하여 백서를 읽..
GoLang 을 사용하면서 주의사항 몇가지 1. go 설치 후 go 를 설치 한다음 터미널에 go env 를 입력하여 go Path를 확인하자 $ go env GOARCH="amd64" GOBIN="" GOCACHE="/{User}/Library/Caches/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/{User}/go" GOPROXY="" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO..
Go에서는 패키지간 상속을 금지 하고있어서 서로 참조 하게되면 에러가 나온다 혹시나 A -> B -> C -> A (-> 는 참조) 와 같이 프로그래밍이 되어있다면... 어휴.... 찾는데 오래걸렸던 기억이 이경우엔 다시 개발하는것을 추천 아래의 코드를 보자. child.go package child import "../parent" type Child struct { parent *parent.Parent } func (child *Child) PrintParentMessage() { child.parent.PrintMessage() } func NewChild(parent *parent.Parent) *Child { return &Child{parent: parent } } parent.go pack..