Posts

Showing posts from March, 2013

dns - Remove CNAME after Azure has verified the domain -

once have verified domain in azure cname record, can remove cname record safely dns server without breaking anything? you can safely delete awverify records. used when validating custom domain (while associating new domain in portal) , post that, not used feel free remove them.

java - How to initialize a JSONArray and use in other methods -

i'm going initialize jsonarray , set input of method copies jsonarray arraylist. this method: public arraylist<string> copyjsonarraytoarraylist(jsonarray jarray){ arraylist<string> arraylist = new arraylist<> (); (int = 0; < jarray.length(); i++) { try { arraylist.add(jarray.getjsonobject(i).getstring("city")); } catch (jsonexception e) { e.printstacktrace(); } } return arraylist; } and code: requestqueue queue = volley.newrequestqueue(getapplicationcontext()); stringrequest stringrequest = new stringrequest(request.method.get, ws_get_city, new response.listener<string>() { @override public void onresponse(string response) { progressbar.setvisibility(view.gone); try { jsonobject = new jsonobject(response); jsonarray = jsonobject.getjsonarray("getcity"); } catch (js

c++ - gcc 6.1. installation, gmp/mpfr/mpc not built? -

i've installed gcc 6.1, libraries mentioned in title (gmp/mpfr/mpc) followed gnu website said: gnu multiple precision library (gmp) version 4.3.2 (or later) necessary build gcc. if gmp source distribution found in subdirectory of gcc sources named gmp, built gcc. alternatively, if gmp installed not in library search path, have configure --with-gmp configure option. see --with-gmp-lib , --with-gmp-include. in-tree build supported gmp version download_prerequisites installs. similar others libraries, namely downloaded sources of last version copied in gcc directory, before doing "configure", "make" , "make install" of gcc under assumption have been built gcc. when try run compiled project use gmp library say: error while loading shared libraries: libgmp.so.10: cannot open shared object file: no such file or directory so looking shared object is, can't find gcc has installed it. was supposed firstly compile gmp/mpfr , mpc b

which is best practice to use authetication in php API -

i use following technique in api authentication in php. use post method api call. in first api have send username , password. send post. if match generate 1 randomkey in database call secretkey. secretkey has pass post field in other api. so question is method proper or need use other techniques ? one of solutions json web token, here's tutorial how use it https://www.toptal.com/web/cookie-free-authentication-with-json-web-tokens-an-example-in-laravel-and-angularjs#land-prodigious-architects

jquery - How to sort date column with proper format in JQXGrid? -

i facing issue date column sorting jqxgrid plugin. date respond in 'dd/mm/yyyy' formate , need same formate displaying. there sorting issue date column here code. datafields: [{ name: 'aa', type: 'date'}], columns: [{ text: 'start date', datafield: 'aa', width: '10%', sorttype:'date', formatter:'date', formatoptions: {newformat:'d/m/y'}}]

php - empty array outside function and array is ok inisde -

i'm having problems getting array values outside function , file. inside array , function have this, values defined getters , setters array ( [0] => xxxxxxxxxx [1] => 5ºa ) those values defined setters , working since have values print_r public function getturmaeprofessor(){ global $myarr; $myarr[] = $this->getprofessor(); $myarr[] = $this->getturma(); print_r($myarr); return $myarr; } now file use this $dados = $esmaior->getturmaeprofessor(); if(!$dados){ echo "sem dados"; } print_r($dados); and result empty, array empty...why?? thanks update function called here $this->setturma($nome_turma); $this->setprofessor(($nome_professor)); $this->getturmaeprofessor(); so if put this public function getturmaeprofessor(array $myarr) i'm gonna need change call method...how it?? update 2 ok... let me put maybe it's better understand. main function one public function novaau

jira - Webhook not working -

