Skip to content

Instantly share code, notes, and snippets.

@clara-shin
clara-shin / 1.js
Created August 9, 2019 12:34 — forked from mxriverlynn/1.js
Standard deviation, in JavaScript
var sum = values.reduce(function(sum, value){
return sum + value;
}, 0);
var avg = sum / data.length;
@clara-shin
clara-shin / grade2.java
Created May 30, 2018 07:56
์„ฑ์ ์ฒ˜๋ฆฌ ์ž๋ฐ”
class Grade {
int e; //์˜์–ด ์„ฑ์ ์„ ์œ„ํ•œ ๋ณ€์ˆ˜
int m; //์ˆ˜ํ•™ ์„ฑ์ ์„ ์œ„ํ•œ ๋ณ€์ˆ˜
void output_grade() { //์ด์ ์„ ๊ตฌํ•˜๋Š” ๋ฉ”์†Œ๋“œ
System.out.println(e+m);
}
}
public class GradeOutput {
public static void main(String args[]) {
Grade g1, g2; //2๋ช…์˜ ์„ฑ์ ์„ ํ‘œํ˜„ํ•˜๋Š” ๊ฐ์ฒด
@clara-shin
clara-shin / grade1.c
Created May 30, 2018 07:52
์„ฑ์ ์ฒ˜๋ฆฌC
int e[2]; //์˜์–ด ์„ฑ์ ์„ ์œ„ํ•œ ๋ณ€์ˆ˜
int m[2]; //์ˆ˜ํ•™ ์„ฑ์ ์„ ์œ„ํ•œ ๋ณ€์ˆ˜
void input_grade() { //์˜์–ด, ์ˆ˜ํ•™ ์„ฑ์ ์„ ์ž…๋ ฅ ๋ฐ›๋Š” ํ•จ์ˆ˜
e[0] = 90; //์ฒซ ๋ฒˆ์งธ ํ•™์ƒ์˜ ์˜์–ด ์„ฑ์ 
e[1] = 80; //๋‘ ๋ฒˆ์งธ ํ•™์ƒ์˜ ์˜์–ด ์„ฑ์ 
m[0] = 85; //์ฒซ ๋ฒˆ์งธ ํ•™์ƒ์˜ ์ˆ˜ํ•™ ์„ฑ์ 
m[1] = 80; //๋‘ ๋ฒˆ์งธ ํ•™์ƒ์˜ ์ˆ˜ํ•™ ์„ฑ์ 
}
void output_grade() { //์ด์  ์ถœ๋ ฅํ•˜๋Š” ํ•จ์ˆ˜
@clara-shin
clara-shin / Hello.java
Created May 30, 2018 06:53
Hello application
/**
* The Hello class implements an application that
* simply prints โ€œHello, Java Application!โ€ to standard output. */
public class Hello {
public static void main(String args[]) { // main method
/* Display the string */
System.out.println("Hello, Java Application!");
}
}
@clara-shin
clara-shin / timeComplexity2.js
Created May 28, 2018 12:51
์‹œ๊ฐ„๋ณต์žก๋„ ๊ตฌํ•˜๊ธฐ
// first
i = 1; // 1
while (i <= n) { // n + 1
x = x + 1; // 1
i = i + 1; // 1
}
// second
int i, j;
for(i=1; i <= n; i++) // n
@clara-shin
clara-shin / timeComplexity.js
Last active May 28, 2018 10:45
์‹œ๊ฐ„๋ณต์žก๋„
function timeComplexity(arr, n) {
let sum = 0; // 1
let i = 0; // 1
let average = 0; // 1
while(i < n) { // n + 1
sum = sum + arr[i]; // n
i = i + 1; // n
}
@clara-shin
clara-shin / binarysearch.js
Created May 28, 2018 09:50
์ด์ง„ํƒ์ƒ‰ ์•Œ๊ณ ๋ฆฌ์ฆ˜
function binarysearch(arr, left, right, x){
let mid = 0;
if(left > right) {
return -1;
}
mid = (left+right)/2;
@clara-shin
clara-shin / sequentialSearch.js
Last active May 28, 2018 10:05
์ˆœ์ฐจํƒ์ƒ‰ ์•Œ๊ณ ๋ฆฌ์ฆ˜
function sequentialSearch(arr,n,x){
for(let i=0; i < n; i++){
if(x === arr[i]) return i;
}
return -1; //ํƒ์ƒ‰์‹คํŒจ ์‹œ ๋ฆฌํ„ด -1
}
/*
arr=[0,1, ...n-1];์—์„œ x๋ฅผ ์ฐพ๋Š” ์•Œ๊ณ ๋ฆฌ์ฆ˜
๋ฐฐ์—ด arr, n ์€ data ๊ฐœ์ˆ˜, x ๋Š” ์ฐพ๊ณ ์ž ํ•˜๋Š” data
@clara-shin
clara-shin / sample.js
Created May 19, 2018 05:08
ํ…Œ์ŠคํŠธ
function add(x,y){
return x+y;
}
@clara-shin
clara-shin / use-git-and-git-flow.adoc
Created February 6, 2018 09:00 — forked from ihoneymon/use-git-and-git-flow.adoc
git ์„ ๊ธฐ๋ฐ˜์œผ๋กœ git-flow๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐฐํฌ๋ฒ„์ „์„ ๊ด€๋ฆฌํ•˜์ž.

GIT์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ ํ”„๋กœ์ ํŠธ ๊ฐœ๋ฐœํ”„๋กœ์„ธ์Šค

๊นƒ์„ ์‚ฌ์šฉํ•ฉ์‹œ๋‹ค. ๊นƒ์„ ์“ฐ์ž. ๊นƒ์„ ์“ฐ๋ž€ ๋ง์•ผ!!

  • SVN์€ ๋ณ€๊ฒฝ์ด๋ ฅ์ด ๋งŽ์•„์งˆ์ˆ˜๋ก ์†๋„๊ฐ€ ๋А๋ฆฌ์ง€.

    • ์ปค๋ฐ‹ ๋ฐ ์ฒ˜๋ฆฌ์†๋„๊ฐ€ ๋น ๋ฅด๋‹ค. ๋ณ€๊ฒฝ์ด๋ ฅ์ด ๋งŽ์ด ์ถ•์ ๋˜์–ด ์žˆ์–ด๋„ ์†๋„์ €ํ•˜๊ฐ€ ๊ฑฐ์˜ ์—†๋‹ค.

  • ์ปค๋ฐ‹์ฐ๊ธฐ๊ฐ€ ์–ด๋ ต๋‹ค.