Posts

c++ - Create a routing table for Dijkstra's algorithm using min_heap for node selection -

i need implement min_heap node selection routing table that's using dijkstra's algorithm. information obtained input file, 'text1.txt', formatted 10 // number of nodes = 10 (labelled 0, 1, 2, …., 9) 25 //number of directed edges = 25; next 25 lines define edges 1 3 7 //there edge v1 v3 cost of 7 5 2 1 //there edge v5 v2 cost of 1 6 4 5 //there edge v6 v4 cost of 5 here code far: #include <iostream> #include <vector> #include <fstream> using namespace std; class e_node { //stands edge node public: int nb;//the neighbor of considered node int weight; //weight of edge above neighbor e_node() {}//constructor }; class rt_node { //rt stands routing table public: int cost; //cost node int from; //the node node int checked; int h_pos; //the postion in heap node rt_node() { = -1; cost = 9999; checked = 0; } }; class h_node { //stands head_node public: int id; int cost; h_node() { id = -1; cost = 9999; } h_node(int i, int j) { id = i; cost =...

I am trying to get this block of VB.NET Json Code to work: -

i trying block of vb.net json code work: there 2 issues -'responsebody' loading valid data array want object data. in addition line 'for each item jproperty in results' throwing error-'unable cast object of type 'newtonsoft.json.linq.jobject' type 'newtonsoft.json.linq.jproperty'. ' have ideas? public async function examplemethodasync() task(of string) dim client = new httpclient() dim querystring = httputility.parsequerystring(string.empty) ' request headers client.defaultrequestheaders.add("key", "xxx") dim uri = "xxx" & querystring.tostring() dim response httpresponsemessage ' request body dim bytedata byte() = encoding.utf8.getbytes(uri) using content = new bytearraycontent(bytedata) content.headers.contenttype = new mediatypeheadervalue("application/...

javascript - Clicking on form button without an <input>? -

i trying click on "slow download" button on this page, html is <form action="https://nitroflare.com/view/a71f0994e20f2e0/security-privacy.jpg" method="post"> <button id="slow-download" class="bootstrapbutton" name="gotofreepage">slow download</button> </form> where doing $( document ).ready(function() { function startfreedownload(){ getelementsbyid('slow-download')[0].submit();​ }; startfreedownload(); }); all posts have seen have <input ... > 1 doesn't. question can tell me doing wrong? this solved problem. function skipid(objid){ var oid = document.getelementbyid(objid); oid.click(); } window.onload = function(){ skipid('slow-download'); };

Does nodetool cleanup affect Apache Spark rdd.count() of a Cassandra table? -

i've been tracking growth of big cassandra tables using spark rdd.count(). 'till expected behavior consistent, number of rows growing. today ran nodetool cleanup on 1 of seeds , usual ran 50+ minutes. and rdd.count() returns 1 third of rows did before.... did destroy data using nodetool cleanup? or spark count unreliable , counting ghost keys? got no errors during cleanup , lots don't show out of usual. did seem successful operation, until now. update 2016-11-13 turns out cassandra documentation set me loss of 25+ million rows of data. the documentation explicit: use nodetool status verify node bootstrapped and all other nodes (un) , not in other state. after new nodes running, run nodetool cleanup on each of existing nodes remove keys no longer belong nodes. wait cleanup complete on 1 node before running nodetool cleanup on next node. cleanup can safely postponed low-usage hours. well check status of other nodes via nodetool sta...

html - Forcing table cell onto new row -

i have standard table in cells appear left-to-right in same row, i'd force third cell appear on new line. there css tweak can this? <table><tr> <td class="col-1">one</td> <td class="col-2">two</td> <td class="col-3">three</td> <td class="col-4">four</td> </tr></table> this displays as: 1 2 3 four can force third column display on new row thus: one 2 3 4 not sure why wouldn't make new row, suppose if had use css, this: table tr td { display: block; width: 50%; box-sizing: border-box; float: left; } jsfiddle

angularjs - Angular-file-upload how to use -

how can use example: http://nervgh.github.io/pages/angular-file-upload/examples/simple/ upload files on server. use .net web api , angularjs this. in apicontroller call wcf service's methods upload files db. how in example local directory name. file name , size. please explain how works. my apicontroller method: [httppost] public attachmentdto createattachment(jobject json) { using (var _client = new dataserviceclient("epdata")) { if (properties.settings.default.domain != "") { _client.clientcredentials.windows.clientcredential.username = properties.settings.default.domain + "\\" + properties.settings.default.login; _client.clientcredentials.windows.clientcredential.password = properties.settings.default.password; } var userid = json["userid"].toobject<guid>(); _client.setcurrentuser(userid); var f...

C - Print a char returned by a function -

update: final if statement if(lettergrade <= 'a' && lettergrade >= 'f') incorrect ascii value f (70) greater (65). i'm trying print character returned function in c. my function, assignletter, given float, , returns character. when run program is: skirchbaum:~/workspace/hmwk/hmwk4 $ ./assignletter enter pointsgrade 100 pointsgrade: 100.00 lettergrade: nothing gets printed lettergrade (i have tried multiple cases - 100.1, 1, etc) what doing wrong? code: /* input: grade points functionality: converts point grade letter grade output: char representing letter grade, or -1 if error letter grade breakdown: = 100 - 91 b = 90 - 81 c = 80 - 71 d = 70 - 61 f = 60 , below */ #include <stdio.h> #include <stdlib.h> #define debug 1 char assignletter(float pointsgrade); char lettergrade; float pointsgrade; int main(){ //input pointsgrade debugging #ifdef debug printf("enter pointsgrade\...