i have done following: 1) created project in jira name "project1" , added work flow "wf1" it. 2) created webhook "wb1"and added webhook post function work flow "wf1". now trying call java rest api webhook "wb1". url rest api " http://pc93112.uk.rebushr.com:8080/jiraintegration/rest/jiraservice/records " appreciated question : how can pass issue key (issue has been edited in jira) rest api. when tried below url getting text “${issue.key}” instead of issue key. http://pc93112.uk.rebushr.com:8080/jiraintegration/rest/jiraservice/records?issue= ${issue.key} the jira webhook documentation mentions limitation, reason: if using jira 5.2.2 or earlier, there known issues when using jql webhooks: ${issue.key} variable replacement not work in webhook, when webhook used in workflow post function. note, ${issue.key} variable replacement work when issue event triggers webhook. if that's not it, configure webho

Visual C++ build error due to circular includes -

i have 2 classes use each other members.. class one: #ifndef property_h #define property_h #include "individualproperty.h" #include "structurizer.h" #include "p_owner.h" #include <windows.h> class p_owner; class p_property { private: p_owner _owner; string ownername; string propertyaddress; string taxid; string postalcode; bool owes_taxes; double propertytaxval; double solidwastetaxval; public: p_owner getowner() { return _owner; } void setowner(p_owner a) { _owner = a; } string getpropertyaddress() { return propertyaddress; } void setpropertyaddress(string a) { propertyaddress = a; } void settaxid(string a) { taxid = a; } string gettaxid() { return taxid; } void setpostalcode(string a) { postalcode = a; } string getpostalcode() { return postalcode; } void settaxes(bool a) { owes_taxes = a; } bool gettaxes() { return owes_taxes; } void setpropertyta

python - How to make integer patterns? -

i want build sequence pattern, example have numbers 1 , 2 , 3 . 1 first pattern, 2 second, , 3 third. # assign patterns. first = 1 second = 2 third = 3 # make loop x in xrange(1, 100): print(second) this print second, want print number after every 2 integers. so example: 1 2 - pattern 2 3 4 - pattern 2 5 6 - pattern 2 7 ... how achieve sequence? can make integer patterns in loop, such integer 2 , after every 2 integers prints pattern2 integer returned. xrange has step parameter. see documentation . for x in xrange(1, 100, 2): print(second) to print pattern 1, 2 , 3 successively: patterns = [first, second, third] x in xrange(1, 100): print(patterns[x % 3]) to print third: for x in xrange(1, 100): if x % 3 == 0: print(third)

c# - How to Post JSON data to a Web API using HttpClient -

