Skip to content

Instantly share code, notes, and snippets.

View foreverlms's full-sized avatar
📚
Studying

bobliao foreverlms

📚
Studying
View GitHub Profile
@foreverlms
foreverlms / trace.h
Created October 21, 2022 07:12 — forked from petewarden/trace.h
Header file for simple variable tracing macros
#ifndef INCLUDE_TRACE_H
#define INCLUDE_TRACE_H
#include <stdio.h>
#include <stdint.h>
#define TRACE_STR(variable) do { fprintf(stderr, __FILE__":%d "#variable"=%s\n", __LINE__, variable); } while (0)
#define TRACE_INT(variable) do { fprintf(stderr, __FILE__":%d "#variable"=%d\n", __LINE__, variable); } while (0)
#define TRACE_PTR(variable) do { fprintf(stderr, __FILE__":%d "#variable"=0x%016lx\n", __LINE__, (uint64_t)(variable)); } while (0)
#define TRACE_SIZ(variable) do { fprintf(stderr, __FILE__":%d "#variable"=%zu\n", __LINE__, variable); } while (0)
@foreverlms
foreverlms / AdbCommands
Created May 27, 2021 04:09 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@foreverlms
foreverlms / color.bash
Created March 16, 2019 08:42
ubuntu终端配色PS1变量设置
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32;01m\]\u@\h:\[\033[00;00;01m\]\w\$ \[\033[0;36;01m\]'
@foreverlms
foreverlms / BlockingQueueTest.java
Created July 1, 2018 07:57
Java BblockingQueue和synchronized加锁关键字两种方法实现递归搜索文件关键字 用于衡量两种方法执行效率不准确,因为存在多线程,导致得出的时间不是正确的。
package chapter14.blockingQueue;
import java.io.File;
import java.io.IOException;
import java.util.Scanner;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
public class BlockingQueueTest {