Skip to content

Instantly share code, notes, and snippets.

View keeproll's full-sized avatar

Jewoong Ku keeproll

  • Korea
View GitHub Profile
@keeproll
keeproll / AsyncFIFOExample.java
Created October 16, 2024 07:36
AsyncFIFOExample
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.AsynchronousFileChannel;
import java.nio.channels.CompletionHandler;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.locks.ReentrantLock;
@keeproll
keeproll / JdbcTemplateItemRepositoryV2.java
Created July 28, 2022 05:27
NamedParameterJdbcTemplate을 이용한 동적파라미터 처리 보완
package hello.itemservice.repository.jdbctemplate;
import hello.itemservice.domain.Item;
import hello.itemservice.repository.ItemRepository;
import hello.itemservice.repository.ItemSearchCond;
import hello.itemservice.repository.ItemUpdateDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
@keeproll
keeproll / JdbcTemplateItemRepositoryV1.java
Created July 28, 2022 00:35
JDBCTemplate을 이용한 DB 컨트롤 V1
package hello.itemservice.repository.jdbctemplate;
import hello.itemservice.domain.Item;
import hello.itemservice.repository.ItemRepository;
import hello.itemservice.repository.ItemSearchCond;
import hello.itemservice.repository.ItemUpdateDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.propertyeditors.StringArrayPropertyEditor;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.EmptyResultDataAccessException;
@keeproll
keeproll / Compare two linked lists.cpp
Created September 12, 2018 02:18
HackerRank - Compare two linked lists
#include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
@keeproll
keeproll / Delete a Node.cpp
Created September 10, 2018 02:11
HackerRank - Delete a Node
#include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
@keeproll
keeproll / Insert a node at a specific position in a linked list.cpp
Created September 6, 2018 02:03
HackerRank - Insert a node at a specific position in a linked list
#include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
@keeproll
keeproll / Insert a node at the head of a linked list.cpp
Created September 6, 2018 01:31
HackerRank - Insert a node at the head of a linked list
#include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
@keeproll
keeproll / Insert a Node at the Tail of a Linked List.cpp
Created September 6, 2018 01:15
HackerRank - Insert a Node at the Tail of a Linked List
#include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
@keeproll
keeproll / Print the Elements of a Linked List.cpp
Created September 6, 2018 00:39
HackerRank - Print the Elements of a Linked List
#include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
@keeproll
keeproll / Sparse Array.cpp
Created September 4, 2018 04:34
HackerRank - Sparse Array
#include <bits/stdc++.h>
using namespace std;
// Complete the matchingStrings function below.
vector<int> matchingStrings(vector<string> strings, vector<string> queries) {
vector<int> vRet;
for(auto it : queries) {
int iCount = count_if(strings.begin(), strings.end(), [&](string s) {
return it == s;