http://poj.org/problem?id=1475

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=249

Pushing Boxes
Time Limit: 2000MS   Memory Limit: 131072K
Total Submissions: 4662   Accepted: 1608   Special Judge

Description

Imagine you are standing inside a two-dimensional maze composed of square cells which may or may not be filled with rock. You can move north, south, east or west one cell at a step. These moves are called walks. 
One of the empty cells contains a box which can be moved to an adjacent free cell by standing next to the box and then moving in the direction of the box. Such a move is called a push. The box cannot be moved in any other way than by pushing, which means that if you push it into a corner you can never get it out of the corner again.

One of the empty cells is marked as the target cell. Your job is to bring the box to the target cell by a sequence of walks and pushes. As the box is very heavy, you would like to minimize the number of pushes. Can you write a program that will work out the best such sequence? 

Input

The input contains the descriptions of several mazes. Each maze description starts with a line containing two integers r and c (both <= 20) representing the number of rows and columns of the maze.

Following this are r lines each containing c characters. Each character describes one cell of the maze. A cell full of rock is indicated by a `#' and an empty cell is represented by a `.'. Your starting position is symbolized by `S', the starting position of the box by `B' and the target cell by `T'.

Input is terminated by two zeroes for r and c.

Output

For each maze in the input, first print the number of the maze, as shown in the sample output. Then, if it is impossible to bring the box to the target cell, print ``Impossible.''.

Otherwise, output a sequence that minimizes the number of pushes. If there is more than one such sequence, choose the one that minimizes the number of total moves (walks and pushes). If there is still more than one such sequence, any one is acceptable.

Print the sequence as a string of the characters N, S, E, W, n, s, e and w where uppercase letters stand for pushes, lowercase letters stand for walks and the different letters stand for the directions north, south, east and west.

Output a single blank line after each test case.

Sample Input

1 7
SB....T
1 7
SB..#.T
7 11
###########
#T##......#
#.#.#..####
#....B....#
#.######..#
#.....S...#
###########
8 4
....
.##.
.#..
.#..
.#.B
.##S
....
###T
0 0

Sample Output

Maze #1
EEEEE Maze #2
Impossible. Maze #3
eennwwWWWWeeeeeesswwwwwwwnNN Maze #4
swwwnnnnnneeesssSSS 分析:
第一次看到题目的时候,以为可以两次bfs,先拿箱子bfs目标,记录路径,得到箱子的开始状态(即人的最终状态),然后再次拿人BFS箱子的初试状态,记录路径,把两个路径加起来即可(之前竟然不知道这个叫嵌套BFS)。
有几个细节需要注意:
    1,箱子移动时,箱子可以移动到人当前所在的位置。
    2,人移动时,人不能移动到箱子未改变状态时所在的位置。
后来第三组数据不对,想到了箱子是不能像人一样拐弯的,Orz WA代码:
 #include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <iomanip>
