This file contains hidden or 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 java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
public class DirReduction { | |
public static String[] dirReduc(String[] arr) { | |
// Your code here. | |
//for simpler result |
This file contains hidden or 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
public class Kata { | |
public static String high(String s) { | |
String bitWords = ""; | |
int bitWordsPoint = 0; | |
String[] words = s.split(" "); | |
int tempPoint = 0; | |
for(String word : words) { | |
tempPoint = getWordsPoint(word.toLowerCase()); |
This file contains hidden or 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 java.util.ArrayList; | |
import java.util.Collections; | |
public class Line { | |
static int ticketPrice= 25; | |
public static String Tickets(int[] peopleInLine) | |
{ | |
int checkPrice = 0; | |
int changeIndex = -1; |
This file contains hidden or 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 java.util.Arrays; | |
import java.util.List; | |
import java.util.Collections; | |
import java.utils.Arrays; | |
public class FindOdd { | |
public static int findIt(int[] a) { | |
int odd = 0; | |
List<Integer> list = Arrays.asList(ArrayUtils.toObject(a)); | |
for(int i : a){ | |
if(Collections.frequency(list, i)%2>0){ |
This file contains hidden or 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
public static String HighAndLow(String numbers) { | |
// Code here or | |
String[] splitStr = numbers.split(" "); // split by " " | |
int lNum = Integer.parseInt(splitStr[0]); //lowest number init; | |
int hNum = Integer.parseInt(splitStr[0]); // highest number init; | |
for(int i=1; i<splitStr.length; i++){//compare | |
if(lNum>Integer.parseInt(splitStr[i])) | |
lNum = Integer.parseInt(splitStr[i]); | |
if(hNum<Integer.parseInt(splitStr[i])) | |
hNum = Integer.parseInt(splitStr[i]); |
This file contains hidden or 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 java.math.*; | |
public class Multiply { | |
public static Double multiply(Double a, Double b) { | |
BigDecimal s1 = new BigDecimal(String.valueOf(a)); | |
BigDecimal s2 = new BigDecimal(String.valueOf(b)); | |
//return a * b | |
return s1.multiply(s2).doubleValue(); | |
} | |
} |
This file contains hidden or 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
export IMPLOG=/oradir # directory for Import log | |
export DUMP_DATE=`date +%y%m%d` #making dumpdate | |
echo "schemas migration : " `date` >> $IMPLOG | |
impdp system/systempw directory=oradir content=metadata_only dumpfile=dumpfile.dmp logfile=logfile.log schemas=SCHEMA >> $IMPLOG | |
#for all export data, User system account. | |
#directory : What you create directory on Oracle upper step. | |
#CONTENT=METADATA_ONY : Only import metadata (not records) | |
#dumpfile : Dump file what you made using expdb in 'directory' | |
#logfile : making log file |
This file contains hidden or 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
expdp system/systempw directory=oradir dumpfile=oraback.dmp logfile=exp.log schemas=SCHEMANAME CONTENT=METADATA_ONLY | |
#for all export data, User system account. | |
#directory : What you create directory on Oracle upper step. | |
#dumpfile : Dump file will be made using this name on 'dirtory' location | |
#logfile : making log file | |
#schemas : select schema what you want exporting | |
#CONTENT=METADATA_ONY : Only export metadata (not records) |
This file contains hidden or 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
#!/bin/bash | |
# JINHYUP KIM | |
cd /data/program/bin #move to directory | |
pid=`ps -ef | grep "Programname" | grep -v 'grep' | awk '{print $2}'` | |
#Get PID for checking already running or not | |
#ps -ef : Get information about running process. -e: Every proecss's , -f: Detail Information | |
# | grep "Programname" : Find process contained "Programname" pattern on "ps -ef" result. | |
# | grep -v 'grep': Get result of not included 'grep'. Can get process info except "grep" searching process. | |
# | awk '{print $2}' : Get information of second($2) value in "ps -ef | grep "Programname" | grep -v 'grep'". $2(second) value is PID. | |
if [ -z $pid ] # -z: checking string size is zero or not. size is zero = true. (If pid size zero, this prgram is not running now) |
This file contains hidden or 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
public static string SimpleUrl(string orgUrl) | |
{ | |
string shortUrl = ""; | |
string key = "google key"; //Google 단축키 Key URL | |
var request = (HttpWebRequest)WebRequest.Create("https://www.googleapis.com/urlshortener/v1/url?key=" + key); | |
//google simple url api 로 key 값 전달 | |
request.ContentType = "application/json"; | |
request.Method = "POST"; | |
request.ContentType = "application/json"; |