Posts

parse.com - Parse Cloud Code Push + Client-initiated push isn't enabled -

Image
i trying run parse cloud code function sends push user associated installation object. when run following code within cloud function error 115 - client-initiated push isn't enabled. // send push parent var query = new parse.query(parse.installation); query.equalto('user', reservation.get("parent")); parse.push.send({ where: query, // set our installation query data: { alert: "your request has been accepted!" } }, { success: function () { console.log("push worked"); return result; }, error: function (error) { console.log("error: " + error.code + " " + error.message); return result; } }); i don't see anywhere client side pushes need enabled cloud code? missing or need enabled? navigate app's settings in parse dashboard, enable client side push under push notificat...

c++ - Simple program with std::string is not working -

i learning std::string , want : input string every second letter make uppercase output new string #include "stdafx.h" #include <iostream> #include <string> using namespace std; int main() { string mystr; getline(cin,mystr); if (mystr.begin() != mystr.end()) { (auto = mystr.begin(); != mystr.end() ; += 2) *it = toupper(*it); } cout << mystr; system("pause"); return 0; } but after input getting error here : it += 2 leads out of bounds, if loop ending condition it != mystr.end() . dereferencing *it = toupper(*it); is undefined behavior. it += 2 never give exact iterator value of mystr.end() have loops termination condition. as comment: so how can fix ? just keep simple , understandable, e.g. using like for (size_t = 0; < mystr.length() ; ++i) { if(i % 2) { // every second letter ... mystr[i] = toupper(mystr[i]); } }

android - AdMob InterstitialAd "AFMA_ReceiveMessage is not defined" vs "must be called on the main UI thread" -

i trying implement iterstitial ads admob. managed displayed in test mode. however, showed blank page "afma_receivemessage not defined" error when running live. i have read many post relating "afma_receivemessage not defined" issue. seemed problem ads has running on separate thread gain network access. however, if move loadad , show methods new thread (like in afma_receivemessage not defined or interstitial admob doesn't work : afma_receivemessage not defined ), complain has run on main thread!! if use runonuithread method, go "afma_receivemessage not defined" problem. i confused conflicting solutions each other. (it has run on uithread while has on separate thread gain network access?) has have working example interstitial ads admob (not in test mode)?

How do you exclude file extensions from command-line JSHint? -

i'm trying exclude *.min.js , *.intellisense.js files being linted command-line jshint . i'm passing in .jshintignore file via --exclude-path looks this: *.min.js *.intellisense.js **.min.js **.intellisense.js **/*.min.js **/*.intellisense.js **\*.min.js **\*.intellisense.js none of patterns seem matching. versions: node v5.3.0, jshint v2.8.0. the full command i'm running (in dir d:\projects\someweb\ ): d:\utils\nodejs\node.exe d:\utils\nodejs\node_modules\jshint\bin\jshint --verbose --show-non-errors --exclude-path d:\utils\nodejs\.jshintignore . update #1: workaround, i'm using powershell command: powershell -nologo -noprofile -command "get-childitem -include *.js -exclude *.min.js,*-vsdoc.js,*.intellisense.js -recurse | % { d:\utils\nodejs\node d:\utils\nodejs\node_modules\jshint\bin\jshint --verbose --show-non-errors $_.fullname }"

php - strpos with two words to find -

i found example on stackoverflow: if (strpos($a,'are') !== false) { echo 'true'; } but how make search 2 words. need this: if $a contains words "are" or "be" or both echo "contains"; i tried xor , || just check both words separately , use boolean or -operator check if either 1 or both contained in $a : if (strpos($a,'are') !== false || strpos($a,'be') !== false) { echo "contains"; } note due or -operator, second check (for 'be') not performed if first 1 showed $a contains 'are'.

How to use the the count number somewhere else in java -

is there anyway in can place count variable. e.g. have count count number of lines. after want use number count has provided, , add number in variable can used somewhere else, e.g. add number, or find percentage or create pie chart using number. public void totalcount12() throws filenotfoundexception { scanner file = new scanner(new file("read.txt")); int count = 0; while(file.hasnext()){ count++; file.nextline(); } system.out.println(count); file.close(); i want use number in count, , use somewhere else (e.g method), have no idea how that. thank you. firstly recommend should complete javatutorial if new programming. if define in class global variable (as attribute of class) out of method, can use in every method in class. but if question using in everywhere of project different class, should use singleton design pattern ; public class classicsingleton { private static ...

scikit learn - sklearn: AUC score for LinearSVC and OneSVM -

one option of svm classifier ( svc ) probability false default. documentation not does. looking @ libsvm source code, seems sort of cross-validation. this option not exist linearsvc nor onesvm . i need calculate auc scores several svm models, including these last two. should calculate auc score using decision_function(x) thresholds? answering own question. firstly, common "myth" need probabilities draw roc curve. no, need kind of threshold in model can change. roc curve drawn changing threshold. point of roc curve being, of course, see how model reproducing hypothesis seeing how ordering observations. in case of svm, there 2 ways see people drawing roc curves them: using distance decision bondary, mentioned in own question using bias term threshold in svm: http://researchgate.net/post/how_can_i_plot_determine_roc_auc_for_svm . in fact, if use svc(probabilities=true) probabilities calculated in manner, using cv, can use draw roc curve. mentioned i...