Posts

mysql - SQL Join issue with two tables -

select tablea.z, count(tablea.z), count(tableb.y) tablea join tableb on tablea.y = tableb.y group tablea.z; i'm trying count(tableb.y)/count(tablea.z) . each 1 works fine when find them individually when join tables shown above, count(tablea.z) turns count(tableb.y) . any tips? you need able evaluate 2 table counts independently of each other: i may have trying count wrong, hope helps give idea on going on select a.z, a.numrows / b.numrows calc -- perhaps error checking avoid /0 error (select z, count(*) numrows tablea group z) join (select z, count(*) numrows tableb group z) b on a.z = b.z

Select folder with current date in jBASE -

im stuck have created folder current date (e.g test.20160419) , want select folder , copy records in folder through jbase command. can me in this. you need use copy (jbase knowledgebase) command trying achieve. for specific scenario, assuming want copy records src.table table test.20160419, command should be: copy src.table test.20160419 if need copy of records in src.table can select (jbase knowledgebase) before so select src.table @id = "a]" 3 records selected >copy src.table test.20160419 this copy selected files (in case starting a).

angularjs - what's the difference for the controller arguments, one is wrapping services and return function in a array -

what's difference controller arguments, 1 wrapping services , return function in array, it seems type 1 obeys dry principle. i don't meaning of difference between following 2 syntax? type 1 app.controller("userctrl", ['$scope', '$http', '$resource', 'users', 'user', '$location', function($scope, $http, $resource, users, user, $location) { .... }]); type 2 app.controller("userctrl", function($scope, $http, $resource, users, user, $location) { .... }); difference how angular find dependencies. with type 1, angular uses string find dependencies, can have own parameter names. i.e. app.controller("userctrl", ['$scope', '$http', '$resource', 'users', 'user', '$location', function(s, h, r, us, u, l) { .... }]); with type 2, angular uses parameter names find dependencies, can't use whatever name like, otherwise, angul...

azure - How frequently the Traffic Manager monitors endpoints -

Image
how traffic manager monitors endpoints? it's obvious it's not event driven (when endpoint down takes up-to 30 secs - 2.5 mins identify status of endpoint per observations). can configure frequency, cannot see configuration this. is there relationship between traffic manager monitoring interval , ttl? this may general question, real issue experience service downtime in fail on scenario (fail on of primary). understand effect in ttl until client dns cache expires calling cached endpoint. spent lot of time on , have narrowed down specific question. issue there delay in traffic manager identifying endpoint status after it's stopped or started. need logical explanation this, not find azure reference explains this. traffic manager settings i need understand delay , plan down time. i have gone through same issue. check link, explains monitoring behaviour traffic manager monitoring the monitoring system performs get, not receive response in 10 seco...

Multi-line regex with multiple matches and negative conditions in python -

i reading text file , attempting capture 1 of arguments of each distinct tag, has not been commented out. more specifically, have following input... maybe there text \thistag[arg1=1,argtwo]{want0} % \thistag[arg1=1,argtwo]{notwant} % blah blah \thistag[arg1=1,argtwo]{notwant} \thistag[arg1=1,argtwo]{want1}\thistag[arg1=1,argtwo]{want2}\\stuff \sometag{stuff don't want}[{\thistag[arg1=1,argtwo]{want3}}]{more stuff don't want} \thistag[arg1=1,argtwo]{obv_want} i want following output want0 want1 want2 want3 obv_want so far have following code, doesn't accomplish want with open(target, "r") ins: f = re.findall(r'^(?:[^%])?\\thistag\[.+\]{(.+?)}(?:{.+})?', ins.read(),re.multiline) you regex line line filtering out ones start % : import re res = [] open('test.txt') f: res = sum([re.findall('\\thistag\[.*?\]{(.*?)}', line) line in f if not line.startswith('%') ], []) p...

java - Loop prints output twice after initial loop -

**removed code prevent copying ongoing assignment problem - loop prints output twice the problem s.nextint() command reads int value. when continue reading s.nextline() "\n" enter key. skip have add s.nextline() . hope should clear now. try that: system.out.print("insert number: "); int number = input.nextint(); input.nextline(); // line have add (it consumes \n character) system.out.print("text1: "); string text1 = input.nextline(); system.out.print("text2: "); string text2 = input.nextline();

java - Merge Sort on Object Linked List (ascending order) -

i working on homework assignment , after days of effort cannot figure out why, after mergesort implemented, list contains last object in linked list. not output entire linked list, last object. how can change code stop list turning null after 1 object. please note: though call them cubes, know not since have random lengths, widths, , heights. assignment specifies called cubes, these random data fields. please ignore this. public class sortingcubes { public static void main(string[] args) { system.out.println(" "); system.out.println("-----my linked list-----"); cube headcubell = new cube(); //create head cube int llnum = 5; //change number of linked list items desired here for(int = 0; < llnum; i++) { headcubell.length = math.random() * 99 + 1; //create random l,w,h each cube (between 1-100) headcubell.width = mat...