Posts

Showing posts from February, 2010

ms access - How to see the MDB deployed in Jboss 7 EAP -

i newbie in jboss. have deployed big war has lot of mdbs in jboss 7 eap. how can see them admin console? in wildfly 10 (which think used in jboss 7 eap) web console can access mdbs in deployment tab. open big war clicking "view" button) go subsystem > ejb3 > message-driven-bean. finally list of deployed mdbs , properties. (delivery active true/false, etc...)

mysql - sql insert into, select, where statement -

i want copy row hk_room table hk_history except row rstatus = '-' or rstatus='long stay' , rstatus = 'check out'. '-' default value rstatus attribute. i have tried these 2 query: insert hk_history (rno,rstatus,bs,bq,hk,ds,dq,pc,twl,fm,amt,db,mw,hkr,fo_r,svr,rdate) select rno,rstatus,bs,bq,hk,ds,dq,pc,twl,fm,amt,db,mw,hkr,fo_r,svr,rdate hk_room1; rstatus <> '-'; or insert hk_history (rno,rstatus,bs,bq,hk,ds,dq,pc,twl,fm,amt,db,mw,hkr,fo_r,svr,rdate) select rno,rstatus,bs,bq,hk,ds,dq,pc,twl,fm,amt,db,mw,hkr,fo_r,svr,rdate hk_room1; rstatus = 'long stay' , rstatus = 'check out'; but got error you have semicolon before where in first query: insert hk_history (rno,rstatus,bs,bq,hk,ds,dq,pc,twl,fm,amt,db,mw,hkr,fo_r,svr,rdate) select rno,rstatus,bs,bq,hk,ds,dq,pc,twl,fm,amt,db,mw,hkr,fo_r,svr,rdate hk_room1; -------------^ rstatus <> '-'; you need remove it. to achi

c++ - Why can't we declare a std::vector<AbstractClass>? -

having spent quite time developping in c#, noticed if declare abstract class purpose of using interface cannot instantiate vector of abstract class store instances of children classes. #pragma once #include <iostream> #include <vector> using namespace std; class ifunnyinterface { public: virtual void iamfunny() = 0; }; class funnyimpl: ifunnyinterface { public: virtual void iamfunny() { cout << "<insert joke here>"; } }; class funnycontainer { private: std::vector <ifunnyinterface> funnyitems; }; the line declaring vector of abstract class causes error in ms vs2005: error c2259: 'ifunnyinterface' : cannot instantiate abstract class i see obvious workaround, replace ifunnyinterface following: class ifunnyinterface { public: virtual void iamfunny() { throw new std::exception("not implemented"); } }; is acceptable workaround c++ wise ? if not, there third party li

javascript - Devextreme load time -

i testing devextreme widgets , have designed login screen. have 2 dx-field that, know, loaded after javascript code executed. think produces ugly effect because rest of page loads before 2 inputs (maybe 1 second). so, there way avoid problem , load inputs (and other widget) @ same time rest of web page? edit: put scripts @ end of body tag , see if change head, such dx demos, works. in case, load scripts @ end thank you.

javascript - With Webdriver, how do I click a button that has a data-bind 'mousedown' event? -