#include <vector>
#pragma comment(linker, "/STACK:1024000000,1024000000")
#pragma warning(disable:4786) using namespace std; const int INF = 0x3f3f3f3f;
const int MAX = + ;
const double eps = 1e-;
const double PI = acos(-1.0); char ma[MAX][MAX];
int vis[MAX][MAX];
int n , m;
int si , sj , bi , bj , ti , tj , ei , ej;
int dir[][] = { , , - , , , , , -};
char path[] = {'S' , 'N' , 'E' , 'W'};
char path1[] = {'s' , 'n' , 'e' , 'w'};
string str , str1 , ans; struct T
{
int x , y ;
string sss;
}temp , in , out; queue<T>qq , qq1; void bfs(int i , int j)
{
temp.x = i;
temp.y = j;
temp.sss = "";
qq.push(temp);
vis[i][j] = ;
while(!qq.empty())
{
out = qq.front();
qq.pop();
if(out.x == ti && out.y == tj)
{
str = out.sss;
break;
}
for(int k = ;k < ;k ++)
{
int ix = out.x + dir[k][];
int iy = out.y + dir[k][];
if(ma[ix][iy] == '#' || vis[ix][iy] || ix < || iy < || ix > n || iy > m)
continue;
in.x = ix;
in.y = iy;
in.sss = out.sss + path[k];
vis[ix][iy] = ;
qq.push(in);
}
}
} void bfs1(int i , int j)
{
temp.x = i;
temp.y = j;
temp.sss = "";
qq.push(temp);
vis[i][j] = ;
while(!qq.empty())
{
out = qq.front();
qq.pop();
if(out.x == ei && out.y == ej)
{
str1 = out.sss;
break;
}
for(int k = ;k < ;k ++)
{
int ix = out.x + dir[k][];
int iy = out.y + dir[k][];
if(ma[ix][iy] == '#' || ma[ix][iy] == 'B' || vis[ix][iy] || ix < || iy < || ix > n || iy > m)
continue;
in.x = ix;
in.y = iy;
in.sss = out.sss + path1[k];
vis[ix][iy] = ;
qq.push(in);
}
}
} int main()
{
int first = ;
while(scanf("%d %d",&n , &m) , n + m)
{
int i , j;
memset(vis , , sizeof(vis));
for(i = ;i <= n;i ++)
{
for(j = ;j <= m;j ++)
{
scanf("%c",&ma[i][j]);
if(ma[i][j] == 'S')
{
si = i;
sj = j;
}
else if(ma[i][j] == 'B')
{
bi = i;
bj = j;
}
else if(ma[i][j] == 'T')
{
ti = i;
tj = j;
}
}
getchar();
}
str = "";
while(!qq.empty())
qq.pop();
bfs(bi , bj);
if(str[] == 'S')
{
ei = bi - ;
ej = bj;
}
else if(str[] == 'N')
{
ei = bi + ;
ej = bj;
}
else if(str[] == 'E')
{
ei = bi;
ej = bj - ;
}
else if(str[] == 'W')
{
ei = bi;
ej = bj + ;
} memset(vis , , sizeof(vis));
str1 = "";
while(!qq.empty())
qq.pop();
bfs1(si , sj);
ans = "";
ans = str1 + str; printf("Maze #%d\n",first ++);
if(ans != "")
cout << ans << "\n" << endl;
else
cout << "Impossible\n" << endl;
}
return ;
}

后来搜了一些资料。

双重bfs:

  在推箱子游戏中人推箱子只有两种情况:

    人推箱子:那么箱子此时所处的位置就是人接下来会到达的位置

    人找位子推箱子:那么人就要到达箱子下一步到达位子对应的相反方向得那一个格子

  所以,主干是箱子的移动过程,箱子每移动一步就对接下来人所处的位子进行考虑。也就是在一次bfs的过程中不断套用另一个bfs

AC代码:

 #include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <queue>
