12. 打招呼( 你以前去过北京吗?Have you ever been Beijing before?)

- Is this seat taken?

-No, please sit down.

- Are you also going to Beijing?

-Yes, on a business trip. How about you?

- I'm taking a vacation to visit a friend there. Have you ever been there before?

- Yes, I went there once last summer.

-Really? What did you think?

- I think it is amazing.  

You can enjoy both the traditional Chinese culture as well as the vitality of a modern cosmopolitan city.

The only thing I didn't enjoy was the subway.

这儿有人吗?

没有,请坐.

你也是去北京吗?

是啊,出差.你呢?

放假去看朋友,你以前去过北京吗?

去年夏天去过一次

是吗,感觉怎么样?

挺棒的!既可以欣赏中国传统文化,又能颁略现代大都市的活力,唯一美中不足的就是北京的地铁

 

 

展开阅读全文

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in

12-01

<%! ResultSet rs=null;%>rnrn <%rn int type=-1;//定义一个标志变量rn tryrn type=Integer.parseInt(request.getParameter("do"));//取得参数do的值,这个值决定了用户对数据库的操作类型rn catch(Exception eee)rn type=0;//如果没有这个参数或者其他原因发生异常,则默认为0rn rn tryrn Statement st=getStatement();//取得Statement对象,getStatement()函数将在步骤8中定义rn String name=request.getParameter("name");//取得参数name的值rnswitch(type)rn//如果为0,表示用户没有操作,则把所有数据库中的所有记录提取出来rn case 0:rn rs=st.executeQuery("select * from friends");//查询全部rn break;rn//如果为1,表示用户执行的是查询操作,则把符合要求的结果提取出来rn case 1:rn name=new String(name.getBytes("ISO-8859-1"));//改变字符编码,否则会出现中文乱码问题rn rs=st.executeQuery("select * from friends where name like '%"+name+"%'");//特定查询rn break;rn //如果为2,表示用户执行的是删除操作,则执行删除后再把控制权转向本页面rn case 2:rn name=new String(name.getBytes("ISO-8859-1"));rn st.executeUpdate("delete from friends where name ='"+name+"'");//删除rn response.sendRedirect("db1.jsp");rn break;rn//如果为3,表示用户执行的是插入操作,则执行插入后再把控制权转向本页面rncase 3:rn name=new String(name.getBytes("ISO-8859-1"));rn String tel=request.getParameter("tel");rn st.executeUpdate("insert into friends values('0','"+name+"','"+tel+"’)");//添加rn response.sendRedirect("db1.jsp");rn break;rn//如果为4,表示用户执行的是修改操作,则执行插入后再把控制权转向本页面rnrncase 4:rn name=new String(name.getBytes("ISO-8859-1"));rn tel=request.getParameter("tel");rn String sql="update friends set tel=’"+tel+"’ where name=’"+name+"'";rn st.executeUpdate(sql);//修改rn response.sendRedirect("db1.jsp");rn break;rnrn%>rnrnsql语句哪错了啊,大神求指教啊 论坛

Variable 'dwFileSize' might not have been initialized delphi

09-20

