Skip to content

Instantly share code, notes, and snippets.

View duangsuse's full-sized avatar
👨‍💻
Leaning at school

duangsuse duangsuse

👨‍💻
Leaning at school
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@duangsuse
duangsuse / Cosmic.java
Last active January 21, 2021 11:29 — forked from Trumeet/Main.java
Cosmic Number
import java.util.*;
/**
* Cosmic Number
* License: Unlicensed
**/
public class Cosmic {
private static final int ONE = 1; //$ tac -
private static final int TEN = ONE*10;
private static final int HUNDRED = TEN*10;
@duangsuse
duangsuse / JDrawing.java
Last active January 21, 2021 10:00 — forked from Trumeet/JDrawing.java
日常闲置重写(+3 files),花了三个小时,感觉击键/操作效率还是要提升,可是我懒得学了……
import javax.swing.*;
import java.awt.*;
import java.awt.geom.Path2D;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.stream.Collectors;
/**
@duangsuse
duangsuse / JPlayer.java
Last active January 18, 2021 18:11 — forked from Trumeet/JPlayer.java
Linux Terminal has the capability of displaying 8-bit colour, so why not play something on it?
import org.jcodec.api.FrameGrab;
import org.jcodec.common.io.NIOUtils;
import org.jcodec.common.model.Picture;
import org.jcodec.scale.AWTUtil;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
@duangsuse
duangsuse / CustomBaseNumber.kt
Last active February 13, 2020 04:23 — forked from CattenLinger/CustomBaseNumber.kt
CustomBaseNumberKt
import kotlin.math.abs
private val max = CustomBase.from(Long.MAX_VALUE)
private val maxLength = max.length
object CustomBase {
val radix = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toList().toCharArray()
val base = radix.size.toLong()
fun from(long: Long): String {
[
{
"content": "我从来不把安逸和快乐看作是生活目的本身,对这种伦理基础,我称之为“猪栏的理想”。",
"author": "爱因斯坦"
},
{
"content": "人生中最大的两个财富是:你的才华和你的时间。才华越来越多而时间越来越少。我们的一生就是用时间来换取才华。"
},
{
"content": "这辈子没法做太多的事情,所以每一件都要做到精彩绝伦!",