R 按排序键顺序访问dict

for key in sorted(myDict.keys()):
    item = myDict[key]
    ## do stuff

C# 简单插入SPROC调用

public void LogRequest(string requestor, string messageBody)
        {
            using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString))
            {
                conn.Open();
                SqlCommand cmd = new SqlCommand("wp_InsertRequest", conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("Requestor", requestor));
                cmd.Parameters.Add(new SqlParameter("EmailBody", messageBody));
                cmd.ExecuteNonQuery();
            }
        }

Objective C 将东西安装到/ usr / bin - Trampolines

int main(int argc, char *argv[])
{
	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
	NSWorkspace *env = [NSWorkspace sharedWorkspace];
	NSString *app = [env absolutePathForAppBundleWithIdentifier:@"com.pdfkey.pdfkeypro"];
	NSString *targetPath = [[app stringByAppendingPathComponent:@"Contents/Resources/pdflock"] retain];

	const char *CStringPath = [targetPath UTF8String];
	[pool release];

	execv(CStringPath, argv);

	// You reach this code only if execv returns, which means that something wrong happened.
	[targetPath release];
	printf("PDFKey Pro is not installed. Please download it from http://pdfkey.com\n");
	return 0;
}

XML Spring JMS模板简单配置

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
        <property name="environment">
            <props>
                <prop key="java.naming.provider.url">localhost:1099</prop>
                <prop key="java.naming.factory.url.pkgs">org.jnp.interfaces:org.jboss.naming</prop>
                <prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
            </props>
        </property>
    </bean>

    <bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate">
            <ref bean="jndiTemplate"/>
        </property>
        <property name="jndiName">
            <value>ConnectionFactory</value>
        </property>
    </bean>


    <bean id="jmsTemplate"
          class="org.springframework.jms.core.JmsTemplate">
        <property name="connectionFactory" ref="connectionFactory"/>
        <property name="defaultDestination">
            <ref bean="sendDestination"/>
        </property>
    </bean>


    <bean id="sendDestination"
          class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate">
            <ref bean="jndiTemplate"/>
        </property>
        <property name="jndiName">
            <value>queue/DummyQueue</value>
        </property>
    </bean>

    

</beans>

Java 简单的JMS模板用法示例

public void sendJMS() {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-config.xml");
        JmsTemplate jmsTemplate = (JmsTemplate) applicationContext.getBean("jmsTemplate");
        jmsTemplate.send(new MessageCreator() {
            public Message createMessage(Session session) throws JMSException {
                return session.createTextMessage("hello queue world");
            }
        });
    }

Other Intellij推荐了VM选项

-Xms256m # more memory
-Xmx512m # the same
-XX:MaxPermSize=256m # the same
-ea # needed for assertions?
-server # recommended for long running processes
-XX:-UseParallelGC # usefull on multicore machines

JavaScript 打印(文件撰写)

function print(msg) {
    document.write(msg, "<br />");
}

JavaScript makeProperty

/*
* O'Reilly Media | JavaScript: The Definitive Guide
* http://www.oreilly.com/catalog/jscript5/
*/
function makeProperty (o,name,predicate) {
	var value;
	
	o["get"+name]=function() { return value; };
	
	o["set"+name]=function(v) {
			if( predicate && !predicate(v) ){
				throw new Error("set"+name+": invalid value "+ v);
			}else{
				value=v;
			}
		};
}

var o={};
makeProperty(o,"Name", function(x) { return typeof x=="string"; } );
o.setName("myObj");
print(o.getName());

PHP 环境变量

$_SERVER["SCRIPT_FILENAME"] // server path to file
$_SERVER["SCRIPT_NAME"] // path to file from web root
$_SERVER["REMOTE_ADDR"] // user's IP address
$_SERVER["QUERY_STRING"] // query string in URL
$_SERVER["DOCUMENT_ROOT"] // server path to web root
$_SERVER["HTTP_HOST"]; // server host name (domain)

HTML template.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<meta name="" content=""/>
		<meta name="" content=""/>
		<meta name="robots" content="index,follow"/>
		<link rel="stylesheet" type="text/css" href="template.css"/>
		<title></title>
    </head>
    <body>
		<div id="masthead">
		</div><!-- id="masthead" -->

		<div id="toolbar">
		</div><!-- id="toolbar" -->

		<div id="navigation">
		</div><!-- id="navigation" -->

		<div id="content">
			<div id="content-main">
			</div><!-- id="content-main" -->

			<div id="content-extra">
			</div><!-- id="content-extra"-->

		</div><!-- id="content" -->

		<div id="footer">
			<p><a href="http://validator.w3.org/check?uri=referer"><img	src="http://www.w3.org/Icons/valid-xhtml10"	alt="Valid XHTML 1.0 Strict"/></a>
			<a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS 2.1"/></a></p>
		</div><!-- id="footer" -->
    </body>
</html>