using namespace std; const int maxn = ;
char map[maxn][maxn];
bool visPerson[maxn][maxn];
bool visBox[maxn][maxn]; int R , C;
int dir[][] = { {,},{,-},{,},{-,} };
char pushes[] = { 'E','W','S','N' };
char walks[] = { 'e','w','s','n' };
string path;
struct Node
{
int br , bc , pr , pc;
string ans;
};
bool inMap(int r , int c)
{
return r>= && r<R && c>= && c<C;
}
bool bfs2(int sr, int sc, int er, int ec, int br, int bc, string &ans)
{
Node node , tmpnode;
memset(visPerson,,sizeof(visPerson));
queue<Node> Q;
node.pr = sr;
node.pc = sc;
node.ans = "";
Q.push(node);
visPerson[br][bc] = true;
while(!Q.empty()) {
node = Q.front(); Q.pop();
if(node.pr == er && node.pc == ec) {
ans = node.ans;
return true;
}
if(visPerson[node.pr][node.pc]) continue;
visPerson[node.pr][node.pc] = true;
for(int i=;i<;i++) {
int nr = node.pr + dir[i][];
int nc = node.pc + dir[i][];
if(inMap(nr,nc) && !visPerson[nr][nc] && map[nr][nc]!='#') {
tmpnode.pr = nr;
tmpnode.pc = nc;
tmpnode.ans =node.ans + walks[i];
Q.push(tmpnode);
}
}
}
return false;
}
bool bfs1(int sr ,int sc, int br, int bc) {
Node node , tmpnode;
memset(visBox,,sizeof(visBox));
queue<Node> Q;
node.pr = sr;
node.pc = sc;
node.br = br;
node.bc = bc;
node.ans = "";
Q.push(node);
while(!Q.empty()) {
node = Q.front(); Q.pop();
if(visBox[node.br][node.bc])
continue;
visBox[node.br][node.bc] = true;
if(map[node.br][node.bc]=='T') {
path = node.ans;
return true;
}
visBox[node.br][node.bc] = true;
for(int i=;i<;i++) {
int nextr = node.br + dir[i][];
int nextc = node.bc + dir[i][];
int backr = node.br - dir[i][];
int backc = node.bc - dir[i][];
string ans = "";
if( inMap(nextr,nextc) && inMap(backr,backc)
&& map[nextr][nextc]!='#' && map[backr][backc]!='#'
&& !visBox[nextr][nextc] ) {
if(bfs2(node.pr, node.pc, backr, backc, node.br, node.bc, ans)) {
tmpnode.pr = node.br;
tmpnode.pc = node.bc;
tmpnode.br = nextr;
tmpnode.bc = nextc;
tmpnode.ans = node.ans +ans +pushes[i];
Q.push(tmpnode);
}
}
}
}
return false;
}
int main() {
int cas = ;
int sr , sc , br , bc;
while(~scanf("%d%d",&R,&C) && R) {
for(int i=;i<R;i++) scanf("%s",map[i]);
for(int i=;i<R;i++)
for(int j=;j<C;j++) {
if(map[i][j]=='S') {
sr = i; sc = j;
}
if(map[i][j]=='B') {
br = i; bc = j;
}
}
path = "";
printf("Maze #%d\n",cas++);
bfs1(sr,sc,br,bc) ? cout<<path<<endl : cout<<"Impossible."<<endl;
cout<<endl;
}
return ;
}

后来测试了几组数据:发现有些数据过不了(比如下面的数据),oj数据水呀。

 #########
#......T#
#.S.....#
##B######
#.......#
#.......#
#.......#
#########

以箱子为开始点 进行BFS。每次判断人(BFS)能不能到达箱子所需推到的反方向。如果能救如队列。有几个细节需要注意。1,箱子移动时,箱子可以移动到人当前所在的位置。2,人移动时,人不能移动到箱子未改变状态时所在的位置。。然后模拟即可。

AC代码:

 #include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<queue>
