基础类库:
http://anahkiasen.github.io/underscore-php
图片操作:
// Please write an sequence list implements the interface with the required | |
// time complexity described in the comments. The users can add the same | |
// element as many times as they want, but it doesn't support the null item. | |
// You can use any types in .NET BCL but cannot use any 3rd party libraries. | |
// PS: You don't need to consider the multi-threaded environment. | |
interface void IMyList<T> : IEnumerable<T> | |
{ | |
// O(1) | |
// Add an item at the beginning of the list. | |
void AddFirst(T item); |
//请实现下面的函数,输入参数baseStr是一个(可以更改的)字符串,请将其中所有连续出现的多个空格都替换成一个空格,单一空格需保留。 | |
//请直接使用baseStr的空间,如需开辟新的存储空间,不能超过o(N)(注意是小o,N是字符串的长度)。返回值是替换后的字符串的长度。 | |
//样例代码为C#,但可以使用任何语言。如需使用任何库函数,必须同时给出库函数的实现。 | |
class Program | |
{ | |
public static int RemoveMultipleSpaces(char[] baseStr) | |
{ | |
if (baseStr == null) | |
throw new ArgumentNullException("baseStr"); |
public static bool ToggleDesktop() | |
{ | |
var success = true; | |
Type shellType = Type.GetTypeFromProgID("Shell.Application"); | |
if (shellType != null) | |
{ | |
try | |
{ | |
object shellObject = Activator.CreateInstance(shellType); | |
shellType.InvokeMember("ToggleDesktop", BindingFlags.InvokeMethod, null, shellObject, null); |
#!/bin/bash | |
# How to install Graphite as a user on CentOS 5.5 (with neither internet access and root account) | |
# -------------------------------------------------------------------------------- | |
# Tomasz Kalkosiński - refaktor.blogspot.com | |
# | |
# Graphite is a Scalable Realtime Graphing (http://graphite.wikidot.com/) | |
# This script is based on two excellent tutorials: | |
# http://community.webfaction.com/questions/10038/how-to-install-pycairo-in-python27-thanks |
function getUserHomePath() { | |
if (isset($_SERVER['HOME'])) { | |
return $_SERVER['HOME']; | |
} | |
if (PHP_OS == 'WINNT') { | |
return getenv('USERPROFILE'); | |
} else { | |
return getenv('HOME'); | |
} |
//http://golang.org/src/pkg/syscall/dll_windows.go | |
//http://golang.org/src/pkg/runtime/syscall_windows_test.go?h=int | |
//http://golang.org/src/pkg/syscall/syscall_windows.go | |
//http://wendal.net/2013/0406.html | |
//http://outofmemory.cn/code-snippet/3006/golang-call-API-liechu-window-suo-exist-run-process | |
// char -> byte | |
// char* -> *byte | |
// wchar_t/LCHAR -> uint16 | |
// wchar_t/LPCHAR -> *uint16 | |
// LPARAM -> uintptr |
server | |
{ | |
listen 8000; | |
index index.html index.htm index.php; | |
root /data/wwwroot/XuanAdmin/current; | |
location ~ .*\.(php|php5)?$ | |
{ | |
try_files $uri =404; | |
fastcgi_pass 127.0.0.1:9000; |
#!/bin/bash | |
# 更改nginx日志为带日期的文件名 | |
log_dir="/var/log/jbmon/backup/apache" | |
new_dir="/var/log/jbmon/backup/apache" | |
date_dir=`date +%Y%m%d%H -d '-1 hours'` | |
yearstr=`date +%Y%m%d` | |
FILES=${log_dir}/*.log | |
for f in ${FILES} |
{ | |
"color_scheme": "Packages/User/SublimeLinter/Seti_monokai (SL).tmTheme", | |
"file_exclude_patterns": | |
[ | |
"*.pyc", | |
"*.pyo", | |
"*.exe", | |
"*.dll", | |
"*.obj", | |
"*.o", |