Posts

Showing posts from August, 2013

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\...

object - How am I writing this constructor? -

how writing object types "addressinfo homeaddress" , "addressinfo workaddress" in constructor?! public employee(string name,addressinfo homeaddress, addressinfo workaddress, int debt) { this.name=name ; ??? ??? this.debt=debt; } just copy-and-think-and-paste code initializes this.name . except different variable , type name, same.

bash - Is this the faster way to test cpu load using shell scripting? -

i'm relatively new shell scripting , i'm in process of writing own health checking scripts using bash. is following script test cpu load best can have in terms of performance, readability , maintainability? #!/bin/sh getloadavg5 () { echo $(cat /proc/loadavg | cut -f2 -d' ') } getnumcpus () { echo $(cat /proc/cpuinfo | grep '^processor' | wc -l) } awk \ -v failthold=0.8 \ -v warnthold=0.7 \ -v loadavg=$(getloadavg5) \ -v numcpus=$(getnumcpus) \ 'begin { ratio=loadavg/numcpus if (ratio >= failthold) exit 2 if (ratio >= warnthold) exit 1 exit 0 }' this might more suitable code review stackexchange , without condoning use of load averages in way, here ideas: #!/bin/sh read -r 1 5 fifteen rest < /proc/loadavg cpus=$(grep -c '^processor' /proc/cpuinfo) awk \ -v failthold=0.8 \ -v warnthold=0.7 \ -v loadavg="$five" \ -v numcpus="$cpus" \ 'begin { ratio...

android - Storing markers in Maps -

i want store markers clicked map in arraylist or hashmap. markers added using kml layer, 1 marker having following code: <placemark> <name>point 1</name> <description>some_description</description> <point> <coordinates>0,0,0</coordinates> </point> </placemark> i store coordinates description , maybe name.

arm - How to the flags from the ALU for set flags instruction(ADDS, SUBS, etc) in single cycle processor? -

i'm doing class project when have implement single cycle processor in verilog (for arm). 1 of instruction adds (add , set flags), , made 4 bits d flipflop enable control hold value of flags alu (zero, negative, overflow, carry out), i'm not sure wire output of dflipflop. should connect mux decide write value register file, or output value? i'm confused flags. thank you.

javascript - Vue.js using unique id in my objects array to grab the index of my object? -

vue.component('post', { template: "#my-component", props: ['posty'], methods: { testfunc: function(index){ this.$parent.parentmethod(index); } } }); var vm = new vue({ el: "#app", data: { posts: [{ uuid: '88f86fe9d', title: "hello", votes: '15' }, { uuid: '88f8ff69d', title: "hello", votes: '15' }, { uuid: '88fwf869d', title: "hello", votes: '10' }] }, methods: { parentmethod: function(index){ this.posts.splice(index, 1) } } }); <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>js bin</title> </head> <body> <div id="app"> <div class="container-fluid...

Embedded Google Calendar not displaying in Firefox or Safari -

i can't embedded google calendar display website in either firefox or safari. looks great in chrome, other 2 see calendar border no content @ all. have tried both full calendar view , agenda view, both same results. here code iframe: <!-- <div> <p>this div calendar</p> iframe src="https://calendar.google.com/calendar/embed? title=squadron%2036%20calendar&amp;height=600&amp;wkst=1&amp;bgcolor=%23999999&amp;src=capsquadron36%40gmail.com&amp;color=%231b887a&amp;mode=agenda&amp;ctz=america%2flos_angeles";mode=agenda&amp style="border:solid 1px #777" width="800" height="600" frameborder="0" scrolling="no"></iframe> </div> --> is there setting need tweak or else? thanks....

postgresql - What's wrong with GIN index, can't avoid SEQ scan? -

