Skip to content

Instantly share code, notes, and snippets.

@alexzhou
alexzhou / CPP_Template.cpp
Created September 11, 2022 08:56 — forked from Neilblaze/CPP_Template.cpp
Competitive Programming Template - C++
#include <bits/stdc++.h>
using namespace std;
/* clang-format off */
/* TYPES */
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vi vector<int>
@alexzhou
alexzhou / php.php
Created June 23, 2014 07:45
基于XML的ajax 数据交换
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
function loadDoc(url) {
var xmlhttp = null;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
@alexzhou
alexzhou / reverse.php
Created June 21, 2014 14:57
《编程珠玑》翻转字符串算法
<?php
function reverse($arr, $len, $m){
$k = 0;
for($i = 0; $i < $m; $i++){
$k = 1;
$temp = $arr[$i];
while(($k*$m+$i) % $len != $i){
$arr[($k-1)*$m+$i] = $arr[$k*$m+$i];
$k++;
}
@alexzhou
alexzhou / yii-delete-link.php
Last active April 30, 2018 09:57
create a delete link with post method in yii framework
@alexzhou
alexzhou / binary-clock.html
Created November 11, 2013 07:40
binary clock 二进制时钟
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<style>
.clock .one{
width: 16px;
height: 16px;
@alexzhou
alexzhou / circle_progressbar_background.html
Created November 5, 2013 03:57
使用背景图来实现环形进度条,背景图片地址在 http://www.mythou.com/demo/images/progressbar_mid.png
<!DOCTYPE html>
<html>
<head>
<title>circle progressbar</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
function setValue(value){
$(".progress-bar").css('background-position',-value*54 + 2 +'px 2px');
$(".progress-value em").text(value);
@alexzhou
alexzhou / accordion-slides.html
Created November 4, 2013 03:01
可折叠式滑动展示图片 according slides images show
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<style type="text/css">
.slides{
margin: 0;
padding: 0;
list-style-type: none;
height: 220px;
/*width: 802px;*/
}
.slides li{
@alexzhou
alexzhou / circle_progressbar_canvas.html
Last active August 26, 2016 08:37
使用canvas 画环形进度条
<!DOCTYPE html>
<html>
<head>
<title>circle progressbar</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var range = $('#range');
var bg = $('#counter');
var ctx = bg[0].getContext('2d');
@alexzhou
alexzhou / circle_progressbar_svg.html
Last active December 26, 2015 16:29
make circle progressbar with svg 用svg 画环形进度条
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Ring Progress Bar</title>
</head>
<body>
<section>
<input type="range" value="64" />
<svg>