Time of Update: 2013-11-06
To complete these exercises, you will need the index.htmlfile for this chapter, as well as the finished JavaScript code as found in complete.js. These files can be downloaded from the Packt Publishing web site at
Time of Update: 2013-11-06
多數情況下,我們使用控制項的監聽事件時,都不帶有附加參數,如下:var ss:Image=new Image();ss.addEventListener(MouseEvent.CLICK,buttonClickShow);function buttonClickShow(e:MouseEvent):void{Alert.show("ok");}但是,有時候,我們會遇到需要傳遞參數的監聽事件,如何做呢?如下:var ss:Image=new
Time of Update: 2013-11-06
1、java web工作原理: Http協議時無狀態的。 發送請求訊息: 一旦建立了TCP串連,web瀏覽器就會向web伺服器發送請求命令,Http協議將來自於用戶端的請求資訊封裝成Http請求,它包括請求行、要求標頭以及訊息體和分割要求標頭和和訊息體的一個空行。
Time of Update: 2013-11-06
<%@ page language="java" import="java.util.*,cn.com.Person" pageEncoding="UTF-8"%><%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><%String path = request.getContextPath()
Time of Update: 2013-11-06
實現一個大表單頁,表單元素比如select / input:text等需要%來定義寬度。之前是px來定義寬度,精確到像素,所以對的很齊,但是用%來定義之後,在IE下select跟input:text就對不齊了,別的瀏覽器都ok,呵呵。大約是input:text為40%時select需要41%;不hack不行啊。 列舉hack知識如下: \9 針對所有IE(IE 6~10)\0 IE8~
Time of Update: 2013-11-06
JavaScript 中的所有事物都是對象:字串、數字、數組、日期,等等。在 JavaScript 中,對象是擁有屬性和方法的資料。 //建立各種類型的對象 var a = 123; var b = "124"; var
Time of Update: 2013-11-06
<?xml version="1.0" encoding="utf-8"?><s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"
Time of Update: 2013-11-06
最近發現了jquery的.filter()方法,這真是一個很強大的方法,最強大之處在於,他可以接受一個函數作為參數,然後根據函數的返回值判斷,如果返回值是true,這個元素將被保留,如果返回值是false,這個元素將被剔除。這就是jquery選取器的過濾器。空說無用,我們展示一下<body> <p>你好啊,今天及多大了啊</p> <p><span>為什麼要告訴你</span>
Time of Update: 2013-11-06
第一步:要部署整個項目(copy外掛程式指令碼庫); @import "js/dataTable/css/demo_page.css";@import "js/dataTable/css/demo_table.css";@import "js/dataTable/css/demo_table_jui.css"; 第二步:表的
Time of Update: 2013-11-06
做前端多年,雖然不是經常需要hack,但是我們經常會遇到各瀏覽器表現不一致的情況。基於此,某些情況我們會極不情願的使用這個不太友好的方式來達到大家要求的頁面表現。我個人是不太推薦使用hack的,要知道一名好的前端,要儘可能不使用hack的情況下實現需求,做到較好的使用者體驗。可是啊,現實太殘酷,瀏覽器廠商之間曆史遺留的問題讓我們在目標需求下不得不向hack妥協,雖然這隻是個別情況。今天,結合自己的經驗和理解,做了幾個demo把IE6~IE10和其他標準瀏覽器的CSS
Time of Update: 2013-11-08
SelectSort代碼package Sort;/** * @author Biang Hoo *O(n ^2 ) * 2013年9月10日 */public class SelectSort implements Sort{@Overridepublic void Sorting(int[] array) {int min;int tmp;for(int i=0;i<array.length;i++){min=i;for(int
Time of Update: 2013-11-08
現在的應用程式變得越來越複雜,甚至只靠單一的應用程式無法完成全部的工作,更別說只使用一種語言了。所以人們就想能不能開必一種應該寫一次就可以讓所有人都可以調用呢,這就是WebService存活的根本。4.有關WebService的幾個術語a. XML. Extensible Markup Language -擴充性標記語言 XML,用於傳輸格式化的資料,是Web服務的基礎。 namespace-命名空間。
Time of Update: 2013-11-08
// 輸出二叉樹中所有從根結點到葉子結點的路徑.cpp : 定義控制台應用程式的進入點。#include "stdafx.h"#include <iostream>#include <vector>using namespace std;struct BTNode{char m_value;BTNode *m_left;BTNode *m_right;};//先序建立二叉樹void CreatBTree(BTNode *&root){char
Time of Update: 2013-11-08
#include <iostream>#include <cstdio>#include <cstring>using namespace std;const int maxn=3e3+9,inf=1e9;int n,m;int dist[maxn],g[maxn][maxn],tree[maxn][maxn];int f[maxn][maxn];struct{ int head[maxn],lon; struct {
Time of Update: 2013-11-08
vector<int> twoSum(vector<int> &numbers, int target) { // Start typing your C/C++ solution below // DO NOT write int main() function vector<int> res; int length = numbers.size();if(length <
Time of Update: 2013-11-08
這是2進位加密解密# -*- coding: cp936 -*-import socketimport win32com.clientimport osimport zipfileimport codecsimport base64def main(): HOST = '127.0.0.1' PORT = 2000 BUF_SIZE = 6553500 #6M key = 'ouyang' timeout = 5 dicName = "ouyang\
Time of Update: 2013-11-08
#include<iostream>#include<string>using namespace std;void main(){string input;while(cin>>input){int maxLength=1;int i;int indexStart=0;int indexEnd=0;for(i=0;i<input.length();++i){int counter=0;int
Time of Update: 2013-11-08
例子見:《程式員面試寶典》5.4#include <iostream>#include <stdio.h>#include <string.h>#include <conio.h>using namespace std;int main(){float a = 1.0f;cout << sizeof(int) <<endl; //4cout << sizeof(float) <<endl; //4
Time of Update: 2013-11-08
理機制上也可以解釋:因為它執行fillStackTrace方法,要記錄當前棧的快照,而String類則是直接申請建立一個記憶體建立對象,異常類慢一籌也在所難免。 public voidlogin(){ try{ //正常登陸 }catch(InvalidLoginExceptionlie){ //使用者名稱無效
Time of Update: 2013-11-08
//給定任意一個正整數,求比這個數大且最小的“不重複數”“不重複數”的含義是相鄰兩位不相同,//例如1101是重複數,1231是不重複數。int GetMinNum(int nNum){char Temp[20];int nLen;for (int i = nNum+1; ;i++){itoa(i, Temp, 10);nLen = strlen(Temp);for (int j=0; j<nLen-1; j++){//有重複,跳出迴圈。if