i have following code, takes in dynamic object (in case of type file) , using httpclient class tries post webapi controller , issue having controller getting null values on [frombody] parameter. code var obj = new { f = new file { description = description, file64 = convert.tobase64string(filecontent), filename = filename, versionname = versionname, mimetype = mimetype }, } var client = new httpclient(signinghandler) { baseaddress = new uri(baseurl + path) //in case v1/document/checkin/12345 }; client.defaultrequestheaders.accept.clear(); client.defaultrequestheaders.accept.add(new mediatypewithqualityheadervalue("application/json")); httpresponsemessage response; action = uri.escapeuristring(action); //obj passed this, of type file var content = new stringcontent(jsonconvert.serializeobject(obj).tostrin

git - upstream/HEAD listed in remote branches -

i've noticed weird in list of remote git branches. seem 1 of coworkers notices following line when run git branch -r : upstream/head -> upstream/7.3.0 no matter seem can't go away, , i'm running issues make me think may root cause. know means, implications of it, , how rid of it? git creates indirect (symbolic) reference on initial git clone in appears misguided attempt useful and/or informative. subsequent git fetch operations may or may not re-create or update (in testing found git fetch not touch it, in past have seen re-created). you can delete manually git branch -r -d upstream/head . it should harmless, if incorrect.

mongodb - Setting a value post update with the `findOneAndUpdate` Mongoose hook -

i trying use findoneandupdate hook mongoose (discussed in detail here ), although i'm having problems trying set value post update. for example: myschema.findoneandupdate({_id: fj394hri3hfj}, {$push: {comments: mynewcomment}}) will trigger following hook: myschema.post('findoneandupdate', function(result) { this.update({}, { totalnumberofcomments: result.comments.length }); }); although, hook $push comments mynewcomment again, therefore making duplicate entry. i use this.update({}, {....}) instead of this.findoneandupdate({}, {....}) within hook post hook not called infinitely. the totalnumberofcomments set length of comments.length . so seems if this.update({}, {....}) pushing more update fields existing update fields on this . how can set totalnumberofcomments within hook instead of re-pushing comments again? the issue seems in update query wrote in post findoneandupdate hook. try replacing with, myschema.post('findonean

asp.net - in extjs error in fill combo with ajax request -

working code: var customstore = new ext.data.store({ model: 'user', proxy: { type: 'ajax', url: 'http://test/service1.svc/getoperator', pageparam: false, startparam: false, limitparam: false, nocache: false, params: { storeid: 31 }, autosync: true, reader: { type: 'json', root: 'users' } }, autoload: true }); ext.define('user', { extend: 'ext.data.model', fields: [ { name: 'staffid', type: 'string' }, { name: 'name', type: 'string' } ] }); declare bind }, { id: 'cmbappoperator', itemid: 'operatorid', name: ext.calendar.data.eventmappings.operatorid.name, fieldlabel: 'operator', xtype: 'combo'

ios - Unable to get Facebook permissions after HTTPMethod DELETE in Swift -

i working on app logs in facebook using fbsdk in swift. have been able make requests wall posts using var request: fbsdkgraphrequest request = fbsdkgraphrequest(graphpath: "me/feed"), parameters: ["access_token": fbsdkaccesstoken.currentaccesstoken().tokenstring], httpmethod:"get") request.startwithcompletionhandler({(connection, result, error) -> void in if error != nil { } else { } }) but have been unable results after used following log out var deletepermission = fbsdkgraphrequest(graphpath: "me/permissions/", parameters: nil, httpmethod: "delete") deleterpermission.startwithcompletionhandler({(connection, result, error) -> void in if error != nil { } else { } }) when log in app, again asked accept permissions, when check expiration date current token fbsdkaccesstoken.currentaccesstoken().expirationdate date before tried httpmethod: delete. so wondering how possible permission app or renew access token

how do i do infinite loop in this function in C -

i have question, loop stopping @ sequence 2, want infinite loop function ambil_nilai() , ulang() until scanf receiving word "tidak" , program stop, , seems can't quite right it, please please me, , please tell me if there's not quite right in ode, thank help. #include <stdio.h> int ambil_nilai(){ int nilai, nmk; printf("masukkan mata kuliah yang ingin dicari analisa nya:\n"); scanf("%d",&nmk); printf("masukkan nilai mata kuliahnya:\n"); scanf("%d",&nilai); if(nilai<=50){ printf("kamu harus belajar lagi karena nilai kamu kurang\n\n"); } else if(nilai>=51){ printf("nilai kamu sudah cukup untuk lulus mata kuliah\n\n"); } return 0; } char ulang(){ char lagi='y'; char tidak='n'; printf("ingin coba mata kuliah lain? tekan y untuk yes, n untuk no\n"); scanf("%c %c", &lagi,&

php - Need destroy session after close browser tab not whole browser -

this question has answer here: how change session timeout in php? 5 answers i need destroy session after page closed in browser. tried unset $_session['value']; can not working destroy current page need destroy after closed in browser you can write this session_set_cookie_params(0); session_start(); this destroy session when browser closed.

javascript - Highchart performance slow on plotting live data -

i plotting live data in highchart's(4.2.4) line type chart each second data i.e. 60 points 1 min. , requirement collect each second data long duration. using below code add point in series. the number of series have 20 . , each series have add point per second. turbothreshold set each series around 2000 . , slicing should done after 1000 points data. chart.series[0].addpoint(point, false, data > 1000?shift: false, false); i see low performance browser keeps hanging , chart irresponsive after time. can better performance? have tried below stuff: 1) off animation series : plotoptions: { series: { animation:false, states: { hover: { linewidthplus: 0 } } } }, 2) turn off animation , red

