Skip to content

Instantly share code, notes, and snippets.

View morris821028's full-sized avatar
💭
I may be slow to respond.

Shiang-Yun Yang morris821028

💭
I may be slow to respond.
View GitHub Profile
@morris821028
morris821028 / Troubleshooting.md
Created April 15, 2022 02:54
Cadence APD Crash

Error message

Allegro Package Designer+ 17.4 S023 Linux SPB 64-bit Edition
      (c) Copyright 2019 Cadence Design Systems, Inc.
             All Rights Reserved.
Termination codes: exit=3, signal=11, errno=2

Workaround

@morris821028
morris821028 / gist:7cf28da12bb710257bc4c146b5a87fcb
Created January 18, 2022 01:06
Orbit Abbreviation & Acronyms
A
Acl A Class Library (library of application agnostic utility classes, Orbit project prefix)
APR Advanced Package Router (Allegro toolkit)
ASIC Application-Specific Integrated Circuit
B
BB Bounding Box
@morris821028
morris821028 / report.txt
Created December 8, 2020 02:55
JNI, Java ProcessBuilder, Thread Error
KEYWORDS: JNI, Java, ProcessBuilder, Thread Error
ERROR MESSAGE: [os,thread] Failed to start thread - pthread_create failed (EINVAL) for attributes: stacksize: 136k, guardsize: 0k, detached.
SOLUTION: -Djdk.lang.processReaperUseDefaultStackSize=true
DESCRIPTION:
From JNI process, it is fine to execute Java internal multi-threading, but can not use Runetime.exec or
ProcessBuilder to do anything. Even through adjust java stack-realted option
#include <stdio.h>
#include <memory.h>
#define GET(x) (cnt[x>>5]>>(x&31)&1)
#define SET(x) (cnt[x>>5] |= 1<<(x&31))
#define REV(x) (cnt[x>>5] ^= 1<<(x&31))
long long ret = 0;
void divide(int a[], int b[], int n) {
if (n <= 1) return 0;
@morris821028
morris821028 / e861_gc.cpp
Last active January 27, 2020 11:38
e861: 【記憶中】之記憶中的堆疊
#include <bits/stdc++.h>
using namespace std;
template<typename T>
struct PStack : std::enable_shared_from_this<PStack<T>> {
T elem;
shared_ptr<PStack<T>> next;
int sz;
PStack(): sz(0), elem(), next(nullptr) {}
@morris821028
morris821028 / problem.md
Created December 24, 2019 12:25
記憶中的堆疊

題目描述

不斷地進行「思想實驗」的妮可,終於讓大腦演進到平行思考。假想在腦海裡,我們把狀態以堆疊 (Stack) 的方式儲存,當走投無路的時候,就會退回到上一個狀態,再把新的分支因素堆疊上去。正在全力計算的妮可無法細說每一個思維狀態,而我們可以操作戳記,反推出當前狀態。

操作有以下三種:

  • 0 v: 退回版本 v
  • 1 x: 在當前堆疊,push x 到堆頂
  • 2: 印出當前堆疊狀態
@morris821028
morris821028 / Persistent.java
Last active December 15, 2019 13:21
Purely functional queues in Java
package persistent;
import java.util.Scanner;
public class Persistent {
public static interface PStack<T> {
public boolean isEmpty();
public long size();
@morris821028
morris821028 / xxx.vmx
Created August 19, 2019 13:23
MapleStory VMware v218
SMBIOS.reflectHost = "TRUE"
hypervisor.cpuid.v0 = "FALSE"
@morris821028
morris821028 / Main.java
Created July 16, 2018 12:23
Java Iterator Performance - HashSet/TreeSet
import java.util.*;
public class Main {
static class Point implements Comparable<Point> {
long x;
long y;
public Point(long x, long y) {
this.x = x;
package bsh;
import org.junit.Test;
public class MemoryTest {
static public double printUsage() {
double cap = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
cap /= 1048576;
System.out.printf("Usage %f MB\n", cap);