KoalaInk

Internet King —— Koala


  • Home

  • Categories

  • Archives

  • Tags

  • About

  • Search
close

JQuery 侧边菜单栏插件

Posted on 2015-09-07   |   In WEB , JS   |   visitors 

JQuery 插件自动生成侧边菜单栏。

菜单目录结构使用JSON 数据格式传入。

DEMO运行效果:点击查看

menu目录结构

目录结构输入格式如下:

Read more »

HTML5 CANVAS 时钟

Posted on 2015-08-26   |   In WEB , HTML   |   visitors 

第一次使用H5 的canvas ,用canvas 画了个彩色时钟,可以配置时钟主题配色 ,

操作时钟暂停/继续/设置时间

DEMO运行效果:点击查看

使用时引入插件JS代码,HTML/CSS/JS部分代码如下

HTML代码

<div class="clock"></div>

CSS代码

.clock { position: relative;}
Read more »

CSS3 泡泡球

Posted on 2015-08-14   |   In WEB , CSS   |   visitors 

CSS3 实现的小球效果

简单的进行边缘碰撞检测,小球碰撞边框后消失(从DOM 中remove )。

使用 A/D 控制发射器左右旋转,空格 发射小球。

DEMO运行效果:点击查看

Read more »

CSS3简单动画

Posted on 2015-08-10   |   In WEB , CSS   |   visitors 

刚开始学习H5 方面的知识,看了CSS3 的基础属性,自己动手写了个小DEMO

主要是对transform 属性的使用,元素位移、旋转、缩放的操作,以及改变transform操作原点

DEMO运行效果:点击查看

Read more »

扩展欧几里得算法及实现

Posted on 2014-12-02   |   In Algorithm , ACM , 数论   |   visitors 

欧几里得算法,即辗转相除法,用于求整数a,b的最大公约数。

欧几里得算法C++实现代码:(无需确定 a,b 大小关系)

long long gcd(long long a,long long b){
    return b?gcd(b,a%b):a;
}

扩展欧几里得算法:设a和b不全为0,则存在整数x和y,使得 gcd(a,b) = xa + yb
证明: 假设 a>b

当 b==0 时:gcd(a,b) = a , 此时 x=1 , y=0

Read more »

Java语言程序设计基础篇 第八章 课后编程答案

Posted on 2014-04-06   |   In JAVA   |   visitors 

ch0801

import java.util.Scanner;
public class ch0801{
public static void main( String[] args ){
Rectangle r1 = new Rectangle(4,40) ;
Rectangle r2 = new Rectangle(3.5,35.9) ;
System.out.println("Rectangle1 : width = " + r1.width + " , height = " + r1.height + " , area = " + r1.getArea() + " , perimeter = " + r1.getPerimeter() ) ;
System.out.println("Rectangle2 : width = " + r2.width + " , height = " + r2.height + " , area = " + r2.getArea() + " , perimeter = " + r2.getPerimeter() ) ;
}
}
class Rectangle{
double width ;
double height ;
Rectangle(){
width = height = 1 ;
}
Rectangle( double w , double h ){
width = w ;
height = h ;
}
double getArea(){
return width*height ;
}
double getPerimeter(){
return (width+height)*2 ;
}
}
Read more »

HDU 1316 How Many Fibs?

Posted on 2013-11-24   |   In Algorithm , ACM , 大数   |   visitors 

题目链接:HDU 1316 How Many Fibs?

好吧,这道题目,让我WA了3次,实在是想哭,最后又重看了一遍题目,发现 f[1] = 1 f[2] = 2 , 惯性思维害死人

思路也没什么特别的 大数相加,然后大数的比较

值得一提的还是审题啊

Read more »
1…345
Koala.ink

Koala.ink

Coding my future.

34 posts
17 categories
36 tags
RSS
GitHub
© 2015 - 2018 Koala.ink
Hosted on GitHub