首页 文章 精选 留言 我的

精选列表

搜索[图片资源],共10000篇文章
优秀的个人博客,低调大师

javascript dom的图片最终版源代码 (重复看)

html代码: <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Image Gallery</title> <script type="text/javascript" src="scripts/showPic.js"></script> <link rel="stylesheet" href="styles/layout.css" type="text/css" media="screen" /> </head> <body> <h1>Snapshots</h1> <ul id="imagegallery"> <li> <a href="images/fireworks.jpg" title="A fireworks display"> <img src="images/thumbnail_fireworks.jpg" alt="Fireworks" /> </a> </li> <li> <a href="images/coffee.jpg" title="A cup of black coffee" > <img src="images/thumbnail_coffee.jpg" alt="Coffee" /> </a> </li> <li> <a href="images/rose.jpg" title="A red, red rose"> <img src="images/thumbnail_rose.jpg" alt="Rose" /> </a> </li> <li> <a href="images/bigben.jpg" title="The famous clock"> <img src="images/thumbnail_bigben.jpg" alt="Big Ben" /> </a> </li> </ul> </body> </html> css: body { font-family: "Helvetica","Arial",serif; color: #333; background-color: #ccc; margin: 1em 10%; } h1 { color: #333; background-color: transparent; } a { color: #c60; background-color: transparent; font-weight: bold; text-decoration: none; } ul { padding: 0; } li { float: left; padding: 1em; list-style: none; } #imagegallery { list-style: none; } #imagegallery li { display: inline; } #imagegallery li a img { border: 0; } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } function insertAfter(newElement,targetElement) { var parent = targetElement.parentNode; if (parent.lastChild == targetElement) { parent.appendChild(newElement); } else { parent.insertBefore(newElement,targetElement.nextSibling); } } function preparePlaceholder() { if (!document.createElement) return false; if (!document.createTextNode) return false; if (!document.getElementById) return false; if (!document.getElementById("imagegallery")) return false; var placeholder = document.createElement("img"); placeholder.setAttribute("id","placeholder"); placeholder.setAttribute("src","images/placeholder.gif"); placeholder.setAttribute("alt","my image gallery"); var description = document.createElement("p"); description.setAttribute("id","description"); var desctext = document.createTextNode("Choose an image"); description.appendChild(desctext); var gallery = document.getElementById("imagegallery"); insertAfter(placeholder,gallery); insertAfter(description,placeholder); } function prepareGallery() { if (!document.getElementsByTagName) return false; if (!document.getElementById) return false; if (!document.getElementById("imagegallery")) return false; var gallery = document.getElementById("imagegallery"); var links = gallery.getElementsByTagName("a"); for ( var i=0; i < links.length; i++) { links[i].onclick = function() { return showPic(this); } links[i].onkeypress = links[i].onclick; } } function showPic(whichpic) { if (!document.getElementById("placeholder")) return true; var source = whichpic.getAttribute("href"); var placeholder = document.getElementById("placeholder"); placeholder.setAttribute("src",source); if (!document.getElementById("description")) return false; if (whichpic.getAttribute("title")) { var text = whichpic.getAttribute("title"); } else { var text = ""; } var description = document.getElementById("description"); if (description.firstChild.nodeType == 3) { description.firstChild.nodeValue = text; } return false; } addLoadEvent(preparePlaceholder); addLoadEvent(prepareGallery);

优秀的个人博客,低调大师

手机开发-京东360buy手机版的图片加载

JingDong:When it render the “search result” page ,(every item has the picture) ,it will buffer all the pictures in the SD card to accelerate the display. Tested from Kevin’s emulator, we can see ,that all the images that requested are downloaded intomnt/sdcard/imagefolder. We open it with image tool ,and see that the images are exactly the same that we see from the android client. So next time ,if we want to see the previous item ,we do not need to launch the REST call again ( because it is very slow for 1G /2G network) ,instead ,it only retrieved from the SDCard locally ,which leads to a faster speed. Result analysis: Advantage: obviously reduce the times to send REST request to server and reduce the network traffic. Disadvantage: we need to clear the temp contents (buffered images ,etc) regularly. 本文转自 charles_wang888 51CTO博客,原文链接:http://blog.51cto.com/supercharles888/835920,如需转载请自行联系原作者

优秀的个人博客,低调大师

用graphite把收集到的数据渲染成图片

在这里我先讲解下他和cacti nagios的区别~ 还有我们为什么要用他~ cacti 是通过snmp来进行抓数据,当然后期可以通过snmp进行exec调取脚本中的数据 nagios是用来监控服务器的各种的状态,当然通过pnp也可以实现画图 但是我为什么要用graphite,其实他就一个功能,把收到的数据展现到页面上~ 就这一个功能,我感觉就够用了~ 需求: 脚本的执行的效率 系统某个日志的分析得到的数值 在线人数 到各个网络节点的质量,延迟 公司的开发人员想看看api的调用次数 某个程序的调用的次数 每个进程延迟的时间统计 这些都可以很好的画图,比自己用rrdtool画图要方便的多~ http://graphite.readthedocs.org/en/latest/index.html 一、 Graphite 项目简介 Graphite是一个企业级的监控工具,可以在廉价机硬件上运行。 二、 Graphite 功能 Graphite是一个画图工具,将数据以图形的方式展现出来。它主要做两件事: 存储时间序列数据 根据需要呈现数据的图形 Graphite不收集数据,有一些工具知道如何发送数据给Graphite。虽然需要一点代码,但是非常简单。 三、 简单架构 Graphite由三个软件组件组成: carbon- 一个Twisted守护进程,监听时间序列数据 whisper- 一个简单的数据库库,用来存储时间序列数据,在设计上类似于RRD graphite webapp-Djangowebapp,使用Cairo来根据需要呈现图形 架构图如下: Graphite High Level 在这个图中我们可以看到Carbon先将数据写入到Whisper数据库文件中,然后Graphite Webapp去读取这个数据,然后显示出图形。但是实际上这个体系采用了缓存,数据可能先到缓存中,然后Webapp读取,显示出图形。这也是为什么在主机I/O反应不过来时Webapp的图形仍能以接近实时的方式显示。 喂数据相当简单,通常大部分的精力花在最开始收集数据时。当你发送数据点给Carbon, 他们马上可以在webapp中画图。webapp 提供几种方式创建和显示图形,包括简单的URL API,这种呈现的方式可以很方便地将图形嵌入到其它Web页面。 四、 使用效果 下图是在浏览器中的效果: shell的例子 ORT=2003 SERVER=graphite.your.org echo "local.random.diceroll 4 `date +%s`" | nc ${SERVER} ${PORT}; python的例子 #!/usr/bin/python import sys import time import os import platform import subprocess from socket import socket CARBON_SERVER='127.0.0.1' CARBON_PORT=2003 delay=60 if len(sys.argv)>1: delay=int( sys.argv[1] ) def get_loadavg(): # For more details, "man proc" and "man uptime" if platform.system() == "Linux": return open('/proc/loadavg').read().strip().split()[:3] else: command="uptime" process=subprocess.Popen(command,stdout=subprocess.PIPE,shell=True) os.waitpid(process.pid, 0) output=process.stdout.read().replace(',', ' ').strip().split() lenlength= len(output) return output[length - 3:length] sock=socket() try: sock.connect( (CARBON_SERVER,CARBON_PORT) ) except: print "Couldn't connect to %(server)s on port %(port)d, is carbon-agent.py running?" % { 'server':CARBON_SERVER, 'port':CARBON_PORT } sys.exit(1) while True: now=int( time.time() ) lines= [] #We're gonna report all three loadavg values loadavg=get_loadavg() lines.append("system.loadavg_1min %s %d" % (loadavg[0],now)) lines.append("system.loadavg_5min %s %d" % (loadavg[1],now)) lines.append("system.loadavg_15min %s %d" % (loadavg[2],now)) message='\n'.join(lines) + '\n' #all lines must end in a newline print "sending message\n" print '-' * 80 print message print sock.sendall(message) time.sleep(delay) 本文转自 rfyiamcool 51CTO博客,原文链接:http://blog.51cto.com/rfyiamcool/1184015 ,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册