i've created table this, create table mytable(hash char(40), title varchar(500)); create index name_fts on mytable using gin(to_tsvector('english', 'title')); create unique index md5_uniq_idx on mytable(hash); when query title, test=# explain analyze select * mytable to_tsvector('english', title) @@ 'abc | def'::tsquery limit 10; query plan -------------------------------------------------------------------------------------------------------------------- limit (cost=0.00..277.35 rows=10 width=83) (actual time=0.111..75.549 rows=10 loops=1) -> seq scan on mytable (cost=0.00..381187.45 rows=13744 width=83) (actual time=0.110..75.546 rows=10 loops=1) filter: (to_tsvector('english'::regconfig, (title)::text) @@ '''abc'' | ''def'''::tsquery) rows removed filter: 10221 planning time: 0.176 ms execution time: 75.564 m...

arraylist - Creating an array list of multiple data types in Java -

some of file i'm working with: http://pastebin.com/wriqcups currently had make population, latitude, , longitude strings or else wouldn't desired output. want them int, double, , double in order. public class city { string countrycode; string city; string region; string population; string latitude; string longitude; public city (string countrycode, string city, string region, string population, string latitude, string longitude) { this.countrycode = countrycode; this.city = city; this.region = region; this.population = population; this.latitude = latitude; this.longitude = longitude; } public string tostring() { return this.city + "," + this.population + "," + this.latitude + "," + this.longitude; } } i suspect has how created array list. there way make of elements of list of different type? tried changin...

project - Basic Calculator Help Java -

i trying create calculator school project, reason when try compile, says have problem , have no clue how fix it. getting error "multiple markers @ line - local variable inputa may not have been initialized - local variable inputb may not have been initialized" @ part: atimesb = (inputa * inputb); adividedbyb = (inputa / inputb); aplusb = (inputa + inputb); aminusb = (inputa - inputb); is wrong. import java.util.scanner; public class calculator { public static void main(string[] args) { int inputa; int inputb; int atimesb; int adividedbyb; int aplusb; int aminusb; atimesb = (inputa * inputb); adividedbyb = (inputa / inputb); aplusb = (inputa + inputb); aminusb = (inputa - inputb); string operation; scanner in = new scanner(system.in); system.out.println("enter first number"); input...

user interface - Minimal example of a standalone matlab GUI app -

Image
i have written matlab code antenna design, , make user-friendly gui project others can use easily. before move actual gui development, overall impression of whether matlab choice gui-based application, in terms of a) whether it's easy / straightforward create, b) whether it's possible user use resulting app without matlab licence / installation. please can provide minimal matlab gui example demonstrating basic concepts of matlab guis me idea of involved, , point me in right direction on how might deploy standalone matlab app , if @ possible? optional - (opinion based, feel free ignore if feel "opinions" on stackoverflow): appreciate explanatory comments on whether choice in general compared other typical options, or if people advise me migrate matlab language specific purpose of gui apps (and why). matlab (in opinion) 1 of easiest languages there design guis, since need add ui elements normal figure windows , link standard functions callbacks...

authentication - Authenticate with Office365 as a Onenote plugin -

Image
how can authentication token without requiring office365 user sign in? (sign in again , - assume user signed onenote onedrive) create onenote plugin utilising semi-new api features teachers ( here ). microsoft released plugin on in branch of onenote schools support added basic buttons onenote toolbar lead online interface. i'm under impression isn't possible token within onenote. unfortunately, capability not exist yet. in order able call onenote api, user have sign in , give app permissions. not ideal user experience, there no way around it. the closest example can think of meeting details button in home tab in onenote web. calls outlook apis , therefore needs able sign user in. on positive side, once user signed in, can store refresh token in cookie (remember encrypt , mark expiration) , he/she not have sign in again in browser.

ruby - How do I remove duplicate rows in my CSV? -

i have csv has data this: a.a.b. direct http://www.aabdirect.com 348 willis ave mineola ny 11501 (800) 382-1002 no email abeam consulting inc http://abeam.com 245 park ave new york ny 10167 (212) 372-8783 no email abeam consulting inc http://abeam.com 245 park ave new york ny 10167 (212) 372-8783 no email alvarez & marsal http://www.alvarezandmarsal.com 600 madison ave new york ny 10022 (212) 759-4433 no email alvarez & marsal http://www.alvarezandmarsal.com 600 lexington ave ste 6 new york ny 10022 (212) 759-4433 no email the key thing here columns in both rows match (like abeam consulting inc ), that's not case. websites match, or phone number or name match. the key thing website. if 2 values have same website, want one. how de-dupe list in non n+1 way? preferably native ruby method .uniq or of sort. just read strings (which i"ve simplified avoid need horizontal scrolling) array: ...

dependency injection - Angular 2 injectable AppSettings Class -

i'm using angular 2 inside of asp.net core application, isn't important issue. part of current task configuration values server angular application. i have settings flowing through point writing 1 setting layout so: <script> var base_web_api_url = '@appsettings.baseurls.api'; </script> and working, have verified looking @ markup. now, want make appsettings class can inject via di services , components need it. here have far: import { injectable } '@angular/core'; @injectable() export class appsettings { public base_web_api_url: string = window['base_web_api_url']; } very simple , straight forward , should allow me inject server variables. however, error when try use it. error: uncaught (in promise): error: no provider appsettings! so, thought problem wasn't listed in imports in app module. added error: error: unexpected value 'appsettings' imported module 'appmodule' so, googling...

jquery - $.ajax like function for React js and Angular js? -

how post data using react , angular? is there has function $.ajax react , angular? i mean need post function react , angular $.ajax{ url:"test.php", type:"post", cache:false, success... etc. the angularjs way of calling $http like: $http({ url: "http://example.appspot.com/rest/app", method: "post", data: {"foo":"bar"} }).success(function(data, status, headers, config) { $scope.data = data; }).error(function(data, status, headers, config) { $scope.status = status; }); or written simpler using shortcut methods: $http.post("http://example.appspot.com/rest/app", {"foo":"bar"}) .success(function(data, status, headers, config) { $scope.data = data; }).error(function(data, status, headers, config) { $scope.status = status; }); there number of things notice: angularjs version more concise (especially using .post() method) angularjs take care of c...

java - How to call a method in an Activity from another class -

i working on sms application , have method in mainactivity perform button click: public void updatemessage() { viewmessages.performclick(); } this method works fine , performs button click when call method inside mainactivity class. but, when call method other class shown below, call main activity's updatemessage method intentservicehandler class, getting nullpointerexception : java.lang.nullpointerexception: attempt invoke virtual method 'boolean android.widget.button.performclick()' on null object reference public class intentservicehandler extends intentservice { public intentservicehandler() { super("intentservicehandler"); } @override protected void onhandleintent(intent intent) { string message = intent.getstringextra("message"); transactiondatabase transactiondb = new transactiondatabase(this, 1); transactiondb.addmessage(message); mainactivity mainactivity = new mai...

video - change mp4 file size to a specific size -

i have mp4 video file, size 219.6 kb (219,643 bytes). i need change video file size specific size, 275.8 kb (275,791 bytes). doesn't have larger size before, changed smaller size. how can make work? (i have both windows/ubuntu environments)

python - Tensorflow large tensor split to small tensor -

i have tensor below x = tf.variable(tf.truncated_normal([batch, input]), stddev=0.1)) assume batch = 99, input= 5, , split small tensor. if x below: [[1.0, 2.0, 3.0, 4.0, 5.0] [2.0, 3.0, 4.0, 5.0, 6.0] [3.0, 4.0, 5.0, 6.0, 7.0] [4.0, 5.0, 6.0, 7.0, 8.0] ......................... ......................... ......................... [44.0, 55.0, 66.0, 77.0, 88.0] [55.0, 66.0, 77.0, 88.0, 99.0]] i want split 2 tensors [[1.0, 2.0, 3.0, 4.0, 5.0] [2.0, 3.0, 4.0, 5.0, 6.0] [3.0, 4.0, 5.0, 6.0, 7.0]] and [4.0, 5.0, 6.0, 7.0, 8.0] ......................... ......................... [44.0, 55.0, 66.0, 77.0, 88.0] [55.0, 66.0, 77.0, 88.0, 99.0]] i don't know how use tf.split split row. an expedient way call tf.slice twice.

c# - Cannot connect to POS printer over TCP 9100 -

i'm using: visual studio 2012 express, c#, .net framework 2.0 pos printer : tysso prp-300 , ip:192.168.1.100 i connect printer using: c:\> telnet 192.168.1.100 9100 _ also using: c:\> portqry -n 192.168.1.100 -e 9100 -p tcp tcp port 9100 (unknown service): listening but when using code: tcpclient c = new tcpclient("192.168.1.100", 9100); i got exception: an unhandled exception of type 'system.net.sockets.socketexception' occurred in system.dll additional information: connection attempt failed because connected party did not respond after period of time, or established connection failed because connected host has failed respond it works when compile same code .net framework 4.0 i think there problem 2.0 version !

c# - How to format HTML table properly in Outlook mailitem -

i'm using c# pragmatically create outlook mail item populates html table. problem is, when email sent looks hell on earth in outlook. understand formats differently in outlook versus chrome. understand html elements need contain inline styles, , cannot use css. knowing of , creating nice inline table in brackets ide , using same code in c# , sending email outlook, still looks terrible. how can accomplish decent formatted table using html/outlook?? here of c# code. sb.append("<table border=\"1px solid black\";>"); sb.append("<tr>"); sb.appendformat("<th style=\"1px solid black\";>{0}</th>"); sb.appendformat("<th style=\"1px solid black\";>{0}</th>"); sb.appendformat("<th style=\"1px solid black\";>{0}</th>"); sb.appendformat("<th style=\"1px solid black\";>{0}</th>...

ef code first - Entity Framework - 3 tables have relationships with each other -

i have 3 tables follows: applicationuser: public class applicationuser : identityuser { ..some basic properties.. // navigation properties public virtual icollection<post> posts { get; set; } public virtual icollection<album> albums { get; set; } } post : public class post { public long id { get; set; } public string content { get; set; } public int? albumid { get; set; } public string userid { get; set; } public virtual applicationuser user { get; set; } public virtual album album { get; set; } } album : public class album { public int id { get; set; } public string name { get; set; } public string userid { get; set; } public virtual applicationuser user { get; set; } public virtual icollection<post> posts { get; set; } } and applicationdbcontext : modelbuilder.entity<applicationuser>() .hasmany(a=>a.posts) ...

javascript - The wordArray that CryptoJS.AES.decrypt() output was padded with 0x8080808 -

i use cryptojs decrypt encryption web server(use php , aes-128-ecb), can't right wordarray , it's length long. here test code: var pwd = "abcdefghijklmnop"; var words = [0x86c5464, 0x7335231]; var plain_array= cryptojs.lib.wordarray.create(words); var base64_pwd = cryptojs.enc.utf8.parse(pwd).tostring(cryptojs.enc.base64); var pwd_key = cryptojs.enc.base64.parse(base64_pwd); var encryption = aes.encrypt(plain_array,pwd_key, {mode: cryptojs.mode.ecb,padding: cryptojs.pad.pkcs7}).tostring(); var decrypt = aes.decrypt(encryption,pwd_key, {mode: cryptojs.mode.ecb,padding: cryptojs.pad.pkcs7}); and decrypt : decrypt == { sigbytes : 8, words : [0x86c5464, 0x7335231, 0x8080808, 0x8080808] } why decrypt.words padded 0x8080808 ? how can right length wordarray? thanks in advance. aes block cipher , requires input in block size chunks, 16-bytes aes. if data encrypted not multiple of block size padding bytes need added. pkcs#7 padding common p...

mysql field in table -

select * users select * country the users , country tables have same field called "city". table country have field "prov". i need add field "prov" in users table. select u.city,c.prov users u join country c on u.city = c.city;

ionic framework - Simple Error - Checked other posts - ngCordova not defined -

i facing error of [$injector:modulerr] failed instantiate module starter due to: error: [$injector:modulerr] failed instantiate module ngcordova due to: now know related index html not able reference ngcordova service somehow. index.html <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular-messages.js"></script> <script src="lib/ionic-material/dist/ionic.material.min.js"></script> <script src="lib/chart.js/dist/chart.min.js"></script> <!-- cordova script (this 404 during development) --> <script type="lib/ngcordova/dist/ng-cordova.min.js"></script> <script src="cordova.js"></script> <script type="lib/ng-cordova-oauth/dist/ng-cordova-oauth.js"></script> <!-- app's js --> <script src="js/app.js"></script> now, "lib/ngcordova/dist/ng-cordova.min.js" present. sure simple ...

deployment - Can't deploy my App Engine since SDK 1.9.46 -

since upgraded gradle build deploy app engine application sdk 1.9.46, deployment conflict messages, 1 below. beginning interaction module admin... 0% created staging directory at: '/var/folders/m8/6z4h4k2x11s3whxrqmd79lym0000gn/t/appcfg2292422843793738444.tmp' 5% scanning jsp files. 8% generated git repository information file. 20% scanning files on local disk. 25% scanned 250 files. 28% scanned 500 files. 31% scanned 750 files. 33% scanned 1000 files. 34% initiating update. nov 13, 2016 11:11:41 com.google.appengine.tools.admin.abstractserverconnection send1 warning: error posting url: https://appengine.google.com/api/appversion/create?module=admin&app_id=the-outdoor-game&version=dev& 409 conflict there operation pending application: applock held "updating engine_version_id='dev' within engine_id='default'." acquired peter.fortuin @ 2016-11-13 09:15:05.482616 gmt. please wait , try again or use 'appcfg rollback' attempt clea...

SELECT * in MemSQL -

i playing memsql , seems fast. when execute select * [some big table] takes long time. can see lot of traffic in memsql opt , no cpu/memory usage. have set sql editor (datagrip) fetch 500 rows doesn't (i know can use limit command). my question going on? of partitions going stream of results client fetch 500 rows after that? there way how monitor this? what's going on situation dependent, can use explain select * [some big table] , should tell query doing in broad sense can give indication step in query execution taking long time if it's not going stream of results client client adding limit you. can use show plancache , presence of select * [some big table] limit 500 see if client adding automatically. if running query limit should going faster, not surprise me if truncates results on end - won't improve speed @ all. if monitor cpu, memory, disk i/o, , network you've got covered. unless you're using column store shouldn't using disk @...

mongodb - How to prevent individual form elements from updating using Meteor + React? -

i have meteor + react single-page-application basic form in it. data collected mongodb using createcontainer method , passed form component. problem facing this. user starts completing form but, if data populated form changes (by user somewhere else in world saving form), createcontainer method re-compute, in turn pushes new set of props form component , therefore overwrites user typing in. many reasons, cannot use shouldcomponentupdate lifecycle method within form component. 1 reason form contains select element, list of items should still accept reactive updates. need way of halting reactive updates, allowing others, whilst user completing form. suggestions? export default formcontainer = createcontainer(( params ) => { const dataformhandle = meteor.subscribe('formspub'); const dataformisready = dataformhandle.ready(); const datalisthandle = meteor.subscribe('listitemspub'); const datalistisready = datalisthandle.ready(); let name =...

prolog check if a list is in ascending order -

i have list , want check if ordered. can point out error? thanks taxinomemene([]). taxinomemene([element1,element2|tail]):- stoixio1>stoixio12, taxinomemene([stoixio2|tail]). what if have singleton list , stoixio1 , stoixio12? condition should in terms of element1 , element2 is_sorted([]). is_sorted([_]). is_sorted([x,y|t]) :- x=<y, is_sorted([y|t]).

java - Can VisualVM be used for profiling Maven Projects? If yes then how? -

i want profile maven project using jvisualvm. in eclipse in run configurations there nothing running maven build in visualvm. next tried running visualvm application , profiling projects, jar files created when mvn -install choice of input. however, don't work. is there way generate functional profile of maven project. dont want know cpu usage , stuff, rather interested in execution flow of project i.e how methods being called , executed , when/where interacting (basically trace of program). if there other tools please feel free suggest. maven build tool . visualvm profiles java processes . running process can built maven , profiled visualvm, have no relation each other. visualvm profiler, it's not used trace execution of program except hotspots caught profiler.

python - Plot bar chart from pandas dataframe -

Image
i have following pandas dataframe plot nan , high values bar plot in matplotlib: df close 1 close 2 close 3 close 4 close 5 close 6 index nan 0.000348 0.000975 0.001450 0.001923 0.002483 0.002916 high 0.001416 -0.000215 0.000058 0.000026 -0.000766 -0.000255 the labels on x-axis shall column names. how can done? many in advance. you can plot transposed df: in [9]: import matplotlib ...: matplotlib.style.use('ggplot') ...: in [10]: df.t.plot.bar(rot=0) out[10]: <matplotlib.axes._subplots.axessubplot @ 0xa1ae240> with vertical labels: in [14]: df.t.plot.bar(width=0.85, alpha=0.6, figsize=(14,12)) out[14]: <matplotlib.axes._subplots.axessubplot @ 0xa3499e8>

html - PHP mail function doesn't complete sending of e-mail -

<?php $name = $_post['name']; $email = $_post['email']; $message = $_post['message']; $from = 'from: yoursite.com'; $to = 'contact@yoursite.com'; $subject = 'customer inquiry'; $body = "from: $name\n e-mail: $email\n message:\n $message"; if ($_post['submit']) { if (mail ($to, $subject, $body, $from)) { echo '<p>your message has been sent!</p>'; } else { echo '<p>something went wrong, go , try again!</p>'; } } ?> i've tried creating simple mail form. form on index.html page, submits separate "thank submission" page, thankyou.php , above php code embedded. code submits perfectly, never sends email. please help. there variety of reasons script appears not sending emails. it's difficult diagnose these things unless there obvious syntax error. without 1 need...

jenkins - Multiple pipeline jobs versus single large pipeline job -

i new jenkins pipeline , considering migrating existing jenkins batch use pipeline script. this may obvious question in know have not been able find discussion of anywhere. if have complex set of jobs, few hundred, best practice end 1 job large script or small number of jobs, parameterized, 5 10, smaller pipeline scripts call each other. having 1 huge job has severe disadvantage cannot execute single stages anymore. on other hand, splitting different jobs has disadvantage many of nice pipeline features (shared variables, shared code) cannot used anymore. not think there unique answer this. have @ following 2 related questions: jenkins build pipeline - restart @ stage run parts of pipeline separate job

javascript - Automatically alter/reset jQuery's position().left depending on class -

i making menu new website , has following css: margin: 20px 20px 0; f-nav class: .f-nav { position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; margin: 0 !important; /* <------------ problem */ -webkit-transition: 0.2s ease-out !important; -moz-transition: 0.2s ease-out !important; -o-transition: 0.2s ease-out !important; -ms-transition: 0.2s ease-out !important; transition: 0.2s ease-out !important; } so code use make menu fixed on top of page, giving class .f-nav . accounts fancy menu line moves on mouse hover, on menu items: window.onload = function () { "use strict"; var menu = $("#menu"); menu.append("<div id=\"menu-line\"></div>"); var foundactive = false; var activeelement; var lineposition = 0; var menuline = $("#menu #menu-line"); var linewidth; var defaultposition; var defaultwidth;...

angularjs - Angular Directive: Dependencies on directive vs dependencies on directive controller -

it seems there two ways declare dependencies re: directives directly on directive function call -- i'll call "directive directly" style: .directive('mycurrenttime', ['$interval', 'datefilter', function($interval, datefilter) {... on controller option of directive object returned function call -- i'll call "directive's controller" style: controller: ['$scope', function mytabscontroller($scope) {... what's difference? when should use "directive directly" style vs "directive's controller" style? here guesses: if use "directive directly" style, dependencies available link function. if use "directive's controller" style, controller allows "inter-directive communication" so that's conclusion: if need controller "inter-directive communication" ... and don't need dependencies available in link function... then use "dir...

c - OpenCL - Local Memory -

i understand whats difference between global- , local-memory in general. have problems use local-memory. 1) has considered transforming global-memory variables local-memory variables? 2) how use local-barriers? maybe can me little example. i tried jacobi-computation using local-memory, 0 result. maybe can give me advice. working solution: #define idx(_m,_i,_j) (_m)[(_i) * n + (_j)] #define u(_i, _j) idx(ul, _i, _j) __kernel void jacobi(__global value* u, __global value* f, __global value* tmp, value factor) { int = get_global_id(0); int j = get_global_id(1); int il = get_local_id(0); int jl = get_local_id(1); __local value ul[(n+2)*(n+2)]; __local value fl[(n+2)*(n+2)]; idx(ul, il, jl) = idx(u, i, j); idx(fl, il, jl) = idx(f, i, j); barrier(clk_local_mem_fence); idx(tmp, i, j) = (value)0.25 * ( u(il-1, jl) + u(il, jl-1) + u(il, jl+1) + u(il+1, jl) - factor * idx(fl, il, jl)); } thanks. 1) query cl_device_local_mem_size value, 16kb minimum , incre...

php - Can curl HTTPS but not HTTP -

i can do: curl https://feinternational.com/buy-a-website/9671-affiliate-e-commerce-survival-and-emergency-preparedness-34k-gross-mo but not: curl http://feinternational.com/buy-a-website/9671-affiliate-e-commerce-survival-and-emergency-preparedness-34k-gross-mo the difference http , https. why that? how can make curl follow redirect https without me have modify url manually? curlopt_followlocation => true, doesn't work. curl not follow redirect without -l option. looks website link shared has kind of rewritrule rewrite http pages https , hence not found error when curl . if there no rewriterule http , able curl url. if want use http https site, can use curl -l "http://feinternational.com/buy-a-website/9671-affiliate-e-commerce-survival-and-emergency-preparedness-34k-gross-mo" -l follows redirect. alternatively can write in php: curl_setopt($ch, curlopt_followlocation, true); where $ch = curl_init();

python 2.7 - User creation with unique constraint in Django Rest framework -

i researched in google, , have tried in lot of ways still not able right. here requirements: a 1 one field extending user model, has been achieved , new model called customer. now, new user 201 response returned not data serialized, date_of_birth coming in json format, want user in json response. if try add user username exists plays bad. trying try , except doesnt work. want response of 409 conflict sent if username exists. here userserializer.py: - from django.contrib.auth.models import user rest_framework import serializers class userserializer(serializers.hyperlinkedmodelserializer): new_username = serializers.serializermethodfield() class meta: model = user fields = ('url', 'pk', 'username', 'email', 'is_staff', 'new_username') extra_kwargs = { 'username': {'validators': []}, } def get_new_username(self, obj): return obj.username here ...