Skip to content

Instantly share code, notes, and snippets.

package demo1;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class DbConn {
// 创建静态全局变量

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@wangdx
wangdx / gist:6912846
Created October 10, 2013 03:59
表情对应图片
<?php
class Emotion{
public function transEmotion($words, $baseUrl = "/Public"){
$patternQQ['1'] = '/\[微笑\]/';
$patternQQ['2'] = '/\[撇嘴\]/';
$patternQQ['3'] = '/\[色\]/';
$patternQQ['4'] = '/\[发呆\]/';
$patternQQ['5'] = '/\[得意\]/';
$patternQQ['6'] = '/\[流泪\]/';
$patternQQ['7'] = '/\[害羞\]/';
42.62.50.238 www.ihelpoo-local.com
42.62.50.238 hbmy.ihelpoo-local.com
42.62.50.238 hutc.ihelpoo-local.com
42.62.50.238 zzuli.ihelpoo-local.com
42.62.50.238 hutc.ihelpoo-local.com
42.62.50.238 xcu.ihelpoo-local.com
42.62.50.238 ccnu.ihelpoo-local.com
42.62.50.238 bnu.ihelpoo-local.com
42.62.50.238 jccug.ihelpoo-local.com
42.62.50.238 hbuas.ihelpoo-local.com
### INSTALL phpredis on Ubuntu 12 with nginx / php5-fpm
# Install php5-dev and dev tools git and php5-cli
$ sudo apt-get install build-essential git php5-dev php5-cli
# clone phpredis (https://github.com/nicolasff/phpredis)
$ git clone git://github.com/nicolasff/phpredis.git
# phpize & make
$ cd phpredis
diff --git a/core/solo-core.iml b/core/solo-core.iml
index b066337..b358e37 100644
--- a/core/solo-core.iml
+++ b/core/solo-core.iml
@@ -3,6 +3,7 @@
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <exclude-output />
<content url="file://$MODULE_DIR$">
@wangdx
wangdx / gist:5010434
Created February 22, 2013 03:06
Should GWT Activities/Places be Singletons or Prototypes?
http://stackoverflow.com/questions/13528268/should-gwt-activities-places-be-singletons-or-prototypes
@wangdx
wangdx / gist:5010177
Created February 22, 2013 01:59
GWT: how do I go to a new place from within the Activity start method?
Scheduler.get().scheduleFinally(new ScheduledCommand() {
@Override
public void execute() {
_app.goTo(new LoginPlace(_app.getCurrentPlaceToken());
}
}
@wangdx
wangdx / gist:4708073
Last active December 12, 2015 03:38
The quick impl of index.jsp in Hupa Evolution
<!DOCTYPE HTML>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="org.apache.hupa.shared.SConsts" %>
<%@ page import="org.apache.hupa.shared.domain.User" %>
<html>
<body>
<%
User user = (User)session.getAttribute(SConsts.USER_SESS_ATTR);
if (user != null) {
@wangdx
wangdx / gist:4707468
Last active December 12, 2015 03:28
500 Internal Server Error, If URL does not match any author. - B3log Solo issue #188
Feb 4, 2013 3:31:10 PM org.b3log.solo.util.Statistics onlineVisitorCount
FINER: Current request [IP=127.0.0.1]
Feb 4, 2013 3:31:10 PM org.b3log.solo.util.Statistics onlineVisitorCount
FINER: Current online visitor count [2]
Feb 4, 2013 3:31:10 PM org.b3log.solo.filter.PageCacheFilter doFilter
FINER: Request URI[/authors/1359990]
Feb 4, 2013 3:31:10 PM org.b3log.solo.filter.PageCacheFilter doFilter
FINER: Page cache miss for request URI[/authors/1359990]
Feb 4, 2013 3:31:10 PM org.b3log.solo.filter.PermalinkFilter doFilter
FINER: Request URI[/authors/1359990]