Skip to content

Instantly share code, notes, and snippets.



Block or report user

Report or block LuckyKoala

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
LuckyKoala / evaluator.scm
Last active Nov 2, 2018
SICP 4.1,Lisp解释器实现(包含习题解答)
View evaluator.scm
(define (eval exp env) ((analyze exp) env))
(define (analyze exp)
(cond ((self-evaluating? exp)
(analyze-self-evaluating exp))
((quoted? exp)
(analyze-quoted exp))
((variable? exp)
(analyze-variable exp))
((assignment? exp)
LuckyKoala / 6174.c
Last active Jun 18, 2018
View 6174.c
#include <stdio.h>
#include <stdlib.h>
#include "mpi.h"
//------Common base------
typedef int bool;
enum { false, true };
//------Define a struct of four digit number------
typedef struct {
int thousand;
LuckyKoala / monte_carlo.c
Last active Jun 18, 2018
View monte_carlo.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include "mpi.h"
//------Common base------
typedef int bool;
enum { false, true };
LuckyKoala / sicpDataAbstraction.js
Last active May 2, 2018
Javascript implementation for SICP Chapter 2.
View sicpDataAbstraction.js
sicp = (function() {
//-----Base implementation------
//Primitive procedure
let cons = (x,y) => [x,y];
let car = (pair) => pair[0];
let cdr = (pair) => pair[1];
//Nil definition
let nil = [];
let isNil = (obj) => obj==null || (Array.isArray(obj) && obj.length==0);
//Helper procedure to build, extract, compare and print list
# 来源 [GitHub](
# 部分注释由iwar添加
read -p "请输入您公网网卡名称:(如:eth0)" ethx
read -p "请输入您的局域网路由器IP:(如:" netip
LuckyKoala / deference_pointer.c
Last active Mar 25, 2018
int array[8]; &array 的类型是 int (*)[8]
View deference_pointer.c
#include <stdio.h>
int main(void)
int array[8] = {10,11,12,13,14,15,16,17};
int *p = array;
int *q = &array; //提示不兼容的类型,这里其实是转换了指针类型
int (*z)[8] = &array;
printf("the size of array: %ld, the size of &array: %ld\n", sizeof(array), sizeof(&array));
LuckyKoala /
Last active Mar 21, 2018
#!/bin/bash -e
#用法: [auto]
chars=$(zenity --title 中文输入 --text 中文输入 --entry 2>/dev/null)
if [ $1 == "auto" ]
LuckyKoala / deepsum.js
Created Jun 27, 2017
Abou Seven Languages In Seven Weeks Io,Day 2. Use js as extension name so the code can be highlighted.
View deepsum.js
//For 3.3
//Create a nested list
li := list(1,2,3,list(3,4),"str")
//Flatten and only operate on Number and then sum them
List deepsum := method(
self flatten select(isKindOf(Number)) sum
li deepsum
LuckyKoala /
Last active Oct 3, 2017
Simple plugin for Minecraft
package tech.zuosi.plugin.antiautofishing;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerFishEvent;
import org.bukkit.inventory.ItemStack;
LuckyKoala / login.jsp
Created May 30, 2017
Simple jsp for user login
View login.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:useBean id="loginBean" class="javabean.LoginBean" scope="session"/>
当前用户: <%= loginBean.getUname() %>[UUID: <%= loginBean.getUuid() %>]
最近一次登录状态: <%= session.getAttribute("loginMessage") %>
if(loginBean.getHasLogin()) {
<a href="login?loginOperator=LOGOUT&srcPage=<%= request.getParameter("srcPage") %>">注销</a>
} else {
You can’t perform that action at this time.