This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cities = { | |
[1100] = "北京市", | |
[1101] = "北京市", | |
[1102] = "北京市", | |
[1200] = "天津市", | |
[1201] = "天津市", | |
[1202] = "天津市", | |
[1300] = "河北省", | |
[1301] = "石家庄市", | |
[1302] = "唐山市", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = 'c9n'; | |
/* ----- isset ----- */ | |
$start = microtime(true); | |
for ($i = 0; $i < 1000 * 1000; $i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$test = mb_convert_encoding('徐若瑄', 'HTML-ENTITIES', 'UTF-8'); | |
echo $test . "\n"; | |
echo html_entity_decode($test); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
pwd # /Users/Lynn/Desktop | |
brew install pcre | |
wget https://www.openssl.org/source/openssl-1.0.2e.tar.gz | |
tar xvf openssl-1.0.2e.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to create an RPM from source with spec file | |
# This is for Redhat versions of linux. Sometimes when you search for an rpm package, | |
# it is either outdated or not available. The only thing available is the source code. | |
# You can create a custom RPM package from source. | |
# | |
# For this example, I'll be using the latest version of Git, currently v.1.7.7.3 | |
# Step: 1 | |
# Install rpmbuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// javac Test.java | |
// java -Xmx512m Test | |
public class Test { | |
public static void main(String[] args) { | |
System.out.println("----------"); | |
long max = Runtime.getRuntime().maxMemory(); | |
System.out.println(max/1024/1024 + "M"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <openssl/rsa.h> | |
#include <openssl/pem.h> | |
#include <openssl/err.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define KEY_LENGTH 2048 | |
#define PUB_EXP 3 | |
#define PRINT_KEYS | |
#define WRITE_TO_FILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <cstdlib> | |
#include <cstdio> | |
#include <csignal> | |
#include <cstring> | |
#include <getopt.h> | |
#include "rdkafkacpp.h" | |
/* for loop */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.redwoods.app</groupId> | |
<artifactId>demo</artifactId> | |
<version>0.0.1</version> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
</properties> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Class WeixinApi { | |
private $appid; | |
private $secret; | |
function __construct ($appid, $secret) { | |
$this->appid = $appid; | |
$this->secret = $secret; |