Time of Update: 2018-12-04
佟強 http://blog.csdn.net/microtong OakCMS內容管理系統 http://www.oakcms.cn http://www.oakcms.net使用telnet發送HTTP請求telnet是Internet遠程登陸服務的標準協議和主要方式,為使用者提供了在本機電腦上登入遠程主機工作的能力。我們利用telnet遠程登入到Web伺服器,手工輸入HTTP請求報文,telnet會將HTTP響應顯示在命令列視窗中。希望通過這個小實驗,可以讓大家加深對HTTP協議的理解。
Time of Update: 2018-12-04
TraceRoute(tracert)實現原理 佟強 2008.11.4 TraceRoute程式的實現主要涉及IP頭部存留時間(time to live, TTL)欄位的使用。
Time of Update: 2018-12-04
n個人,報到3的退出,主要是注意幾個條件!#include"stdio.h"void ThreeOut(int *p,int n){ int i=0,j=0,temp=0; while(temp < n-1) //這裡是n-1不是n { if(*(p+i) != 0)j++; if(j == 3){ *(p+i) = 0; j = 0;
Time of Update: 2018-12-04
聊天室用戶端程式 Windows控制台應用程式 對應的Linux伺服器使用select模型實現: Linux下select函數實現的聊天伺服器http://blog.csdn.net/microtong/archive/2009/12/12/4989902.aspx 運行命令列為:Client.exe 127.0.0.1 8000 命令列參數分別為要串連的IP地址和連接埠 //Client.cpp#include <winsock2.h>#include
Time of Update: 2018-12-04
本文重點介紹HashMap。首先介紹一下什麼是Map。在數組中我們是通過數組下標來對其內容索引的,而在Map中我們通過對象來對對象進行索引,用來索引的對象叫做key,其對應的對象叫做value。在下文中會有例子具體說明。再來看看HashMap和TreeMap有什麼區別。HashMap通過hashcode對其內容進行快速尋找,而TreeMap中所有的元素都保持著某種固定的順序,如果你需要得到一個有序的結果你就應該使用TreeMap(HashMap中元素的排列順序是不固定的)。下面就要進入本文的主題
Time of Update: 2018-12-04
對應的Linux伺服器為:http://blog.csdn.net/microtong/archive/2009/12/12/4989902.aspx 標頭檔ClientDlg.h// ClientDlg.h : 標頭檔//#pragma once#include "afxcmn.h"#include "afxwin.h"#define WM_NETWORK WM_USER+100// CClientDlg 對話方塊class CClientDlg : public CDialog{//
Time of Update: 2018-12-04
1.如果查詢單個欄位返回String型直接用list.get(i)即是返回的那個欄位值 2.多個返回Object[]型,已經過測試Session session = sessionFactory.openSession();String hql = "select distinct d.username,d.address from Demo d ";Query query = session.createQuery(hql);List l = query.list();for
Time of Update: 2018-12-04
1.對無頭指標的鏈表刪除中間某一個元素。先保留後面這個元素的值,把後面的元素給刪了,把它的值賦給前一個就可以了(狸貓換太子)ASSERT(p!=NULL)2.給定頭指標,把鏈表倒置。1)把各個值從後查到最前面2)只需交換各個裡面的值,不要懂指標3)用3個指標,保證頭指標不倒置#include <iostream>using namespace std;typedef struct tagNode { char data; struct tagNode *next;}
Time of Update: 2018-12-04
Action 類: • Struts1要求Action類繼承一個抽象基類。Struts1的一個普遍問題是使用抽象類別編程而不是介面。 • Struts 2Action類可以實現一個Action介面,也可實現其他介面,使可選和定製的服務成為可能。Struts2提供一個ActionSupport基類去 實現 常用的介面。Action介面不是必須的,任何有execute標識的POJO對象都可以用作Struts2的Action對象。 線程模式: • Struts1
Time of Update: 2018-12-04
我實現的代碼如下: package com.jadecenter.common;public class StringManage {//對數組元素中的相同元素只保留一個public String[] dsArrary(String[] str){StringBuffer sb = new StringBuffer(); //用來儲存不同的資料sb.append(str[0]+";"); //添加第一個元素for(int i = 1;i <
Time of Update: 2018-12-04
佟強 http://blog.csdn.net/microtong OakCMS內容管理系統 http://www.oakcms.cn
Time of Update: 2018-12-04
#include"stdio.h"void sort(char *p){ int i,j; char s[10],*smax,*smin; for(i=0;i<10;i++){ smax=p+10*i; for(j=0;j<10;j++){ smin=p+10*j; if(strcmp(smin,smax)>0){ strcpy(s,smin);
Time of Update: 2018-12-04
1.主要採用分詞和本體技術 2.用tomcat + myeclipse開發 3.架構mvc 4.實現思路:上傳檔案,對檔案轉化成字串,然後用lucene分詞代碼:r File files=new File(FileName);//System.out.println(FileName);FileInputStream str=new FileInputStream(files); int
Time of Update: 2018-12-04
在比較對象時候,常常用到 "==" 和 "equals(Object)"。它們常常讓初學者感到疑惑。下面先看一個例子 public class Example1 { public static void main(String[] args) { String s1=new String("abc"); String s2=new String("abc"); // s1=s2; System.out.println("用 == 比較結果");
Time of Update: 2018-12-04
<html><head> <title> test</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta http-equiv="Content-Language" content="gb2312" /> <style
Time of Update: 2018-12-04
SAX概念 SAX是Simple API for XML的縮寫,它並不是由W3C官方所提出的標準,可以說是“民間”的事實標準。實際上,它是一種社區性質的討論產物。雖然如此,在XML中對SAX的應用絲毫不比DOM少,幾乎所有的XML解析器都會支援它。
Time of Update: 2018-12-04
#include"stdio.h"void Print(int *p){ //輸入數組元素 int i; for(i = 0;i < 5;i++){ printf("%d ",*(p+i)); }}void Process(int *p){ int min = *p; int i,j=0,temp; for(i=0;i<5;i++){ if(*(p+i) <
Time of Update: 2018-12-04
1.預設載入 如果是 Configuration config = new Configuration().configure();則是預設載入classpath下的hibernate.cfg.xml檔案,當然,我們也可以再new Configuration().configure(“*****.cfg.xml”);載入指定的檔案。 如果是 Configuration config = new
Time of Update: 2018-12-04
這2個介面都可以用來對對象進行比較。具體例子如下: 一個測試bean:public class TestBean {String name;int id;public String getName() {return name;}public void setName(String name) {this.name = name;}public int getId() {return id;}public void setId(int id) {this.id =
Time of Update: 2018-12-04
客戶機:10.1.29.15目標機:10.1.29.75 使用者名稱:root 密碼:f從客戶機登入到目標機 在客戶機上產生密鑰,一直敲斷行符號即可,把公開金鑰/root/.ssh/id_rsa.pub拷貝到目標主機。root@alen:~# ssh-keygen -t rsaGenerating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa):Enter