#include<cstring>
using namespace std;
int n,m;
char map[][];
int dir[][]={{-,},{,},{,-},{,}};
int other_dir[][]={{,},{-,},{,},{,-}};
int ex,ey,flag;
bool vis[][][][];
bool mark[][];
char op[]="nswe";
char big_op[]="NSWE";
string ans;
struct node{
int b_x,b_y;
int p_x,p_y;
int step;
string ans;
}s_pos;
bool cheack(int x,int y){
return x>=&&x<n&&y>=&&y<m&&map[x][y]!='#';
return false;
}
bool people_cango(node &cur,node last,int e_x,int e_y){
queue<node > q; node per;per=cur; per.step=; per.ans="";
memset(mark,false,sizeof(mark));
q.push(per);
mark[cur.p_x][cur.p_y]=true; while(!q.empty()){
node now=q.front(); q.pop();
if(now.p_x==e_x&&now.p_y==e_y){
cur.ans+=now.ans;
return true;
}
for(int i=;i<;i++){
node next=now; next.step+=;
next.p_x+=dir[i][]; next.p_y+=dir[i][];
if(cheack(next.p_x,next.p_y)&&!mark[next.p_x][next.p_y]){
if(next.p_x==last.b_x&&next.p_y==last.b_y) continue; //遇见箱子
mark[next.p_x][next.p_y]=true;
next.ans+=op[i];
if(next.p_x==e_x&&next.p_y==e_y){
cur.ans+=next.ans;
return true;
}
q.push(next);
}
}
}
return false; }
void bfs(){
queue<node > q;
memset(vis,false,sizeof(vis)); q.push(s_pos);
vis[s_pos.b_x][s_pos.b_y][s_pos.p_x][s_pos.p_y]=true;
while(!q.empty()){
node now = q.front(); q.pop(); for(int i=;i<;i++){
node next = now; next.step+=;
next.b_x+=dir[i][]; next.b_y+=dir[i][]; int x=now.b_x+other_dir[i][]; //人要到达箱子的反面
int y=now.b_y+other_dir[i][];
if(cheack(next.b_x,next.b_y)&&cheack(x,y)&&!vis[next.b_x][next.b_y]
[now.b_x][now.b_y]){
// if(next.b_x==now.p_x&&next.b_y==now.p_y) continue;
// cout<<next.p_x<<" "<<next.p_y<<endl; if(people_cango(next,now,x,y)){
// cout<<x<<" "<<y<<endl;
next.p_x=now.b_x;
next.p_y=now.b_y;
next.ans+=big_op[i];
if(next.b_x==ex&&next.b_y==ey){
flag=;
ans=next.ans;
return ;
} vis[next.b_x][next.b_y][next.p_x][next.p_y]=true;
q.push(next);
}
} } } }
int main(){
int ca=;
while(scanf("%d%d",&n,&m)!=EOF,n+m){ for(int i=;i<n;i++) scanf("%s",map[i]); for(int i=;i<n;i++){
for(int j=;j<m;j++){
if(map[i][j]=='T'){
ex=i,ey=j;
}
if(map[i][j]=='B'){
s_pos.b_x=i; s_pos.b_y=j;
}
if(map[i][j]=='S'){
s_pos.p_x=i; s_pos.p_y=j;
}
}
} flag=; s_pos.step=; s_pos.ans="";
bfs();
cout<<"Maze #"<<ca++<<endl;
if(flag){
cout<<ans<<endl;
}
else
cout<<"Impossible."<<endl;
cout<<endl; }
return ;
}

AC代码:

 #include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <string> using namespace std; #define MAXN 22
