- P3489 [POI2009] WIE-Hexer
summ1ts
算法c++图论dijkstra状态压缩
*原题链接*最短路+状态压缩不愧是POI的题,看题面知道要求加了一些限制的最短路,看数据范围很容易想到状态压缩。求解最短路就用堆优化dijkstra好了。至于状态压缩,我们对原数组再开一维,表示此时“剑的集合”,相应的数组也要多开一维。由于此时的最短路有状态的限制,所以我们要用三元组来维护,如果不想写结构体也可以pair,int>。输入时存储边上的“怪物集合”,以及一个村庄的“铁匠集合”,在来到新
- 划分为k个相等的子集
SummerM.
刷题日记深度优先算法
作者主页:慢热的陕西人专栏链接:力扣刷题日记欢迎各位大佬点赞关注收藏,留言文章目录划分为k个相等的子集题目链接方法一:状态压缩+记忆化搜索思路代码复杂度分析划分为k个相等的子集题目链接698.划分为k个相等的子集-力扣(LeetCode)方法一:状态压缩+记忆化搜索思路状态压缩:s的二进制位来表示每个位置(对应到数组种的index)是否被选择,1为未选择,反之为被选择。记忆化搜索:dp数组表示每种
- 状态压缩DP---最短Hamilton路径
派大星45599
力扣算法数据结构
给定一张nn个点的带权无向图,点从0∼n−10∼n−1标号,求起点00到终点n−1n−1的最短Hamilton路径。Hamilton路径的定义是从00到n−1n−1不重不漏地经过每个点恰好一次。输入格式第一行输入整数nn。接下来nn行每行nn个整数,其中第ii行第jj个整数表示点ii到jj的距离(记为a[i,j]a[i,j])。对于任意的x,y,z数据保证a[x,x]=0,a[x,y]=a[y,x
- 【动态规划】【C++算法】1563 石子游戏 V
闻缺陷则喜何志丹
算法动态规划c++LeetCode石子游戏两个非空行最大
作者推荐【数位dp】【动态规划】【状态压缩】【推荐】1012.至少有1位重复的数字本文涉及知识点动态规划汇总LeetCoce:1563石子游戏V几块石子排成一行,每块石子都有一个关联值,关联值为整数,由数组stoneValue给出。游戏中的每一轮:Alice会将这行石子分成两个非空行(即,左侧行和右侧行);Bob负责计算每一行的值,即此行中所有石子的值的总和。Bob会丢弃值最大的行,Alice的得
- 【动态规划】【C++算法】2742. 给墙壁刷油漆
闻缺陷则喜何志丹
#算法题算法动态规划c++LeetCode状态优化刷油漆免费
作者推荐【数位dp】【动态规划】【状态压缩】【推荐】1012.至少有1位重复的数字本文涉及知识点动态规划汇总LeetCode2742.给墙壁刷油漆给你两个长度为n下标从0开始的整数数组cost和time,分别表示给n堵不同的墙刷油漆需要的开销和时间。你有两名油漆匠:一位需要付费的油漆匠,刷第i堵墙需要花费time[i]单位的时间,开销为cost[i]单位的钱。一位免费的油漆匠,刷任意一堵墙的时间为
- 【深度优先搜索】【图论】【树】2646. 最小化旅行的价格总和
闻缺陷则喜何志丹
#算法题深度优先图论算法c++LeetCode旅行最小
作者推荐【数位dp】【动态规划】【状态压缩】【推荐】1012.至少有1位重复的数字涉及知识点深度优先搜索图论树LeetCode2646.最小化旅行的价格总和现有一棵无向、无根的树,树中有n个节点,按从0到n-1编号。给你一个整数n和一个长度为n-1的二维整数数组edges,其中edges[i]=[ai,bi]表示树中节点ai和bi之间存在一条边。每个节点都关联一个价格。给你一个整数数组price,
- 2-7基础算法-位运算
卡__卡
C/C++算法竞赛算法c++开发语言c语言青少年编程
一.基础位运算经常考察异或的性质、状态压缩、与位运算有关的特殊数据结构、构造题。位运算只能应用于整数,且一般为非负整数,不能应用于字符、浮点等类型。左移操作相当于对原数进行乘以2的幂次方的操作,低位补0右移操作相当于对原数进行除以2的幂次方的操作,高位补0&与|或~按位取反^按位异或在讨论二进制数的位数时,通常采用的是从右向左的计数方法,其中最右边的位被称为第0位。1.判断x的奇偶性:若x&1的结
- 寒假思维训练day21
嘗_
算法动态规划
今天更新一道不错的状态压缩DP题,顺带总结一下状态压缩DP。摘要:Part1浅谈状态压缩DP的理解Part2浅谈对状态机DP的理解Part3关于状态压缩DP的1道例题Part1状态压缩DP1、状态压缩DP:事物的状态可能包含多个特征,但是事物的状态之间却可以互相转移,此时我们引入状态压缩DP,将事物的复杂的状态用一个数字来替代,此时事物的状态可以用数组的某个位置表示,从而可以进行状态的转移。2、常
- CF1249C1 Good Numbers (easy version) 题解
PYL2077
题解#Codeforces状态压缩二分查找
题目:Linkhardversion正解:状态压缩+二分查找看到题目中“每个333的幂最多只能使用一次”,可以很容易想到用状态压缩来解决对于每一个好的数(GoodNumber)xxx,可以将它用一个二进制数yyy表示。其中,如果对应的二进制数的第iii位为111,代表构成xxx时使用了3i3^i3i这样,我们就将散落在区间中的好数集中了起来,二分查找大于等于nnn的最小好数即可时间复杂度:O((
- 牛客周赛 Round 32 F.小红的矩阵修改【三进制状态压缩dp】
lianxuhanshu_
动态规划算法动态规划
原题链接:https://ac.nowcoder.com/acm/contest/75174/F时间限制:C/C++1秒,其他语言2秒空间限制:C/C++262144K,其他语言524288K64bitIOFormat:%lld题目描述小红拿到了一个字符矩阵,矩阵中仅包含"red"这三种字符。小红每次操作可以将任意字符修改为"red"这三种字符中的一种。她希望最终任意两个相邻的字母都不相同。小红想
- 状态压缩和状压DP
lvanzn
问题:n*n的棋盘放置n个点,保证每一行,每一列都有且只有一个点,有几种放置方式?一、组合数解法:ans=n!二、状态压缩DP:方案数目:f[0]=1,其他初始化为0状态:10010=>21+24=2+16=18->一个整数表示一种状态->拆解整数->表示了所有的部件的当前状态遍历顺序(第一层):s:1->(1(111..11(n个位))(第二层):i:1->n(枚举所有的部件)已知当前的状态是s
- 【算法学习】编程中的位运算
lcx_defender
算法学习算法
位运算位运算是直接对二进制的每一位进行逻辑操作的运算方式用途:位运算一般用于考察异或的性质、状态压缩、与位运算相关的特殊数据结构、构造题等。基本的位运算共6种,分别为按位与、按位或、按位异或、按位取反、左移和右移。按位与&两个数字与运算的结果不会变小按位或|两个数字或运算的结果不会变小异或^两个数字进行异或运算,结果可能变大,也可能变小,也可能不变。异或的性质//交换律x^y=y^x//结合律x^
- 状态压缩DP--最短Hamilton路径问题的状态压缩动态规划解法
派大星45599
数据结构与算法分析动态规划算法
在图论中,Hamilton路径是一种经过图中每个顶点恰好一次的路径。本文将详细介绍如何使用状态压缩动态规划(DynamicProgramming,DP)方法求解最短Hamilton路径问题,即找到一条经过所有顶点恰好一次且总权重最小的路径。题目链接:91.最短Hamilton路径-AcWing题库问题描述算法概述状态压缩动态规划可以在处理特定类型的组合问题时非常有用,尤其是当问题涉及到需要考虑集合
- 【组合数学】【动态规划】【前缀和】1735生成乘积数组的方案数
闻缺陷则喜何志丹
#算法题动态规划算法c++力扣组合数学前缀和数目
作者推荐【动态规划】【状态压缩】【2次选择】【广度搜索】1494.并行课程II本文涉及知识点动态规划汇总C++算法:前缀和、前缀乘积、前缀异或的原理、源码及测试用例包括课程视频组合数学LeetCode1735生成乘积数组的方案数给你一个二维整数数组queries,其中queries[i]=[ni,ki]。第i个查询queries[i]要求构造长度为ni、每个元素都是正整数的数组,且满足所有元素的乘
- 【动态规划】【图论】【C++算法】1928规定时间内到达终点的最小花费
闻缺陷则喜何志丹
#算法题算法动态规划图论c++力扣最小旅行
作者推荐【动态规划】【状态压缩】【2次选择】【广度搜索】1494.并行课程II本文涉及知识点动态规划汇总LeetCode1928.规定时间内到达终点的最小花费一个国家有n个城市,城市编号为0到n-1,题目保证所有城市都由双向道路连接在一起。道路由二维整数数组edges表示,其中edges[i]=[xi,yi,timei]表示城市xi和yi之间有一条双向道路,耗费时间为timei分钟。两个城市之间可
- 【动态规划】【子序列除重】【C++算法】1987不同的好子序列数目
闻缺陷则喜何志丹
#算法题算法动态规划c++力扣数论二进制数目
作者推荐【动态规划】【状态压缩】【2次选择】【广度搜索】1494.并行课程II本文涉及知识点动态规划汇总LeetCode1987:不同的好子序列数目给你一个二进制字符串binary。binary的一个子序列如果是非空的且没有前导0(除非数字是“0”本身),那么它就是一个好的子序列。请你找到binary不同好子序列的数目。比方说,如果binary=“001”,那么所有好子序列为[“0”,“0”,“1
- C++ 动态规划 状态压缩DP 蒙德里安的梦想
伏城无嗔
算法笔记力扣动态规划c++动态规划
求把N×M的棋盘分割成若干个1×2的长方形,有多少种方案。例如当N=2,M=4时,共有5种方案。当N=2,M=3时,共有3种方案。如下图所示:2411_1.jpg输入格式输入包含多组测试用例。每组测试用例占一行,包含两个整数N和M。当输入用例N=0,M=0时,表示输入终止,且该用例无需处理。输出格式每个测试用例输出一个结果,每个结果占一行。数据范围1≤N,M≤11输入样例:121314222324
- C++ 动态规划 状态压缩DP 最短Hamilton路径
伏城无嗔
动态规划力扣算法笔记c++动态规划
给定一张n个点的带权无向图,点从0∼n−1标号,求起点0到终点n−1的最短Hamilton路径。Hamilton路径的定义是从0到n−1不重不漏地经过每个点恰好一次。输入格式第一行输入整数n。接下来n行每行n个整数,其中第i行第j个整数表示点i到j的距离(记为a[i,j])。对于任意的x,y,z,数据保证a[x,x]=0,a[x,y]=a[y,x]并且a[x,y]+a[y,z]≥a[x,z]。输出
- 力口打卡第19天 获取所有钥匙的最短路径
ShadderSeina
力扣打卡算法leetcodec++
获取所有钥匙的最短路径给定一个二维网格grid,其中:‘.’代表一个空房间’#’代表一堵’@’是起点小写字母代表钥匙大写字母代表锁。我们从起点开始出发,一次移动是指向四个基本方向之一行走一个单位空间。我们不能在网格外面行走,也无法穿过一堵墙。如果途经一个钥匙,我们就把它捡起来。除非我们手里有对应的钥匙,否则无法通过锁。方法:状态压缩+广度优先搜索给定一个只包含空房间、墙、起点和终点的二维网格,我们
- MatrixOne---MatrixKV产品体验
☞ ♚ ☜
docker容器java
MatrixKvMatrixKV是一个简单的分布式强一致KV存储系统,采用Pebble作为底层的存储引擎,MatrixCube作为分布式组件,以及自定义了最简单的读写请求接口。用户可以非常简单的在任意一个节点发起读写数据的请求,也可以从任意一个节点读到需要的数据。如果对TiDB架构比较熟悉的同学可以把MatrixKV等同于一个TiKV+PD,而MatrixKV其中使用的RocksDB换成了Pebb
- 【动态规划】【状态压缩】【2次选择】【广度搜索】1494. 并行课程 II
闻缺陷则喜何志丹
#算法题数据结构与算法动态规划算法c++力扣状态压缩广度优先搜索并行课程
作者推荐视频算法专题本文涉及知识点动态规划汇总状态压缩广度优先搜索LeetCode1494.并行课程II给你一个整数n表示某所大学里课程的数目,编号为1到n,数组relations中,relations[i]=[xi,yi]表示一个先修课的关系,也就是课程xi必须在课程yi之前上。同时你还有一个整数k。在一个学期中,你最多可以同时上k门课,前提是这些课的先修课在之前的学期里已经上过了。请你返回上完
- 【动态规划】【精度】1883. 准时抵达会议现场的最小跳过休息次数
闻缺陷则喜何志丹
#算法题动态规划算法c++图论力扣精度最小
作者推荐【动态规划】【状态压缩】【2次选择】【广度搜索】1494.并行课程II本文涉及知识点动态规划汇总LeetCode:1883.准时抵达会议现场的最小跳过休息次数给你一个整数hoursBefore,表示你要前往会议所剩下的可用小时数。要想成功抵达会议现场,你必须途经n条道路。道路的长度用一个长度为n的整数数组dist表示,其中dist[i]表示第i条道路的长度(单位:千米)。另给你一个整数sp
- 2.2日总结
已经成为了代码的形状
算法图论c++
第一题:搭配购买题解:一看就是很普通的01背包问题,但是和查并集一起考了,首先我们需要把每个有联系的链接起来,形成一个大背包,用来装他们的总金额和总价值,然后我们在看一个个的物品进行取或者不取两种操作,但是这题需要进行状态压缩,不能用二维的dp数组,否则会MLE,要用一维的滚动数组来解决问题#includeusingnamespacestd;intn,m,we;intc[10005];intd[1
- 状态压缩DP
琛_
AcWing算法提高课动态规划算法
状态压缩DP小国王玉米田炮兵阵地愤怒的小鸟宝藏蒙德里安的梦想最短Hamilton路径小国王在n×n的棋盘上放k个国王,国王可攻击相邻的8个格子,求使它们无法互相攻击的方案总数。输入格式共一行,包含两个整数n和k。输出格式共一行,表示方案总数,若不能够放置则输出0。数据范围1≤n≤10,0≤k≤n2输入样例:32输出样例:16算法解析算法构造这道题目,根据数据范围,不难得出,这道题目考察的是状态压缩
- 状压DP 学习笔记
glorious_dream
模板总结学习笔记算法c++动态规划
首先来说一下状态压缩状态压缩就是使用某种方法,简明扼要地以最小代价来表示某种状态,通常是用一串01数字(二进制数)来表示各个点的状态。这就要求使用状态压缩的对象的点的状态必须只有两种,0或1;当然如果有三种状态用三进制来表示也未尝不可。使用条件1.解法需要保存一定的状态数据(表示一种状态的一个数据值),每个状态数据通常情况下是可以通过2进制来表示的。这就要求状态数据的每个单元只有两种状态,比如说棋
- 状态压缩DP相关
刘先森222
算法
状态压缩动态规划学习笔记-AcWing状态压缩动态规划算法笔记(二)-AcWing【笔记】状压DP复习笔记-AcWing状态压缩dp-AcWing
- 状态压缩 笔记
泠楠子
dp笔记c++算法动态规划
棋盘式的f[i][j]中表示状态的j可以是状态本身也可以是在合法状态state中的下标用状态本身比较方便,用下标比较省空间用下标的话可以开id[M]数组记录一下蒙德里安的梦想求把N×M的棋盘分割成若干个1×2的长方形,有多少种方案。例如当N=2,M=4时,共有5种方案。当N=2,M=3时,共有3种方案。如下图所示:输入格式输入包含多组测试用例。每组测试用例占一行,包含两个整数N和M。当输入用例N=
- [E模拟] lc2670. 找出不同元素数目差数组(哈希表+状态压缩)
Ypuyu
LeetCode散列表哈希算法数据结构
文章目录1.题目来源2.题目解析1.题目来源链接:2670.找出不同元素数目差数组2.题目解析哈希计数统计就行了,题解里有看到用long64位进行状态压缩的,可以参考下。这类题就不纠结写法了。思路:两个哈希表,一个统计前缀、一个统计后缀。哈希表的size就是不同元素的个数。先统计后缀,元素依次入哈希表。再顺序遍历,维护前缀哈希表,size差值就是答案。注意后缀哈希表元素个数为0时,需要erase掉
- AtCoder Beginner Contest 338F - Negative Traveling Salesman【floyd+状态压缩dp】
lianxuhanshu_
动态规划算法动态规划
原题链接:https://atcoder.jp/contests/abc338/tasks/abc338_fTimeLimit:6sec/MemoryLimit:1024MBScore:500points、问题陈述有一个有N个顶点和M条边的加权简单有向图。顶点的编号为1到N,i/th边的权重为Wi,从顶点Ui延伸到顶点Vi。权重可以为负,但该图不包含负循环。确定是否存在至少访问每个顶点一次的行走。
- AcWing.291.蒙德里安的梦想(状态压缩dp)
Die love 6-feet-under
c++动态规划算法
求把NNN×MMM的棋盘分割成若干个111×222的长方形,有多少种方案。例如当NNN=2,MMM=4时,共有5种方案。当NNN=2,MMM=3时,共有3种方案。如下图所示:输入格式输入包含多组测试用例。每组测试用例占一行,包含两个整数NNN和MMM。当输入用例NNN=0,MMM=0时,表示输入终止,且该用例无需处理。输出格式每个测试用例输出一个结果,每个结果占一行。数据范围1≤N,M≤11输入样
- 项目中 枚举与注解的结合使用
飞翔的马甲
javaenumannotation
前言:版本兼容,一直是迭代开发头疼的事,最近新版本加上了支持新题型,如果新创建一份问卷包含了新题型,那旧版本客户端就不支持,如果新创建的问卷不包含新题型,那么新旧客户端都支持。这里面我们通过给问卷类型枚举增加自定义注解的方式完成。顺便巩固下枚举与注解。
一、枚举
1.在创建枚举类的时候,该类已继承java.lang.Enum类,所以自定义枚举类无法继承别的类,但可以实现接口。
- 【Scala十七】Scala核心十一:下划线_的用法
bit1129
scala
下划线_在Scala中广泛应用,_的基本含义是作为占位符使用。_在使用时是出问题非常多的地方,本文将不断完善_的使用场景以及所表达的含义
1. 在高阶函数中使用
scala> val list = List(-3,8,7,9)
list: List[Int] = List(-3, 8, 7, 9)
scala> list.filter(_ > 7)
r
- web缓存基础:术语、http报头和缓存策略
dalan_123
Web
对于很多人来说,去访问某一个站点,若是该站点能够提供智能化的内容缓存来提高用户体验,那么最终该站点的访问者将络绎不绝。缓存或者对之前的请求临时存储,是http协议实现中最核心的内容分发策略之一。分发路径中的组件均可以缓存内容来加速后续的请求,这是受控于对该内容所声明的缓存策略。接下来将讨web内容缓存策略的基本概念,具体包括如如何选择缓存策略以保证互联网范围内的缓存能够正确处理的您的内容,并谈论下
- crontab 问题
周凡杨
linuxcrontabunix
一: 0481-079 Reached a symbol that is not expected.
背景:
*/5 * * * * /usr/IBMIHS/rsync.sh
- 让tomcat支持2级域名共享session
g21121
session
tomcat默认情况下是不支持2级域名共享session的,所有有些情况下登陆后从主域名跳转到子域名会发生链接session不相同的情况,但是只需修改几处配置就可以了。
打开tomcat下conf下context.xml文件
找到Context标签,修改为如下内容
如果你的域名是www.test.com
<Context sessionCookiePath="/path&q
- web报表工具FineReport常用函数的用法总结(数学和三角函数)
老A不折腾
Webfinereport总结
ABS
ABS(number):返回指定数字的绝对值。绝对值是指没有正负符号的数值。
Number:需要求出绝对值的任意实数。
示例:
ABS(-1.5)等于1.5。
ABS(0)等于0。
ABS(2.5)等于2.5。
ACOS
ACOS(number):返回指定数值的反余弦值。反余弦值为一个角度,返回角度以弧度形式表示。
Number:需要返回角
- linux 启动java进程 sh文件
墙头上一根草
linuxshelljar
#!/bin/bash
#初始化服务器的进程PId变量
user_pid=0;
robot_pid=0;
loadlort_pid=0;
gateway_pid=0;
#########
#检查相关服务器是否启动成功
#说明:
#使用JDK自带的JPS命令及grep命令组合,准确查找pid
#jps 加 l 参数,表示显示java的完整包路径
#使用awk,分割出pid
- 我的spring学习笔记5-如何使用ApplicationContext替换BeanFactory
aijuans
Spring 3 系列
如何使用ApplicationContext替换BeanFactory?
package onlyfun.caterpillar.device;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import
- Linux 内存使用方法详细解析
annan211
linux内存Linux内存解析
来源 http://blog.jobbole.com/45748/
我是一名程序员,那么我在这里以一个程序员的角度来讲解Linux内存的使用。
一提到内存管理,我们头脑中闪出的两个概念,就是虚拟内存,与物理内存。这两个概念主要来自于linux内核的支持。
Linux在内存管理上份为两级,一级是线性区,类似于00c73000-00c88000,对应于虚拟内存,它实际上不占用
- 数据库的单表查询常用命令及使用方法(-)
百合不是茶
oracle函数单表查询
创建数据库;
--建表
create table bloguser(username varchar2(20),userage number(10),usersex char(2));
创建bloguser表,里面有三个字段
&nbs
- 多线程基础知识
bijian1013
java多线程threadjava多线程
一.进程和线程
进程就是一个在内存中独立运行的程序,有自己的地址空间。如正在运行的写字板程序就是一个进程。
“多任务”:指操作系统能同时运行多个进程(程序)。如WINDOWS系统可以同时运行写字板程序、画图程序、WORD、Eclipse等。
线程:是进程内部单一的一个顺序控制流。
线程和进程
a. 每个进程都有独立的
- fastjson简单使用实例
bijian1013
fastjson
一.简介
阿里巴巴fastjson是一个Java语言编写的高性能功能完善的JSON库。它采用一种“假定有序快速匹配”的算法,把JSON Parse的性能提升到极致,是目前Java语言中最快的JSON库;包括“序列化”和“反序列化”两部分,它具备如下特征:  
- 【RPC框架Burlap】Spring集成Burlap
bit1129
spring
Burlap和Hessian同属于codehaus的RPC调用框架,但是Burlap已经几年不更新,所以Spring在4.0里已经将Burlap的支持置为Deprecated,所以在选择RPC框架时,不应该考虑Burlap了。
这篇文章还是记录下Burlap的用法吧,主要是复制粘贴了Hessian与Spring集成一文,【RPC框架Hessian四】Hessian与Spring集成
 
- 【Mahout一】基于Mahout 命令参数含义
bit1129
Mahout
1. mahout seqdirectory
$ mahout seqdirectory
--input (-i) input Path to job input directory(原始文本文件).
--output (-o) output The directory pathna
- linux使用flock文件锁解决脚本重复执行问题
ronin47
linux lock 重复执行
linux的crontab命令,可以定时执行操作,最小周期是每分钟执行一次。关于crontab实现每秒执行可参考我之前的文章《linux crontab 实现每秒执行》现在有个问题,如果设定了任务每分钟执行一次,但有可能一分钟内任务并没有执行完成,这时系统会再执行任务。导致两个相同的任务在执行。
例如:
<?
//
test
.php
- java-74-数组中有一个数字出现的次数超过了数组长度的一半,找出这个数字
bylijinnan
java
public class OcuppyMoreThanHalf {
/**
* Q74 数组中有一个数字出现的次数超过了数组长度的一半,找出这个数字
* two solutions:
* 1.O(n)
* see <beauty of coding>--每次删除两个不同的数字,不改变数组的特性
* 2.O(nlogn)
* 排序。中间
- linux 系统相关命令
candiio
linux
系统参数
cat /proc/cpuinfo cpu相关参数
cat /proc/meminfo 内存相关参数
cat /proc/loadavg 负载情况
性能参数
1)top
M:按内存使用排序
P:按CPU占用排序
1:显示各CPU的使用情况
k:kill进程
o:更多排序规则
回车:刷新数据
2)ulimit
ulimit -a:显示本用户的系统限制参
- [经营与资产]保持独立性和稳定性对于软件开发的重要意义
comsci
软件开发
一个软件的架构从诞生到成熟,中间要经过很多次的修正和改造
如果在这个过程中,外界的其它行业的资本不断的介入这种软件架构的升级过程中
那么软件开发者原有的设计思想和开发路线
- 在CentOS5.5上编译OpenJDK6
Cwind
linuxOpenJDK
几番周折终于在自己的CentOS5.5上编译成功了OpenJDK6,将编译过程和遇到的问题作一简要记录,备查。
0. OpenJDK介绍
OpenJDK是Sun(现Oracle)公司发布的基于GPL许可的Java平台的实现。其优点:
1、它的核心代码与同时期Sun(-> Oracle)的产品版基本上是一样的,血统纯正,不用担心性能问题,也基本上没什么兼容性问题;(代码上最主要的差异是
- java乱码问题
dashuaifu
java乱码问题js中文乱码
swfupload上传文件参数值为中文传递到后台接收中文乱码 在js中用setPostParams({"tag" : encodeURI( document.getElementByIdx_x("filetag").value,"utf-8")});
然后在servlet中String t
- cygwin很多命令显示command not found的解决办法
dcj3sjt126com
cygwin
cygwin很多命令显示command not found的解决办法
修改cygwin.BAT文件如下
@echo off
D:
set CYGWIN=tty notitle glob
set PATH=%PATH%;d:\cygwin\bin;d:\cygwin\sbin;d:\cygwin\usr\bin;d:\cygwin\usr\sbin;d:\cygwin\us
- [介绍]从 Yii 1.1 升级
dcj3sjt126com
PHPyii2
2.0 版框架是完全重写的,在 1.1 和 2.0 两个版本之间存在相当多差异。因此从 1.1 版升级并不像小版本间的跨越那么简单,通过本指南你将会了解两个版本间主要的不同之处。
如果你之前没有用过 Yii 1.1,可以跳过本章,直接从"入门篇"开始读起。
请注意,Yii 2.0 引入了很多本章并没有涉及到的新功能。强烈建议你通读整部权威指南来了解所有新特性。这样有可能会发
- Linux SSH免登录配置总结
eksliang
ssh-keygenLinux SSH免登录认证Linux SSH互信
转载请出自出处:http://eksliang.iteye.com/blog/2187265 一、原理
我们使用ssh-keygen在ServerA上生成私钥跟公钥,将生成的公钥拷贝到远程机器ServerB上后,就可以使用ssh命令无需密码登录到另外一台机器ServerB上。
生成公钥与私钥有两种加密方式,第一种是
- 手势滑动销毁Activity
gundumw100
android
老是效仿ios,做android的真悲催!
有需求:需要手势滑动销毁一个Activity
怎么办尼?自己写?
不用~,网上先问一下百度。
结果:
http://blog.csdn.net/xiaanming/article/details/20934541
首先将你需要的Activity继承SwipeBackActivity,它会在你的布局根目录新增一层SwipeBackLay
- JavaScript变换表格边框颜色
ini
JavaScripthtmlWebhtml5css
效果查看:http://hovertree.com/texiao/js/2.htm代码如下,保存到HTML文件也可以查看效果:
<html>
<head>
<meta charset="utf-8">
<title>表格边框变换颜色代码-何问起</title>
</head>
<body&
- Kafka Rest : Confluent
kane_xie
kafkaRESTconfluent
最近拿到一个kafka rest的需求,但kafka暂时还没有提供rest api(应该是有在开发中,毕竟rest这么火),上网搜了一下,找到一个Confluent Platform,本文简单介绍一下安装。
这里插一句,给大家推荐一个九尾搜索,原名叫谷粉SOSO,不想fanqiang谷歌的可以用这个。以前在外企用谷歌用习惯了,出来之后用度娘搜技术问题,那匹配度简直感人。
环境声明:Ubu
- Calender不是单例
men4661273
单例Calender
在我们使用Calender的时候,使用过Calendar.getInstance()来获取一个日期类的对象,这种方式跟单例的获取方式一样,那么它到底是不是单例呢,如果是单例的话,一个对象修改内容之后,另外一个线程中的数据不久乱套了吗?从试验以及源码中可以得出,Calendar不是单例。
测试:
Calendar c1 =
- 线程内存和主内存之间联系
qifeifei
java thread
1, java多线程共享主内存中变量的时候,一共会经过几个阶段,
lock:将主内存中的变量锁定,为一个线程所独占。
unclock:将lock加的锁定解除,此时其它的线程可以有机会访问此变量。
read:将主内存中的变量值读到工作内存当中。
load:将read读取的值保存到工作内存中的变量副本中。
- schedule和scheduleAtFixedRate
tangqi609567707
javatimerschedule
原文地址:http://blog.csdn.net/weidan1121/article/details/527307
import java.util.Timer;import java.util.TimerTask;import java.util.Date;
/** * @author vincent */public class TimerTest {
 
- erlang 部署
wudixiaotie
erlang
1.如果在启动节点的时候报这个错 :
{"init terminating in do_boot",{'cannot load',elf_format,get_files}}
则需要在reltool.config中加入
{app, hipe, [{incl_cond, exclude}]},
2.当generate时,遇到:
ERROR