4个回答

① document.getElementById 有时会抓 name 放过了 id ，据说是 IE 的一个 BUG ；页面中有

``````    <inputtype="hidden" id="hello8" name="category_id"value="2" />
``````

rnpoj 1915rnrnrnBackgroundrnMr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fast. Can you beat him? rnThe ProblemrnYour task is to write a program to calculate the minimum number of moves needed for a knight to reach one point from another, so that you have the chance to be faster than Somurolov. rnFor people not familiar with chess, the possible knight moves are shown in Figure 1. rnrnrnrnInputrnThe input begins with the number n of scenarios on a single line by itself. rnNext follow n scenarios. Each scenario consists of three lines containing integer numbers. The first line specifies the length l of a side of the chess board (4 <= l <= 300). The entire board has size l * l. The second and third line contain pair of integers 0, ..., l-1*0, ..., l-1 specifying the starting and ending position of the knight on the board. The integers are separated by a single blank. You can assume that the positions are valid positions on the chess board of that scenario.rnOutputrnFor each scenario of the input you have to calculate the minimal amount of knight moves which are necessary to move from the starting point to the ending point. If starting point and ending point are equal,distance is zero. The distance must be written on a single line.rnrnSample Inputrn3rn8rn0 0rn7 0rn100rn0 0rn30 50rn10rn1 1rn1 1rnSample Outputrn5rn28rn0rnrnrnrn我的代码：rnrnrn#includern#includern#includern#includern#includernusing namespace std;rnstruct nodernrn int x;rn int y;rn;rnint dx[8] = 1, 2, 2, 1, -1, -2, -2, -1;rnint dy[8] = -2, -1, 1, 2, 2, 1, -1, -2;rnqueue q;rnnode head, tail;rnint bfs(node a, node b, int m)rnrn int step[m + 5][m + 5];rn bool vis[m + 5][m + 5];rn q.push(a);rn step[a.x][a.y] = 0;rn vis[a.x][a.y] = true;rn while(!q.empty())rn rn head = q.front();rn q.pop();rn for(int i = 0; i < 8; i++)rn rn tail.x = dx[i] + head.x;rn tail.y = dy[i] + head.y;rn if((tail.x < 0) || (tail.y < 0) || (tail.x > m - 1) || (tail.y > m - 1))rn continue;rn if(!vis[tail.x][tail.y])rn rn q.push(tail);rn step[tail.x][tail.y] = step[head.x][head.y] + 1;rn vis[tail.x][tail.y] = true;rn rn if(tail.x == b.x && tail.y == b.y)rn return step[tail.x][tail.y];rn rn rnrnint main()rnrn int t;rn cin>>t;rn while(t--)rn rn int m;rn cin>>m;rn int step[m + 5][m + 5];rn bool vis[m + 5][m + 5];rn node s, r;rn memset(step, 0, sizeof(step));rn memset(vis, false, sizeof(vis));rn cin>>s.x>>s.y>>r.x>>r.y;rn while(!q.empty())rn q.pop();rn printf("%d\n", bfs(s, r, m));rn rn return 0;rnrnrnrnWA了5次 实在没有信心做下去了...

