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
@Slf4j | |
@Data | |
@Entity | |
@Table(name = "ad_segment") | |
public class AdSegment { | |
@Id | |
@GeneratedValue | |
private long id; |
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 java.util.Collection; | |
import java.util.Set; | |
public interface SegmentCategoryCustomRepo { | |
Set<Long> findSegmentsByCategoryId(Collection<Long> categoryIds); | |
} |
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
@Configuration | |
@ConfigurationProperties(prefix = "student") | |
public class AllStudentConfig { | |
@Setter @Getter | |
private StudentProperties younghee; | |
@Setter @Getter | |
private StudentProperties chulsoo; |
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
@ContextConfiguration | |
@DataJpaTest | |
class DbunitWithGenesisTest extends Specification { | |
private static Logger log = LoggerFactory.getLogger(DbunitWithGenesisTest.class) | |
def hi = 1L..10L | |
// testEntityManager는 persistence context 테스트 목적으로 사용된다. | |
// 즉, 실제 데이터베이스에 적용할수는 없다 | |
@Autowired |
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
local csv = require("csv") | |
local f = csv.open("device-table2.csv", {['header'] = true}) | |
local columns = {"id", "free_storage_in_byte", "used_storage_in_byte"} | |
local parameters = {} | |
local counter = 0 | |
for fields in f:lines() do | |
perRowCondition = {} | |
for index, value in pairs(fields) do | |
for _,v in pairs(columns) do |
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
def main() { | |
def input = 192 | |
def gcd | |
gcd = { int val, int remainder -> | |
if(remainder ==0){ | |
return val | |
} |
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
def main() { | |
def reader = new Scanner(System.in) | |
int a = reader.nextInt() | |
BigInteger count = (2 ** a) -1 | |
println(count) | |
boolean canPrint = a <= 20 | |
def hanoiTower | |
hanoiTower = { int num, int from, int to, int aux -> |
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
task submitLivy(type: Exec, dependsOn: shadowJar ) { | |
def targetUrl = 'http://localhost:8998/batches' | |
def sparkOption = file("livy.json").getText("utf-8") | |
def curlComm = ['curl', '-X', 'POST', '-H', 'Content-Type: application/json', targetUrl, '-d', sparkOption] | |
doLast { | |
ProcessBuilder builder = new ProcessBuilder(curlComm) | |
println builder.command() | |
Process process = builder.start() |
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
def main2() { | |
// def reader = new Scanner(System.in) | |
// String str1 = reader.next() | |
// String str2 = reader.next() | |
// | |
// println(str1, str2) | |
def characters = 'FRANCE'.trim().toCharArray() | |
def characters2 = 'french'.trim().toCharArray() |
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 Solution { | |
// Complete the climbingLeaderboard function below. | |
def climbingLeaderboard(scores: Array[Int], alice: Array[Int]) = { | |
val score2 = scores.distinct | |
val length = score2.length-1 | |
var j = length | |
for(i:Int <- alice) yield { | |
val cond = score2.search[Int](i)(Ordering[Int].reverse) match { |