Skip to content

Instantly share code, notes, and snippets.

// https://binarysearch.com/problems/Edges-that-Disconnect-the-Graph
import java.util.*;
class Solution {
static class Result {
int lowLink;
boolean isCycle;
Result(int lowLink, boolean isCycle) {
@kelvinc1024
kelvinc1024 / Solution.kt
Last active May 9, 2021 20:51
[Kotlin] Fast Print Scan Template for Competitive Programming
import java.io.*
import java.util.*
fun main() {
Solution().main()
}
class Solution {
fun main() {
solve()
@kelvinc1024
kelvinc1024 / Solution.java
Last active August 7, 2022 20:35
[Java] Fast Print Scan Template for Competitive Programming
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
int tc = io.nextInt();
for (int i = 0; i < tc; i++) {
solve();
}
sh("mkdir ~/.ssh")
withCredentials([sshUserPrivateKey(credentialsId: '1234-abcd-efgh-5678', keyFileVariable: 'SSH_PRIVATE_KEY', passphraseVariable: 'SSH_PASS', usernameVariable: 'SSH_USER')]) {
sh("cp $SSH_PRIVATE_KEY ~/.ssh/id_rsa")
}
sh("chmod 700 ~/.ssh/id_rsa")
sh 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=~/.ssh/known_hosts -p 7999 git@bitbucket.org whoami'
sh 'git submodule update --init --recursive'
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".ScrollingActivity">
@kelvinc1024
kelvinc1024 / CustomSwipeRefreshLayout.java
Created September 26, 2018 02:38
CustomTargetScrollSwipeRefreshLayout
import android.content.Context;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.View;
public class CustomSwipeRefreshLayout extends SwipeRefreshLayout {
private View mScrollView;
public CustomSwipeRefreshLayout(Context context, AttributeSet attrs) {
@kelvinc1024
kelvinc1024 / not_working_literal_nested_coordinator_layout.xml
Created September 13, 2018 00:38
Literal Nesting Coordinator Layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbarLayout"
android:layout_width="match_parent"
@kelvinc1024
kelvinc1024 / scroll_exitUntilCollapsed_and_scroll_enterAlways_not_working.xml
Created September 13, 2018 00:07
Scroll ExitUntilCollapsed with Scroll EnterAlways is not working
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbarLayout"
android:layout_width="match_parent"
@kelvinc1024
kelvinc1024 / scroll_and_scroll_enterAlways.xml
Created September 12, 2018 09:43
Scroll and Scroll Enter Always combination
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbarLayout"
android:layout_width="match_parent"
@kelvinc1024
kelvinc1024 / activity_main.xml
Created September 12, 2018 07:23
NestedScrollCoordinatorLayout Usage Example
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbarLayout"
android:layout_width="match_parent"