PHP 基本表格处理程序

<?php 

$fields = array(); 
$fields{"Name"} = "Name"; 
$fields{"Email"} = "Email";   
$fields{"Message"} = "Message"; 

$to = "webmaster@excelegance.com" ; 
$from = $_REQUEST['Email'] ; 
$name = $_REQUEST['Name'] ; 
$headers = "From: $from"; 
$subject = "NCCDC Web contact -- From contact page"; 

$body = "WEB CONTACT FROM NCCDC \n\n We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } 

/*Second email */
$headers2 = "From: noreply@excelegance.com"; 
$subject2 = "Thank you for contacting NCCDC"; 
$autoreply = "Thank you for contacting us. Somebody will get back to you as soon as possible, usually within 48 hours. If you have any more questions, please consult our website at www.pdxchild.org";
               $autoreply .= "\n\n You Wrote: \n".$_REQUEST["Message"];

if($from == '') {print "You have not entered an email, please go back and try again";} 
else { 
if($name == '') {print "You have not entered a name, please go back and try again";} 
else { 
$send = mail($to, $subject, $body, $headers); 
$send2 = mail($from, $subject2, $autoreply, $headers2); 
if($send) 
{header( "Location: ../thankyou/" );} 
else 
{print "We encountered an error sending your mail, please notify webmaster@otcjugband.com"; } 
}
}
?>

ActionScript 3 在AS3中声明和输出字符串值

//declare a String, and assign a value to it
var str:String = "This is a string.";

//trace the value of the String
trace(str);

Other @fractastical testMethod


public static testMethod void t1() {
    
    //setup test data
    
    Test.startTest();
    
    User u = TestUtility.createTestUser([select id, name from Profile where name='Standard User' limit 1]);
    
    System.runAs(u) {
    
    
    
    }
    
    Test.stopTest();

    }

Other @umityalcinalp URLRewriter

http://blog.sforce.com/sforce/2010/05/url-rewriting-for-your-customizing-your-site-urls.html


