This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
''' | |
连接数据库,查询表信息,生成markdown文档内容 | |
''' | |
from __future__ import print_function | |
import mysql.connector | |
import getpass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
MGraph是用邻接矩阵实现的图存储结构。 | |
Dijkstra算法求最短路径。 | |
*/ | |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <string.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ 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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
import org.bukkit.plugin.java.JavaPlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
#用法: minecraft_input.sh [auto] | |
#加上参数auto意味着脚本会自动将接收到的文字发送到输入框中并发送 | |
#如果是在告示牌上使用,不需要带参数 | |
#打开zenity对话框 | |
chars=$(zenity --title 中文输入 --text 中文输入 --entry 2>/dev/null) | |
#检查是否有参数 | |
if [ $1 == "auto" ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 来源 [GitHub](https://github.com/funet8/shell/blob/master/check_internet.sh) | |
#网络检查的脚本,当你不能上公网时,则直接执行这个脚本 | |
# 部分注释由iwar添加 | |
#输入网卡和局域网路由器IP | |
read -p "请输入您公网网卡名称:(如:eth0)" ethx | |
read -p "请输入您的局域网路由器IP:(如:192.168.1.1)" netip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <math.h> | |
#include "mpi.h" | |
//------Common base------ | |
typedef int bool; | |
enum { false, true }; |
OlderNewer