Posts

Showing posts from February, 2013

Which Android devices support multiple Bluetooth Low Energy reading and writing at the same time? -

i writing android app allow connecting 2 bles @ same time, can send signal write , read 2 bles @ same time also. (after testing) it's working fine asus memo pad 7 (4.4.2) , samsung s4, not moto g (4.4.4) , nexus 7 disconnected 1 , wrote other when tried write both @ same time. don't want set delay between both devices because want signal both long user keep pressing button. 4 device tested right now. did know why it's not working devices? hardware issue? how know android devices support read , write multiple ble @ same time? you have test each device information, no other way. ideally on moto g , nexus 7 should have worked also. there lots of changes in ble frameworks on android 5.1 google. think device supporting 5.1 should allow multiple device read/write operations.

linux - Can't run a script -

i tried create script in linux, on synology server on ssh so wrote file test.sh #!/bin/bash echo "this test" i saved file. after did chmod 755 test.sh the did ./test.sh then got error -ash "./test.sh" not found the file created in /root i don't understand your shell (ash?) trying execute script , getting enoent (no such file or directory) error code back. can refer script itself, in case refers interpreter named in #! line. that is, /bin/bash not exist , that's why script couldn't started. workaround: install bash or (if don't need bash specific features) change first line #!/bin/sh .

javascript - Sum of individual arrays inside two-dimensional array -

i'm @ wit's end when comes adding individual sums of arrays inside two-dimensional array. example: var arrarrays = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; function sumarray(numberarray) { var sum = 0; numberarray.foreach(function(a,b) { sum = + b; }); return sum; } the function sumarray can add & return sum of regular (one-dimensional array), when passed arrarrays returns single array of random-looking values. i need able return sums of many arrays inside array. reason being because need next function call sumarray(): function sumsort(arrayofarrays) { arrayofarrays.sort(function(a,b) { var sumarray1 = sumarray(a); var sumarray2 = sumarray(b); if (sumarray1 < sumarray2) { return -1; } else { return 0; } }); } sumsort() will, theoretically, order arrays based on sum of numbers inside each array (descending highest lowest). any tips awesome. thank in advance! this method allow handle arrays of nested dept...

javascript - Trouble with Autolinker.js: Cannot read property 'assign' of undefined -

i'm using greg jacob's autolinker.js on twitter api call. no matter place code autolinker.link() code can't seem work. i've tried passing string variable , more defined document...innerhtml , neither seem work. here's code stands now: <blockquote id="tweets"></blockquote> <script src="autolinker.js"></script> <script> // api call function tweetsapi( data ) { var tweets = data.statuses.length; var n = math.floor(math.random() * ((tweets - 1) - 0 + 1)) + 0; var string = data.statuses[n].text + other twitter data; document.getelementbyid("tweets").innerhtml = string; document.getelementbyid("tweets").innerhtml = autolinker.link(document.getelementbyid("tweets").innerhtml); } </script> shouldn't data defined time autolinker.js picks up? odd, using minified version of code fixed problem.

SQLite not loading data upon activity starting in android -