c# - How to play different .wav when click button on wpf -

i try play different listed .wav sound every click button queue apps on hospital or bank. i have no idea make on 1 button. this xaml code: <window x:class="wpfapplication8.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="296.477"> <grid margin="0,0,2,0"> <grid.columndefinitions> <columndefinition width="17*"/> <columndefinition width="15*"/> <columndefinition width="254*"/> <columndefinition width="0*"/> </grid.columndefinitions> <button content="next" margin="10,251,175,0" verticalalignment="top" click="button_click" rendertransformorigin="1.169,0.851" height="59" fontsize="20&

xamarin.forms - How can I get sensors values with xamarin forms? -

i want values of sensors xamarin forms. found tutorials on how android project not app.cs shared project in xamarin forms. i found answer use device motion plugin : https://components.xamarin.com/view/devicemotionplugin

seo - Tracking Conversions on External Website with Google Analytics -

i have booking site refers customers other companies websites confirm , pay bookings. make money off of conversions, not clickthroughs. these sites owned other corporations , not have access website code, clarify. i know can use ga track clickthroughs site, how track actual conversions? you cannot track conversions on site unless agree send data you. that's answer, included bit more info below. your business model of affiliate . affiliate tracking works appending parameter link goes website partner website. partner website has take care parameter persisted throughout booking process. on confirmation page, if id present, send beacon informs booking has happened. that beacon image pixel on server; if pixel called writes line logfile contains information passed via image source (e.g. total price if renumeration depends on revenue). if want can use google analytics; unlikely partner site agrees implement fledged ga implementation cross domain tracking, use measuremen

c - How To Assign char* to an Array variable -

