Java 一维数组转换链表结构
最近在 Leetcode 刷题,发现遇到不少链表类型的题目,题目会定义好链表节点 ListNode 的数据结构。
最近在 Leetcode 刷题,发现遇到不少链表类型的题目,题目会定义好链表节点 ListNode 的数据结构。
function getIpAddress() {
window.RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
var pc = new RTCPeerConnection({
iceServers: []
}),
noop = function() {};
pc.createDataChannel(''); //create a bogus data channel
pc.createOffer(pc.setLocalDescription.bind(pc), noop); // create offer andsetlocaldescription
pc.onicecandidate = function(ice) {
if (ice && ice.candidate && ice.candidate.candidate) {
var myIP = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(ice.candidate.candidate)[1];
console.log('my IP: ', myIP); //【注:Chrome浏览器下ice.candidate.address也可以拿到值,火狐浏览器不可以】
pc.onicecandidate = noop;
return myIP;
}
};
return null;
}
跨域访问时很多需求,所以 SpringBoot 的跨域解决也是必须的。
Access to XMLHttpRequest at 'http://127.0.0.1:18888/XXXX' from origin 'http://127.0.0.1:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
近期在做一个搜索引擎,需要匹配字符高亮显示。
现在有字符串 "struts StrUts hibernate",我想把 不区分大小写匹配 struts 的字符串替换为 <font color='red'>匹配字符串</font>
。
若 k8s 删除 pod 一直处于 terminating 状态
可强制删除:
kubectl delete pod PODNAME --force --grace-period=0