i using webdriverio , webdrivercss create visual regression test suite. the page testing has form submit button, however, when send try click on button, form not submitted. the html button below <div class="submit_jump_patch" data-bind="event: {'mousedown': $root.formsubmithandler }"> <input type="submit" name="journey_save" value="next" id="journey_save" class="btn btn_primary btn_large float_right full_width_m" data-bind="css : { 'spinner' : showspinner, 'disabled' : disablesubmit }, attr: { 'aria-busy' : showspinner() ? 'true' : 'false' }" aria-busy="false"> </div> i have tried following webdriverio commands: .click .movetoobject.click() .execute ( unfortunately unable change html doesn't require 'mousedown' event, , unsure why there in first place. try using selectorexecute browser.select

r - Adjusting for dividend and splits using quantmod -

i using quantmod adjust dividends , splits. seems work have found following problem: when adjusting sma(200,0) historical values wrong , correct date approaches current date. please see code below. stockdata <- new.env() #make new environment quantmod store data in symbols = c("iwm","spy","tlt","tsla") nr.of.positions<-3 getsymbols(symbols, src='yahoo',from = "2015-10-01",to = sys.date()) (i in 1:length(symbols)) { assign (symbols[i], adjustohlc(get(symbols[i]), adjust=c("split", "dividend"), use.adjusted=false, symbol.name=symbols[i])) } x <- list() (i in 1:length(symbols)) { x[[i]] <- get(symbols[i], pos=stockdata) # data stockdata environment x[[i]]$sma <-sma(cl(x[[i]]),10) x[[i]]$smalong <-sma(cl(x[[i]]),200) x[[i]]$adx<-adx(hlc(x[[i]]),10) x[[i]]$rsi <-rsi(cl(x[[i]]),14) x[[i]]$close <-(cl(x[[i]])) }

node.js - counter not running inside coffeescript createInterface function -

i want make function "countryipcounterstream" read large text file lines in format: 100575232 100577279 5.254.168.0 - 5.254.175.255 se - , calculate sum of absolute difference between numbers in 1st , 2nd column 4th column code == countrycode given function argument. problem in line: if line[3] == countrycode counter= +line[1]-+line[0] clause counter= +line[1]-+line[0] after "then" won't work! however, noticed if replace else, replaced part after "then" runs perfectly. example console.log line[x]. code followed: exports.countryipcounterstream = (countrycode, cb) -> return cb() unless countrycode heapusagebefore = process.memoryusage().heapused console.log "program init normally, " instream = fs.createreadstream "#{__dirname}/../data/geo.txt", 'utf8' console.log "streaming started" line_counter = 0 outstream = new stream instream.on('data', (chunk) -> conso

Python implementation of SAML2 protocol for app engine on Google cloud platform -

i tried pysaml2 , python-saml library on google cloud platform both internally using libraries using c extensions or python wrapper on c libraries incompatible app engine app engine blocks c implemented libraries in eco system. 1 has implemented saml2 protocol in appengine using python? pysaml2 documentation suggests pure python implementation uses library pycrytodome or cryptodome need _ctype library. below error: file "/home/***/anaconda2/lib/python2.7/ctypes/_init_.py", line 10, in <module> _ctypes import union, structure, array file "/home/***/sdks/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 963, in load_module raise importerror('no module named %s' % fullname) importerror: no module named _ctypes please suggest other approaches if possible. i figured out if want use c libraries in app engine environment. first of have use app engine flexible environment ins

javascript - Accessing an array from with an AJAX callback function -

i'm trying use ajax call update bunch of image elements on page. list of elements update held in array , urls assign each image retrieved php page via ajax. the code have below doesn't work because imagesarray[i] undefined when called callback function in ajax call - due asynchronous nature of javascript presumably. var imagesarray = document.getelementsbyclassname('swappableimages'); (i = 0; < imagesarray.length; i++) { var requesturl = "http://example.com/getanimageurl.php"; getdataviaajax(requesturl, function(data) { alert('img url=' + data.responsetext); imagesarray[i].src = data.responsetext; }); } function getdataviaajax(url, callback) { var request = window.activexobject ? new activexobject('microsoft.xmlhttp') : new xmlhttprequest; request.onreadystatechange = function() { if (request.readystate == 4) { request.onreadystatechange = donothing; callback(request, request.status);

Indexing PDF files using Solr and Tika -

i'm trying index pdf files using solr. included tika config file force use pdf parser, keeps using emptyparser. result, metadata returned correctly, content empty. it's important mention i'm using sole-word.pdf file not scanned pdf. what should pdf content in case please? this extractrequesthandle used: <requesthandler name="/update/extract" startup="lazy" class="solr.extraction.extractingrequesthandler" > <lst name="defaults"> <str name="lowernames">true</str> <str name="uprefix">attr_</str> <str name="captureattr">true</str> <str name="fmap.content">attr_content</str> <str name="literalsoverride">true</str> <str name="tika.config">./tika/tika.config</str> <str name="parsecontext.config"> <entries>

python - Image Resize with PIL -

input image size dimension (a,b) output image size (c,d) c> =k , d >= k example: input image(900,600) minimum dimension k= 400 then output image should (600,400) is there function pil.image achieve goal? you can't use usual "thumbnail", designed more usual requirement of having maximum dimension. instead can use "resize" method, after having computed wanted size. like: if image.width >= k , image.height >= k: if image.height < image.width: factor = float(k) / image.height else: factor = float(k) / image.width image.resize((image.width* factor, image.height * factor))

c++ - LLVM: Creating a CallInst with a null pointer operand -

i'm trying use llvm c++ bindings write pass generates following ir %1 = call i64 @time(i64* null) #3 @time here c standard library time() function. here's code i've written void pass::insert(basicblock *bb, type *timety, module *m) { type *timetype[1]; timetype[0] = timety; arrayref<type *> timetypearef(timetype, 1); value *args[1]; args[0] = constantint::get(timety, 0, false); arrayref<value *> argsref(args, 1); functiontype *signature = functiontype::get(timety, false); function *timefunc = function::create(signature, function::externallinkage, "time", m); irbuilder<> builder(&*(bb->getfirstinsertionpt())); allocainst *a1 = builder.createalloca(timety, nullptr, twine("a1")); callinst *c1 = builder.createcall(timefunc, args, twine("time")); } this compiles, results in following error when run incorrect number of arguments passed called function! %time = call i64 @time(i64

C++ Dynamic Constructor -

i'm getting error: no operator "[]" matches these operands for line: cout << a[j].display(n) but when take out [j] , i'm getting error: class "list" has no member "display" here code: class list { protected: int *p; // pointer list int size; // dimension public: list(int x) { size = x; p = new int[size]; } void get(int i, int val) { p[i] = val; } }; class dlist : public list { public: int display(int i) { return p[i]; } }; int main() { int n; cout << "enter elements in row\n"; cin >> n; list a(n); int j, val; (j = 0; j < n; j++) { cin >> val; a.get(j, val); } cout << "\n"; cout << "list of elements :\n"; cout << "----------------------\n"; (j = 0; j < n; j++) cout << a[j].display

groovy - sdkman changed leiningen, clojure path variable -

i've installed groovy language via recommended sdkman package , somehow path leiningen has messed i.e. can no longer (import '[clojure.string :as string]) without raising following error classnotfoundexception clojure.string.:as java.net.urlclassloader.findclass (urlclassloader.java:381) the basic lein repl command working fine otherwise clojure native-java libs only. how correct behavior? oh, turns out classpath problem and wrong way import alias had go .groovy/conf , add local ~/.m2/**/*.jar startup settings. sovled :)

php - MYSQL selecting all records with the most recent date -

Image
i have database stores history of transactions, comment updates. therefore, accept multiple records same id. what need pull in of records , display recent of each record. here example of 2 records same uid. highlighted record recent of 2. here 1 of queries attempted: select uid ,voyage ,max(comments) ,max(edituser) ,max(editdate) table group uid order uid here same uid returned: if you'll notice, recent user , editdate, it's not recent comment, should 'this test comment'. i have tried several queries, closest i've gotten returning recent of every record. i tried link: sql select record recent date but don't think need use joins in case, being in same table. again, strength not in mysql. i'm hoping can me providing correct (and better) query make work. with this, better off using sub-selects. select t1.uid, t1.voyage, (select comments table t2 t2.uid = t1.uid , t2.editdat

php - Empty fields can get inserted into my database -

i have following code. try use submit button insert code database, every time use , refresh browser, empty fields inserted database. <?php $servername = "localhost"; $username = "root"; $password = ""; //create connection $cn = new mysqli($servername, $username, $password, "milege"); //check connection if ($cn->connect_error) { echo "connection failed!". $cn->connect_error; } // once button clicked if (isset($_post['submitform'])) { //the values in boxes $name = $_post['fname']; $email = $_post['email']; $password = $_post['password']; $confpass = $_post['confpass']; $interest = $_post['interest']; $info = $_post['info']; //echo "connection successfully"; //insert table $sql = "insert miltb(name, email, password, interest, info, productorder) values('$name', '$email', '$password',

javascript - jQuery BlockUI + Vuejs + Webpack -

i creating vue directive work vuejs! have made work in other project made laravel + vuejs. now doing on pure front-end project have used vue-cli create project webpack! at first had problem make tooltip directive works , solved following code: tooltip-directive.js import vue 'vue' import _ 'lodash' const buildoptions = (config) => { return { ... title: config.title || '', ... } } vue.directive('pml-tooltip', { bind: function (el, binding) { let config = _.isstring(binding.value) ? buildoptions({ title: binding.value }) : buildoptions(binding.value) window.jquery(el).tooltip(config) }, unbind: function (el) { window.jquery(el).tooltip('destroy') } }) webpack.base.config.js ... plugins: [ new webpack.provideplugin({ $: "jquery", jquery: "jquery", "window.jquery": "jquery

polygon - Rendering non-simplified Mapbox Vector Tile using mapbox gl js -

i trying render mvt (mapbox vector tile) containing osm data using mapbox gl js, keep getting ugly polygons simplified (like in simplification section of documentation !). don't want polygons simplified. @ least best resolution close possible reality. first, checked if come osm data. osm data good. looked tile server , more precisely mvt encoder ( code ). extent value, controls how detailed coordinates encoded in vector tile, 4096. 4096 value. don't understand why don't proper polygons. i suppose issue comes mapbox gl js might perform additional simplification. what extent value use in encoder? there way configure resolution mapbox gl js ? i appreciate ! thanks! mapbox gl js not additional simplification on vector tile sources. if seeing simplified geometries, done during vector tile generation.

R convert dates into Julian days in a loop -

i have date year 1996 till 2014 need convert julian days. here example data: date<- c("21-jul", "14-jul", "08-jul", "08-jul","16-jul","22-jul", "10-jul", "02-jul", "06-jul","18-jul","24-jul", "15-jul", "03-jul", "04-jul","19-jul") year<-rep(1996:1998,each=5) dat<-as.data.frame(cbind(date,year)) dat$date<-as.character(dat$date) for each year, want convert date julian day i.e. day of year. used following function link: convert date without year julian day (number of days since start of year) for leap-year (e.g. 1996), can convert date julian day following: julian(as.date(paste0("1996-", ds$ds), format="%y-%d-%b"), origin=as.date("1996-01-01"))+1 for non-leap year (e.g. 1997), can convert date julian day following: julian(as.date(paste0("1997-", ds$ds), format="%y-%d

google api - Proximity Beacon API Register EID-Frame -

Image
i'm working google proximity beacon api, eid-frame. able register eid-frame taking type "eddystone", saved beacon id "beacons/3!beaconid". the api-reference says type of advertisedid should contain type "eddystone_eid" ( see here ). sadly, requests type error response (see picture). so if want resolve eid, should search beacon beacon-id "beacons/4!beaconid(eid)" ( see here ). since wasn't able register eid type, how able resolve it? for more information feel free comment. information in request pseudo values, except service_ecdh_puplic_key . when registering eddystone-eid, advertisedid field should valid eddystone-uid. see here: https://developers.google.com/beacons/proximity/register#register_an_eddystone-eid_beacon this uid forms beaconname , once eid registered.

Clickable Images for Python -

i'm entry level python coder looking create guess styled game. @ university, i've yet learn how import images , bind them fixed places on screen (resembling game board). there way click on specific image , have onclickevent occur, specific character(image) chosen. majority of coding abilities in python, skeptical if best possible language project in. every gui has button widget clicable , (mostly) can display image. but in gui can assign click event every object ie. label image . ie. tkinter import tkinter tk pil import image, imagetk # --- functions --- def on_click(event=none): # `command=` calls function without argument # `bind` calls function 1 argument print("image clicked") # --- main --- # init root = tk.tk() # load image image = image.open("image.png") photo = imagetk.photoimage(image) # label image l = tk.label(root, image=photo) l.pack() # bind click event image l.bind('<button-1>', on_cli

encryption - Does firebase encrypt data with a unique key per account? -

so , know firebase encrypt data @ rest according this question . question use unique key per account , keys stored. more compliance concern. firebase relies on google cloud platform's default encryption @ rest . data not encrypted account-specific key.

vector - Counting number of appeareances of a certain value in r -

let's have vector a <- c(1,2,3,4,1,5,6,1,7) , want function return number of repetitions of each value. results want c(1,1,1,1,2,1,1,3,1) - because number 1 being repeated 3 times. the second question - how function return c(1,0,0,0,2,0,0,3,0) values above? count elements being repeated , others 0? thank you! you can use ave function: ave(rep(1, length(a)), a, fun=cumsum) # [1] 1 1 1 1 2 1 1 3 1 following @lmo's comment, second part: alldups <- duplicated(a) | duplicated(a, fromlast = true) res <- ave(rep(1, length(a)), a, fun=cumsum) res[!alldups] <- 0 # [1] 1 0 0 0 2 0 0 3 0

java - (Oracle + Hibernate): How to avoid temporary table creation during bulk operations? -

i have scenario hibernate trying create temporary tables during bulk operations. but, unfortunately, user not have privelege create tables. this causing application crash. i have tried override particular method in dialect: @override public boolean supportstemporarytables() { return false; } but, still not work. do have option suppress temporary table creation? no, problem different, 'duplicate' question says: "is there way create them once time ?". in case, want totally avoid creation of temporary tables. user not having privelege create tables on schema @ all. insert , delete or update.

How to remove entity declarations from XML in PHP -

i'm trying remove <!entity definitions xml file without success, thought using following snippet output contain no traces of entity definitions i'm wrong. how can achieve goal? i no error message beside domdocument::loadxml(): xmlns: uri &ns_svg; not absolute in entity a little context: i'm embedding svg inside another, <!entity gives me kind of problem, i'm thinking of using libxml_noent , deleting <!entity definitions. the php: <?php header('content-type: text/plain'); $str = file_get_contents(dirname(__file__) . '/test2.svg'); $document = new domdocument(); $document->loadxml($str); foreach ($document->doctype->entities $entity) { $entity->parentnode->removechild($entity); // thought remove <!entity declaration } echo $document->savexml(); // --> want xml without <!entity ns_svg "http://www.w3.org/2000/svg"> , <!entity ns_xlink "http://www.w3.org/1999/xlink&q

fonts are not loading for NativeScript on ios -

fonts not loading on iphone simulator. followed instructions listed https://docs.nativescript.org/ui/styling#using-fonts . however, fonts got loaded android, not ios. code: label { font-family: opensans-regular; } i have added font opensans-regular app/fonts folder. ios looking font name , not font file name . in order font appear in ios need refer original font name. sdee original font-name under macos open font font book application , see name @ top in center. think original name looking "open sans" (without -regular) your code work if keep original font name , change css following code .icon { font-family: 'open sans'; font-size: 48; }

javascript - Submit without submit button after sweetalert message - Laravel -

html: <form class="btn btn-danger fa fa-trash easy delete" method="post" action="/administrator/slidenamedelete/{{$slidephotos->id}}"> {{ csrf_field() }} <input type="hidden" name="_method" value="patch"> <input type="hidden" name="md_photo" id="md_photo" class="form-control" value=""> </form> jquery: <script type="text/javascript"> $(document).ready(function(){ $("form.delete").click(function(){ swal({ title: "are sure?", text: "you not able recover imaginary file!", type: "warning", showcancelbutton: true, confirmbuttoncolor: "#dd6b55", confirmbuttontext: "yes, delete it!", cancelbuttontext: "no, cancel plx!", closeonconfirm: false, closeoncancel: false }, function(isconfirm){ if (isconfirm) {

c++ - YAML-cpp null string parsing? -

how code parse "" string (or recognize not acceptable string)? using this yaml-cpp library verified treats nodetype::value() , not nodetype::null . std::string getfilepath() { yaml::node nodevalue = node["filepath"]; if(nodevalue.type() == yaml::nodetype::value()){ return nodevalue.as<std::string>(); //breaks here } return ""; } in .yaml file, entry listed filepath: "" yaml::nodetype does not include more specific variable types value() , null . here's specific error: terminate called after throwing instance of 'yaml::typedbadconversion<std::string>' what(): bad conversion the work-around have figured out far try-catch block.

c++ - boost:scoped_ptr with legacy C functions that takes char* as input type? -

i new boost library , started exploring @ work new project. want understand how scoped_ptr boost works? till using raw pointers in our codes , propsed use smartpointers make memory management easy. our programming not pure c++ language integrated application language. example trying understand how can initialize scoped_ptr null , pass raw pointer application api. consider code below this api application toolkit takes arguments this int some_api_func(int obj, const char* prop, char** cvalue); i cannot change api because not published. now parameter cvalue want use smart pointer memory management automated since api dynamically allocates memory , assigns value , returns. we tried scoped_ptr declaring this boost::scoped_ptr<char*> pcvalue(new char*()); and used in api like some_api_func(obj, prop,&*cvalue); my question if cvalue allocated malloc internally inside api happens since scoped_ptr using delete ? delete clean memory properly? how validate mem

Select random items from list of lists in Python -

i have list of lists of different lengths. each list of lists, need randomly select 10 items. have combine results in single list each list item separated comma. (pls see output below). not sure whether possible in python. appreciated. [[-26.0490761 27.79991 ] [-25.9444218 27.9116535] [-26.1055737 27.7756424] ..., [-26.036684 28.0508919] [-26.1367035 28.2753029] [-26.0668163 28.1137161]] [[ 45.35693 -63.1701241] [ 44.6566162 -63.5969276] [ 44.7197456 -63.48137 ] ..., [ 44.624588 -63.6244736] [ 44.6563835 -63.679512 ] [ 44.66706 -63.621582 ]] i output in format suitable plotting them on map using folium. [[-26.0490761 27.79991], [-25.9444218 27.9116535], [ 44.6563835 -63.679512 ], [ 44.66706 -63.621582 ]] i tried code not sure went wrong: cluster in clusters: in range(2): modifiedlist.append(cluster) something easy using module random : import random def samplefromlists(lists,n): """draw

tsql - Calculating Running Balances -

i struggling how calculate running balance dynamic. here's have. a range of periods intersection between total duration , each month in duration. a rate applied @ each intersection. an initial amount a need calculate running balance based on initial amount less rate applied in period. for example, have project worth $2,500,000 8 months long. rates each interval follows: 1. 8.10% 2. 14.04% 3. 26.8% 4. 29.1% 5. 33.4% 6. 30.4% 7. 47.4% 8. 100% for period 1 have $202,500 (8.10% × $2.5 million), period 2, have $322,500 (14.04% × $2,297,500 ($2.5 - $202,500)), period 3, have $530,000 (26.8% × $1,974,999 ($2.5 - sum of first 2 periods ($525,000)). @ end of period 8, balance $0 , earned amount = $2.5 million. can use runningtotal = sum(monthlyamts) on (order xx rows unbounded preceding), order period ? or candidate cursor? thanks in advance! it depends on table structure. sounds should use function. if years use table valued function, if interested on result use

javascript - initMap is not a function - map not rendering. Google Maps API - JS -

Image
i experiencing known issue initmap not function , don't see how solve it. i've tried various methods recommended in other questions none of them work. plausible solution found involving usage of angularjs trying accomplish script without it. here html code: <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> <script async defer src="https://maps.googleapis.com/maps/api/js?key=xxxxxx&callback=initmap"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-tc5iqib027qvyjsmfhjomalkfuwvxzxupncja7l2mcwnipg9mgcd8wgnicpd7txa" crossorigin="anonymous"></script> <script src ="script.js" /> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" in

java - How to manage session timeout expired -

i have following trouble. spring application configured in following way: application context security <http use-expressions="true" pattern="/ext/**" entry-point-ref="loginurlauthenticationentrypoint"> //others configuration <session-management invalid-session-url="/sessionexpired"> </session-management> </http> my controller: @requestmapping(value="/sessionexpired", method = requestmethod.get) public string sessionexpired(modelmap model, httpsession session) { return "login"; } now problem in method sessionexpired should able differentiate property of user example: @requestmapping(value="/sessionexpired", method = requestmethod.get) public string sessionexpired(modelmap model, httpsession session) { //test1 authentication auth = securitycontextholder.getcontext().getauthentication(); myuser u = (myuser) authentication.getprincipal(); /

Jmeter - How to check if less than 10 stylesheets are loading when I open a web page -

Image
i have requirement need verify when open web page, there should less 10 stylesheets , less 20 .js loading. there way in jmeter? it is, need scripting. example solution: add beanshell assertion child of http request need test. put following code beanshell assertion "script" area: import org.apache.jmeter.samplers.sampleresult; int js, css; js = css = 0; (sampleresult subresult : sampleresult.getsubresults()) { if (subresult.geturlasstring().endswith(".css")) { css++; } else if (subresult.geturlasstring().endswith(".js")) { js++; } } log.info("js files: " + js); // can comment or remove these lines log.info("css files: " + css); // nothing print numbers jmeter.log if (css > 10 || js > 20) { failure = true; failuremessage = "exceeded maximum scripts/styles"; } if of specified thresholds met, sampler failed relevant message: more information on conditional

mysql - How can I display data from two unrelated tables? -

Image
i have 2 unrelated tables in mysql database. want select , display data both of them. as example, tables looks this: i display results on site, organised alphabetically, this: the id each table used refer photo of cat or dog. haven't had luck join statements, union work in scenario? any appreciated. select alpha, name, convert(cat_id, char(50)) cat_id, '' dog_id cat union select alpha, name, '' cat_id, convert(dog_id, char(50)) dog_id dog order alpha a few comments: strictly speaking, if want show empty string missing cat or dog ids, need cast cat_id or dog_id columns char , because values in column need same type. it not necessary wrap union query use order by , sort alpha column, rather can add order by end.

xcode - Do you know a good tutorial for helping me to learn to introduce to my app the facebook login button? -

can me tutorial or codes , please? there many resources should authentic resource integral step of website or application. order according authenticity. 1) https://developers.facebook.com/products/login 2) https://code.tutsplus.com/tutorials/quick-tip-add-facebook-login-to-your-android-app--cms-23837 3) https://www.tutorialspoint.com/php/php_facebook_login.htm

plot - How to dynamically create multiple charts on one User Control -

i created user control , have graph drawn on it. problem need multiple channels in sync. adding control , adding plot each control. need 9 channels, , i'd able have user determine how many channels using 1 control. i thought make array below keeps crashing: readonly plotarea[] linegrapharea = new plotarea[2]; this.linegrapharea[0].width = this.wrapperplot.width - 100; this.linegrapharea[0].height = this.wrapperplot.height - 2; this.linegrapharea[0].top = this.wrapperplot.top + 2; this.linegrapharea[0].left = this.wrapperplot.left + 6; this.linegrapharea[0].backcolor = backgroundcolor; this.controls.add(this.linegrapharea[0]); i know this: readonly plotarea linegrapharea1 = new plotarea(); readonly plotarea linegrapharea2 = new plotarea(); readonly plotarea linegrapharea3 = new plotarea(); but i'm sure there's got easier more efficient way of doing this.

lets encrypt - Letsencrypt how to use --preferred-challenges -

this command: $ letsencrypt certonly --manual --preferred-challenges dns --email foo@bar.com --domains test001.bar.com outputs: letsencrypt: error: unrecognized arguments: --preferred-challenges dns from documentation here: https://certbot.eff.org/docs/using.html#certbot-command-line-options i find: --preferred-challenges pref_challs sorted, comma delimited list of preferred challenge use during authorization preferred challenge listed first (eg, "dns" or "tls- sni-01,http,dns"). not plugins support challenges. see https://certbot.eff.org/docs/using.html#plugins details. acme challenges versioned, if pick "http" rather "http-01", certbot select latest version automatically. (default: []) why error? found a

java - Scalr image resize changes background color on output -

Image
i using scalr resize images. have problem images. scalr changing color of resized image. in short, outline of code. read file byte array: bufferedimage image = imageio.read(bis); then resize image using scalr: scalr.resize(image, scalr.method.ultra_quality, scalr.mode.automatic, targetwidth, targetheight); then, write output file: bytearrayoutputstream baos = new bytearrayoutputstream(); imageio.write(bufferedimage, extension, baos); the type of image before , after resizing same , equals type_4byte_abgr. original image: image after resize:

How to use linux library functions in C user program? -

i looking use init_bch , encode_bch , decode_bch available in linux library source code bch.c ( http://lxr.free-electrons.com/source/lib/bch.c ) can write user program like int main() { ret = init_bch(args); return 0; } i think need somehow make shared object , link while building c source. side question: bch.c source precompiled , linked shared object (perhaps libc.so or libm.so) that code part of kernel, , not compiled kernel default. (it used on embedded systems bch encoding/decoding required access raw nand flash devices.) on systems, not accessible userspace. if need functions in program, can copy file own program , use minor modifications. (keep in mind require license program under gplv2.)

What is the scope of variables in JavaScript? -

what scope of variables in javascript? have same scope inside opposed outside function? or matter? also, variables stored if defined globally? i think best can give bunch of examples study. javascript programmers practically ranked how understand scope. can @ times quite counter-intuitive. a globally-scoped variable var = 1; // global scope function one() { alert(a); // alerts '1' } local scope var = 1; function two(a) { alert(a); // alerts given argument, not global value of '1' } // local scope again function three() { var = 3; alert(a); // alerts '3' } intermediate : no such thing block scope in javascript (es5; es6 introduces let ) a. var = 1; function four() { if (true) { var = 4; } alert(a); // alerts '4', not global value of '1' } b. var = 1; function one() { if (true) { let = 4; } alert(a); // alerts '1' because 'let' keyword uses block scoping } intermedia

python - make a copy of dataframe inside function without changing original -

i'm trying create function can change values of dataframe copy without changing original dataframe. have far: def home_undervalued(df): local_df = df local_df['total_games'] = 0 local_df['total_wins'] = 0 cond_1 = local_df['predicted_spread'] > local_df['vegas_spread'] cond_2 = local_df['actual_spread'] > local_df['vegas_spread'] cond_3 = local_df['predicted_spread'] - local_df['vegas_spread'] >= 3 local_df.loc[cond_1 & cond_3 , 'total_games'] = 1 local_df.loc[cond_1 & cond_2 & cond_3 , 'total_wins'] = 1 total_games = sum(local_df.total_games) total_wins = sum(local_df.total_wins) return float(total_wins) / float(total_games) i call function with home_undervalued(df) it seems work, realize values df['total_games'] , df['total_wins'] have changed. i'm trying change values local_df, preserve values df. idea

android - Fragment duplicate tab Layout -

Image
i have fragment have 3 tabs in, after came homefragment activity it's same have duplicate layout please inform me if i'm doing wrong ? homefragment.class public class homefragment extends fragment { public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); } public view oncreateview(layoutinflater inflater , viewgroup container , bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_home,container,false); // [start tabs] toolbar toolbar = (toolbar) rootview.findviewbyid(r.id.toolbar_fragment); //toolbar.setnavigationicon(android.r.drawable.ic_menu_preferences); ((appcompatactivity) getactivity()).setsupportactionbar(toolbar); ((appcompatactivity) getactivity()).getsupportactionbar().setdisplayoptions(actionbar.display_show_custom); ((appcompatactivity) getactivity())

javascript - i want to show only some FAQ categories on CMS page magento -

im trying put faq's categories on cms page on magento. actually im using padoo faq module im im trying put working next code, used in cms page layout (xml) <reference name="content"> <block type="faq/faq" name="faq" template="padoofaq/faq.phtml"> <block type="faq/faq" name="faq.group" > <action method="settemplate"> <template>padoofaq/faq_group.phtml</template> <action method="setgroupid"> <category_id>3</category_id> </action> </action> </block> </block> </reference> im working on next code trying call 1 category, without sucess... <action method="setgroupid"> <category_id>3</categ

Save audio bytes in java -

here problem, i'm regularly receiving audio bytes library, write them bytearrayoutputstream and, after typing cmd, saving wav file. the problem bytearrayoutputstream creating memory leaks because it's there (private variable) and, because reset doesn't free memory, i'm stuck. i know there better way, don't know is. ps: getbytes(byte[] audio) called library. example: public class gettinginfos() { private bytearrayoutputstream allinfos; public void getbytes(byte[] audio) { allinfos.write(audio); } public void endrecord() { bytearrayinputstream bais = new bytearrayinputstream(allinfos.tobytearray()); audioinputstream ais = new audioinputstream(bais, recordbotarh.output_format, allinfos.tobytearray().length); audiosystem.write(ais, audiofileformat.type.wave, new file("file.wav")); //i tried both of these solutions allinfos.reset(); allinfos = null; } }

Syntax error in Prolog regarding <> -

i have prolog code must calculate successor of number, number being represented in list. problem code generates "syntax error: operator expected" error on -n<>0 part of code. searched everywhere equivalent of <>, how find everywhere , how learned in class. should change fix error? %successor of number represented on list %[1 9 3 5 9 9]-->[1 9 3 6 0 0] %domains % el=integer % list=el* %predicates % add_fn(el,list,list) % inverted(list,list) % succesor(list,list) % suc(list,list,integer) %clauses add_fn(e,[],[e]). add_fn(e,[h|t],[h|l]):-add_fn(e,t,l). inverted([],[]). inverted([h|t],l):-inverted(t,l1),add_fn(h,l1,l). succesor([],[]):-!. succesor(l,r):-inverted(l,lm),suc(lm,s,1),inverted(s,r). suc([],[],_):-!. suc([h|t],[h|l],n):-n=0,!,suc(t,l,0). suc([h|t],[m|l],n):-n<>0,!,s=h+n,m=s mod 10,n1=s div 10,suc(t,l,n1).

mysql - Get user's highest score from a table -

i have feeling simple question maybe i'm having brain fart right , can't seem figure out how go it. i have mysql table structure below +---------------------------------------------------+ | id | date | score | speed | user_id | +---------------------------------------------------+ | 1 | 2016-11-17 | 2 | 133291 | 17 | | 2 | 2016-11-17 | 6 | 82247 | 17 | | 3 | 2016-11-17 | 6 | 21852 | 17 | | 4 | 2016-11-17 | 1 | 109338 | 17 | | 5 | 2016-11-17 | 7 | 64762 | 61 | | 6 | 2016-11-17 | 8 | 49434 | 61 | now can particular user's best performance doing select * performance user_id = 17 , date = '2016-11-17' order score desc,speed asc limit 1 this should return row id = 3. want single query run able return 1 such row each unique user_id in table. resulting result this +---------------------------------------------------+ | id | date

javascript - Store Data (High Score) in my app -

i developed clicker program when click on button strata counting clicks , after 15 seconds button goose disabled , want **how clicked in 15 seconds store high score , when cross high score store new high score show on same activity ** you can save , check high score using sharedpreferences. this: these lines under set_contentview @ start: string prefs_game ="your package name"; sharedpreferences sp = getsharedpreferences(prefs_game,context.mode_private); final integer oldrec = sp.getint("record",0); then write code in setonclicklistenre: if (newrec>oldrec){ sp.edit().putint("record",new rec).commit(); toast.maketext(mainactivity.this,"your new record :"+newrec, toast.length_short).show(); }

Obtaining deep and REM sleep data from the Jawbone UP API? -

i realize may have been asked before previous comment/question never answered :( any update on jawbone including rem sleep details in sleep phases/ticks response? jawbone app shows phases of sleep evening sleep event (awake, light, rem, deep/sound) i'm confused why endpoint doesn't return same data (it includes light, deep/sound combined, , awake)?

javascript - Scatter Plot Points lose color when using boost.js for Highcharts -

i've been trying figure out why colors of each point on scatter plot disappear when using boost.js module highcharts. need boost.js module because amount of points generating great web site's performance diminished without using boost.js. i made fiddle simulate trying accomplish. if comment out boost.js script reference in fiddle see colors each point on scatter plot way trying achieve notice performance on website poor. i need performance boost.js offers while still maintaining colors of each scatter plot point. so question is, how keep colors each point while maintaining performance? update: without boost.js https://jsfiddle.net/rtunis/9rldfzq7/4/ with boost.js https://jsfiddle.net/rtunis/9rldfzq7/3/ javascript: var data = []; (var = 0; < 350; i++) { (var j = 0; j < 350; j++) { var point = { datum: i, y: i, x: j, color: "hsla(" + math.floor((math.random() * 100) + 1) + "

jquery - Grouping by matching div value with query -

i getting total of div values fine, not sure how breakdown of values. how many of each div value match. static example under breakdown. <h2>prices</h2> <div id="price1" class="price">125.95</div> <div id="price2" class="price">312.00</div> <div id="price3" class="price">560.00</div> <div id="price4" class="price">100.00</div> <div id="price5" class="price">125.95</div> <div id="price6" class="price">100.00</div> <div id="price7" class="price">125.95</div> <div id="price8" class="price">560.00</div> <div id="price9" class="price">100.00</div> <div id="price10" class="price">100.00</div> <div id="totalprice"></div> <h2>breakdow

c# - Display 4 picturebox 1 by 1 -

so have button , 4 pictureboxes , when click button want add on first picturebox 1 picture , if click button second time want make picturebox2 = picturebox1 , picturebox1 = new image , on until 4 did far it's not working, shows me on 4 pictureboxes same image: namespace imageuploadandcamerause { public partial class form1 : form { image file; image file2; image file3; image file4; bool button1click = true; bool button1click2 = true; bool button1click3 = true; bool button1click4 = true; public form1() { initializecomponent(); } private void button1_click(object sender, eventargs e) { openfiledialog f = new openfiledialog(); f.filter = "image files (*.jpg, *.jpeg, *.jpe, *.jfif, *.png) | *.jpg; *.jpeg; *.jpe; *.jfif; *.png"; bool isnullorempty1 = false; bool isnullorempty2 = false; b

css - How would I change my SVG color with media queries? -

i need change logo color black, instead of white, when screen small 992px. easier showing , hiding 2 different images, think. i tried adding in .svg file style tags, seems use white fill , doesn't affected screen resize. <style type="text/css"> .logo-color{fill:#ffffff;} @media (min-width: 992px) { .logo-color { fill:#000000; } } </style> <path class="logo-color"...etc.. thanks help. edit: i should state i'm calling this, if makes difference: <img src="css/img/logo.svg" alt="logo" width="150" style="width:150px;"> i imagine there different approaches here one: as per @media query, when screen width shrinks less 992px , logo change black image on white background white image on black background. svg { width: 414px; height: 96px; fill: rgb(0,0,0); background-color: rgb(255,255,255); } @media screen , (max-width:992px) { svg

Visual Studio - .Net - Partial Service Reference (referente.cs) -

i'm working on single-app-multi-team environment , struggling each other's developments , wasting lot of time managing versions when have concurrent developments on same component. big problem our version control system (that works file versions, rather differences between versions), no way gonna change of time soon. to avoid making classes partial. wondering if there's way of making referente.cs of service referente automaticaly partial. or if there's way of running kind of code during or after "update service referente" job.

How to use function input to order a column in my function [R] -

i have spent lot of time on getting syntax down without success, put away revisiting class of object not data.frame, read in using read_csv{readr} (and hunch important. class(tt) [1] "tbl_df" "tbl" "data.frame" below original post: its easier show mean. note: can if statement work, want sort column heart attack. test <- function(state,output) { if ((state %in% unique(tt$state)) & (output %in% names(tt)[3:5])){ tt2 <- subset(tt, tt$state==state) #tt3 <- tt2[order(tt2$output),] #tt3$`hospital name`[1] print(head(tt2)) } else print("yenoo") } and output: > test("al","heart attack") # tibble: 6 × 5 `hospital name` state `heart attack` `heart failure` pneumonia <chr> <chr> <dbl> <dbl>