本人认为很实用的几条语句1)select ... from ...into...2)insert into ...select ...3)select ...from ...left join ...on ...4)case...when...then ...else ... endJava代码se...
分类:
数据库 时间:
2015-08-10 23:56:09
阅读次数:
185
smarty中的if语句和php中的if语句一样,if必须与/if成对出现。可以使用else和elseif子句。可以使用条件修饰词:eq、ne、neq、gt、lte、le、gte、ge、is even、is odd、is not even、is not odd、not、mod、div by、even...
分类:
其他好文 时间:
2015-08-10 21:37:28
阅读次数:
8821
题意:平面上有n个点,每个点画一个正方形并且该点要落在正方形上边或者下边的中间,问满足条件的最大正方形的边长是多少。
思路:二分边长mid,建图用2-SAT作为判断条件。
i表示画在上面,~i表示画在下面
if|xi-xj|>=mid continue;
else if |yi-yj|>=2*mid continue;
else if |yi-yj|==0 then i->~j,~i->j,j->~i,~j->i;
else if |yi-yj|>0 then ~i->i,j->~j;
else |yi-y...
分类:
其他好文 时间:
2015-08-10 20:01:19
阅读次数:
159
#!/bin/bash
ifls/backup|grep$(date+%F)&>/dev/null
then
echo"todayisalreadybackup"
exit1
else
ifls/|grepbackup&>/dev/null
then
if[-f/backup]
then
mv/backup/$(date+%T)&>/dev/null
echo"changenamebackupto$(date+%T)"
mkdir/backup&>/de..
分类:
其他好文 时间:
2015-08-10 16:18:29
阅读次数:
125
原理参见《离散数学》P201
#include
#include
#include
#include
using namespace std;
bool Miller_Rabin(long long n)
{
if(n < 2)
return false;
else if(n == 2)
return true;
long long q = 0, m = n - 1;
w...
分类:
编程语言 时间:
2015-08-10 14:52:29
阅读次数:
188
在大部分的编程语言中,都有分支控制语句 switch。 Switch语句用于编写多分支结构的程序,类似与if...elif...else语句 Swith语句表达的分支结构比if...elif...else语句表达更清晰,代码的可读性更高。 但是pytho...
分类:
编程语言 时间:
2015-08-10 02:14:42
阅读次数:
147
由于目前做的是一个数据库操作的一个简易类,涉及到如下查询语句,在此记录一下。
1.查询表名select object_id,name name from sys.tables2.查询列信息SELECT (case
when a.colorder = 1 then
d.name
else
null
end) 表...
分类:
数据库 时间:
2015-08-10 01:59:07
阅读次数:
154
如果把身份证号码传到页面上,在前端页面获取年龄就需要用到JS脚本了:function GetAge(identityCard) { var len = (identityCard + "").length; if (len == 0) { return 0; } else { if ((len !=...
分类:
Web程序 时间:
2015-08-10 01:43:56
阅读次数:
143
示例代码:
#include
#include
using namespace std;
//基数排序(LSD)从最低位到最高位进行如此的分配收集
void print(int a[], int n)
{
for(int t=0; t<n; ++t)
{
if(t+1<n)
{
printf("%d ", a[t]);
} else {
printf("%d\n"...
分类:
编程语言 时间:
2015-08-10 00:23:20
阅读次数:
183
ref:http://www.cplusplus.com/doc/tutorial/preprocessor/concolusion:directives:#define #undef#include#if #else #elif #endif #ifdef #ifndef#error ( #war...
分类:
编程语言 时间:
2015-08-09 23:50:31
阅读次数:
159