Skip to content

Instantly share code, notes, and snippets.

@xingty
xingty / wf.sh
Created March 3, 2023 12:06
用来过滤文本中的单词
#!/bin/bash
# words filter 过滤文本中每一行的单词,忽略句子
do_filter() {
while read -r line || [ -n "$line" ]; do
words_count=$(echo $line | wc -w)
if [[ $words_count -eq 1 ]]; then
echo $line
echo $line >> $output
fi
@xingty
xingty / jdk1.4.java
Last active July 25, 2021 12:32
Dog's bytecode jdk1.4
Classfile Dog.class
Last modified Jul 25, 2021; size 292 bytes
MD5 checksum 0a3fc7839e461000cf02f189aad9a1cc
Compiled from "Dog.java"
public class org.wiyi.bridge.Dog extends org.wiyi.bridge.Animal
minor version: 0
major version: 46
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #2 // org/wiyi/bridge/Dog
super_class: #4 // org/wiyi/bridge/Animal
public class GeoHashHelper {
private static final double MAX_LAT = 90;
private static final double MIN_LAT = -90;
private static final double MAX_LNG = 180;
private static final double MIN_LNG = -180;
private static final int length = 20;
private static final double latUnit = (MAX_LAT - MIN_LAT) / (1 << 20);
private static final double lngUnit = (MAX_LNG - MIN_LNG) / (1 << 20);
private static final String[] base32Lookup =
{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "b", "c", "d", "e", "f", "g", "h",