基于面向对象的C++双向链表代码演示//An example of a simple double linked list using OOP techniques#include <iostream>using namespace std; struct Node{ double value; Node *N,*P; ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2817浏览 2620个赞
几个非常有用的C字符串函数#include <string.h>#include <stdlib.h> void remchars(char *str, char c);void remcnks(char *str, char *cnk);void replchars(char *str, char c1, char ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2286浏览 1669个赞
C++异常处理范例代码// Program shows copying one text file from source location// to any other location (destination), plus possibility of changing its name, // and also shows many lan……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2178浏览 2963个赞
C++使用key文件进行xor加解密/* The function (en/de)crypts an input data file with an input key file using the XOR method. The use of a key file instead of a plain text key m……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1760浏览 107个赞
C++按单词换行的函数,按照指定的长度对字符串进行换行,如果指定的长度正好在某个单词中间,就往回查找,直到出现空格再换行/* This function takes a string and an output buffer and a desired width. It then copies the string to the buf……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1576浏览 1566个赞
C++演示在不同的范围内不冲突使用同名变量的范例// An example of using the same variable declarations in different scopes in C++ without conflicts #include <iostream> using std::cout;using s……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1340浏览 2366个赞
C语言创建pascal三角图形//Procedural Programming technique shows creation of Pascal's Triangl#include <iostream>#include <iomanip>using namespace std;int** comb(int*……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2388浏览 2137个赞
AS3控制键盘的方向键代码package { import flash.display.MovieClip; import flash.events.Event; import flash.events.KeyboardEvent; public class KeyboardController extends MovieClip……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2243浏览 369个赞
iphone UIActionSheet – pop up list of options// place this code in a UIViewController subclass - (void)debugButtonPressed:(id)sender{ UIActionSheet* action = [[UIActio……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2436浏览 1450个赞
来源: ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1247浏览 656个赞
最新HTML5标准的网页设计模板,包含了常用的布局元素<!doctype html><!-- I HTML 5 --><html lang="en"><head> <title>New Document</title> <meta charse……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1827浏览 2944个赞
纯CSS实现支持IE6的min-width.min_width{ min-width: 500px; /* For good browsers */} * html .min_width { padding: 0 250px; } /* This is for the markup that only appears in IE6 t……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2165浏览 2280个赞
AS3快速生成bmpvar bmpData:BitmapData = new BitmapData(800,800, true, 0x00000000);bmpData.draw (myClip);var bmp:Bitmap = new Bitmap(bmpData); this.addChild(bmp);……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2812浏览 1177个赞
AS3关闭所有声音的代码import flash.media.SoundMixer; SoundMixer.soundTransform = new SoundTransform(0);……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1371浏览 423个赞
这段代码利用了函数指针进行自定义排序function CustomSortProc(Item1, Item2: TListItem; ColumnIndex: integer): integer; stdcall;beginif ColumnIndex = 0 thenResult := CompareText(Item1.Caption,Ite……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1522浏览 1272个赞
Delphi ListView 添加新的项目,演示里的ListView包含三栏,第一栏使用caption设置标题,第二栏和第三栏需要使用SubItems对象才操作i := ListView1.Items.Count; with ListView1 do begin ListItem:=Items.Add; ListItem.Caption:= ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2070浏览 2310个赞
AS3 删除数组里的重复数据代码function removeDuplicate(arr:Array) : void{ var i:int; var j: int; for (i = 0; i < arr.length - 1; i++){ for (j = i + 1; j < arr.length……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2792浏览 1098个赞
AS3对数组进行Push, Pop, Unshift 和 Shift 等操作的代码var myArray:Array = new Array(); // PUSH// Adds one or more elements to the end of an array and returns the new length of the array……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1464浏览 1761个赞
objective c一个更好的日志方案代码// Macro voodo? Will not be printed if application is build with -DPRODUCTION// Ex. Log(@"String with %s", @"Formatting");#ifndef PRO……继续阅读 » 水墨上仙 4年前 (2021-03-20) 3051浏览 886个赞
jQuery使用非常简单的语句实现表格隔行变色效果// jQuery$(function(){ $("tr.stripe:even").css("background-color", "#D0D0D0"); $("tr.stripe:odd").css("……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2578浏览 2678个赞
youtube使用的HTML5 视频播放器<div id="video-player"> <video width="640" height="360" src="/demo/google_main.mp4?2" autobuffer> &……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2376浏览 2519个赞
AS3检查网络链接是否正常,这段代码通过监控一个指定的url来判断链接是否正常import air.net.URLMonitor;import flash.net.URLRequest;import flash.events.StatusEvent; var monitor:URLMonitor = new URLMonitor(new URL……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1340浏览 1469个赞
这段代码非常简单实用,通过链接切换所有checkbox是否选中var tog = false; // or true if they are checked on load $('a').click(function() { $("input[type=checkbox]").attr("……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1595浏览 1474个赞
Delphi ListView 按标题删除项目,这段代码的遍历是从后往前遍历的for i:=ListView1.Items.Count-1 downto 0 Do if ListView1.Items[i].Caption = Edit1.Text then begin ListView1.Items.Item[i].Delete(); //删除……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1328浏览 1234个赞
CodeIgniter: Redirect Internet Explorer Visitors$this->load->library('user_agent');if($this->agent->browser() == 'Internet Explorer' AND in_arra……继续阅读 » 水墨上仙 4年前 (2021-03-20) 3222浏览 2334个赞
AS3加载Xml文件的代码import flash.events.Event;import flash.net.URLLoader;import flash.net.URLRequest;import flash.display.Loader; private var myXML:XML; // pass the path to the ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1670浏览 2188个赞
AS3检测鼠标移动的方向的代码片段function Start() { stage.addEventListener(MouseEvent.MOUSE_MOVE, CheckDirection); }Start(); var prevX=0;var prevY=0;var curX=0;var curY=0; var di……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2556浏览 308个赞
AS3下载文件到桌面的代码private var request:URLRequest; private var localRef:FileReference; protected function buttonClick():void { request = new URLRequest("soundbyte.m……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2266浏览 2995个赞
C++希尔排序算法代码template<class T>void ShellSort(T arr[], int N){ inti; intj; intstep; for( step = N/2; step > 0; step/=2) { ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1774浏览 1163个赞
Java下获取可用CPU数Runtime.getRuntime().availableProcessors()……继续阅读 » 水墨上仙 4年前 (2021-03-20) 3037浏览 1014个赞
JXL导出Excel文件/** * 导出为Excel * @param cdosCategoryKeyWords * @return */ public boolean exportExcel(CDO[] cdosCategoryKeyWords) { HttpServletResponse re……继续阅读 » 水墨上仙 4年前 (2021-03-20) 3008浏览 1245个赞
Java模拟数据结构中栈的进队出队package com.stackANDqueue;import java.io.DataInputStream;import java.io.IOException;/* * 这是一个栈的模拟 * 模拟的是入栈和出栈 */public class Stack { static int MAX =……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2103浏览 1953个赞
ASM 是一个 Java 字节码操控框架。它能够以二进制形式修改已有类或者动态生成类。ASM 可以直接产生二进制 class 文件,也可以在类被加载入 Java 虚拟机之前动态改变类行为。ASM 从类文件中读入信息后,能够改变类行为,分析类信息,甚至能够根据用户要求生成新类。示例中演示的功能: 生成被代理类的子类,并重写所有方法(除java.lan……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1832浏览 1202个赞
C#中的委托,匿名方法和Lambda表达式用法举例来源:http://www.cnblogs.com/niyw/archive/2010/10/07/1845232.html 在.NET中,委托,匿名方法和Lambda表达式很容易发生混淆。我想下面的代码能证实这点。下面哪一个First……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2985浏览 2350个赞
C#委托实现匿名方法// CalculateTax is a delegate that takes a double and returns a doublepublic delegate double CalculateTax(double x);static void Main(string[] args) { CalculateTa……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1233浏览 762个赞
CalculateTax是一个委托,给定一个double值并返回一个double值// CalculateTax is a delegate that takes a double and returns a doublepublic delegate double CalculateTax(double x);static public doub……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1754浏览 489个赞
C#连接Oracle数据库 //1、添加引用 System.data.oracleClient //2、设置连接字符串 data source是服务名(也就是在客户端sqlplus中需要输入的主机字符串) //3、以下用法和sqlserver Access 用法一直 ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1952浏览 2510个赞
C#手动为数据库自增字段插入编号 string sqlstr = "SET IDENTITY_INSERT t1 ON;"; lists.Add(sqlstr); sqlstr = "INSERT INTO t1 (i……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1685浏览 2384个赞
C#通过assembly打印公共实例方法 public void Coverage() { writeMethodStart("Coverage"); Assembly assembly = Assembly.LoadFrom("MyApplication.dll"); ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2563浏览 2681个赞
C#写入字符串到文件或者追加字符串到文件public static void WriteStringToFile(string fileName, string contents) { StreamWriter sWriter = null; try { FileStream fileStre……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2577浏览 1197个赞
C#通过对象类型创建对象实例object[] paramObject = new object[] {}; object obj = Activator.CreateInstance(type, paramObject); 或者string className = &qu……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1342浏览 2288个赞
C# 打印Assmebly里的 objects Assembly assembly = Assembly.GetAssembly(this.GetType()); Type[] types = assembly.GetTypes(); foreach(Type type in types) { ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2322浏览 2174个赞
C#生成随机ArrayList public static void RandomizeArrayList(ArrayList arrayList, Random random) { if(arrayList == null) { return; } int count = arrayList.Count; for(int i=……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1780浏览 325个赞
这段代码演示了System.Collections.Generic的各容器类的用法,包括:Dictionary,KeyValuePair,SortedDictionary,SortedList,HashSet,SortedSet,List,Queue,Stack等类的用法System.Collections.Generic.Dictionary<……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2892浏览 2318个赞
C#中判断DataReader是否为空,下面的代码通过DataReader的HasRows属性来判断是否为空if(DataReader.HasRows){//do whatever}……继续阅读 » 水墨上仙 4年前 (2021-03-20) 3576浏览 850个赞