用Python写了一个postgresql函数,感觉很爽
CREATE LANGUAGE plpythonu;
postgresql函数
CREATE OR REPLACE FUNCTION myfun1(text)
RETURNS text AS
$BODY$
s = args[0]
h = 0;
n = len(s);
for i, c in enumerat...
分类:
数据库 时间:
2015-06-10 19:26:28
阅读次数:
164
我是前端的门外汉,js我用得比较少。今天意外发现js自带的replace “居然”只替换1处,而其它的许多许多语言都是替换全部的。你可能会说,切,我早就知道。高手请绕道。你可能会说,用js的正则就可以解决这个问题。对,没错,但敝人有“不轻易使用正则”的癖好。于是想出一个办法,既然js你只帮我做一次,...
分类:
编程语言 时间:
2015-06-10 19:00:38
阅读次数:
126
在FragmentActivity的fragment跳转的时候添加到运行栈,public void switchFrag(BaseFragment to) {
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.frag_login_content,...
分类:
移动开发 时间:
2015-06-10 17:26:37
阅读次数:
228
编写JavaScript函数trim()来去掉字符串前后空格,在该函数中应用String对象的replace()方法去掉字符串中的首尾空格.trim()函数的关键代码如下:...
分类:
编程语言 时间:
2015-06-10 12:27:34
阅读次数:
115
Write an algorithm to determine if a number is “happy”.A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of i...
分类:
移动开发 时间:
2015-06-10 08:58:42
阅读次数:
128
String.prototype.Trim = function(){ return this.replace(/^\s+/g,"").replace(/\s+$/g,""); } function JSCookie(){ this.GetCookie = function(key){ va...
分类:
Web程序 时间:
2015-06-09 23:26:50
阅读次数:
120
1 将下面的代码放在网站根目录下的一个文件中,以便在其它文件中引用。 2 3 路径方式: 4 5 define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/"); 6 7 echo BA...
分类:
Web程序 时间:
2015-06-09 19:31:56
阅读次数:
146
最近因为工作需要写了个登录校验函数,话不多说,贴代码,因为只是一个简单的介绍用法,所以核心判断我就全部去掉了。//最先要求是只返回一个用户id,于是简单的returns integer就可以完成。CREATE OR REPLACE FUNCTION validate_user()RETURNS in...
分类:
数据库 时间:
2015-06-09 19:16:49
阅读次数:
1088
1.create or replace procedure PROC_CHECK(Insert_by VARCHAR) ISv_OID VARCHAR2(36);begin declare --类型定义 cursor c_check is selec...
分类:
其他好文 时间:
2015-06-09 19:06:25
阅读次数:
124
#include#include#define MAXN 10001using namespace std;char dict[MAXN][20];char s[20];bool is_replace(const char * a,const char * b);bool is_delete(con...
分类:
其他好文 时间:
2015-06-09 16:39:57
阅读次数:
85