5. 社交友谊(你找到工作了吗? Have You Got the Job?)

原文链接:http://talk.oralpractice.com/article_14537.html

- I got a part-time job as a tutor.

- I think being a tutor is a challenging job.

- Yes. And I also gained a lot from that. 

- I'd like to be a salesman. 

- Have you got the job?

- Yes. I'll begin next week.

我兼职做家教。

我想做家教是很有挑战性的工作吧。

是的。我也从中学到了很多。

我想做推销员。

你找到工作了吗?

是的。下个星期开始工作。

展开阅读全文

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语句哪错了啊,大神求指教啊 论坛

提示: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 问答

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