注:这个例子来自[FL车在臣](在blueidea上又名“寂寞火山”)翻译的“Animation in ActionScript3.0”一书,下面的原理分析也来自他的思路
原 理:
1.先分析一下lyc的格式:
[ti:Going Home] [ar:Sophie Zelmani] [al:] [by:yitian1977] [offset:500] [00:01.52]Going Home [00:06.66]Sophie Zelmani [00:11.32] [00:36.60]Not very often have we met / [00:42.94]But the music's been too bad [00:48.92]Can only sense happiness [00:55.68]if the music is sad [00:59.34] [01:00.29]So, I'm going home [01:06.30]I must hurry home [01:11.88]Where a life goes on [01:16.05] [01:20.14]We're too old to make a mess [01:26.16]Dreams will keep me young [01:32.78]Old enough to stress [01:38.86]Only mirrors tell the time [01:41.76] [02:52.99][01:42.80]So, I'm going home [02:59.19][01:48.91]I must hurry home [03:05.33][01:55.04]So will my life go on [03:09.29][02:00.56] [03:17.40][02:07.45]Yes, I'm going home [03:23.70][02:13.43]Going home alone [03:29.80][02:19.77]And your life goes on [03:40.16][02:34.09] [04:05.13][03:52.01](edit by Nathan_na@msn.com)
function StopMouseDownHandler(e:MouseEvent) { if (sc!=null){ sc.stop(); sc =null; } }
function PlayMouseDownHandler(e:MouseEvent) { if (sc==null){ sc = sound.play(); } }
function SoundPlaying(evt:Event):void { if (sc==null){return;} //trace(sc.position); for (var i:uint=2,j:uint=LRCarray.length-1; i <j; i++) { if (sc.position<LRCarray[i].timer) { lrc_txt.text=""+LRCarray[i-2].lyric+"\n→"+LRCarray[i-1].lyric+"\n "+LRCarray[i].lyric; break; } lrc_txt.text=LRCarray[LRCarray.length-1].lyric; } }
function LoadFinish(evt:Event):void {
var list:String=evt.target.data; var listarray:Array=list.split("\r\n");
//分析歌词,填充到全局歌词数组中 var reg:RegExp=/\[[0-5][0-9]:[0-5][0-9].[0-9][0-9]\]/g; for (var i:uint=1,j:uint=listarray.length; i <j; i++) { var info:String=listarray[i];
var len:int=info.match(reg).length; var timeAry:Array=info.match(reg); var lyric:String=info.substr(len*10);
if (lyric.length<=0) { continue; }
for (var k:uint=0,t:uint=timeAry.length; k < t; k++) { var obj:Object =new Object(); var ctime:String=timeAry[k]; var ntime:uint =1000* (parseInt(ctime.substr(1,2),10)*60+ parseInt(ctime.substr(4,5),10)) + parseInt(ctime.substr(7,8),10); obj.timer=ntime; obj.lyric=lyric; LRCarray.push(obj); }
}
//数组排序 LRCarray.sort(compare);
var objFirst:Object =new Object(); objFirst.timer=1; objFirst.lyric="Loading..."; LRCarray.unshift(objFirst);
var objLast:Object =new Object(); objLast.timer=999999; objLast.lyric="the end."; LRCarray.push(objLast);
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Net; using System.Text.RegularExpressions; using System.Windows; using System.Windows.Browser; using System.Windows.Controls; using System.Windows.Media;
终端仿真器是一款用其它显示架构重现可视终端的计算机程序。换句话说就是终端仿真器能使哑终端看似像一台连接上了服务器的客户机。终端仿真器允许最终用户用文本用户界面和命令行来访问控制台和应用程序。(LCTT 译注:终端仿真器原意指对大型机-哑终端方式的模拟,不过在当今的 Linux 环境中,常指通过远程或本地方式连接的伪终端,俗称“终端”。)
你能从开源世界中找到大量的终端仿真器,它们
功能:在控制台每秒输出一次
代码:
package Main;
import javax.swing.Timer;
import java.awt.event.*;
public class T {
private static int count = 0;
public static void main(String[] args){
1,获取样式属性值
top 与顶部的距离
left 与左边的距离
right 与右边的距离
bottom 与下边的距离
zIndex 层叠层次
例子:获取左边的宽度,当css写在body标签中时
<div id="adver" style="position:absolute;top:50px;left:1000p
spring data jpa 支持以方法名进行查询/删除/统计。
查询的关键字为find
删除的关键字为delete/remove (>=1.7.x)
统计的关键字为count (>=1.7.x)
修改需要使用@Modifying注解
@Modifying
@Query("update User u set u.firstna
项目中controller的方法跳转的到ModelAndView类,一直很好奇spring怎么实现的?
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* yo
(1)npm是什么
npm is the package manager for node
官方网站:https://www.npmjs.com/
npm上有很多优秀的nodejs包,来解决常见的一些问题,比如用node-mysql,就可以方便通过nodejs链接到mysql,进行数据库的操作
在开发过程往往会需要用到其他的包,使用npm就可以下载这些包来供程序调用
&nb
Controller层的拦截器继承于HandlerInterceptorAdapter
HandlerInterceptorAdapter.java 1 public abstract class HandlerInterceptorAdapter implements HandlerIntercep