global class ApexClassName implements Site.UrlRewriter {

  global PageReference mapRequestUrl(PageReference externalUrl) {//}

   global List<PageReference> generateUrlFor(List<PageReference> myForcedotcomUrls) {//...}

}

Note that a developer may not need all of the methods and may choose to return a null. 

Here is the implementation of our the global Apex class that maps the URLs from our example: 

global class myRewriter implements Site.UrlRewriter {

 //Variables to represent the friendly URLs for pages

 String DIRECTORY = '/friendly/';

 //Variables to represent my custom Visualforce pages that display page information

 String VISUALFORCE_PAGE = '/page?pageid=';

 // The first global method for mapping external URL to an internal one

 global PageReference mapRequestUrl(PageReference myFriendlyUrl){

    String url = myFriendlyUrl.getUrl();

    if(url.startsWith(DIRECTORY)){

       String name = url.substring(DIRECTORY.length(),url.length());

       //Select the ID of the page that matches the name from the URL

       Page__c site_page = [select id from Page__c where name =:name LIMIT 1];

       //Construct a new page reference in the form of my Visualforce page

       return new PageReference(VISUALFORCE_PAGE + site_page.id);

    }

    //If the URL isn't in the form of a cmasforce page, continue with the request

    return null;

  }

  // The second global method for mapping internal Ids to URLs

  global List<PageReference> generateUrlFor(List<PageReference> mySalesforceUrls){

    //A list of pages to return after all the links have been evaluated

    List<PageReference> myFriendlyUrls = new

    List<PageReference>();

    for(PageReference mySalesforceUrl : mySalesforceUrls){

      //Get the URL of the page

      String url = mySalesforceUrl.getUrl();

      //If this looks like a page that needs to be mapped, transform it

      if(url.startsWith(VISUALFORCE_PAGE)){

        //Extract the ID from the query parameter

        String id= url.substring(VISUALFORCE_PAGE.length(), url.length());

        //Query for the name of the cmsforce page to put in the URL

        Page__c site_page2 = [select name from Page__c where id =:id LIMIT 1];

        //Construct the new URL

        myFriendlyUrls.add(new PageReference(DIRECTORY+ site_page2.name));

     }  

     else {

       //If this doesn't start like an cmsforce page, don't do any transformations

       myFriendlyUrls.add(mySalesforceUrl);

     }

  }

  //Return the full list of pages

  return myFriendlyUrls;

  }

}

Other LOREM

<p><strong>Lorem Ipsum</strong> - это текст-"рыба",
часто используемый в печати и вэб-дизайне. Lorem Ipsum является 
стандартной "рыбой" для текстов на латинице с начала XVI века. В то 
время некий безымянный печатник создал большую коллекцию размеров и форм
шрифтов, используя Lorem Ipsum для распечатки образцов. Lorem Ipsum не 
только успешно пережил без заметных изменений пять веков, но и 
перешагнул в электронный дизайн. Его популяризации в новое время 
послужили публикация листов Letraset с образцами Lorem Ipsum в 60-х 
годах и, в более недавнее время, программы электронной вёрстки типа 
Aldus PageMaker, в шаблонах которых используется Lorem Ipsum.</p>

<div class="rc"> 
<h2 class="why"><span>Почему он используется?</span></h2> 
<p>Давно выяснено, что при оценке дизайна и композиции читаемый текст мешает 
сосредоточиться. Lorem Ipsum используют потому, что тот обеспечивает 
более или менее стандартное заполнение шаблона, а также реальное 
распределение букв и пробелов в абзацах, которое не получается при 
простой дубликации "Здесь ваш текст.. Здесь ваш текст.. Здесь ваш 
текст.." Многие программы электронной вёрстки и редакторы HTML используют Lorem 
Ipsum в качестве текста по умолчанию, так что поиск по ключевым словам 
"lorem ipsum" сразу показывает, как много веб-страниц всё ещё дожидаются
своего настоящего рождения. За прошедшие годы текст Lorem Ipsum получил
много версий. Некоторые версии появились по ошибке, некоторые - 
намеренно (например, юмористические варианты).</p>
</div>

<div class="lc"><h2 class="where"><span>Откуда он 
появился?</span></h2><p>Многие думают, что Lorem Ipsum - взятый с 
потолка псевдо-латинский набор слов, но это не совсем так. Его корни 
уходят в один фрагмент классической латыни 45 года н.э., то есть более 
двух тысячелетий назад. Ричард МакКлинток, профессор латыни из колледжа 
Hampden-Sydney, штат Вирджиния, взял одно из самых странных слов в Lorem
Ipsum, "consectetur", и занялся его поисками в классической латинской 
литературе. В результате он нашёл неоспоримый первоисточник Lorem Ipsum в
разделах 1.10.32 и 1.10.33 книги "de Finibus Bonorum et Malorum" ("О 
пределах добра и зла"), написанной Цицероном в 45 году н.э. Этот трактат
по теории этики был очень популярен в эпоху Возрождения. Первая строка 
Lorem Ipsum, "Lorem ipsum dolor sit amet..", происходит от одной из 
строк в разделе 1.10.32</p><p>Классический текст Lorem Ipsum, 
используемый с XVI века, приведён ниже. Также даны разделы 1.10.32 и 
1.10.33 "de Finibus Bonorum et Malorum" Цицерона и их английский 
перевод, сделанный H. Rackham, 1914 год.</p>
</div> 

<h2 class="getsome"><span>Где его взять?</span></h2>

<p>Есть много вариантов Lorem Ipsum, но большинство из них имеет не всегда приемлемые 
модификации, например, юмористические вставки или слова, которые даже 
отдалённо не напоминают латынь. Если вам нужен Lorem Ipsum для 
серьёзного проекта, вы наверняка не хотите какой-нибудь шутки, скрытой в
середине абзаца. Также все другие известные генераторы Lorem Ipsum 
используют один и тот же текст, который они просто повторяют, пока не 
достигнут нужный объём. Это делает предлагаемый здесь генератор 
единственным настоящим Lorem Ipsum генератором. Он использует словарь из
более чем 200 латинских слов, а также набор моделей предложений. В 
результате сгенерированный Lorem Ipsum выглядит правдоподобно, не имеет 
повторяющихся абзацей или "невозможных" слов.</p>

C# '哪个'命令,在C#中

using System;
using System.IO; 
using System.Text; 
using Microsoft.Win32;
using System.Diagnostics;

class Script
{
	const string usage = "Usage: cscscript which file\nVerifies which copy of the executable file would be executed if invoked from command-prompt.\n"+
						 "file - name of the executable file\n";

	static public void Main(string[] args)
	{
		if (args.Length == 0 || 
			(args.Length == 1 && (args[0] == "?" || args[0] == "/?" || args[0] == "-?" || args[0].ToLower() == "help")))
		{
			Console.WriteLine(usage);
		}
		else 
		{
			string file = args[0].EndsWith(".exe") ? args[0] : args[0]+".exe";
			string filePath = file;

			if (File.Exists(file))
				Console.WriteLine(Path.GetFullPath(filePath));
			else			
				foreach(string dir in Environment.GetEnvironmentVariable("Path").Split(";".ToCharArray()))
				{
					if (File.Exists(filePath = Path.Combine(dir, file)))
					{
						Console.WriteLine(filePath);
						break;
					}
				}
		}
	}
}

CSS CSS3旋转功能在IE中运行良好

iframe {
   -webkit-transform: rotate(-90deg);
   -moz-transform: rotate(-90deg);
   transform: rotate(-90deg);
   position: absolute;
   filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}

PHP CSS调试

*:hover { outline: 2px dotted red; } * *:hover { outline: 2px dotted green; } * * *:hover { outline: 2px dotted orange; } * * * *:hover { outline: 2px dotted blue; } * * * * *:hover { outline: 1px solid red; } * * * * * *:hover { outline: 1px solid green; } * * * * * * *:hover { outline: 1px solid orange; } * * * * * * * *:hover { outline: 1px solid blue; }

Bash bash [script] - 使用wget下载网站

#! /bin/bash
# use this script for downloading websites using 'wget' utility
# replace URL field with the URL to be downloaded

URL="$1"

wget -Nrkpl 0 $URL 

# wget flags and their functions
# -r = recursive: follows the links
# -k = changes links adresses to their local file adress
# -p = downloads images
# -l = recursion level. 0 for infinite.

exit

XML Ensim托管Exchange服务

<?xml version="1.0" encoding="utf-8" ?>
<soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:exc="http://ensim.com/unifyws/Exchange2K7WS" xmlns:com="http://ensim.com/unifyws/commontypes" xmlns:dat="http://ensim.com/unifyws/Exchange2K7WS/datatypes">
	<soapenv:Header>
		<exc:AuthInfo>
			<com:Username>#xmlFormat(scope.cp4Username)#</com:Username>
			<com:Password>#xmlFormat(scope.cp4Password)#</com:Password>
			<com:Context>#xmlFormat(scope.cp4ResellerAccount)#</com:Context>
		</exc:AuthInfo>
	</soapenv:Header>
	<soapenv:Body>
		<exc:AddOrgService>
			<exc:domainName>#xmlFormat(arguments.domainName)#</exc:domainName>
			<exc:orgServiceDetails>
				<dat:ExchangeVSCConfig>
					<dat:Version>#xmlFormat(scope.cp4ExchangeVersion)#</dat:Version>
					<dat:ExternalContacts>true</dat:ExternalContacts>
					<dat:PublicFolders>true</dat:PublicFolders>
					<dat:DTOutlookSetup>true</dat:DTOutlookSetup>
					<dat:DTActiveSynch>false</dat:DTActiveSynch>
					<dat:SendLimit>100</dat:SendLimit>
					<dat:SendRecvLimit>130</dat:SendRecvLimit>
					<dat:DiskSpace>#xmlFormat(arguments.diskSpace)#</dat:DiskSpace>
					<dat:MailBoxLimit>#xmlFormat(arguments.numMailboxes)#</dat:MailBoxLimit>
					<dat:PFDiskSpace>100</dat:PFDiskSpace>
					<dat:POPEnabledMailboxLimit>#xmlFormat(arguments.numMailboxes)#</dat:POPEnabledMailboxLimit>
					<dat:IMAPEnabledMailboxLimit>#xmlFormat(arguments.numMailboxes)#</dat:IMAPEnabledMailboxLimit>
					<dat:OWAEnabledMailboxLimit>#xmlFormat(arguments.numMailboxes)#</dat:OWAEnabledMailboxLimit>
					<dat:MAPIEnabledMailboxLimit>#xmlFormat(arguments.numMailboxes)#</dat:MAPIEnabledMailboxLimit>
					<dat:MobilityEnabledMailboxLimit>0</dat:MobilityEnabledMailboxLimit>
					<dat:ShFoldersEnLimit>#xmlFormat(arguments.numMailboxes)#</dat:ShFoldersEnLimit>
					<dat:ShCalEnLimit>#xmlFormat(arguments.numMailboxes)#</dat:ShCalEnLimit>
					<dat:ShContactEnLimit>#xmlFormat(arguments.numMailboxes)#</dat:ShContactEnLimit>
					<dat:ShTasksEnLimit>#xmlFormat(arguments.numMailboxes)#</dat:ShTasksEnLimit>
					<dat:GrpSchEnLimit>#xmlFormat(arguments.numMailboxes)#</dat:GrpSchEnLimit>
					<dat:UMEnabledMailboxLimit>#xmlFormat(arguments.numMailboxes)#</dat:UMEnabledMailboxLimit>
					<dat:AutoGrow>Never</dat:AutoGrow>
					<dat:DiskSpaceLowerBound>0</dat:DiskSpaceLowerBound>
					<dat:DiskSpaceIncrement>0</dat:DiskSpaceIncrement>
					<dat:DiskSpaceUpperBound>0</dat:DiskSpaceUpperBound>
					<dat:MailBoxLimitLowerBound>0</dat:MailBoxLimitLowerBound>
					<dat:MailBoxLimitIncrement>0</dat:MailBoxLimitIncrement>
					<dat:MailBoxLimitUpperBound>0</dat:MailBoxLimitUpperBound>
					<dat:OrgInstances>1</dat:OrgInstances>
					<dat:UnifiedMessages>false</dat:UnifiedMessages>
					<dat:Compliances>false</dat:Compliances>
					<dat:IsConsumerOrganization>false</dat:IsConsumerOrganization>
					<dat:templates>
						<dat:anyType xsi:type="xsd:string">Core</dat:anyType>
					</dat:templates>
					<dat:FlexibleMailboxSizes>true</dat:FlexibleMailboxSizes>
					<dat:OTADeliveryPrefList>
						<dat:MobileAccess>false</dat:MobileAccess>
						<dat:USBDelivery>false</dat:USBDelivery>
						<dat:EmailDelivery>false</dat:EmailDelivery>
						<dat:OTADelivery>false</dat:OTADelivery>
						<dat:SMSDelivery>false</dat:SMSDelivery>
					</dat:OTADeliveryPrefList>
					<dat:NumMobilityUsers>0</dat:NumMobilityUsers>
					<dat:PFoab>true</dat:PFoab>
					<dat:WEBoab>false</dat:WEBoab>
				</dat:ExchangeVSCConfig>
			</exc:orgServiceDetails>
			<exc:info>
				<dat:poolName>#xmlFormat(scope.cp4ExchangePoolName)#</dat:poolName>
			</exc:info>
		</exc:AddOrgService>
	</soapenv:Body>
</soapenv:Envelope>