텍스트 입력할때 CPU사용량이 폭등하는 문제 완화하기
https://youtrack.jetbrains.com/issue/IDEA-207243
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intToBase64 = [ | |
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', | |
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', | |
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', | |
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', | |
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' | |
] | |
def encode(InputStream is) { | |
int countByte = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object MergeSort { | |
def sort(source: Array[Int]): Unit = { | |
branch(source, 0, source.length) | |
} | |
private def sortAndMerge(source: Array[Int], | |
offset0: Int, len0: Int, | |
offset1: Int, len1: Int): Unit = { | |
val buffer = new Array[Int](len0 + len1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object HeapSort { | |
def sort(source: Array[Int]): Unit = { | |
buildHeap(source) | |
lineUp(source) | |
} | |
private def buildHeap(source: Array[Int]): Unit = { | |
def moveUp(source: Array[Int], idx: Int): Unit = { | |
if (idx > 0) { | |
val pIdx = Math.round(idx * 0.5f) - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn- round [idx] | |
(int (+ idx 0.5))) | |
(defn- get-parent-idx [idx] | |
(dec (round (* idx 0.5)))) | |
(defn- get-left-child-idx [idx] | |
(inc (* idx 2))) | |
(defn- get-right-child-idx [idx] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn- swap [source idx0 idx1] | |
(def tmp (aget source idx0)) | |
(aset source idx0 (aget source idx1)) | |
(aset source idx1 tmp)) | |
; find median among start/mid/end | |
(defn- get-pivot [source start len] | |
(let [end (+ start (dec len)) mid (+ start (int (/ len 2)))] | |
(if | |
(or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn- count-change [coins offset target] | |
(if (= target 0) | |
1 | |
(loop [coins coins offset offset target target sum 0] | |
(if (< offset (alength coins)) | |
(if (>= target (nth coins offset)) | |
(recur coins (inc offset) target (+ sum (count-change coins offset (- target (nth coins offset))))) | |
(recur coins (inc offset) target sum)) | |
sum)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import java.io.IOException; | |
import java.util.Map; | |
import java.util.UUID; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.context.annotation.Configuration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert all m4a to mp3 in directory | |
# mp3 256k bitrate | |
for f in *.m4a; do name=`basename ${f} .m4a`; ffmpeg -i ${f} -acodec libmp3lame -ab 256k ${name}.mp3; done |
Storybook 패키지로부터 react, react-dom, emotion 패키지의 타입 정의가 컴파일에 포함되는데,
vue에 맞게 intrinsic elements, value-based elements를 타입 호환이 되도록 맞출수가 없다.
storybookjs/storybook#7379
부모 컴포넌트에서 functional component엘리먼트에 v-for와 ref를 적용했을때 refInFor가 적용되지 않음.
ref에 지정한 이름의 프로퍼티에 엘리먼트 array로 저장되지 않고 v-for의 마지막 엘리먼트만 저장됨.
vuejs/vue#10171
찾아봤는데 vue-template-compiler에 결함이 있다.
OlderNewer