char P[]={'N','S','W','E'};
char M[]={'n','s','w','e'};
int R,C;
int dir[][]={-,,,,,-,,};
char map[MAXN][MAXN];
struct point
{
int x,y;
int p_x,p_y;//当前状态person所在的地方
string ans;
};
bool isok(int x,int y)
{
if(x>= && x<R && y>= && y<C && map[x][y] != '#')
return true;
return false;
}
string tmp;
bool bfs_person(point en,point cu)
{
tmp="";
point st;
st.x=en.p_x;
st.y=en.p_y;
st.ans="";
queue<point>q;
bool vis[MAXN][MAXN];
memset(vis,,sizeof(vis));
while(!q.empty())
q.pop();
q.push(st);
while(!q.empty())
{
point cur,next;
cur=q.front();
q.pop();
if(cur.x==en.x && cur.y==en.y)
{
tmp=cur.ans;
return true;
}
for(int i=;i<;i++)
{
next=cur;
next.x=cur.x+dir[i][];
next.y=cur.y+dir[i][];
if(!isok(next.x,next.y)) continue;
if(next.x==cu.x && next.y==cu.y) continue;
if(vis[next.x][next.y]) continue;
vis[next.x][next.y]=;
next.ans=cur.ans+M[i];
q.push(next);
}
}
return false;
}
string bfs_box()
{
bool vis[MAXN][MAXN][];//某点四个方向是否访问!!0==N,1==S,2==W,3==E
point st;
st.x=st.y=-;
st.p_x=st.p_y=-;
st.ans="";
for(int i=;i<R && (st.x==- || st.p_x==-);i++)
for(int j=;j<C && (st.x==- || st.p_x==-);j++)
if(map[i][j]=='B')
{
st.x=i;
st.y=j;
map[i][j]='.';
}
else if(map[i][j]=='S')
{
st.p_x=i;
st.p_y=j;
map[i][j]='.';
}
//----------------------------------------
//cout<<"st.x="<<st.x<<" st.y="<<st.y<<" st.p_x="<<st.p_x<<" st.p_y="<<st.p_y<<endl;
//----------------------------------------
queue<point> q;
while(!q.empty())
q.pop();
q.push(st);
memset(vis,,sizeof(vis));
while(!q.empty())
{
point cur=q.front();q.pop();
//----------------------------------------
// cout<<"cur.x="<<cur.x<<" cur.y="<<cur.y<<" cur.p_x="<<cur.p_x<<" cur.p_y="<<cur.p_y<<endl;
// cout<<"-----------------------------\n";
//----------------------------------------
point next,pre;
if(map[cur.x][cur.y]=='T')
return cur.ans;
for(int i=;i<;i++)
{
next=cur;
next.x=cur.x+dir[i][];
next.y=cur.y+dir[i][];
if(!isok(next.x,next.y))
continue;
if(vis[next.x][next.y][i])
continue;
pre=cur;
switch(i)
{
case : pre.x=cur.x+;break;
case : pre.x=cur.x-;break;
case : pre.y=cur.y+;break;
case : pre.y=cur.y-;break;
}
if(!bfs_person(pre,cur))//搜寻人是否能走到特定的位置
continue;
vis[next.x][next.y][i]=;
next.ans=cur.ans+tmp;
next.ans=next.ans+P[i];
next.p_x=cur.x;next.p_y=cur.y;
q.push(next);
}
}
return "Impossible.";
} int main()
{
int cas=;
while(scanf("%d%d",&R,&C) && (R+C))
{
getchar();
for(int i=;i<R;i++)
gets(map[i]); //---------------------------------------
// for(int i=0;i<R;i++)
// cout<<map[i]<<endl;
//---------------------------------------- printf("Maze #%d\n",cas++);
//printf("%s\n",bfs_box());
cout<<bfs_box()<<endl<<endl;
}
return ;
}

程序终究是会有bug,上面两个肯定也有bug数据过不了,就不列举啦,重要是思想。

下面一个是wcg的AC代码:

附上链接:http://www.cnblogs.com/lovychen/p/4453147.html

 //解题思路:先判断盒子的四周是不是有空位,如果有,则判断人是否能到达盒子的那一边,能的话,把盒子推到空位处,然后继续
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<queue>
#include<string>
#include<cmath>
using namespace std;
int bx,by,sx,sy,tx,ty;
int m,n,dir[][]={-,,,,,-,,};//注意题目要求的是n、s、w、e的顺序,因为这个wa了一次
char op[]={'n','s','w','e'};
bool mark[][][];//标记箱子四周的位置时候已被用过
int vis[][];//标记人走过的位置
char map[][];
struct BB//盒子
{
int x,y,SX,SY;//SX,SY表示当前箱子固定了,人所在的位置
string ans;
}bnow,beed;
struct YY//人
{
int x,y;
string ans;
}ynow,yeed;
char up(char c)
{
return (c-'a'+'A');
}
//aa,bb 表示当前盒子的位置;ss,ee表示起点;
bool bfs2(int s,int e,int aa,int bb,int ss,int ee)//寻找当前人,是否能够到达盒子指定的位置;
{
queue<YY>yy;
if(s< || s>m || e< || e>n || map[s][e] == '#') return false;
ynow.x = ss; ynow.y = ee; ynow.ans="";
memset(vis,,sizeof(vis));
vis[aa][bb] =;//不能经过盒子
vis[ss][ee] = ;//起点标记为
yy.push(ynow);
while(!yy.empty())
{
ynow = yy.front();
yy.pop();
if(ynow.x == s && ynow.y == e)
{
return true;
}
for(int i=;i<;i++)
{
yeed.x = ynow.x+dir[i][];
yeed.y = ynow.y+dir[i][];
if(yeed.x> && yeed.x<=m && yeed.y> && yeed.y<=n && !vis[yeed.x][yeed.y] && map[yeed.x][yeed.y]!='#')
{
yeed.ans = ynow.ans+op[i];//记录走过的路径
vis[yeed.x][yeed.y] = ;
yy.push(yeed);
}
}
}
return false;
} bool bfs1()
{
queue<BB>bb;
bnow.x = bx;bnow.y=by;bnow.ans="";
bnow.SX = sx;bnow.SY=sy;
bb.push(bnow);
while(!bb.empty())
{ bnow=bb.front();
bb.pop();
if(bnow.x == tx && bnow.y==ty)
{
return true;
}
for(int i=;i<;i++) //盒子周围的四个方向;
{
beed.x = bnow.x+dir[i][];
beed.y = bnow.y+dir[i][];
if(beed.x> && beed.x<=m && beed.y> && beed.y<=n && !mark[beed.x][beed.y][i] && map[beed.x][beed.y]!='#')
{
if(bfs2(beed.x-*dir[i][],beed.y-*dir[i][],bnow.x,bnow.y,bnow.SX,bnow.SY))//如果能推到yeed,则需要判断人是否能到达,它的上一个点;
{
beed.SX = bnow.x;//推完箱子后,人的位置在箱子上
beed.SY = bnow.y;
beed.ans=bnow.ans+ynow.ans+up(op[i]);//当前的加上推箱子的加上目前挨着推的;
mark[beed.x][beed.y][i] = true;
bb.push(beed);
}
}
}
}
return false;
} int main()
{
int T,k=;
while(scanf("%d %d",&m,&n) && m+n)
{
memset(mark,false,sizeof(mark));
for(int i=;i<=m;i++)
for(int j=;j<=n;j++)
{
scanf(" %c",&map[i][j]);
if(map[i][j] == 'S')
{
sx=i;sy =j;
}
if(map[i][j] == 'T')
{
tx = i;ty = j;
}
if(map[i][j] == 'B')
{
bx = i;by = j;
}
}
printf("Maze #%d\n",k++);
if(bfs1())
printf("%s\n\n",bnow.ans.c_str());//少个换行wa了一次
else
printf("Impossible.\n\n");
}
return ;
}