problem: user matched user, , game begins. user given words, taken sqlite database. problem is, when activity starts, area words should empty. log not show errors. here relevant code. the database class words kept: public class wordslistdatabasehelper extends sqliteopenhelper { protected static set<string> mselectedwords; private static final string db_name = "game_table"; private static final int db_version = 1; protected static linkedlist<string> mcopy; public static int gamenumber = 0; wordslistdatabasehelper(context context) { super(context, db_name, null, db_version); } @override public void oncreate(sqlitedatabase db) { db.execsql("create table game (" + "_id integer primary key autoincrement, " + "selected_words text, " + "game_number integer);" ); collection<string> wordlist = new linkedlist<string>(); msele...

Need help understanding Math in C++ -

Image
hey guys doing credit program , run every input use ends 1. can point me right direction on messed please , thank you #include<stdio.h> #include<math.h> #define euler 2.718282 #define pi 3.141593 int main(void) { int n; int n_fact(int n); printf("enter n: "); scanf_s("%d", &n); while (n < 0) { printf("the n value must not negative"); printf("enter value of n: "); scanf_s("%d", &n); } printf("n! stirling approximation value %i %i ", n, n_fact(n)); getchar(); getchar(); return 0; } int n_fact(int n) { if (n == 0) { return 0; } else { return (int)(1 + 1 / (12 * euler) + 1 / (288 * n*n) - 139 / (51840 * n*n*n)); } } you having problems here because of integer arithmetic, particularly integer division: return (int)(1 + 1 / (12 * euler) + 1 / (288 * n*n) - 139 / (51840 * n*n*n))...

android - Multi-device Bcrypt library for delphi XE8 -

i able find 2 bcrypt libraries can compiled windows struggling compile them android in delphi xe8. the first 1 https://github.com/chinshou/bcrypt-for-delphi doesn't require modifications compiled windows. for second 1 https://github.com/ponypc/bcrypt-for-delphi-lazarus-fpc had make minor adjustments in checkpassword function same result since freepascal specific: function checkpassword(const str: string; const hash: ansistring): boolean; var regexobj: tregex; match : tmatch; salt : string; begin regexobj := tregex.create('^\$2a\$10\$([\./0-9a-za-z]{22})',[roignorecase]); match := regexobj.match(hash); if match.success begin salt := copy(match.value,8,22); result := hashpassword(str, salt) = hash; end else begin result := false; end; end; after changing platform win android first 1 shows lot of errors since depends on comobj, windows , activex. second 1 after replacing regexpr regularexpressions , types shows conflicts res...

ant - How to set the log level via the command-line -

echo tasks have logging level associated them, , i've been able use turn off debug messages default, echoing classpath before every build. that's great, except don't know how debug messages show @ all, via command-line argument. i've read refers this, must possible set log level, i've no idea how set it. thanks! i'm sure simple thing must have missed in documentation, quite few likely search queries returned no relevant results. method via eclipse or intellij relevant. ant has several command line options controlling own verbosity ( -quiet , -verbose ), these not appear correspond log levels <echo> tasks, , cannot map possible log levels. i see can set log level from within build file , that's not need. according email , following mappings set up: cmd arg | log level ---------+---------- | info -verbose | verbose -debug | debug -quiet | ??? -silent | ??? ??? | ??? if can find more, please edit post , add th...

javascript - youtube api loadPlaylist on big array of videoIDs -

i've been struggling iframe api past few days trying load large list of videoids. i'm trying load playlist around 380 songs. now believe read somewhere max size playlist suppose 200 videos. i've cut down array size of around 200 videos , still doesn't work. however, when cut size of array down around 145 playlist load no problem. what happening, , why seeing kind of functionality? creating playlist improperly? there better way create playlist , allow 380+ videos loaded through playlist? in code have initial array of around 380 videos called arrayofvideoids. create array called videoids200 arrayofvideoids array spliced down smaller array. have splice cut out first 145 videos. load smaller array in playlist because bigger array not load. here code, please :) : //button assignments: $("#prevbtn").click(function() { console.log("pressed previousbtn"); previousvideo(); }); $("#pausebtn").click(function() { consol...

batch file - FOR /F not outputting correctly wen using move in the loop -

i'm trying clean few file shares, , have list of folders i'm trying move in csv file. values in delfromtest.csv test1 test2 test3 i'm attempting use this. for /f "tokens=1" %%a in (c:\delfromtest.csv) ( if exist %drive%:\%%~a (set asset=%%~a%) move "%drive%:\images%drive%\%asset%" "%drive%:\images%drive%\do not migrate%drive%\%asset%" ) this outputs move "v:\imagesv\c:\delfromtest.csv" "v:\imagesv\do not migratev\c:\delfromtest.csv" but if remove entire move command loop, variables output desired. try for without quotes or use usebackq . enable delayedexpansion when variable set , within for @echo off setlocal enabledelayedexpansion /f %%a in (c:\delfromtest.csv) ( set asset=%%~a if exist %drive%:\!asset! ( echo move "%drive%:\images%drive%\!asset!" "%drive%:\images%drive%\do not migrate%drive%\!asset!" ) ) exit /b 0

vb.net - BackgroundWorker's ProgressChanged not updating UI until end of work loop -

i coding wpf application grab email's off of imap account, , export them user-selected folder. i use backgroundworker download emails. however, ui isn't being updated until loop over. any tips appreciated. class mainwindow public mailrepo mailrepository private bw_connect new backgroundworker private bw_save new backgroundworker public sub new() initializecomponent() bw_connect.workerreportsprogress = true bw_connect.workersupportscancellation = true addhandler bw_connect.dowork, addressof bw_connect_dowork bw_save.workerreportsprogress = true bw_save.workersupportscancellation = true addhandler bw_save.dowork, addressof bw_save_dowork addhandler bw_save.progresschanged, addressof bw_save_progresschanged end sub private sub bw_save_dowork(byval sender object, byval e doworkeventargs) dim worker backgroundworker = ctype(sender, backgroundworker) if bw_connec...

java - Akka message is null -

i playing akka framework java, version 2.3.9 going fine, have issue callback. when run callback getsender().tell(null, self()); i in logs [akka://system/user/towerofdeath:current:266:ceil:34] message null akka.actor.invalidmessageexception: message null @ akka.pattern.promiseactorref.$bang(asksupport.scala:266) @ akka.actor.actorref.tell(actorref.scala:123) it's fine, can't send null, made small generic message , problem solved. if error happens, actor dies. believe possible produce bag, send object, null. hot restore actor in case? thanks help. use supervision, allows parent actor decide how deal failures (bugs) that: here's example: http://doc.akka.io/docs/akka/2.3.14/java/fault-tolerance.html#creating_a_supervisor_strategy for more information: http://doc.akka.io/docs/akka/2.3.14/general/supervision.html http://doc.akka.io/docs/akka/2.3.14/java/fault-tolerance.html

mysql - Why the PHP code assigning to an array hangs? -

i'm new php. have prepared (based on various internet sources) page taking data mysql database , displaying them using flot graph. single database table loaded works great. i'm turning code 'multitable' load want have multiple graphs per single web page. the mentioned code here: <?php // retrieves data single page $servername = "dbserver"; $username = "dbuser"; $password = "dbpassword"; $dbname = "mydatabase"; $port = 5511; // create connection $conn = new mysqli($servername, $username, $password, $dbname, $port); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } // time in microseconds $timenow = time()*1e6; // start time 8 hours ago $timestart = intval($timenow - (8*60*60*1e6)); $tables = array("cfoua47bccmb1a_stat", "cfoua47bccmb2a_stat", "cfoua47bccmb1b_stat", "cfoua47bccmb2b_stat"); $sql = "...

dialog - Android SetText in Activity from AlertDialog -

i have textview on mainactivity , , create alertdialog follows: textviewpropanol = (textview) findviewbyid(r.id.textviewpropranol); boton_propanol = (togglebutton) findviewbyid(r.id.button_propanol); boton_propanol.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { if(boton_propanol.ischecked()) { textviewpropanol.settext("activacted"); final alertdialog.builder a_builder = new alertdialog.builder(medicamentosactivity.this); a_builder.setcancelable(false) .setitems(r.array.medipropanolol, new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { textviewpropanol.settext(); } }) .setnegativebutton("cancel...

java - How does a method "reference to an instance method of an arbitrary object of a particular type" resolve the arbitrary object? -

this question has answer here: instance method reference , lambda parameters 2 answers the oracle java 8 documentation defines 4 types of method references can use instead of lambda expressions. trying understand kind of method reference described as: "reference instance method of arbitrary object of particular type " written containingtype::methodname . i not sure if missing something, me seems more like: "reference first parameter of abstract method of functional interface, assuming of type containingtype ". tried come examples 'arbitrary object' second parameter, of course not compile. is there official reference how object resolved compiler? correct in understanding that: the arbitrary object has 1st parameter of abstract method of functional interface. the signature of method reference must same of abstract method of funct...

r - Error in UseMethod("select_") : no applicable method for 'select_' applied to an object of class "NULL" -

i strange error when knitting r markdown html file. think has sort of incompatibility in dplyr package knitr . update: replaced cbind chunk dplyr::bind_cols command, suggested below not use cbind dplyr . however, different, equally incomprehensible error: library(dplyr) counts.all <- bind_cols(count.tables[["sf10281"]], count.tables[["sf10282"]]) the error change (again, when knitting): error in eval(expr, envir, enclos) : not compatible strsxp calls: <anonymous> ... withvisible -> eval -> eval -> bind_cols -> cbind_all -> .call previous error cbind instead of dplyr::bind_cols : running chunks separately works fine, , able knit fine until added last chunk (using select dplyr ). this error get: quitting lines 75-77 (analysis_sf10281_sf10282_sep29_2015.rmd) error in usemethod("select_") : no applicable method 'select_' applied object of class "null" calls: <anonymous> ... withv...

meteor - Avoiding If statements in render method -

i new , unfamiliar web development. in side project keep ending these if statements in render() method when trying control render based on different things. one example... app = react.createclass({ getinitialstate(){ return {validcode: false}; }, handlesubmit(code){ var result = meteor.call('validatecode', code); this.setstate({validcode: result}); }, render() { if(this.state.validcode){ return ( <div> <h1>valid code!!</h1> <menu /> <othercomponentsonlyvisiblewhenauthorized /> </div> ); } else { return ( <div> <h1>welcome</h1> <invitecodeinput oncodesubmit={this.handlesubmit}/> </div> ); } } }); basically want...

asp.net - Finding the request's physical path -

in asp.net 5, how retrieve physical path of request if i'm creating asp.net middleware? public async task invoke(httpcontext context) { var request = context.request previously have either leveraged: httpserverutility.mappath() or system.web.request.physicalpath() the new microsoft.aspnet.http.request object has path property, , i'm unclear how convert request path filesystem path. you can use ihostingenvironment service follows: public class physicalpathmiddleware { private readonly requestdelegate _next; private readonly ihostingenvironment _hostingenvironment; public physicalpathmiddleware(requestdelegate next, ihostingenvironment hostingenvironment) { _next = next; _hostingenvironment = hostingenvironment; } public async task invoke(httpcontext context) { var physicalfileinfo = _hostingenvironment.webrootfileprovider.getfileinfo(context.request.path); var physicalfilepath = ...

oop - c# object function calling -

so starting learn c# , running problems... trying create bestiary console rpg game, , have ran wall. in monsters class, have class constructor monster objects, , have function print out data in bestiary style. public void mprint() { console.writeline(name); console.writeline("class: " + mclass); console.writeline("hp: " + healthmax); console.writeline("atk: " + atk); console.writeline("exp drop: " + expdrop); console.writeline("description: "); console.writeline(description); } then have void asking imput , uses switch statement put down chain , desired entry: switch (monsterchoice) { case 1: rat.mprint(); break; default: console.writeline(); console.writeline("make sure using number next name of monster choose....

c# - Why does using the await operator for the second argument to a method affect the value of the first argument? -

the following c# program produces unexpected output. expect see: value1: 25, value2: 10 value1: 10, value2: 25 but instead see value1: 0, value2: 10 value1: 10, value2: 25 namespace consoleapplication4 { class program { static void main(string[] args) { dowork().wait(); console.readline(); } private async static task dowork() { someclass foo = new someclass() { myvalue = 25.0f }; printtwovalues(foo.myvalue, await getvalue()); printtwovalues(await getvalue(), foo.myvalue); } static void printtwovalues(float value1, float value2) { console.writeline("value1: {0}, value2: {1}", value1, value2); } static task<float> getvalue() { return task.factory.startnew(() => { return 10.0f; ...

java - Iterator and regular for loop -

i understand how iteration work may need more knowledge it. can 1 please show me main difference between these 2 statements: while (scanner.hasnext()) { tokenizer = new stringtokenizer(scanner.nextline()); numberofitems = integer.parseint(tokenizer.nexttoken()); int[] numbers = new int[numberofitems]; (int i:numbers) { numbers[i] = integer.parseint(tokenizer.nexttoken()); } system.out.println(isjolly(numbers)); } while (scanner.hasnext()) { tokenizer = new stringtokenizer(scanner.nextline()); numberofitems = integer.parseint(tokenizer.nexttoken()); int[] numbers = new int[numberofitems]; (int = 0; < numberofitems; i++) { numbers[i] = integer.parseint(tokenizer.nexttoken()); } system.out.println(isjolly(numbers)); } why these giving me 2 different output? you have created empty array (array filled zeroes). int[] numbers = new int[numb...

javascript - sass with gruntjs doesn't work -

the livereload worked sass isn't output css. no error shown in terminal. below gruntfile.js module.exports = function (grunt) { grunt.initconfig({ pkg: grunt.file.readjson('package.json'), watch: { sass: { files: ['components/sass/*.{scss,sass}'], tasks: ['sass'], options: { livereload: true } }, livereload: { files: ['**/*'], options: { livereload: true } } }, sass: { options: { sourcemap: true, outputstyle: 'compressed' }, files: { 'css/styles.css': 'components/sass/styles.scss' } } }); grunt.registertask('default', ['sass', 'watch']); grunt.loa...

c++ - Child process receives parent's SIGINT -

i have 1 simple program that's using qt framework. uses qprocess execute rar , compress files. in program catching sigint , doing in code when occures: signal(sigint, &unix_handler); when sigint occures, check if rar process done, , if isn't wait ... problem (i think) rar process get's sigint meant program , quits before has compressed files. is there way run rar process doesn't receive sigint when program receives ? thanks if generating sigint ctrl-c on unix system, signal being sent entire process group . you need use setpgid or setsid put child process different process group not receive signals generated controlling terminal. [edit] be sure read rationale section of setpgid page carefully. little tricky plug of potential race conditions here. to guarantee 100% no sigint delivered child process, need this: #define check(x) if(!(x)) { perror(#x " failed"); abort(); /* or whatever */ } /* block sigint. */ sigset_t mas...

android - How to make a UI like this ...? -

Image
hello every 1 question how make ui in xml shapes present in image ...!! this image generated in photoshop, want make same interface in android xml. thanks in advance. the simplest way set image background of layout. convert image nine-patch if don't want jagged part scale.

android - App communication using intents with multiples activities -

i'm doing communication between 2 apps using intents. first app launch intent captured second app. in second app, have process multiples activities , @ end of process, last activity should return result caller app. in simple diagram this: app 1 ----- launch intent -----> app 2 activity1 app 2 activity2 app 2 activity3 app1 <----- intent response ---- app 2 activity4 onactivityresult i suppose in case, app2 activity1 should activity in charge respond app1, reason have tried "empty stack" app2 activity 4 using intent.flag_activity_new_task | intent.flag_activity_clear_task i'm not able "kill" app2 app2 activity1, , come app2 activity3. i have thought alternative start each activity on app2 waiting result , app2 activity 4 init notification chain activity 4 activity 1 feel option have strange behaviors if user start go ahead , through activities... :s any idea achieve send info...

computer vision - How do I combine transforms in the ceres solver? -

i have 2 parameters transformations input ceres cost function. both transforms combined, in order reproject points. both transforms given in form of rodrigues rotation vector, , translation vector. my question is, how combine these 2 transforms within cost function (using ceres api's), in order reproject points? have @ functions in ceres/rotation.h header file: http://ceres-solver.org/nnls_modeling.html#rotation-h for example can convert rodrigues vector rotation matrix: void angleaxistorotationmatrix<t>(t const *angle_axis, t *r) with can build own 3x4 transformation matrix every transformation combining rotation , translation (you can use eigen http://eigen.tuxfamily.org/index.php?title=main_page that). matrix multiplication yields final transform (mind order).

Python 3.3 - Lists -

so i'm trying create state abbreviation list of first 10 states. easy enough (lest call list states1). want create second list using slicing outputs middle 4 states...still enough enough(we'll call list states2). ok part i'm getting messed on here.. want use function (lets name list_func) states2 being argument. within argument want delete second state in list, insert tx index 2, ask user random new state , append list, reverse list. here i've come far.. think have of correct i'm not sure on fine tuning... def main(): states1 = ['al', 'ak', 'az', 'ar', 'ca', 'co', 'ct', 'de', 'dc', 'fl'] print(states1) states2 = states1[3:7] print(states2) list_func in states2: states2.remove('ca') states2.insert(1,'tx') user_st = input('enter new state: ') states2.append(user_st) states2.reverse() print(stat...

has many - Ember Data JSON-API hasMany: How? -

i'm familiar old ember-data "sideloading" model, this: ``` { authors:[ {id:1, name:"ernest", type: 'author', books: [1,2] ], books: [ {id:1, name: "for whom bell tolls", type: 'book', author:1}, {id:2, name: "farewell arms", type: 'book', author:1} ] } but new json-api method different. for 1 thing, (and this), attributes separated id , type information, preventing namespace collisions. i don't yet understand how hasmany relationship json-api format. can point me doc or article on how expected? examples on json-api page show individual relationships, not hasmany . if write above example in new format, you'd have answered question. i believe found answer in the json-api spec . if correct in reading, each model have relationships key, value object key each named relationship, has data key can either single object or array hasmany relationship. in case, above e...

javascript - How to remove directive before it gets processed by angular? -

i trying create directive encapsulates label , input field: <form-field label="name" ng-model="person.name"></form-field> directive definition: app.directive("formfield", function(){ var ignoreattrs = ["label"]; return { priority: 3, //so executes before ngmodel. template: "<div>" + "<label>{{label}}</label>" + "<input type='text' />" + "</div>", scope: true, compile: function(telement, tattrs){ var $input = telement.find("input"); //copy attributes directive element inner input field var attrs = []; $.each(telement[0].attributes, function(index, attr){ if(ignoreattrs.indexof(attr.label) < 0){ attrs.push(attr.name); $input.attr(attr.name, attr.value); } }); ...

tfs2013 - TFS 2013 Web Portal 'checkout' status -

i have checkout project via vs2013, , form vs2013 explorer, can see status of locked users. however, not see such status via web portal. pls advice. the answer no. not allowed check pending changes status on tfs web portal since tfs2012.

javascript - jshint turn off alert() error doesn't work -

jshint: { files: [ 'src/js/*.js', 'gruntfile.js' ], options: { jshintrc: '.jshintrc', devel:true } }, how turn off alert error in jshint? hell want turn off stupid feature off! if possible "use strict" too, annoying.. there way, here . here little snippet that: // code here linted jshint. /* jshint ignore:start */ // code here ignored jshint. /* jshint ignore:end */ you can ignore single line trailing comment this: ignorethis(); // jshint ignore:line

php - unable to send email as both plain text and html in cakephp -

app::uses('cakeemail', 'network/email'); $email = new cakeemail(); $email->to($emailcontentarray['to']); $email->from(array($emailcontentarray['from'] => configure::read('from_name'))); $email->subject($emailcontentarray['subject']); $email->emailformat('both'); $response=$email->send($emailcontentarray['body']); if check resulting email looks like:- content-type: multipart/mixed; boundary="782f009f669cbcf2faafff59fe0eeb5d" content-transfer-encoding: 8bit x-identified-user: {:test25.xyzzzz.com:testttt.com} {sentby:program running on server} --782f009f669cbcf2faafff59fe0eeb5d content-type: multipart/alternative; boundary="alt-782f009f669cbcf2faafff59fe0eeb5d" --alt-782f009f669cbcf2faafff59fe0eeb5d content-type: text/plain; charset=utf-8 content-transfer-encoding: 8bit <div>​<br>hi<br><br>soon reach action limit. keep updat...

Conditionally take out elements on Groovy Closure -

i using groovy library call ws-lite web service testing. way works takes closure , generate xml , send web service end point. see below simple example of closure looks like: def bookxml = { books { book(available: "20", id: "1") { title("don xijote") author(id: "1", "manuel de cervantes") } book(available: "14", id: "2") { title("catcher in rye") author(id: "2", "jd salinger") } book(available: "13", id: "3") { title("alice in wonderland") author(id: "3", "lewis carroll") } } } will generate xml in request below: <?xml version="1.0" encoding="utf-8"?> <books> <book available="20" id="1"> <title>don xijote</title> <...

javascript - why is this while loop causing an infinite loop? -

for reason i'm having difficulty getting while loop work. keeps crashing browser whenever try test out, , in 1 case able see results of loop in console, saw nan printed several times. there i've forgotten in code? <div id="output"></div> <script> var starting = prompt("what starting balance?"); var target = prompt("what target balance?"); var interest = prompt("what interest rate?"); var periods = 0; var current = starting; var greaterthan = false; while (greaterthan === false) { if (current < target) { current = current + (current * interest); periods++; } else { greaterthan = true; alert("it took " + periods + " periods make starting balance greater target balance."); document.queryselector('#output').textcontent = "to grow initial investment of " + starting + " " + target + " @ " + interest + " interest rate require ...

wordpress - Custom Order Listing Page With WooCommerce -

i have created plugin has separate page order listing.. in looks same woocommerce's order listing page but. unable comments of order added custom post type wc_order_types after there no order listed.. showing empty table. ? add_filter( 'wc_order_types',array($this,'add_wc_order_types'),10,3); public function add_wc_order_types($order_types,$type){ $order_types[] = wc_qd_pt; return $order_types; } apply_filters( 'wc_order_types', $order_types, $for ); default wc_filters takes 2 parameters have asked 3 here add_filter( 'wc_order_types',array($this,'add_wc_order_types'),10,3); , again supplied 2. visit http://docs.woothemes.com/wc-apidocs/source-function-wc_get_order_types.html#149 may this.

Vectorization MATLAB sum equation snippet -

i new matlab, , understand how can vectorize below snippet, or how can efficiently: sum=0; = 1:50 sum=sum+i; end you can use sum native function: total = sum(1:50);

android - std::thread as member of class executing random thread causing an abort at asignate thread -

in class have thread object public membe: class appmanager{ ... public: std::thread m_thread; }; then when initialize thread: void* bridgefunction(void *pctx) { ((appmanager*)pctx)->mainappthread(); return 0; } void appmanager::createappthread(){ m_thread = std::thread(&bridgefunction, this); m_thread.detach(); } i got abort on std::terminate: thread& operator=(thread&& __t) noexcept { if (joinable()) std::terminate(); swap(__t); return *this; } why? i'm calling detach, tried changing from: m_thread = std::thread(&bridgefunction, this); to: m_thread = std::thread(&appmanager::mainappthread, this); and same, works if declare m_thread global , debugged why works, turns out thread declared member execute random thread before assign thread, know because printed id see if joinable: auto myid = m_thread.get_id(); std::stringstream ss; ss << myid; std::str...

javascript - How to check whether pdf file exists? -

this question has answer here: fastest way check remote file existance 5 answers i trying check if pdf file exists in arxiv. there 2 example arxiv.org/pdf/1207.4102.pdf arxiv.org/pdf/1207.41021.pdf the first pdf file , second not , returns error page . is there way check whether url pdf or not. tried answers in how check if file exists in jquery or javascript? none of them work , return true (i.e. file exists) both urls. there way find url pdf file in javascript/jquery or php? can solved using pdf.js ? it return correct result. function gethttpcode($url) { $ch = curl_init($url); curl_setopt($ch, curlopt_header, true); curl_setopt($ch, curlopt_nobody, true); curl_setopt($ch, curlopt_returntransfer,1); curl_setopt($ch, curlopt_timeout,10); curl_setopt($ch, curlopt_useragent, 'mozilla/4.0 (compatible; msi...

load - Most important and Basic things about jmeter -

i learning jmeter load testing tool, explore jmeter of doc jmeter community have question running in mind. 1)what minimum pc configuration use jmeter check load. 2)how can start no. of user test load. 3)threads, ramp-up , loop controller how inputs test script. 4)what maximum capacity of threads while test load. 5)how can use of timer checking of concurrent user load test. there no, different applications can hold different load. better application hardware , software, more power need load it. you click run button. 100 users 1000 seconds ramp means introduce new user every 10 sec. maximum capacity maximum number hardware can handle. jmeter has lot of listeners, can pick 1 think has information.

Javascript / JQuery events vs knockout observable + subscribe -

is there programming scenario js / jquery events need used while using knockoutjs observable variables? technically, no, can use ko.utils.registereventhandler instead, more technically, that's using js events. more point (i hope), may apply jquery events within binding handler, should not doing in other app code. reason should not reaching around knockout's binding handlers manipulate view directly. binding handlers exist synchronize view , viewmodel. want view should done manipulating viewmodel. if there no way modify or access view in way want via viewmodel, need binding handler. within binding handler, objective ensure viewmodel , view reflect each other. may use tools achieve that. also note knockout provides event binding let viewmodel respond events view.