CSDN_java华山论剑_日不落神贴

魔鬼_ 2014-03-08 12:01:10
一楼压低,代码节节高。。
...全文
313 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
机器学习之禅 2014-04-09
  • 打赏
  • 举报
回复
public class WatchThread extends Thread { private static final Log LOG = LogFactory.getLog("crawler"); private int crawlerThreadCount;//抓取线程的数目 private int scriptFilterThreadCount;//调度线程的数目 //所有抓取线程的执行状态,<线程名称,是否正在运行>,true表示正常运行,false表示已终止 private static HashMap<String, Boolean> crawlerThreadsStatus; //所有调度线程的执行状态 private static HashMap<String, Boolean> scriptFilterThreadsStatus; public WatchThread(String threadName) {//构造函数 super(threadName); LOG.info("Start Watch Thread"); init(); } /** * 初始化抓取线程和脚本调度线程的数目、状态,并启动所有抓取线程和调度线程 */ public void init() { //从配置文件读取抓取线程的数目 crawlerThreadCount = Integer.parseInt(LoadConfig .lookUpValueByKey("crawlerThreadCount")); LOG.info("crawler thread count:" + crawlerThreadCount); //调度线程的数目暂定为1 scriptFilterThreadCount = 1; LOG.info("script filter thread count:" + scriptFilterThreadCount); crawlerThreadsStatus = new HashMap<String, Boolean>(); scriptFilterThreadsStatus = new HashMap<String, Boolean>(); //启动所有的抓取线程,数目为crawlerThreadCount startAllCrawlerThreads(); //启动脚本调度线程 startAllScriptFilterThreads(); } /** * 启动所有的抓取线程,数目为crawlerThreadCount * 各抓取线程执行具体的抓取行为 */ public void startAllCrawlerThreads() { for (int i = 0; i < crawlerThreadCount; i++) { CrawlerThread crawlerThread = new CrawlerThread("CrawlerThread-" + i); crawlerThread.start(); crawlerThreadsStatus.put("CrawlerThread-" + i, true); } }
S117 2014-04-09
  • 打赏
  • 举报
回复
引用 8 楼 wzq6578702 的回复:
IE8浏览器下面上传图片,怎样得到图片的宽高 <input type="file" name="upload"onchange="checkPicSize(this);"/> function checkPicSize(obj){ var img = new Image(); img.src = obj.value; alert(img.width); alert(img.height); } 通过这种方式是不可以的,得到的都是0 。该怎么解决,
试试offsetWidth和offsetHeight
魔鬼_ 2014-04-08
  • 打赏
  • 举报
回复
function choice(obj){ alert(obj); var box = document.getElementById(obj); box.checked=true; //$("#"+obj).attr('checked',true); } <table> <s:iterator value="privileges" var="privilege" status="seq"> <%-- <div id="<s:property value="id"/>" style="border: 1px;background-color: #e8f3f8" onclick="clickdiv(<s:property value="id"/>);" > <div style="border: 3px;background-color:#8ac1db" > id:<s:property value="id"/><br/> name:<s:property value="name"/> </div> <hr style="color: red;border: 1px" /> <div id="url<s:property value="#seq.index"/>" style="display: none;background-color: pink" > <s:iterator value="urls" status="seq"> <s:property value="urls[#seq.index]"/><br/> </s:iterator> </div> </div> --%> <tr> <td><select onchange="choice(<s:property value="id"/>);"> <option>oo</option> <option>pp</option> <option>kk</option> <option>hh</option> </select> </td> <td><input type="checkbox" id="<s:property value="id"/>" /></td> </tr> </s:iterator> </table>
魔鬼_ 2014-03-11
  • 打赏
  • 举报
回复
引用 9 楼 dongzeviva 的回复:
什么意思啊?
就是想得到上传文件的长度和宽度 在IE8下面 使用JS
  • 打赏
  • 举报
回复
什么意思啊?
魔鬼_ 2014-03-11
  • 打赏
  • 举报
回复
IE8浏览器下面上传图片,怎样得到图片的宽高 <input type="file" name="upload"onchange="checkPicSize(this);"/> function checkPicSize(obj){ var img = new Image(); img.src = obj.value; alert(img.width); alert(img.height); } 通过这种方式是不可以的,得到的都是0 。该怎么解决,
tony4geek 2014-03-10
  • 打赏
  • 举报
回复
sca4441479 2014-03-10
  • 打赏
  • 举报
回复
这是干嘛的,接分接分!
sliwey 2014-03-10
  • 打赏
  • 举报
回复
能接分吗?
巫巫巫 2014-03-09
  • 打赏
  • 举报
回复
代号裤子 2014-03-08
  • 打赏
  • 举报
回复
接分
姜小白- 2014-03-08
  • 打赏
  • 举报
回复

23,404

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