poj 1475 || zoj 249 Pushing Boxes的更多相关文章

  1. poj 1475 uva 589 - Pushing Boxes

    题目大意 人推箱子从起点到终点,要求推箱子的次数最少,并打印出来人移动的路径. 题目分析 对于箱子进行宽搜的同时,要兼顾人是否能够把箱子推到相应的位置 每一次对箱子bfs 然后对人再bfs #incl ...

  2. [poj P1475] Pushing Boxes

    [poj P1475] Pushing Boxes Time Limit: 2000MS   Memory Limit: 131072K   Special Judge Description Ima ...

  3. HDU 1475 Pushing Boxes

    Pushing Boxes Time Limit: 2000ms Memory Limit: 131072KB This problem will be judged on PKU. Original ...

  4. Pushing Boxes(广度优先搜索)

    题目传送门 首先说明我这个代码和lyd的有点不同:可能更加复杂 既然要求以箱子步数为第一关键字,人的步数为第二关键字,那么我们可以想先找到箱子的最短路径.但单单找到箱子的最短路肯定不行啊,因为有时候不 ...

  5. POJ 1562 && ZOJ 1709 Oil Deposits(简单DFS)

    题目链接 题意 : 问一个m×n的矩形中,有多少个pocket,如果两块油田相连(上下左右或者对角连着也算),就算一个pocket . 思路 : 写好8个方向搜就可以了,每次找的时候可以先把那个点直接 ...

  6. 『Pushing Boxes 双重bfs』

    Pushing Boxes Description Imagine you are standing inside a two-dimensional maze composed of square ...

  7. POJ1475 Pushing Boxes(双搜索)

    POJ1475 Pushing Boxes  推箱子,#表示墙,B表示箱子的起点,T表示箱子的目标位置,S表示人的起点 本题没有 Special Judge,多解时,先最小化箱子被推动的次数,再最小化 ...

  8. POJ 3076 / ZOJ 3122 Sudoku(DLX)

    Description A Sudoku grid is a 16x16 grid of cells grouped in sixteen 4x4 squares, where some cells ...

  9. poj 3100 (zoj 2818)||ZOJ 2829 ||ZOJ 1938 (poj 2249)

    水题三题: 1.给你B和N,求个整数A使得A^n最接近B 2. 输出第N个能被3或者5整除的数 3.给你整数n和k,让你求组合数c(n,k) 1.poj 3100 (zoj 2818) Root of ...

随机推荐

  1. ArcGIS Server发布服务,报错001270

    错误001270 这个问题一般是因为数据源文件太大导致. 解决办法:  对于001270的错误,官方帮助中给出了一些可能的原因并提供了相应的解决办法(http://resources.arcgis.c ...

  2. [转]EF 4.1 Code First

    这篇文章介绍Code First开发以及如何与DbContext API一起使用.Code First允许使用C#或VB.NET类定义模型,在类或属性上有选择性的执行额外的配置或者使用Fluent A ...

  3. ExtJS 刷新或者重载Tree后,默认选中刷新前最后一次选中的节点代码片段

    //tree对象 var tree = Main.getPageControler().treePanel; //获取选中的节点 var node = tree.getSelectionModel() ...

  4. fstream 坑解决办法

    status_t SysWatcher::setWVer() {     fstream myfile;     myfile.open("/data/w_version", io ...

  5. yii2 rbac-plus的使用

    前言 1.本教程适合有RBAC基础,对RBAC有一定了解的同学. 2.本教程使用advanced模板 3.确保数据库中存在user表,没有的同学请查阅文档 运行 php yii migrate 来生成 ...

  6. php之curl实现http与https请求的方法

    原文地址:http://m.jb51.net/show/56492   这篇文章主要介绍了php之curl实现http与https请求的方法,分别讲述了PHP访问http网页与访问https网页的实例 ...

  7. JeeSite是基于多个优秀的开源项目,高度整合封装而成的高效,高性能,强安全性的 开源 Java EE快速开发平台

    JeeSite本身是以Spring Framework为核心容器,Spring MVC为模型视图控制器,MyBatis为数据访问层, Apache Shiro为权限授权层,Ehcahe对常用数据进行缓 ...

  8. ArcGIS API for Silverlight 调用WebService出现跨域访问报错的解决方法

    原文:ArcGIS API for Silverlight 调用WebService出现跨域访问报错的解决方法 群里好几个朋友都提到过这样的问题,说他们在Silverlight中调用了WebServi ...

  9. SQLSERVER 16进制与10进制转换

    最近工控项目中遇到的16进制与10进制转换,在.NET中比较容易实现,在SQLSERVER中发现没有直接的转换,尤其是出现超出范围的long负数,即无符号64位整数在sqlserver中的存储.网上找 ...

  10. c#上传文件(二)使用文件流保存文件

    1.html代码: <asp:FileUpload runat="server" ID="UpLoadFile"/> <asp:Button ...