基于面向对象的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) 2974浏览 2768个赞
几个非常有用的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) 1688浏览 904个赞
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) 2004浏览 159个赞
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) 2674浏览 2756个赞
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) 2436浏览 161个赞
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) 1493浏览 1371个赞
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) 2595浏览 680个赞
AS3控制键盘的方向键代码package { import flash.display.MovieClip; import flash.events.Event; import flash.events.KeyboardEvent; public class KeyboardController extends MovieClip……继续阅读 » 水墨上仙 4年前 (2021-03-20) 3053浏览 1268个赞
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) 1763浏览 2328个赞
来源: ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2705浏览 879个赞
最新HTML5标准的网页设计模板,包含了常用的布局元素<!doctype html><!-- I HTML 5 --><html lang="en"><head> <title>New Document</title> <meta charse……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2402浏览 2812个赞
纯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) 2414浏览 1138个赞
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) 1423浏览 561个赞
AS3关闭所有声音的代码import flash.media.SoundMixer; SoundMixer.soundTransform = new SoundTransform(0);……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2997浏览 1500个赞
这段代码利用了函数指针进行自定义排序function CustomSortProc(Item1, Item2: TListItem; ColumnIndex: integer): integer; stdcall;beginif ColumnIndex = 0 thenResult := CompareText(Item1.Caption,Ite……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1881浏览 1828个赞
Delphi ListView 添加新的项目,演示里的ListView包含三栏,第一栏使用caption设置标题,第二栏和第三栏需要使用SubItems对象才操作i := ListView1.Items.Count; with ListView1 do begin ListItem:=Items.Add; ListItem.Caption:= ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2995浏览 2554个赞
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) 1358浏览 2872个赞
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) 3007浏览 2767个赞
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) 1482浏览 1580个赞
jQuery使用非常简单的语句实现表格隔行变色效果// jQuery$(function(){ $("tr.stripe:even").css("background-color", "#D0D0D0"); $("tr.stripe:odd").css("……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2808浏览 954个赞
youtube使用的HTML5 视频播放器<div id="video-player"> <video width="640" height="360" src="/demo/google_main.mp4?2" autobuffer> &……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2437浏览 2472个赞
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) 1664浏览 304个赞
这段代码非常简单实用,通过链接切换所有checkbox是否选中var tog = false; // or true if they are checked on load $('a').click(function() { $("input[type=checkbox]").attr("……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2490浏览 2522个赞
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) 1741浏览 2441个赞
CodeIgniter: Redirect Internet Explorer Visitors$this->load->library('user_agent');if($this->agent->browser() == 'Internet Explorer' AND in_arra……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2539浏览 1351个赞
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) 1420浏览 2937个赞
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) 1527浏览 2545个赞
AS3下载文件到桌面的代码private var request:URLRequest; private var localRef:FileReference; protected function buttonClick():void { request = new URLRequest("soundbyte.m……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2112浏览 839个赞
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) 1620浏览 857个赞
Java下获取可用CPU数Runtime.getRuntime().availableProcessors()……继续阅读 » 水墨上仙 4年前 (2021-03-20) 3038浏览 826个赞
JXL导出Excel文件/** * 导出为Excel * @param cdosCategoryKeyWords * @return */ public boolean exportExcel(CDO[] cdosCategoryKeyWords) { HttpServletResponse re……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1594浏览 1423个赞
Java模拟数据结构中栈的进队出队package com.stackANDqueue;import java.io.DataInputStream;import java.io.IOException;/* * 这是一个栈的模拟 * 模拟的是入栈和出栈 */public class Stack { static int MAX =……继续阅读 » 水墨上仙 4年前 (2021-03-20) 3106浏览 2162个赞
ASM 是一个 Java 字节码操控框架。它能够以二进制形式修改已有类或者动态生成类。ASM 可以直接产生二进制 class 文件,也可以在类被加载入 Java 虚拟机之前动态改变类行为。ASM 从类文件中读入信息后,能够改变类行为,分析类信息,甚至能够根据用户要求生成新类。示例中演示的功能: 生成被代理类的子类,并重写所有方法(除java.lan……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1403浏览 565个赞
C#中的委托,匿名方法和Lambda表达式用法举例来源:http://www.cnblogs.com/niyw/archive/2010/10/07/1845232.html 在.NET中,委托,匿名方法和Lambda表达式很容易发生混淆。我想下面的代码能证实这点。下面哪一个First……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1666浏览 918个赞
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) 1754浏览 2914个赞
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) 2691浏览 174个赞
C#连接Oracle数据库 //1、添加引用 System.data.oracleClient //2、设置连接字符串 data source是服务名(也就是在客户端sqlplus中需要输入的主机字符串) //3、以下用法和sqlserver Access 用法一直 ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1861浏览 1828个赞
C#手动为数据库自增字段插入编号 string sqlstr = "SET IDENTITY_INSERT t1 ON;"; lists.Add(sqlstr); sqlstr = "INSERT INTO t1 (i……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2411浏览 2267个赞
C#通过assembly打印公共实例方法 public void Coverage() { writeMethodStart("Coverage"); Assembly assembly = Assembly.LoadFrom("MyApplication.dll"); ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2292浏览 1328个赞
C#写入字符串到文件或者追加字符串到文件public static void WriteStringToFile(string fileName, string contents) { StreamWriter sWriter = null; try { FileStream fileStre……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1301浏览 1736个赞
C#通过对象类型创建对象实例object[] paramObject = new object[] {}; object obj = Activator.CreateInstance(type, paramObject); 或者string className = &qu……继续阅读 » 水墨上仙 4年前 (2021-03-20) 1288浏览 1274个赞
C# 打印Assmebly里的 objects Assembly assembly = Assembly.GetAssembly(this.GetType()); Type[] types = assembly.GetTypes(); foreach(Type type in types) { ……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2086浏览 1563个赞
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) 2425浏览 547个赞
这段代码演示了System.Collections.Generic的各容器类的用法,包括:Dictionary,KeyValuePair,SortedDictionary,SortedList,HashSet,SortedSet,List,Queue,Stack等类的用法System.Collections.Generic.Dictionary<……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2270浏览 595个赞
C#中判断DataReader是否为空,下面的代码通过DataReader的HasRows属性来判断是否为空if(DataReader.HasRows){//do whatever}……继续阅读 » 水墨上仙 4年前 (2021-03-20) 2772浏览 1435个赞