$R *.dfmrnfunction GetWebPage(const Url: string):string;rnvarrn Session,rn HttpFile:HINTERNET;rn szSizeBuffer:Pointer;rn dwLengthSizeBuffer:DWord;rn dwReserved:DWord;rn dwFileSize:DWord;rn dwBytesRead:DWord;rn Contents:PChar;rnbeginrn Session:=InternetOpen('',0,niL,niL,0);rn HttpFile:=InternetOpenUrl(Session,PChar(Url),niL,0,0,0);rn dwLengthSizeBuffer:=1024;rn HttpQueryInfo(HttpFile,5,szSizeBuffer,dwLengthSizeBuffer,dwReserved);rn GetMem(Contents,dwFileSize);rn InternetReadFile(HttpFile,Contents,dwFileSize,dwBytesRead);rn InternetCloseHandle(HttpFile);rn InternetCloseHandle(Session);rn Result:=StrPas(Contents);rn FreeMem(Contents);rnend;rnrnprocedure TForm1.Button1Click(Sender: TObject);rnbeginrnwebbrowser1.navigate('http://www.baidu.com/s?wd='+edit1.text);rnlistbox1.Clear;//清空列表中的链接rnend;rnrnprocedure TForm1.Button2Click(Sender: TObject);rnvarrn str1,str2:string;rn i:integer;rnbeginrn progressbar1.min:=0; //设置进度条的属性rn progressbar1.Max:=listbox1.items.Count-1;rnrnrn for i=0 to listbox1.items.count -1 do //i最大取值(listbox1.items.count-1)rn beginrn str1=getwebpage(listbox1.Items.Strings[i]+' and 1=1');rn str2=getwebpage(listbox1.Items.Strings[i]+' and 1=2');rnrn if str1<>str2 // 如果两个字符串不相等rn listbox2.Items.Add('存在注入漏洞--'+listbox1.Items.Strings[i])rn elsern listbox2.Items.Add(listbox1.Items.Strings[i]); //没有漏洞直接添加地址rnrn application.ProcessMessages;//防止程序假死rn progressbar1.Position=i; // 设置进度条进度rn rn if i=listbox1.Items.Count-1 thenrn showmessage('地址检测完毕!');rnrn end;rnend;rnrnprocedure TForm1.WebBrowser1DownloadComplete(Sender: TObject);rnbeginrnvarrni,ninteger;rnbeginrnfor i=0 to WebBrowser1.OleObject.document.links.length-1 dorn listBox1.Items.Add(WebBrowser1.OleObject.document.links.item(i).href); // 读取链接rn n=WebBrowser1.OleObject.document.links.length; // 链接数rnend;rnend;rnrnrn=======一段检测注入点的代码 错误提示rnVariable 'dwFileSize' might not have been initialized rn如何解决? 论坛

提示:You have an error in your SQL syntax

11-25

[code=Java]rn/**rn * 添加操作记录rn */rn public Statistics saveStatistics(Integer status, List batchProcess) rn Statistics stat = new Statistics();rn Article article = getArticle();rn User user = getLoggedOnUser();rn stat.setType(2);//文章rn stat.setUserId(user.getId());rn Date date = new Date();rn SimpleDateFormat dateformat=new SimpleDateFormat("yyyy-MM-dd");rn dateformat.format(date);rn stat.setStatisticsTime(date);rn if(status != null) rn switch (status) rn case 0://重申rn stat.setDescribe(user.getUsername() + "重申了"+article.getCommUser().getUserName()+"发表的文章" + article.getTitle());rn break;rn case 1://通过rn stat.setDescribe(user.getUsername() +article.getCommUser().getUserName()); //article.getTitle()rn break;rn case 2://屏蔽rn stat.setDescribe(user.getUsername() + "屏蔽了"+article.getCommUser().getUserName()+"发表的文章" + article.getTitle());rn break;rn case 3://删除rn stat.setDescribe(user.getUsername() + "删除了"+article.getCommUser().getUserName()+"发表的文章" + article.getTitle());rn break;rn rn rn if(batchProcess != null) rn stat.setDescribe(user.getUsername() + "处理了"+article.getCommUser().getUserName()+"发表的文章" + article.getTitle());rn rn [color=#FF0000statisticsManager.save(stat);][/color] //这里执行走不了rn this.saveStatisticsDesc(stat,article);rn return stat;rn rn[/code]rnrn错误信息如下:rnrnHibernate: insert into ibokee_statistics (describe, statisticsTime, type, userId) values (?, ?, ?, ?)rnWARN ["http-bio-8080"-exec-9] JDBCExceptionReporter.logExceptions(100) | SQL Error: 1064, SQLState: 42000rnERROR ["http-bio-8080"-exec-9] JDBCExceptionReporter.logExceptions(101) | You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'describe, statisticsTime, type, userId) values ('adminzhender', '2011-11-25 10:4' at line 1rn 论坛

How Long Do You Have to Draw

10-28

