iphone UIActionSheet – pop up list of options// place this code in a UIViewController subclass - (void)debugButtonPressed:(id)sender{ UIActionSheet* action = [[UIActio……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2948浏览 2801个赞
来源: ……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1351浏览 1596个赞
最新HTML5标准的网页设计模板,包含了常用的布局元素<!doctype html><!-- I HTML 5 --><html lang="en"><head> <title>New Document</title> <meta charse……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2745浏览 646个赞
纯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……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1919浏览 1910个赞
AS3快速生成bmpvar bmpData:BitmapData = new BitmapData(800,800, true, 0x00000000);bmpData.draw (myClip);var bmp:Bitmap = new Bitmap(bmpData); this.addChild(bmp);……继续阅读 » 水墨上仙 5年前 (2021-03-20) 3018浏览 1023个赞
AS3关闭所有声音的代码import flash.media.SoundMixer; SoundMixer.soundTransform = new SoundTransform(0);……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2634浏览 144个赞
这段代码利用了函数指针进行自定义排序function CustomSortProc(Item1, Item2: TListItem; ColumnIndex: integer): integer; stdcall;beginif ColumnIndex = 0 thenResult := CompareText(Item1.Caption,Ite……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2450浏览 2325个赞
Delphi ListView 添加新的项目,演示里的ListView包含三栏,第一栏使用caption设置标题,第二栏和第三栏需要使用SubItems对象才操作i := ListView1.Items.Count; with ListView1 do begin ListItem:=Items.Add; ListItem.Caption:= ……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1675浏览 2580个赞
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……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1573浏览 402个赞
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……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2808浏览 2970个赞
objective c一个更好的日志方案代码// Macro voodo? Will not be printed if application is build with -DPRODUCTION// Ex. Log(@"String with %s", @"Formatting");#ifndef PRO……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2894浏览 2065个赞
jQuery使用非常简单的语句实现表格隔行变色效果// jQuery$(function(){ $("tr.stripe:even").css("background-color", "#D0D0D0"); $("tr.stripe:odd").css("……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2193浏览 451个赞
youtube使用的HTML5 视频播放器<div id="video-player"> <video width="640" height="360" src="/demo/google_main.mp4?2" autobuffer> &……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1656浏览 2932个赞
AS3检查网络链接是否正常,这段代码通过监控一个指定的url来判断链接是否正常import air.net.URLMonitor;import flash.net.URLRequest;import flash.events.StatusEvent; var monitor:URLMonitor = new URLMonitor(new URL……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1910浏览 1429个赞
这段代码非常简单实用,通过链接切换所有checkbox是否选中var tog = false; // or true if they are checked on load $('a').click(function() { $("input[type=checkbox]").attr("……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1456浏览 1165个赞
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(); //删除……继续阅读 » 水墨上仙 5年前 (2021-03-20) 3055浏览 2790个赞
CodeIgniter: Redirect Internet Explorer Visitors$this->load->library('user_agent');if($this->agent->browser() == 'Internet Explorer' AND in_arra……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2694浏览 2881个赞
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 ……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1955浏览 2393个赞
AS3检测鼠标移动的方向的代码片段function Start() { stage.addEventListener(MouseEvent.MOUSE_MOVE, CheckDirection); }Start(); var prevX=0;var prevY=0;var curX=0;var curY=0; var di……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2247浏览 234个赞
AS3下载文件到桌面的代码private var request:URLRequest; private var localRef:FileReference; protected function buttonClick():void { request = new URLRequest("soundbyte.m……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2971浏览 2585个赞
C++希尔排序算法代码template<class T>void ShellSort(T arr[], int N){ inti; intj; intstep; for( step = N/2; step > 0; step/=2) { ……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2582浏览 563个赞
Java下获取可用CPU数Runtime.getRuntime().availableProcessors()……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1939浏览 1705个赞
JXL导出Excel文件/** * 导出为Excel * @param cdosCategoryKeyWords * @return */ public boolean exportExcel(CDO[] cdosCategoryKeyWords) { HttpServletResponse re……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1747浏览 749个赞
Java模拟数据结构中栈的进队出队package com.stackANDqueue;import java.io.DataInputStream;import java.io.IOException;/* * 这是一个栈的模拟 * 模拟的是入栈和出栈 */public class Stack { static int MAX =……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2826浏览 2582个赞
ASM 是一个 Java 字节码操控框架。它能够以二进制形式修改已有类或者动态生成类。ASM 可以直接产生二进制 class 文件,也可以在类被加载入 Java 虚拟机之前动态改变类行为。ASM 从类文件中读入信息后,能够改变类行为,分析类信息,甚至能够根据用户要求生成新类。示例中演示的功能: 生成被代理类的子类,并重写所有方法(除java.lan……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2114浏览 500个赞
C#中的委托,匿名方法和Lambda表达式用法举例来源:http://www.cnblogs.com/niyw/archive/2010/10/07/1845232.html 在.NET中,委托,匿名方法和Lambda表达式很容易发生混淆。我想下面的代码能证实这点。下面哪一个First……继续阅读 » 水墨上仙 5年前 (2021-03-20) 3248浏览 596个赞
C#委托实现匿名方法// CalculateTax is a delegate that takes a double and returns a doublepublic delegate double CalculateTax(double x);static void Main(string[] args) { CalculateTa……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2910浏览 2266个赞
CalculateTax是一个委托,给定一个double值并返回一个double值// CalculateTax is a delegate that takes a double and returns a doublepublic delegate double CalculateTax(double x);static public doub……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1525浏览 2999个赞
C#连接Oracle数据库 //1、添加引用 System.data.oracleClient //2、设置连接字符串 data source是服务名(也就是在客户端sqlplus中需要输入的主机字符串) //3、以下用法和sqlserver Access 用法一直 ……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2793浏览 1202个赞
C#手动为数据库自增字段插入编号 string sqlstr = "SET IDENTITY_INSERT t1 ON;"; lists.Add(sqlstr); sqlstr = "INSERT INTO t1 (i……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2887浏览 2565个赞
C#通过assembly打印公共实例方法 public void Coverage() { writeMethodStart("Coverage"); Assembly assembly = Assembly.LoadFrom("MyApplication.dll"); ……继续阅读 » 水墨上仙 5年前 (2021-03-20) 3123浏览 2852个赞
C#写入字符串到文件或者追加字符串到文件public static void WriteStringToFile(string fileName, string contents) { StreamWriter sWriter = null; try { FileStream fileStre……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2025浏览 120个赞
C#通过对象类型创建对象实例object[] paramObject = new object[] {}; object obj = Activator.CreateInstance(type, paramObject); 或者string className = &qu……继续阅读 » 水墨上仙 5年前 (2021-03-20) 3037浏览 307个赞
C# 打印Assmebly里的 objects Assembly assembly = Assembly.GetAssembly(this.GetType()); Type[] types = assembly.GetTypes(); foreach(Type type in types) { ……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1861浏览 900个赞
C#生成随机ArrayList public static void RandomizeArrayList(ArrayList arrayList, Random random) { if(arrayList == null) { return; } int count = arrayList.Count; for(int i=……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1931浏览 383个赞
这段代码演示了System.Collections.Generic的各容器类的用法,包括:Dictionary,KeyValuePair,SortedDictionary,SortedList,HashSet,SortedSet,List,Queue,Stack等类的用法System.Collections.Generic.Dictionary<……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2578浏览 2324个赞
C#中判断DataReader是否为空,下面的代码通过DataReader的HasRows属性来判断是否为空if(DataReader.HasRows){//do whatever}……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1988浏览 2393个赞
C#检测DataSet是否为空,下面的代码片段通过判断DataSet的Table数量来判断DataSet是否为空DataSet dt = new DataSet();if (dt.Tables.Count>0) // has tables in it{ //dataset is not empty}else {// otherw……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2024浏览 2129个赞
下面以链接sql server为例,默认情况下连接池的大小为100个,你可以根据需要设定连接池,下面设置为最大75个,最小5个DATA SOURCE=(LOCAL);Initial Catalog=sharejsDB;User ID=root;Password=****;Max Pool SIZE=75;Min Pool SIZE=5;……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1676浏览 2232个赞
下面的代码可以实现异步发送邮件,等邮件发送出去后会自动调用回调函数,这样在发送邮件时就不会卡住程序不动了MailMessage m = new MailMessage ("item@75271.com", "raja@75271.com", "This is the subject ……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1755浏览 2796个赞
C#中通过SSL发送邮件MailMessage m = new MailMessage ("item@75271.com", "raja@75271.com", "This is the subject for the authorized email.", &qu……继续阅读 » 水墨上仙 5年前 (2021-03-20) 3194浏览 1666个赞
C#中使用smtp发送邮件MailMessage m = new MailMessage ("jane@75271.com", "ben@75271.com", "This is the subject for the email.", "This is ……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1342浏览 567个赞
C#发送HTML格式的邮件MailMessage m = new MailMessage();m.From = new MailAddress("ir@w3mentor.com", "Raja Item");m.To.Add(new MailAddress("su@w3mentor.com"……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2580浏览 2620个赞
C#发送带附件的邮件MailMessage m = new MailMessage();m.From = new MailAddress("ir@75271.com", "Raja Item");m.To.Add(new MailAddress("su@75271.com", "S……继续阅读 » 水墨上仙 5年前 (2021-03-20) 1782浏览 505个赞
C#发送邮件并抄送给多个邮件接收者MailMessage m = new MailMessage();m.From = new MailAddress("ir@75271.com", "Raja Item");m.To.Add(new MailAddress("su@75271.com", ……继续阅读 » 水墨上仙 5年前 (2021-03-20) 2964浏览 2179个赞