nodes

How to restart kubernetes nodes?

拟墨画扇 提交于 2019-11-30 11:48:25
问题 The status of nodes is reported as unknown "conditions": [ { "type": "Ready", "status": "Unknown", "lastHeartbeatTime": "2015-11-12T06:03:19Z", "lastTransitionTime": "2015-11-12T06:04:03Z", "reason": "Kubelet stopped posting node status." } whle kubectl get nodes return a NOTReady status. What does this imply and how to fix this? 回答1: Get nodes kubectl get nodes Result: NAME STATUS AGE 192.168.1.157 NotReady 42d 192.168.1.158 Ready 42d 192.168.1.159 Ready 42d Describe node Here is a NotReady

Speeding up xpath

戏子无情 提交于 2019-11-30 11:29:30
问题 i have a 1000 entry document whose format is something like <Example> <Entry> <n1></n1> <n2></n2> </Entry> <Entry> <n1></n1> <n2></n2> </Entry> <!--and so on--> There are more than 1000 Entry nodes here. I am writing a Java program which basically gets all the node one by one and do some analyzing on each node. But the problem is that the retrieval time of the nodes increases with its no. For example it takes 78 millisecond to retrieve the first node 100 ms to retrieve the second and it keeps

python - networkx - graph different colored nodes using two lists

落爺英雄遲暮 提交于 2019-11-30 07:39:15
I'm new to networkx and need some help. I've searched previously and couldn't resolve my issue. I have a networkx graphviz image I made, using a list as input for the nodes, and a two column file for the edges. A second file contains the items from the first list, as well values which correspond to node size. I have another file, which contains items that are in the original list, and i need those identical items to appear another color, without changing the layout or structure of the graph. Here's some of the code I've been testing: import sys from collections import defaultdict import

Model.findOne not returning docs but returning a wrapper object

主宰稳场 提交于 2019-11-30 07:31:39
I have defined a Model with mongoose like this: var mongoose = require("mongoose") var Schema = mongoose.Schema var userObject = Object.create({ alias: String, email: String, password: String, updated: { type: Date, default: Date.now } }) var userSchema = new Schema(userObject, {strict: false}) var User = mongoose.model('User', userSchema) module.exports = User Then I created a user that I can perfectly find through mongo console like this: db.users.findOne({ email: "coco@coco.com" }); { "_id" : ObjectId("55e97420d82ebdea3497afc7"), "password" : "caff3a46ebe640e5b4175a26f11105bf7e18be76",

Looping through XML using VBA

和自甴很熟 提交于 2019-11-30 06:59:41
问题 I'm trying to loop through the following simple XML using VBA, with the ultimate goal to be able to easily extract the data in sequence. <?xml version="1.0"?> <PMRData> <Staff StaffName="Person 1"> <Openings>1.1</Openings> <Closures>1.11</Closures> </Staff> <Staff StaffName="Person 2"> <Openings>1.2</Openings> <Closures>1.22</Closures> </Staff> <Staff StaffName="Person 3"> <Openings>1.3</Openings> <Closures>1.33</Closures> </Staff> </PMRData> My code so far manages to get the data into the

Algorithm for finding all of the shared substrings of any length between 2 strings, and then counting occurrences in string 2?

China☆狼群 提交于 2019-11-30 06:44:39
I've run into an unusual challenge and so far I'm unable to determine the most efficient algorithm to attack this. Given the following 2 strings as an example, find all commonly shared substrings between the 2 strings of any length, and count the number of occurrences of all of those shared substrings in string 2. Your algorithm also needs to be able to compute shared substrings between files containing strings that are up to 100MB or more in size. Example: String 1: ABCDE512ABC361EG51D String 2: ADE5AHDW4131EG1DG5C Given these 2 strings this algorithm would find the following shared

Different node symbols for d3.js force-directed graph

拈花ヽ惹草 提交于 2019-11-30 05:42:41
问题 How do I display nodes as different symbols in d3.js's force-directed library? I wanted to implement something similar to what I wrote below: var node = svg.selectAll(".node") .data(graph.nodes) .enter().append(function(d){return d.shape;}) .attr("class", "node") .attr("r", 5) .style("fill", function(d) { return color(d.group); }) .call(force.drag); Each node would have an encoded shape ("rect", "circle", etc.). However, I get the error: Uncaught TypeError: Object function (d){return "circle"

Check if an element is closed using a discrete tag with JavaScript

耗尽温柔 提交于 2019-11-30 03:31:06
问题 I am getting the child nodes of en element and i want to check if the tags can actually contain text. For example: <br />, <img /> Should return false and <span></span>, <div></div>, <li></li> should return true. Thanks! 回答1: Unfortunately, there is no way to detect how a tag was written in the code, since when the JavaScript runs, the HTML code has already been parsed into DOM objects. However, your question seems to be more about whether a particular element type can contain text. This

mongodb map reduce on multicore server

纵饮孤独 提交于 2019-11-29 23:16:11
问题 I have a mongodb with thousands of records holding very long vectors. I am looking for correlations between an input vector with my MDB data set using a certain algorithm. psudo code: function find_best_correlation(input_vector) max_correlation = 0 return_vector = [] foreach reference_vector in dataset: if calculateCorrelation(input_vector,reference_vector) > max_correlation then: return_vector = reference_vector return return_vector This is a very good candidate for map-reduce pattern as I

PHP: Using simplexml to loop through all levels of an XML file

时间秒杀一切 提交于 2019-11-29 22:42:52
问题 I have a function which uses simplexml to return the first level of nodes in an XML file and write it into an unordered list: function printAssetMap() { $xml = simplexml_load_file(X_ASSETS); $assets = $xml->asset; $html = '<ul>'."\n"; foreach ($assets as $asset) { $html .= '<li id="asset'.$asset->asset_assetid.'"><ins> </ins><a href="#">'.$asset->asset_name.' ['.$asset->asset_assetid.']</a></li>'."\n"; }//end foreach $html .= '</ul>'."\n"; return $html; }// printAssetMap() XML I am using,