i have started code in c , having quite lot of fun it. ran little problem have tried solutions think of no success. how can assign char* variable array? example int main() { char* sentence = "hello world"; //sentence gets altered... char words[] = sentence; //code logic here... return 0; } this of course gives me error. answer appreciated. turn compiler warnings on , trust says. array initializer must string literal or initializer list. such needs explicit size or initializer. if had explicitly initialized still wouldn't have been assignable in way wrote. words = sentence; please consult this post quotation c standard. as of: how assign char* array variable ? you can populating "array variable" content of string literal pointed char * , have give explicit length before can copying. don't forget #include <string.h> char* sentence = "hello world"; char words[32]; //e

java - Capturing System/out in Clojure -

i'm working java package outputs text console , need capture text in string, i'm not sure how this. looking @ clojure documentation seemed have wrap java call in with-out-str isn't working me. minimal code example: if try (with-out-str (.println (system/out) "foo")) i'm hoping string value "foo", it's still outputting console instead. doing wrong? java's system.out.println(...) call println method of printstream instance. need replace system.out stream own instance , capture content: (import [java.io bytearrayoutputstream printstream]) (def out-buffer (java.io.bytearrayoutputstream.)) (system/setout (java.io.printstream. out-buffer true "utf-8")) (defn out-str [] (.tostring out-buffer "utf-8")) watch out in repl though because uses system.out print results when replace globally, break repl instance. you can write macro capture content of system.out , restore original printstream inst

php - How to check if record exists by searching into inner array -

i have record in db { "_id": objectid("5759ccbcc2b503980c000143"), "phone": "516-425-5878", "orders": [ "1338475681", "1891805481", "1891805481" ] } here code. $collection = $mongo_db_obj->selectcollection('scrapers', 'leads'); $data = array( 'phone' => '516-425-5878', "orders" => array('$in'=>1891805481) ); $doc = $collection->findone($data); dump($doc); i want check if particular phone , and order id inside orders array exists or not. code giving error. i have tried 1 too. $data = array( 'phone' => '516-425-5878', "orders" => array(1891805481) ); but returns empty results. how check that? $in operator selects documents field values matches values in array. please try executing following code snippet solution above mentioned issue $conn

email - Oracle UTL_STMP - no content -

i send emails on oracle database via utl_smtp. daily emails sent automatically. but on days there no content in email , blank mail sent. this code: c := utl_smtp.open_connection(smailserver); utl_smtp.helo(c, smailserver); utl_smtp.mail(c, sfrom); utl_smtp.rcpt(c, srecipients); utl_smtp.open_data(c); utl_smtp.write_data(c, 'to: ' || srecipients || utl_tcp.crlf); utl_smtp.write_data(c, 'from: ' || sfrom || utl_tcp.crlf); utl_smtp.write_data(c, 'subject: ' || replace(sdescr, '[date]',to_char(sdate,'dd.mm.yyyy')) || utl_tcp.crlf); utl_smtp.write_data(c, 'content-type: text/html;' || utl_tcp.crlf); -- write data utl_smtp.write_data(c, sdata); utl_smtp.close_data(c); utl_smtp.quit(c); the answer put line between header-data , body-data: utl_smtp.write_data(c, 'content-type: text/html;' || utl_tcp.crlf); -- line between header , body utl_smtp.write_data(c, utl_tcp.crlf); -- write data utl_smtp.write_data

jquery - DataTable Warning - Can not reinitiliaze DataTable -

i trying initialize datatable on ajax success. works fine first time won't work again unless refresh page. js function: this.summaryreport = function() { crsf = $("input[name=csrftestname]").val(); searchclients = $("#searchclients").val(); $('#loadingmessage').show(); $.ajax({ url: url+"query_report_summary", type: "post", cache: false, data: {"csrftestname": crsf, searchclients: searchclients}, success: function(query_result) { var data = $.parsejson(query_result); $('#example').datatable( { data: data, columns: [ { data: "name" }, { data: "location" }, { data: "source" }, { data: "contact" }, { data: "number" }, { data: "status" } ] } );

android - Removing Firebase from project without losing GCM -

in starters, have read thread: remove firebase analytics android app completely - didn't give me answer problem. in app developing had implement push notifications. wanted start gcm, discovered firebase. added project , realized pricing on it. decided scrap , come gcm. removed firebase-related stuff code , thought allright. lately started work on optimization of app , noticed information in debug log: 07-06 07:03:39.310 13286-13474/com.example.myapp d/firebaseinstanceid: background sync failed: missing_instanceid_service, retry in 20s it goes on , on, doubling retry time. i'm not sure how affect app (hovewer, once saw big loss of frames everytime happened), dumbfound firebase still being in app. instances of located in build folder, means can't erase them myself. tried use configurations, tried exclude gcm exclusively, still nothing. configurations { all*.exclude group: 'com.google.firebase', module: 'firebase-core' all*.exclude group: &

syntax - Swift variable declaration trouble -

i'm following guide use syntax declare variable: let fromview = presenting ? toview : transitioncontext.view(forkey: uitransitioncontextfromviewkey) but don't understand syntax: specially question mark , colon ( presenting boolean variable). this allows declare variables based on boolean expressions. saves time don't have write out various if else statements. above expression in question declaring variable based on boolean presenting. if presenting true fromview gets set toview (on left side of colon). if presenting false, fromview gets set transitioncontext.view(forkey: uitransitioncontextfromviewkey) or right side of colon

javascript - Load JSON with AJAX to be used in another function -

i've got 2 functions, 1 called button triggered, other 1 when "process" triggered button finished. to load json data ajax request in calculateprize() function reduce loading time @ end of function finish() function calculateprize() { // ...some code goes here // load ajax data here , parse in "finish function" } function finish() { // retrieve win $.getjson("/generate").done(function(data){ // console.log(data.state) // set win amount amount_field.append( document.createtextnode(data.win_amount)); }); } how in best way? you can call calculateprize function ajax done - , pass data parameter function calculateprize(responsdata) { console.log(responsedata); } function finish() { // retrieve win $.getjson("/generate").done(function(data){ // call function - pass data parameter calculateprize(data); }); } or store data in global variable , acces

c++ - Avoid global variables in my program -

i have global variables in program , tried avoid them don't know how.. here program: here is there alternative avoid variables? and other remark appriciated too i think have multiple possibilities. create class , put functions , global variables inside (preferred way) if care name conflicts can use unnamed namespaces it global variable used in 1 function, declare static variable inside function (its value kept between calls)

opc ua - OPC UA Secure Connection C# -

i trying establish secure connection using opcua client wiht beckhoff server. error control certificate not trusted. suggestions on how proceed here? public bool connect(string url) { // todo implement security // select best endpoint. endpointdescription endpointdescription; try { endpointdescription = clientutils.selectendpoint(url, true); } catch { return false; } endpointdescription.securitypolicyuri = securitypolicies.basic128rsa15; endpointdescription.securitymode = messagesecuritymode.signandencrypt; endpointconfiguration endpointconfiguration = endpointconfiguration.create(appconfig()); configuredendpoint endpoint = new configuredendpoint(null, endpointdescription, endpointconfiguration); m_session = session.create( appconfig(), endpoint, false, false, "experiment", 6

Git mirror setup with bare upstream repo for Gogs -

given existing bare repository on network share, i'd able use gogs issue tracking (etc.) without disrupting workflow else who's using bare repo.after reading bit, under impression mirror provide functionality, , able set in gogs through migration. when adding migration in gogs providing path network bare repository , selecting "this repository mirror", however, following error: migration failed: check bare: exit status 128 - fatal: bad object head looking @ log, can see following: 2016/06/13 13:19:20 [t] action.newrepoaction: myuser/the-repo-name [git-module] git clone --mirror --quiet x:\path\to\bare\repo.git x:\path\to\gogs\repo.git 2016/06/13 13:19:30 [w] delete repository wiki [x:\path\to\gogs\the-repo-name.wiki.git]: exit status 2 strangely enough, can issue git clone --mirror through git bash , have execute successfully. $ git clone --mirror /x/path/to/repo.git my-mirror.git cloning bare repository 'my-mirror.git'... done. my questio

ruby on rails - Use join table data in model -

i have 2 tables: user_nutrients (that holds user_id, nutrient_id , amount integer) , nutrients (that holds more information on nutrients, kcal, fat etc.). want create "foodcalculator" takes amount user_nutrients , other data (let's kcal) nutrients perform calculations (multiply amount kcal current user). can retrieve user_nutrients belong user (through def user_nutrients ) question how can retrieve corresponding data nutrients table in foodcalculator? been struggling several days. sorry if question may simple or not explained. started coding few months ago. food_calculator.rb class foodcalculator def initialize(user) @user = user end def user_nutrients @user_nutrients ||= @user.user_nutrients end end nutrient.rb class nutrient < activerecord::base validates :name, uniqueness: true has_many :user_nutrients has_many :users, through: :user_nutrients end user_nutrient.rb class usernutrient < activerecord::base belongs_to

parsing html text with regex in javascript? -

i realize html can not parsed regex. however, have string source code typical amazon web page. <script type="text/javascript"> p.when("a", "jquery").execute(function(a, $) { var pagestate = a.state('ftpagestate'); if (typeof pagestate === 'undefined') { pagestate = {}; } if (pagestate["fast-track-message"]) { pagestate["fast-track-message"].stoptimer(); } <li> 48 pages</li> pagestate["fast-track-message"] = new fasttrackcountdown(20710,"fast-track-message"); a.state('ftpagestate', pagestate); }); </script> i want grab 48. every number followed pages</li> how can match this? attempt var string_tester =

php - Save (and retrieve) module configurations in Prestashop -

good day all. have simple module on prestashop, i'd add configuration flag, boolean value user can enable/disable configure module. easy. i've done "vikings" way, using form in tpl , read php post variables. but i'd in proper way. what i've far form, created in module: protected function getconfigform() { return array( 'form' => array( 'legend' => array( 'title' => $this->l('settings'), 'icon' => 'icon-cogs', ), 'input' => array( array( 'type' => 'switch', 'label' => $this->l('a label'), 'name' => 'multishop_language_mode', 'is_bool' => true, 'desc' => $thi

node.js - How to delete an item in expressJS view -

i building expressjs app , want add delete icon on collection delete individual items. i bit confused how this. one method thought of binding click event icon in express view , doing ajax call server when clicked. another method create form around icon , icon button when clicked submits form. i not confident of 2 approaches, have thought on elegant way express way i recommend second method because it's more easy understand @ moment. from words understand delete button vulnerability or security hole if did in wrong way. sure it's delete button on way. easy way more secure use session variable. user can't delete unless authorized (logged in). if open session on server , give user key of session. in session can store securely data user interact server via providing session key gave him @ login process. at step user click button delete document guess should authorized delete document. time session key provide inform identity. decision either delete

Unable to load patterns in AIML via Python -

i've installed aiml via pip , wrote files startup.py , std-startup.xml , basic.aiml , bot_brain.brn in core folder. when try run startup.py , warning: loading std-startup.xml... done (0.06 seconds) warning: no match found input: load aiml b kernel bootstrap completed in 0.10 seconds saving brain core/bot_brain.brn... done (0.00 seconds) this content of std-startup.xml : <aiml version="1.0.1" encoding="utf-8"> <!-- std-startup.xml --> <category> <pattern>load aiml b</pattern> <template> <learn>basic.aiml</learn> </template> </category> </aiml> this python script: import aiml import os kernel = aiml.kernel() if os.path.isfile("core/bot_brain.brn"): kernel.bootstrap(brainfile = "core/bot_brain.brn") else: kernel.bootstrap(learnfiles = "std-startup.xml", commands = "load aiml b") k

javascript - filter method replacing one array with another array -

i'm trying filter out values of 1 array array. when using javascript's filter method, script looks this. var notused = ["advanced tac. training area", "dunbarton railroad yard"]; var areas = ["a area", "advanced tac. training area", "b area", "dunbarton railroad yard", "c area"]; areas.filter(function(){ return areas = notused; }) console.log(areas); according documentation, when console areas array after i've run filter function, array should this "a area", "b area", "c area" however, that's not what's happening. instead, i'm getting values of notused array, it's replacing areas array notused array. can explain why happening , how go getting areas array without values of notused array? if question has been asked, please let me know in comments , link answered question. way can delete 1 , eliminate duplication. two mistake

pyspark - Spyder anaconda cloudera -

i work cloudera vm 5.4.2 i have .py want execute instruction instruction. i installed in cloudera vm anaconda. , try use spyder. my .py has instruction from pyspark.mllib.clustering import kmeans, kmeansmodel importerror: no module named 'pyspark' how have configure spyder work pyspark add spark_home , pyspark_home in .bashrc . , makes sure py4j module installed or not

xamarin - Install IPA file from server and install programmatically -

i want download ipa file server , install programmatically. want same kind of thing in android , have found way. android: http://bpsinghrajput.blogspot.in/2012/07/how-to-download-and-install-apk-from.html ios: ? could please me. regards, sneh you can't install ipa's programatically within ios (on non-jailbroken device). some other options are: if testing : upload application apple's testflight , invite testers. if testing can use web adhoc-install. requires device going have application installed registered in provisioning profile. see: http://gknops.github.io/adhocgenerate/ , https://developer.apple.com/library/ios/documentation/ides/conceptual/appdistributionguide/testingyouriosapp/testingyouriosapp.html open direct link appstore application want install within app. see: how link apps on app store

java - Adapters ignored when testing resources in Neo4j unmanaged extension -

i have implemented entityresource class entity model , entityadapter adapter overriding xmladapter in neo4j managed extension. works when deploying server. model uses adapter marshal entity , resource responds accordingly. however in test class (below) uses neo4j harness , neo4jrule entityadapter ignored receive default marshaled version of entity unwanted values. @rule public neo4jrule neo4j = new neo4jrule() .withfixture( "create ({name:'test'})" ) .withextension( "/test", entityresource.class ); @test public void testread() { // given uri serveruri = neo4j.httpuri(); string uri = serveruri.tostring() + "test/entities/test"; http.response response = http.get( uri ); // should reply assertequals( response.tostring(), 200, response.status() ); system.out.println( response.tostring() ); } the adapter must set correctly work in resource guess it's how test searches correct adapter.

java - Application stops after progress bar reaching 100 -

i built small progress bar. when press button, progress bar starts counting, 1 100. changed button text "running" when runs. when tried change text "again?" after reached 100 (after while loop finished), application has stopped - every time. help? thank in advance. package com.myfirstapplication.owner.myfirstapplication; import android.os.handler; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.progressbar; import android.widget.textclock; import android.widget.textview; public class mainactivity extends appcompatactivity { progressbar pg; button bt; int progressstatus = 0; textview tv; handler handler = new handler(); protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); pg = (progressbar) f

swift2 - About notification iOS -

i'm studying notifications, , create code thar show notification using datepicker schedule. code worked well. how show notification each 10 minutes when app in background? os code: appdelegate : func application(application: uiapplication, didregisterusernotificationsettings notificationsettings: uiusernotificationsettings) { print(notificationsettings.types.rawvalue) } func application(application: uiapplication, didreceivelocalnotification notification: uilocalnotification) { print("received local notification:") print(notification.alertbody!) } func application(application: uiapplication, handleactionwithidentifier identifier: string?, forlocalnotification notification: uilocalnotification, completionhandler: () -> void) { if identifier == "editlist" { nsnotificationcenter.defaultcenter().postnotificationname("modifylistnotification", object: nil) } else if identifier == "tras

What are the GIT versions supported by GITLAB? -

i started use gitlab. version of gitlab 8.7.5-ee. wanted know git version supported , unsupported gitlab. i try elaborate: on pc, have git version 1.5/1.6, gitlab 8.7.5-ee supports version? i tried information not find. can has information, please provide in form of chart or links? thanks , regards, vijay reddy. in official installation page suggest >= 2.7.4: (...) make sure have right version of git installed # install git sudo apt-get install -y git-core # make sure git version 2.7.4 or higher git --version but can try older one.

python - Scale rows of 3D-tensor -

i have n -by- 3 -by- 3 numpy array a , n -by- 3 numpy array b . i'd multiply every row of every 1 of n 3 -by- 3 matrices corresponding scalar in b , i.e., import numpy np = np.random.rand(10, 3, 3) b = np.random.rand(10, 3) a, b in zip(a, b): = (a.t * b).t print(a) can done without loop well? you can use numpy broadcasting let elementwise multiplication happen in vectorized manner after extending b 3d after adding singleton dimension @ end np.newaxis or alias/shorthand none . thus, implementation a*b[:,:,none] or a*b[...,none] .

iOS Swift App SceneKit with UINavigationController -

i'm developing app on ios using uikit, it's informations , health app, not game. it's company produces chairs, planned add 3d models of each chair in small view. i managed import 3d-models chair.dae , display them using scnview. complete app build storyboard , segues, combined uinavigationcontroller, user , forth on navigationbar. now problem is, navigationbar on every other viewcontroller working intended. on viewcontroller has scnview added, there no navigationbar @ all. used normal viewcontroller, added scnview , connected navigation show detail segue. another issue is, while views pulled right side of screen when switch, 1 pulled bottom , replaces everything is there way force show navigation bar? tried following, didn't change anything navigationcontroller?.navigationbar.hidden = false that sounds correct behavior show detail. per apple's view controller programming guide ios : this segue displays new content using showdetailviewcont