[size=18px][color=#800000]麻烦把bootstrap常用到的类别 列举出来[/color][/size]rnrn 有没有比较好的教程或者视频分享下小白我

n元多项式rn功能： 完成多项式的相加、相减、相乘、除法运算，以及多项式的导函数、不定积分函数、多项式求值等，给出明确的等式形式或值。rnrnrn最好能用C++语言编写，感激不尽
HUD2707Steganography（PE了，求大神告知）
Problem Description In cryptography, the goal is to encrypt a message so that, even if the the message is intercepted, only the intended recipient can decrypt it. In steganography, which literally mea...

int sum(int a[],int n)rnrn if(n>0)rn rn return a[n-1]+sum(a,n-1);rn rnrnvoid main()rnrn int a[]=1,2,3,4,5;rn cout<

11-28 16:03:55.586: E/StrictMode(766): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.rn11-28 16:03:55.586: E/StrictMode(766): java.lang.Throwable: Explicit termination method 'close' not calledrn11-28 16:03:55.586: E/StrictMode(766): at dalvik.system.CloseGuard.open(CloseGuard.java:184)rn11-28 16:03:55.586: E/StrictMode(766): at android.database.CursorWindow.(CursorWindow.java:192)rn11-28 16:03:55.586: E/StrictMode(766): at android.database.CursorWindow.(CursorWindow.java:47)rn11-28 16:03:55.586: E/StrictMode(766): at android.database.CursorWindow\$1.createFromParcel(CursorWindow.java:739)rn11-28 16:03:55.586: E/StrictMode(766): at android.database.CursorWindow\$1.createFromParcel(CursorWindow.java:737)rn11-28 16:03:55.586: E/StrictMode(766): at android.database.BulkCursorDescriptor.readFromParcel(BulkCursorDescriptor.java:75)rn11-28 16:03:55.586: E/StrictMode(766): at android.database.BulkCursorDescriptor\$1.createFromParcel(BulkCursorDescriptor.java:34)rn11-28 16:03:55.586: E/StrictMode(766): at android.database.BulkCursorDescriptor\$1.createFromParcel(BulkCursorDescriptor.java:30)rn11-28 16:03:55.586: E/StrictMode(766): at android.content.ContentProviderProxy.query(ContentProviderNative.java:426)rn11-28 16:03:55.586: E/StrictMode(766): at android.content.ContentResolver.query(ContentResolver.java:386)rn11-28 16:03:55.586: E/StrictMode(766): at android.content.ContentResolver.query(ContentResolver.java:329)rn11-28 16:03:55.586: E/StrictMode(766): at miuisdk.com.miui.internal.variable.v14.Android_Content_ContentResolver_class.originalQuery(Native Method)rn11-28 16:03:55.586: E/StrictMode(766): at miuisdk.com.miui.internal.variable.v14.Android_Content_ContentResolver_class.handleQuery(Android_Content_ContentResolver_class.java:63)rn11-28 16:03:55.586: E/StrictMode(766): at android.content.ContentResolver.query(Native Method)rn11-28 16:03:55.586: E/StrictMode(766): at basefx.android.content.AsyncQueryHandler\$WorkerHandler.handleMessage(AsyncQueryHandler.java:81)rn11-28 16:03:55.586: E/StrictMode(766): at android.os.Handler.dispatchMessage(Handler.java:99)rn11-28 16:03:55.586: E/StrictMode(766): at android.os.Looper.loop(Looper.java:158)rn11-28 16:03:55.586: E/StrictMode(766): at android.os.HandlerThread.run(HandlerThread.java:60)
rabbitmq 手工确认的问题？求大神告知。
1:按照网上的demo，做了一个rabbitmq的例子，确认模式为手工确认（AcknowledgeMode.MANUAL），但是我的消息发送者，无论消费者是否调用channel.basicAck方法，都会执行到回调函数里。rn代码：rn配置文件：rn@Configuration rnpublic class RabbitConfig rn public static final String EXCHANGE = "exchange"; rn public static final String ROUTINGKEY = "will.message"; rn @Autowiredrn Receiver receiver; rn @Bean rn public ConnectionFactory connectionFactory() rn CachingConnectionFactory connectionFactory = new CachingConnectionFactory(); rn connectionFactory.setAddresses("10.120.1.148"); rn connectionFactory.setUsername("zhouyou"); rn connectionFactory.setPassword("zhouyou@163"); rn connectionFactory.setVirtualHost("/"); rn [color=#FF0000]connectionFactory.setPublisherConfirms(true); //必须要设置[/color] rn return connectionFactory; rn rn @Bean rn @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) rn //必须是prototype类型 rn public RabbitTemplate rabbitTemplate() rn RabbitTemplate template = new RabbitTemplate(connectionFactory()); rn return template; rn rn @Bean rn public DirectExchange defaultExchange() rn return new DirectExchange(EXCHANGE); rn rn @Bean rn public Queue queue() rn return new Queue("will.message", true,false,false,null); //队列持久 rn rn @Bean rn public Binding binding() rn return BindingBuilder.bind(queue()).to(defaultExchange()).with(RabbitConfig.ROUTINGKEY); rn rn @Bean rn public SimpleMessageListenerContainer messageContainer() rn SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory()); rn container.setQueues(queue()); rn container.setExposeListenerChannel(true); rn container.setMaxConcurrentConsumers(10); rn container.setConcurrentConsumers(1); rn [color=#FF0000]container.setAcknowledgeMode(AcknowledgeMode.MANUAL); //设置确认模式手工确认 rn container.setMessageListener(receiver);[/color]rn return container; rn rn rn消费者receiver:rn@Servicernpublic class Receiver implements ChannelAwareMessageListenerrn @Overridern public void onMessage(Message message, Channel channel) throws Exception rn byte[] body = message.getBody(); rn System.out.println("receive msg : " + new String(body));rn// channel.basicAck(message.getMessageProperties().getDeliveryTag(),false ); rn rnrn消息发送方sender：@Service rnpublic class Sender implements RabbitTemplate.ConfirmCallback rn private RabbitTemplate rabbitTemplate; rn /** rn * 构造方法注入 rn */ rn @Autowired rn public Sender(RabbitTemplate rabbitTemplate) rn this.rabbitTemplate = rabbitTemplate; rn rabbitTemplate.setConfirmCallback(this); //rabbitTemplate如果为单例的话，那回调就是最后设置的内容 rn rn public void sendMsg(String content) rn CorrelationData correlationId = new CorrelationData(UUID.randomUUID().toString()); rn rabbitTemplate.convertAndSend(RabbitConfig.EXCHANGE, RabbitConfig.ROUTINGKEY, content, correlationId); rn rn /** rn * 回调 rn */ rn @Override rn public void confirm(CorrelationData correlationData, boolean ack, String cause) rn System.out.println(" 回调id:" + correlationData); rn if (!ack) rn System.out.println("消息成功消费"); rn else rn System.out.println("消息消费失败:" + cause); rn rn rn rn测试方法rn @Autowiredrn private Sender sender;rn @RequestMapping("/getUserInfo")rn @ResponseBodyrn public void getUserInfo() rn sender.sendMsg("will.message");rn rn网页访问地址：rnlocalhost:8080/getUserInfo。rn现在问题就是：Receiver里面无论是否调用channel.basicAck(message.getMessageProperties().getDeliveryTag(),false ); 该方法，最后程序都会跑到Sender的confirm方法里面(即 public void confirm(CorrelationData correlationData, boolean ack, String cause) 方法，而且参数ack一直为true)。rn求大神告知，是我理解的回调设置错误，还是怎么回事？谢谢！！！！！！

[b]sersync是不是不能监听文件夹下的隐藏文件，比如 .aaa这类型的。[/b]rn[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/19.gif][/img]

asp页面跳转方面的问题，求大神们告知，急急急急急急急急急

app无法横屏，求大神指点，急！

redis问题，求告知

socket通信问题 急~求大神~

[img=http://img04.taobaocdn.com/imgextra/i4/668776149/T28OdPXX0aXXXXXXXX_!!668776149.jpg][/img] rn[color=#FF0000][size=24px]我用的是visual studio 2010 里面的vb。然后我写了个程序，有个数据库的，放在D盘。然后我生成了程序。我在自己电脑是运行成功的。但是在别人电脑运行就不成功。数据库也拷过去了。求解。。。。。[/[/size]color]

<%rn dim idrn id=request.querystring("id")rn 'session("id")=idrn call ConnectionDatabasern '创建对象rn Set mypage=new xdownpagern '得到数据库连接rn mypage.GetConn=connrn 'sql语句rn mypage.getsql="select * from yx_pic where cid=8 and[color=#FF0000] id='"&id&"'[/color] order by orderid asc,id desc"rn '设置每一页的记录条数据为5条rn mypage.pagesize=20rn '返回Recordsetrn set rs=mypage.getrs()rn '显示分页信息，这个方法可以，在set rs=mypage.getrs()以后,可在任意位置调用，可以调用多次rn mypage.showpage()rn '显示数据rn for i=1 to mypage.pagesizern '这里就可以自定义显示方式了rn if not rs.eof then rn %>rn rn rn " target="_blank" class="group1">" width="121" height="124" alt="" class="img1" />rn rn rn " target="_blank"><%=rs("titles")%>rn rn rn <%rn if i mod 4 = 0 thenrn Response.Write("")rn end ifrn rs.movenextrn elsern exit forrn end ifrn nextrn 'rs.closern 'conn.close()rn %>rn rn rn rn rn rn rn rnrnrn标记红色那里，如果我直接改成ID=57，就可以显示信息，但是我点击ID是57的这个地址，用[color=#FF0000] id='"&id&"'[/color]传递过来，却没有任何显示

Oracle批量修改问题 求大神 急求

#includern#includernusing namespace std;rnclass point_1drnrn int x;rn string name;rnpublic:rn point_1d():x(0)cout<<"1d点缺省构造"<
[急！急！求大神指点]X64应用程序 无法使用OCX控件