- 常用类库 Guava 简介
豆瑞瑞
java
简介GoogleGuava是一个由Google开发的Java开源函数库。前身是GoogleCollectionsLibrary,提供了许多简化工具,如缓存、连接器、过滤器、关联数组等仓库代码GitCode-全球开发者的开源社区,开源代码托管平台参考https://github.com/google/guavahttps://github.com/google/guava/wikiRedisStre
- guava中对Map的扩展数据结构
qq_36608622
guavaspringboot
Multimap-多值Mapguava中的Multimap提供了将一个键映射到多个值的形式,使用起来无需定义复杂的内层集合,可以像使用普通的Map一样使用它,定义及放入数据如下:Multimapmultimap=ArrayListMultimap.create();multimap.put("day",1);multimap.put("day",2);multimap.put("day",8);m
- 【JAVA】基于Guava实现本地缓存
还算善良_
javaguava缓存
使用Guava实现本地缓存1、首先,导入pom依赖com.google.guavaguava30.1-jre2、创建一个本地缓存的接口LocalCacheService,用于定义缓存方法publicinterfaceLocalCacheService{/***存储数据**@paramkey*@paramvalue*/voidput(Kkey,Vvalue);/***如果存在就获取**@paramk
- Caffeine 与 Guava Cache
雨季里的向日葵
java
一、概要1.1背景在项目开发中,为提升系统性能,减少IO开销,本地缓存是必不可少的。最常见的本地缓存是Guava和Caffeine,Caffeine是基于GoogleGuavaCache设计经验改进的结果,相较于Guava在性能和命中率上更具有效率。1.2应用场景愿意消耗一些内存空间来提升速度预料到某些键会被多次查询缓存中存放的数据总量不会超出内存容量二、GuavaCache2.1GuavaCac
- Guava Cache的使用
coderlong
javaCache
缓存在Guav中的应用GuavaCache与ConcurrentMap很相似,但也不完全一样。最基本的区别是ConcurrentMap会一直保存所有添加的元素,直到显式地移除。相对地,GuavaCache为了限制内存占用,通常都设定为自动回收元素。在某些场景下,尽管LoadingCache不回收元素,它也是很有用的,因为它会自动加载缓存。通常来说,GuavaCache适用于:你愿意消耗一些内存空间
- java guava local cache +Map深浅拷贝
ZHEXI_Coding free
java/jsjava
笔者使用guava的localcache遇到一个坑,查了很长时间,最终顺利解决。1.问题阐述1.定义缓存privateLoadingCache>liveCenterLRFeatureCache;2.获取缓存处:Mapfeature=this.liveCenterLRFeatureCache.getUnchecked(anchorFeatureKey))3.操作从缓存中获取的数据3.1使用处对map
- JAVA Guava排序器Ordering原理代码
邓家少爷
一创建排序器排序器:可以用来为构建复杂的比较器,以完成集合排序的功能:本质上来说,Ordering实例无非就是一个特殊的Comparator实例。Ordering把很多基于Comparator的静态方法(如Collections.max)包装为自己的实例方法(非静态方法),并且提供了链式调用方法,来定制和增强现有的比较器//创建排序器@TestpublicvoidcreateOreing(){//
- easyPOI生成的excel添加水印
梦幻D开始
工作记录技术杂记excel水印
项目场景:需求要求生成的excel添加水印,这个还是第一次听到,于是研究了一下。引入依赖代码如下:implementation('cn.afterturn:easypoi-base:4.5.0'){excludegroup:'com.google.guava',module:'guava'excludegroup:'org.apache.commons',module:'commons-compr
- EventBus(事件总线)的使用和源码的简单解析
Tai_Monster
Android开发笔记java开发语言android
GoogleGuavaEventBus(事件总线)的使用和源码的简单解析什么是EventBus?事件总线(EventBus)是一种广泛用于软件架构中的设计模式,用于实现解耦和松散耦合的通信机制。它可以帮助组织和管理应用程序中不同组件之间的通信,以提高应用程序的可维护性、可扩展性和灵活性。在事件总线模式中,不同的组件通过订阅和发布事件来进行通信。发布者发布一个事件,订阅者可以订阅该事件并在事件发生时
- java sublist 分页_如何简便的将List分页成多个subList
雷浩翰
javasublist分页
概述本文讲述下如何将一个List拆分成多个subList,这个常用的操作主要会用于一个列表的内存分页处理,虽然在Java的基本API里有subList,但并没有提供便捷方法实现分页,需要自己去计算页码边界。但有两个类库提供了简单易用的API方法实现,Guava和ApacheCommonsCollections使用Guava分页com.google.guavaguava23.6-jre@Testpu
- guva java list取交集_java guava 集合的操作:交集、差集、并集
鲸阮
guvajavalist取交集
Guava:google的工程师利用传说中的“20%时间”开发的集合库,它是对jdk提供的扩展,提供了很多实用的类来简化代码。开源地址:https://github.com/google/guavajar包下载:http://maven.outofmemory.cn/com.google.guava/guava/packagecom.uwo9.test08;importjava.util.Set;
- Redis+Lua脚本实现分布式服务的限流
henry_2016
Redis分布式redislua
背景限流的目的是通过对并发访问/请求进行限速或者一个时间窗口内的的请求进行限速来保护系统,一旦达到限制速率则可以拒绝服务。开始打算使用GuavaRateLimiter来实现限流,但RateLimiter是局限于单机中使用,然后打算使用Redis+Lua脚本实现限流。1提供调用的接口@Slf4j@RestController@RequestMapping("/rateLimter")publiccl
- JVM级缓存本地缓存Caffeine
旺仔爱Java
JVM专题jvmJVM缓存本地缓存CaffeineGuavaCache
JVM级缓存本地缓存Caffeine和GuavaCache前言一、创建缓存的代码逻辑二、Caffeine的优化方面淘汰算法W-TinyLFU三、Caffeine的业务使用总结前言最新的Java面试题,技术栈涉及Java基础、集合、多线程、Mysql、分布式、Spring全家桶、MyBatis、Dubbo、缓存、消息队列、Linux…等等,会持续更新。一、创建缓存的代码逻辑Caffeine:publ
- Guava 工具类之Cache的使用 本地缓存组件
ʚ小华
guava缓存
一.guavacache介绍1.介绍guavacache是Googleguava中提供的一款轻量级的本地缓存组件,其特点是简单、轻便、完善、扩展性强,内存管理机制也相对完善。2.使用缓存的优点1.减少了网络调用的开销2.减少了数据请求的序列化和反序列化二.guavacache分类guavacache提供了2种类型:Cache:创建1个缓存.LoadingCache:它能够通过CacheLoader
- 面试redis篇-04缓存雪崩
卡搜偶
缓存面试redis
原理缓存雪崩:是指在同一时段大量的缓存key同时失效或者Redis服务宕机,导致大量请求到达数据库,带来巨大压力。解决方案:给不同的Key的TTL添加随机值利用Redis集群提高服务的可用性(哨兵模式、集群模式)给缓存业务添加降级限流策略(ngxin或springcloudgateway)给业务添加多级缓存(Guava或Caffeine)问答面试官:什么是缓存雪崩?怎么解决?回答:缓存雪崩意思是设
- 本地缓存工具类
Fairy要carry
工具缓存
com.google.guavaguava30.1-jrepackagecom.wyh.subject.domain.util;importcom.alibaba.fastjson.JSON;importcom.baomidou.mybatisplus.core.toolkit.CollectionUtils;importcom.google.common.cache.Cache;importco
- 本地缓存工具类
Fairy要carry
工具缓存
com.google.guavaguava30.1-jrepackagecom.wyh.subject.domain.util;importcom.alibaba.fastjson.JSON;importcom.baomidou.mybatisplus.core.toolkit.CollectionUtils;importcom.google.common.cache.Cache;importco
- 浅谈本地缓存的应用
梦之救赎
缓存java后端jvm
前言缓存的本质是内存的读写速度优于磁盘,加速数据处理、加快请求响应,在并发场景下,减轻DB读的压力。本地缓存的使用,是缓存架构的基石。无论系统简单还是复杂,都离不开本地缓存的使用。本地缓存的选择本地缓存可选择:JVM堆/Ehcache/GuavaCache(1)Ehcache:支持堆外缓存,持久化。以前集中式架构,尤其是企业IT系统,用物理机或虚拟机部署,需要缓存的数据量很大,为了合理利用机器资源
- Java 8之自定义Stream收集器
nobita0522
声明:本篇文章除部分引用外,均为原创内容,如有雷同纯属巧合,引用转载请附上原文链接与声明本文链接:注:阅读本篇文章需掌握java集合基础知识、Stream基本语法与使用、函数式接口、lambda表达式、泛型知识、lombok插件使用、guava基础集合工具使用、java8双冒号的使用;请先掌握上述知识再行阅读本篇文章。若有错误,欢迎友好纠正,谢谢。参考引用Java8系列之重构和定制收集器Java8
- 设计模式-观察者模式 Observer
中二Espresso
设计模式设计模式观察者模式java
观察者模式一、概述二、使用场景三、发布订阅1)观察者模式2)发布-订阅模式四、源码使用1)jdk中的观察者2)Guava中的消息总线五、进阶1)异步非阻塞模型一、概述观察者模式是一种行为设计模式,允许对象间存在一对多的依赖关系,当一个对象的状态发生改变时,所有依赖它的对象都会得到通知并自动更新。在这种模式中,发生状态改变的对象被称为“主题”(Subject),依赖它的对象被称为“观察者”(Obse
- Guava Cache之开启统计信息收集
大风过岗
GauvaCache开启统计信息收集1.开启统计在创建Cache时,我们可以配置Cache让其开启统计信息收集,这样我们就可以对Cache的内存使用情况进行监控,并根据统计信息对cache进行调优,如果您的应用比较重视性能的话,可以开启这个特性。在创建Cache时,只需要调用recordStats()即可开启统计特性:开启统计2.开启一个后台线程完成统计信息的收集工作为了能够获取到缓存cache的
- 探秘Guava的RateLimiter:单机流量控制的黄金法宝
一只牛博
javaguava数据库
欢迎来到我的博客,代码的世界里,每一行都是一个故事探秘Guava的RateLimiter:单机流量控制的黄金法宝前言RateLimiter简介:速度的守护者工作原理:时间、令牌与控制参数调优:玩转RateLimiter的技巧前言在程序的世界里,想象一下你的服务器像一位疲倦的服务员,面对繁忙的顾客。如果没有合理的流量控制,他可能被淹没在请求的海洋中。但别担心,Guava的RateLimiter就像是
- Guava RateLimiter单机实战指南
一只牛博
javaguava
欢迎来到我的博客,代码的世界里,每一行都是一个故事GuavaRateLimiter单机实战指南前言maven坐标引入业务实现重要参数和方法关于`warmupPeriod`实战前言想象一下你是一位大厨,正在烹饪美味佳肴。突然之间,前来就餐的人潮如潮水般涌入,如果没有明智的限流策略,你可能会被厨房的热潮吞噬。现在,想象Guava的RateLimiter就像是一把魔法调味剂,帮助你在这个数字厨房中优雅地
- jvm一级缓存
Leo.荒
jvm缓存
1、利用JVM缓存。脱离redis。2、导包,springboot自带此包。如没有可以导:com.google.guava:guava:20.0的包。3、直接上代码:packagecom.leo.cache;importcom.alibaba.fastjson.JSONObject;importcom.google.common.cache.Cache;importcom.google.commo
- 基于Google guava工具实现一致性Hash算法的应用实践
小满别摸鱼
javajavaweb杂记guava哈希算法一致性HashHash虚拟环
一、前言在分布式架构系统中,要将数据存储到具体的节点上,如果采用普通的key%N取模Hash算法,将数据映射到具体的节点上,就有可能大部分数据集中在某一个节点,形成“热点”数据,造成数据分布失衡,二是如果有一个机器加入或退出这个集群,则大部分的数据映射都无效了,数据需要重新进行排列。基于上面普通Hash算法的问题,1997年由麻省理工学院提出一致性Hash算法,引入了“虚拟节点”的概念:即想象在这
- Caffeine与Spring cache的各种注解操作
500了
springjava后端
前言Caffeine是一个基于Java8的进程内缓存框架,它使用乐观锁技术来提高并发吞吐量,并被誉为最快的缓存之一。Caffeine是内存型缓存,即缓存与调用者属于同一个应用,具体地说是属于同一个JVM。它的设计目标是提供高性能、高命中率以及低内存占用的本地缓存解决方案,被描述为GuavaCache的加强版和“新一代缓存”。关于Caffeine的使用,其提供了多种灵活的配置选项:自动加载数据:可以
- 【日常总结 - java】list 与 字符串(用逗号隔开)相互转换
ladymorgana
日常工作总结windowspython开发语言
一、list转字符串第一种:使用谷歌Joiner方法(推荐)第二种:循环插入逗号第三种:stream流(推荐)第四种:lambda表达式遍历并加入逗号二、字符串转list方法一:使用split()方法方法二:使用Collections.addAll()方法方法三:使用Java8的StreamAPI(推荐)方法四:使用Guava库(不推荐,需要引入Guava库)一、list转字符串第一种:使用谷歌J
- 异步八种方式提高性能
A尘埃
java异步性能
异步的八种实现方式线程ThreadFuture异步框架CompletableFutureSpring注解@AsyncSpringApplicationEvent事件消息队列第三方异步框架,比如Hutool的ThreadUtilGuava异步一、线程异步publicclassAsyncThreadextendsThread{@Overridepublicvoidrun(){System.out.pr
- Guava的这些骚操作让我的代码量减少了50行
漫走云雾
java前端后端guava
目录Guava是google公司开发的一款Java类库扩展工具包,内含了丰富的API,涵盖了集合、缓存、并发、I/O等多个方面。使用这些API一方面可以简化我们代码,使代码更为优雅,另一方面它补充了很多jdk中没有的功能,能让我们开发中更为高效。今天要给大家分享的就是Guava中封装的一些关于Map的骚操作,在使用了这些功能后,不得不说一句真香。先引入依赖坐标,然后开始我们的正式体验吧~ c
- 缓存Caffeine之W-TinyLFU淘汰策略
georgesnoopy
guava缓存java淘汰策略Caffeine
我们常见的缓存是基于内存的缓存,但是单机的内存是有限的,不能让缓存数据撑爆内存,所有需要缓存淘汰机制。https://mp.csdn.net/editor/html/115872837中大概说明了LRU的缓存淘汰机制,以及基于LRU的著名实现guavacache。除了LRU淘汰策略外,其是常见的还有FIFO以及LFU,只是说目前用的最多的是LRU。LRULRU记录了缓存中数据项的访问时间,在缓存数
- 统一思想认识
永夜-极光
思想
1.统一思想认识的基础,才能有的放矢
原因:
总有一种描述事物的方式最贴近本质,最容易让人理解.
如何让教育更轻松,在于找到最适合学生的方式.
难点在于,如何模拟对方的思维基础选择合适的方式. &
- Joda Time使用笔记
bylijinnan
javajoda time
Joda Time的介绍可以参考这篇文章:
http://www.ibm.com/developerworks/cn/java/j-jodatime.html
工作中也常常用到Joda Time,为了避免每次使用都查API,记录一下常用的用法:
/**
* DateTime变化(增减)
*/
@Tes
- FileUtils API
eksliang
FileUtilsFileUtils API
转载请出自出处:http://eksliang.iteye.com/blog/2217374 一、概述
这是一个Java操作文件的常用库,是Apache对java的IO包的封装,这里面有两个非常核心的类FilenameUtils跟FileUtils,其中FilenameUtils是对文件名操作的封装;FileUtils是文件封装,开发中对文件的操作,几乎都可以在这个框架里面找到。 非常的好用。
- 各种新兴技术
不懂事的小屁孩
技术
1:gradle Gradle 是以 Groovy 语言为基础,面向Java应用为主。基于DSL(领域特定语言)语法的自动化构建工具。
现在构建系统常用到maven工具,现在有更容易上手的gradle,
搭建java环境:
http://www.ibm.com/developerworks/cn/opensource/os-cn-gradle/
搭建android环境:
http://m
- tomcat6的https双向认证
酷的飞上天空
tomcat6
1.生成服务器端证书
keytool -genkey -keyalg RSA -dname "cn=localhost,ou=sango,o=none,l=china,st=beijing,c=cn" -alias server -keypass password -keystore server.jks -storepass password -validity 36
- 托管虚拟桌面市场势不可挡
蓝儿唯美
用户还需要冗余的数据中心,dinCloud的高级副总裁兼首席营销官Ali Din指出。该公司转售一个MSP可以让用户登录并管理和提供服务的用于DaaS的云自动化控制台,提供服务或者MSP也可以自己来控制。
在某些情况下,MSP会在dinCloud的云服务上进行服务分层,如监控和补丁管理。
MSP的利润空间将根据其参与的程度而有所不同,Din说。
“我们有一些合作伙伴负责将我们推荐给客户作为个
- spring学习——xml文件的配置
a-john
spring
在Spring的学习中,对于其xml文件的配置是必不可少的。在Spring的多种装配Bean的方式中,采用XML配置也是最常见的。以下是一个简单的XML配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.or
- HDU 4342 History repeat itself 模拟
aijuans
模拟
来源:http://acm.hdu.edu.cn/showproblem.php?pid=4342
题意:首先让求第几个非平方数,然后求从1到该数之间的每个sqrt(i)的下取整的和。
思路:一个简单的模拟题目,但是由于数据范围大,需要用__int64。我们可以首先把平方数筛选出来,假如让求第n个非平方数的话,看n前面有多少个平方数,假设有x个,则第n个非平方数就是n+x。注意两种特殊情况,即
- java中最常用jar包的用途
asia007
java
java中最常用jar包的用途
jar包用途axis.jarSOAP引擎包commons-discovery-0.2.jar用来发现、查找和实现可插入式接口,提供一些一般类实例化、单件的生命周期管理的常用方法.jaxrpc.jarAxis运行所需要的组件包saaj.jar创建到端点的点到点连接的方法、创建并处理SOAP消息和附件的方法,以及接收和处理SOAP错误的方法. w
- ajax获取Struts框架中的json编码异常和Struts中的主控制器异常的解决办法
百合不是茶
jsjson编码返回异常
一:ajax获取自定义Struts框架中的json编码 出现以下 问题:
1,强制flush输出 json编码打印在首页
2, 不强制flush js会解析json 打印出来的是错误的jsp页面 却没有跳转到错误页面
3, ajax中的dataType的json 改为text 会
- JUnit使用的设计模式
bijian1013
java设计模式JUnit
JUnit源代码涉及使用了大量设计模式
1、模板方法模式(Template Method)
定义一个操作中的算法骨架,而将一些步骤延伸到子类中去,使得子类可以不改变一个算法的结构,即可重新定义该算法的某些特定步骤。这里需要复用的是算法的结构,也就是步骤,而步骤的实现可以在子类中完成。
 
- Linux常用命令(摘录)
sunjing
crondchkconfig
chkconfig --list 查看linux所有服务
chkconfig --add servicename 添加linux服务
netstat -apn | grep 8080 查看端口占用
env 查看所有环境变量
echo $JAVA_HOME 查看JAVA_HOME环境变量
安装编译器
yum install -y gcc
- 【Hadoop一】Hadoop伪集群环境搭建
bit1129
hadoop
结合网上多份文档,不断反复的修正hadoop启动和运行过程中出现的问题,终于把Hadoop2.5.2伪分布式安装起来,跑通了wordcount例子。Hadoop的安装复杂性的体现之一是,Hadoop的安装文档非常多,但是能一个文档走下来的少之又少,尤其是Hadoop不同版本的配置差异非常的大。Hadoop2.5.2于前两天发布,但是它的配置跟2.5.0,2.5.1没有分别。 &nb
- Anychart图表系列五之事件监听
白糖_
chart
创建图表事件监听非常简单:首先是通过addEventListener('监听类型',js监听方法)添加事件监听,然后在js监听方法中定义具体监听逻辑。
以钻取操作为例,当用户点击图表某一个point的时候弹出point的name和value,代码如下:
<script>
//创建AnyChart
var chart = new AnyChart();
//添加钻取操作&quo
- Web前端相关段子
braveCS
web前端
Web标准:结构、样式和行为分离
使用语义化标签
0)标签的语义:使用有良好语义的标签,能够很好地实现自我解释,方便搜索引擎理解网页结构,抓取重要内容。去样式后也会根据浏览器的默认样式很好的组织网页内容,具有很好的可读性,从而实现对特殊终端的兼容。
1)div和span是没有语义的:只是分别用作块级元素和行内元素的区域分隔符。当页面内标签无法满足设计需求时,才会适当添加div
- 编程之美-24点游戏
bylijinnan
编程之美
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;
public class PointGame {
/**编程之美
- 主页面子页面传值总结
chengxuyuancsdn
总结
1、showModalDialog
returnValue是javascript中html的window对象的属性,目的是返回窗口值,当用window.showModalDialog函数打开一个IE的模式窗口时,用于返回窗口的值
主界面
var sonValue=window.showModalDialog("son.jsp");
子界面
window.retu
- [网络与经济]互联网+的含义
comsci
互联网+
互联网+后面是一个人的名字 = 网络控制系统
互联网+你的名字 = 网络个人数据库
每日提示:如果人觉得不舒服,千万不要外出到处走动,就呆在床上,玩玩手游,更不能够去开车,现在交通状况不
- oracle 创建视图 with check option
daizj
视图vieworalce
我们来看下面的例子:
create or replace view testview
as
select empno,ename from emp where ename like ‘M%’
with check option;
这里我们创建了一个视图,并使用了with check option来限制了视图。 然后我们来看一下视图包含的结果:
select * from testv
- ToastPlugin插件在cordova3.3下使用
dibov
Cordova
自己开发的Todos应用,想实现“
再按一次返回键退出程序 ”的功能,采用网上的ToastPlugins插件,发现代码或文章基本都是老版本,运行问题比较多。折腾了好久才弄好。下面吧基于cordova3.3下的ToastPlugins相关代码共享。
ToastPlugin.java
package&nbs
- C语言22个系统函数
dcj3sjt126com
cfunction
C语言系统函数一、数学函数下列函数存放在math.h头文件中Double floor(double num) 求出不大于num的最大数。Double fmod(x, y) 求整数x/y的余数。Double frexp(num, exp); double num; int *exp; 将num分为数字部分(尾数)x和 以2位的指数部分n,即num=x*2n,指数n存放在exp指向的变量中,返回x。D
- 开发一个类的流程
dcj3sjt126com
开发
本人近日根据自己的开发经验总结了一个类的开发流程。这个流程适用于单独开发的构件,并不适用于对一个项目中的系统对象开发。开发出的类可以存入私人类库,供以后复用。
以下是开发流程:
1. 明确类的功能,抽象出类的大概结构
2. 初步设想类的接口
3. 类名设计(驼峰式命名)
4. 属性设置(权限设置)
判断某些变量是否有必要作为成员属
- java 并发
shuizhaosi888
java 并发
能够写出高伸缩性的并发是一门艺术
在JAVA SE5中新增了3个包
java.util.concurrent
java.util.concurrent.atomic
java.util.concurrent.locks
在java的内存模型中,类的实例字段、静态字段和构成数组的对象元素都会被多个线程所共享,局部变量与方法参数都是线程私有的,不会被共享。
- Spring Security(11)——匿名认证
234390216
Spring SecurityROLE_ANNOYMOUS匿名
匿名认证
目录
1.1 配置
1.2 AuthenticationTrustResolver
对于匿名访问的用户,Spring Security支持为其建立一个匿名的AnonymousAuthenticat
- NODEJS项目实践0.2[ express,ajax通信...]
逐行分析JS源代码
Ajaxnodejsexpress
一、前言
通过上节学习,我们已经 ubuntu系统搭建了一个可以访问的nodejs系统,并做了nginx转发。本节原要做web端服务 及 mongodb的存取,但写着写着,web端就
- 在Struts2 的Action中怎样获取表单提交上来的多个checkbox的值
lhbthanks
javahtmlstrutscheckbox
第一种方法:获取结果String类型
在 Action 中获得的是一个 String 型数据,每一个被选中的 checkbox 的 value 被拼接在一起,每个值之间以逗号隔开(,)。
所以在 Action 中定义一个跟 checkbox 的 name 同名的属性来接收这些被选中的 checkbox 的 value 即可。
以下是实现的代码:
前台 HTML 代码:
- 003.Kafka基本概念
nweiren
hadoopkafka
Kafka基本概念:Topic、Partition、Message、Producer、Broker、Consumer。 Topic: 消息源(Message)的分类。 Partition: Topic物理上的分组,一
- Linux环境下安装JDK
roadrunners
jdklinux
1、准备工作
创建JDK的安装目录:
mkdir -p /usr/java/
下载JDK,找到适合自己系统的JDK版本进行下载:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
把JDK安装包下载到/usr/java/目录,然后进行解压:
tar -zxvf jre-7
- Linux忘记root密码的解决思路
tomcat_oracle
linux
1:使用同版本的linux启动系统,chroot到忘记密码的根分区passwd改密码 2:grub启动菜单中加入init=/bin/bash进入系统,不过这时挂载的是只读分区。根据系统的分区情况进一步判断. 3: grub启动菜单中加入 single以单用户进入系统. 4:用以上方法mount到根分区把/etc/passwd中的root密码去除 例如: ro
- 跨浏览器 HTML5 postMessage 方法以及 message 事件模拟实现
xueyou
jsonpjquery框架UIhtml5
postMessage 是 HTML5 新方法,它可以实现跨域窗口之间通讯。到目前为止,只有 IE8+, Firefox 3, Opera 9, Chrome 3和 Safari 4 支持,而本篇文章主要讲述 postMessage 方法与 message 事件跨浏览器实现。postMessage 方法 JSONP 技术不一样,前者是前端擅长跨域文档数据即时通讯,后者擅长针对跨域服务端数据通讯,p