Problem DescriptionnThere are two horizontal lines on the XoY plane. One is y1 = a, the other is y2 = b(a < b). On line y1, there are N points from left to right, the x-coordinate of which are x = c1, c2, ... , cN (c1 < c2 < ... < cN) respectively. And there are also M points on line y2 from left to right. The x-coordinate of the M points are x = d1, d2, ... dM (d1 < d2 < ... < dM) respectively.nNow you can draw segments between the points on y1 and y2 by some segments. Each segment should exactly connect one point on y1 with one point on y2.nThe segments cannot cross with each other. By doing so, these segments, along with y1 and y2, can form some triangles, which have positive areas and have no segments inside them.nThe problem is, to get as much triangles as possible, what is the minimum sum of the length of these segments you draw?n nnInputnThe first line has a number T (T <= 20) , indicating the number of test cases.nFor each test case, first line has two numbers a and b (0 <= a, b <= 104), which is the position of y1 and y2.nThe second line has two numbers N and M (1 <= N, M <= 105), which is the number of points on y1 and y2.nThe third line has N numbers c1, c2, .... , cN(0 <= ci < ci+1 <= 106), which is the x-coordinate of the N points on line y1.nThe fourth line has M numbers d1, d2, ... , dM(0 <= di < di+1 <= 106), which is the x-coordinate of the M points on line y2.n nnOutputnFor test case X, output "Case #X: " first, then output one number, rounded to 0.01, as the minimum total length of the segments you draw.n nnSample Inputn1n0 1n2 3n1 3n0 2 4n nnSample OutputnCase #1: 5.66 问答

WorstWeather Ever

07-15

Problem Descriptionn"Man, this year has the worst weather ever!", David said as he sat crouched in the small cave where we had sought shelter from yet another sudden rainstorm. n"Nuh-uh!", Diana immediately replied in her traditional know-it-all manner. n"Is too!", David countered cunningly. Terrific. Not only were we stuck in this cave, now we would have to listen to those two nagging for at least an hour. It was time to cut this discussion short. n"Big nuh-uh. In fact, 93 years ago it had already rained five times as much by this time of year." n"Duh", David capitulated, "so it's the worst weather in 93 years then." n"Nuh-uh, this is actually the worst weather in 23 years.", Diana again broke in. n"Yeah, well, whatever", David sighed, "Who cares anyway?". nWell, dear contestants, you care, don't you? nYour task is to, given information about the amount of rain during different years in the history of the universe, and a series of statements in the form "Year X had the most rain since year Y", determine whether these are true, might be true, or are false. We say that such a statement is true if: nnThe amount of rain during these two years and all years between them is known. nnIt rained at most as much during year X as it did during year Y. nnFor every year Z satisfying Y < Z < X, the amount of rain during year Z was less than the amount of rain during year X.nnWe say that such a statement might be true if there is an assignment of amounts of rain to years for which there is no information, such that the statement becomes true. We say that the statement is false otherwise.n nnInputnThe input will consist of several test cases, each consisting of two parts. nThe first part begins with an integer 1 <= n <= 50000, indicating the number of different years for which there is information. Next follow n lines. The ith of these contains two integers -109 <= yi <= 109 and 1 <= ri <= 109 indicating that there was ri millilitres of rain during year yi (note that the amount of rain during a year can be any nonnegative integer, the limitation on ri is just a limitation on the input). You may assume that yi < yi+1 for 1 <= i < n. nThe second part of a test case starts with an integer 1 <= m <= 10000, indicating the number of queries to process. The following m lines each contain two integers -109 <= Y < X <= 109 indicating two years. nThere is a blank line between test cases. The input is terminated by a case where n = 0 and m = 0. This case should not be processed. nTechnical note: Due to the size of the input, the use of cin/cout in C++ might be too slow in this problem. Use scanf/printf instead. In Java, make sure that both input and output is buffered.n nnOutputnThere should be m lines of output for each test case, corresponding to the m queries. Queries should be answered with "true" if the statement is true, "maybe" if the statement might be true, and "false" if the statement is false. nSeparate the output of two different test cases by a blank line.n nnSample Inputn4n2002 4920n2003 5901n2004 2832n2005 3890n2n2002 2005n2003 2005nn3n1985 5782n1995 3048n2005 4890n2n1985 2005n2005 2015nn0n0n nnSample Outputnfalsentruennmaybenmayben n 问答

没有更多推荐了,返回首页