Skip to content

Instantly share code, notes, and snippets.

View liuxueyang's full-sized avatar
🙊
🌝️🌝️🌝️

liuxueyang liuxueyang

🙊
🌝️🌝️🌝️
View GitHub Profile
@liuxueyang
liuxueyang / latest-firefox.sh
Created March 21, 2017 09:55 — forked from ruario/latest-firefox.sh
This script will find the latest Firefox binary package, download it and repackage it into Slackware format.
#!/bin/bash
# latest-firefox Version 1.3.9
# This script will find the latest Firefox binary package, download it
# and repackage it into Slackware format.
# I don't use Firefox for regular browsing but it is handy for
# comparative tests against Vivaldi. :P
# Copyright 2016 Ruari Oedegaard, Oslo, Norway
#!perl
use v5.20;
use strict;
use warnings;
use Class::Struct;
struct (
Interval => [
length => '$',
cntShip => '$',
endPos => '$'
#!perl
use v5.18;
# time complexity: O(Nlog(N))
# got Accepted
while(<>){
my(@b,@a,$i,$n,$m,$s0,$pos);
($n,$m)=split;
for $i ( 0..$n-1 ) {
($s0,$_)=split ' ',<>; push @a,$s0;
}
@liuxueyang
liuxueyang / SortAndCompressArray.java
Last active July 17, 2016 12:21
Java离散化,根据类的某个成员排序数组
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws FileNotFoundException {
int t;
Scanner cin;

Setup lisp with slime on OS X

Install your favorite lisp interpreter

If you already have Homebrew, just open a terminal and type

$ brew install clozure-cl
@liuxueyang
liuxueyang / life.lisp
Created April 6, 2016 13:46 — forked from masatoi/life.lisp
life
(ql:quickload 'lispbuilder-sdl)
(ql:quickload 'lispbuilder-sdl-gfx)
(ql:quickload 'alexandria)
(defparameter world (make-array '(100 100) :element-type 'fixnum))
;; initialize
(defun init-world! (world)
(loop for i from 0 to (1- (array-dimension world 0)) do
(loop for j from 0 to (1- (array-dimension world 1)) do
% --------------------------------------------------------------
% This is all preamble stuff that you don't have to worry about.
% Head down to where it says "Start here"
% --------------------------------------------------------------
\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}