Posts

Showing posts from August, 2010

javascript - marionette control from backbone controls -

i want create mariontte control consists of 3 backbone controls. first date picker, second numeric stepper , third 1 again date picker. idea first date initial date , numeric stepper adds days , result shown in second date picker. anyway don't know how create marionette view when not child items same. how should approach this? i think can create compositeview(or layout can work) having 3 divs , render 3 different itemviews in 3 divs explicitly adding el of itemviews in divs e.g. if following compositeview template <div id="first-datepicker"></div> <div id="numeric-stepper"></div> <div id="second-datepicker"></div> then in compositeview js can render itemviews follows ui:{ firstdatepicker: "#first-datepicker", numericstepper: "#numeric-stepper", seconddatepicker: "#second-datepicker" }, onrender: function(){ this.ui.firstdatepicker.html(new dat

wordpress - How to display block or trigger the style on Woocommerce if !is_in_stock -

i trying display block or div when product out of stock condition not appear work add_action( 'woocommerce_get_availability', 'display_welcome', 10); function display_welcome() { global $_product; if ( ! $_product->is_in_stock() ) { ?> <style> #hello {display:block } </style> <? } } html <div id="hello">try product instead</div> add_action('woocommerce_get_availability', 'display_welcome', 10, 2); function display_welcome($availability_class, $_product) { if ($availability_class['availability'] == 'out of stock') { $availability_class['class'] = $availability_class['class'] . ' my-customclass'; add_action('woocommerce_single_product_summary', 'hooks_add_div', 33); function hooks_add_div() { echo '<div id="helllo">mujeebu rahma

jquery - open full calendar based on selected month -

i using foundation datepicker , full calendar. requiement is, 1) if select date in calendar, for example, current month july 2016. if select date in november or other month in foundation datepicker, full calendar should start selected month. please @ fiddle.one datepicker , 1 full calendar there. please @ following fiddle. jsfiddle defaultly full calendar in july month. @ starting 1 mor datepicker there. if change date on datepicker, @ time fullcalendar should opn on selected month. var nowtemp = new date(); var = new date(nowtemp.getfullyear(), nowtemp.getmonth(), nowtemp.getdate(), 0, 0, 0, 0); var checkin = jquery('#startdate').fdatepicker({ format: "dd.mm.yyyy", }).data('datepicker'); var checkout = jquery('#enddate').fdatepicker({ format: "dd.mm.yyyy", }).on('changedate', function (ev) { }).data('datepicker');

string - append or replace last char by dynamic number in C without libraries (avr-gcc) -

i'm programming microcontroller , dynamically generate string. basically desire following: char * string = "app"; for(uint8_t i=0;i<max;i++){ char * newstring = app + i; printf("%s \n",newstring); } and should print app1, app2, app3, ... know there libraries manipulate strings, i'm working on microcontroller avr-gcc , keep code size minimal. i've been messing around pointers , arrays, can't work. edit: tried like: char * path = "application/app "; path[2]=(char) '1'; rest_activate_resource(&coap_app_res[coap_app_res_nb], path); but prints "aplication/app " (without 2nd p). to manipulate strings, first of strings must modifiable. string literals aren't modifiable. the first example can implemented this: char string[] = "appx"; /* x used placeholder */ for(uint8_t i=0;i<max;i++){ string[3] = + '0'; /* assign character x */ printf("%s \n&quo

html - Customise stripe button -

im using stripe checkout in rails app. have been following thier tutorial here . basic , have payment process working. what i'm having trouble styling button in following code. script contains button (im not sure if said right), brings in default button: <script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-key="<%= rails.configuration.stripe[:publishable_key] %>" data-description="a month's subscription" data-amount="500" data-locale="auto"></script> iv tried applying styles strip-button class have no luck, have looked within doc provided cant find nothing within suggest how style default button. any suggestions or thier better way in styling button? i made little code pen i think you'll have use selector in stylesheet: .stripe-button-el { width: 100px; # ... } here's dom part want style: <b

android - InflateException DatePicker -

i trying show datepickerdialog in fragment when user clicks edittext //initialise calendar newcalendar = calendar.getinstance(); datepickerdialog = new datepickerdialog(getactivity(), new datepickerdialog.ondatesetlistener() { public void ondateset(datepicker view, int year, int month, int day) { etdate.settext(day + "/" + month + "/" + year); } },newcalendar.get(calendar.year), newcalendar.get(calendar.month), newcalendar.get(calendar.day_of_month)); //show on click datepickerdialog.show(); the problem is ends with: fatal exception: main process: tvfriends.kolio.com.tvproba, pid: 26562 android.view.inflateexception: binary xml file line #18: binary xml file line #18: error inflating class android.widget.datepicker caused by: android.view.inflateexception: binary xml file line #18: error inflating class android.widget.datepicker caused by: java.lang.reflect.invocationtargetexception @ java.lang.reflect.constructor.ne

ios - Which of the following will set the font of UISegmentedControl? -

uifont font = [uifont boldsystemfontofsize: 12.0f]; nsdictionary attributes = [nsdictionary dictionarywithobject: font forkey: uitextattributefont]; [segmentedcontrol settitletextattributes: attributes forstate: uicontrolstatenormal]; [[uisegmentedcontrol appearance] settitletextattributes:[nsdictionary dictionarywithobjectsandkeys:[uifont fontwithname:@"stheitisc-medium" size:13.0], uitextattributefont, nil] forstate:uicontrolstatenormal]; segmentedcontrol.transform = cgaffinetransformmakescale(.6f, .6f); none of these. uifont font = [uifont boldsystemfontofsize: 12.0f]; nsdictionary attributes = [nsdictionary dictionarywithobject: font forkey: uitextattributefont]; [segmentedcontrol settitletextattributes: attributes forstate: uicontrolstatenormal]; the above code change font 1 particular segmentcontrol whereas below code change font segmentcontrol in app. [[uisegmentedcontrol appearance] settitletextattributes:[nsdictionary dictionarywithobjectsandkey

swift - iOS App screen freezes when loading more than 2 collection views inside container view -

i have viewcontroller has 4 containers. intent fill containers 4 collectionviews defined on separate viewcontroller. but, problem is, when 4 collection views loaded, cannot app. no buttons nor scrolling happens. freezes- no errors thrown. when load 2 of collection views works fine. idea why happens? here code: import uikit class homeviewcontroller: uiviewcontroller { @iboutlet weak var newproductscontainer: uiview! @iboutlet weak var featuredproductscontainer: uiview! @iboutlet weak var packagelistcontainer: uiview! @iboutlet weak var productccontainer: uiview! @iboutlet weak var discountcontainer: uiview! override func viewdidload() { super.viewdidload() self.createslideshow() self.setnewproductscontainercontent() self.setfeaturedcontainercontent() self.setpackagelistcontainercontent() print("hello there") } func setnewproductscontainercontent(){ let productcollectionvc: pr

javascript - Unique names are not coming in jqgrid filter functionality -

i have implemented filter functionality in jqgrid. logic iterate on data of grid , find unique values filter. selecting values present in filter can apply filter. 1 of strings present in column coming twice , same. e.g. row 1 : "abc", row 2: "abc",row 3: "def", row 4: "def", row 5 :"feg" values in filter should all,abc,def,feg getting all,abc,abc,def,feg. def not repeating. problem string or else. code is getuniquenames = function(columnname) { var data = $("#grid0").jqgrid('getgridparam', 'data'); var uniquetexts = [], text, textsmap = {}, i; (i = 0; < data.length; i++) { text=data[i][columnname]; if (text !== undefined && textsmap[text] === undefined) { // test whether texts unique place in map. textsmap[text] = true; if (typeof text =="

excel - VBA Solver not Looping -

Image
i trying use solver on multiple columns (the exact number of columns being defined user). after looking @ questions here, still can't find what's wrong code (i pretty new vba). when run it, works fine first year not apply following years. dim wsfm_b3 worksheet set wsfm_b3 = thisworkbook.worksheets("xxxx_b3") dim wscharts worksheet set wscharts = thisworkbook.worksheets("charts") dim j integer j = 0 range("cc_reduction_years").value solverreset solveradd cellref:=wsfm_b3.range("e_start").offset(0, j), relation:=3, formulatext:=wscharts.range("min_e") solveradd cellref:=wsfm_b3.range("bank_start").offset(0, j), relation:=3, formulatext:=wsfm_b3.range("cash_b3") solverok setcell:=wsfm_b3.range("poy_start").offset(0, j).address, maxminval:=3, valueof:=0, bychange:=wscharts.range("cc_base_start").offset(0, j).address, engine _ :=1, enginedesc:="grg nonlinea

java - throw Exception in lambda(or equivalent) - javafx -

i trying popup come asking user if wish exit program everytime click exit button (x in the top left corner). using fxml , have throw exception when try load popup primarystage.setoncloserequest(new eventhandler<windowevent>{} keep getting unhandled exception error when throw error in method calling from. have tried try , catch , while there isn't error code doesn't run. trying see if can wrap method in can maybe around exception nothing has seemed work. there way use setoncloserequest thrown exception ? public class main extends application { @override public void start(stage primarystage)throws exception { file f = new file("goal.txt"); boolean bool = false; if (f.exists() ) { fxmlloader loader = new fxmlloader(getclass().getresource("mainpage.fxml")); parent root = loader.load(); primarystage.settitle("money saver program"); primarystage.sets

linux - gcc compile confuse in Ubuntu 16.04.1 LTS -

in ubuntu 16.04.1 lts, wrote hello.c following: #include <stdio.h> int main(void) { printf("hello world!"); return 0; } and compiled > gcc hello.c which result in cat: /home/linky/workspace/repo/repository/build-tool3: no such file or directory /tmp/cca62xps.o: file not recognized: file truncated collect2: error: ld returned 1 exit status then typed > gcc /usr/bin/gcc at first, removed gcc system, , reinstall it, didn't work. confused it. please me. lot

PostgreSQL - check if a row is completely filled in -

i've seen questions checking if row merely exists , haven't seen (on or elsewhere) whether or not all data filled in. i hoping select true mytable name='myrow' , * not null; work, doesn't. what wildcard work in place of asterisk, if there one? have put in each column name query individually? you can indeed reference whole row, not using * , using table name: select true mytable name='myrow' , mytable not null; the is not null operator on row value returns true if all columns of row not null. the following statement: with mytable (col1, col2, col3) ( values (1,null,null), (null,1,null), (null,null,1), (1,1,1) ) select * mytable mytable not null; will return: col1 | col2 | col3 -----+------+----- 1 | 1 | 1 the opposite btw. not true. where mytable null not return because row definition never null (because wouldn't exist). find rows @ least 1 column null need use where not (mytable not null)

Elasticsearch Java API MoreLikeThis not returning documents compared to "_search" rest endpoint -

intention: elasticsearch java morelikethis query in java below raw more_like_this filtered query via /_search rest endpoint doing. get /index/type/_search { "query": { "filtered": { "query": { "more_like_this": { "fields": [ "title", "body", "description", "organisations", "locations" ], "min_term_freq": 2, "max_query_terms": 25, "ids": [ "http://xxx/doc/doc" ] } }, "filter": { "range": { "datepublished": { "gte": "2016-01-01t12:30:00+01:00" } } } } }, "fields": [ "title", "description", "datepublished" ] }

java - Grails 3 error when packaging aplication- Could not resolve all dependencies for configuration ':gspCompile' -

app info: grails version: 3.1.8 groovy version: 2.4.6 jvm version: 1.8.0_60 i'm running grails package runnable archives come across following error: could not resolve dependencies configuration ':gspcompile'. not resolve javax.servlet:javax.servlet-api:3.1.0. required by: app:app:0.1 not resolve javax.servlet:javax.servlet-api:3.1.0. not resource ' https://repo.grails.org/grails/core/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.pom '. not head ' https://repo.grails.org/grails/core/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.pom '. connect repo.grails.org:443 [repo.grails.org/52.205.225.191, repo.grails.org/23.23.24.228] failed: connection timed out: connect error command [package] error: not execute build using gradle distribution 'https://services.gradle.org/distributions/gradle-2.13-bin.zip'. the servlet api in fact in grails repo (thanks loucher) i'm not entirely

javascript - Angular Bootstrap Typeahead dropdown -

i have angular ui-boostrap typeahead component working correctly until added 1 requirement whole function. want call backend suggested results after user types in 3 letters. done correctly problem results visible when users type in 4th letter. there way bypass this, forcing refresh ui after user types in 3rd letter. code : htlm <input name="states" id="states" type="text" ng-model="vm.cityname" uib-typeahead="municipality municipality.city + ' (' + municipality.name + ') '+municipality.zipcode municipality in vm.getmunicipalitiesbycity($viewvalue) | filter:$viewvalue | limitto:8" class="form-control" typeahead-on-select="vm.cityselected()" > js controller vm.getmunicipalitiesbycity = function (cityname) { if (cityname != undefined && cityname.length == 3) { calculationendpointservice.municipalitiesbycity({cityname: cityname}, function (result) {

java - Quartz RMI remote server returning invalid hostname -

i have 2 processes on separate servers. 1 running quartz scheduler , want connect other manage triggers. on scheduler server config is: org.quartz.scheduler.rmi.export = true org.quartz.scheduler.rmi.createregistry = org.quartz.scheduler.rmi.registryhost = localhost org.quartz.scheduler.rmi.registryport = 1099 org.quartz.scheduler.rmi.serverport = 1100 on remote server config is: org.quartz.scheduler.rmi.proxy = true org.quartz.scheduler.rmi.registryhost = ip-172-16-5-11.eu-west-1.compute.internal org.quartz.scheduler.rmi.registryport = 1099 when try , connect remote scheduler following error in log: error [2016-07-28 09:10:23,017] xxxx: error communicating remote scheduler. ! java.net.connectexception: connection refused ! ... 83 common frames omitted ! causing: java.rmi.connectexception: connection refused host: log-emea-1; nested exception is: ! java.net.connectexception: connection refused although host host on our network have no idea why being returned remote re

arrays - How to change Jquery ajax get params to ajax post params, like '?name=2&name=3&name=4'? -

Image
i wanna post lot of same field values server in jquery ajax, can via adding values url, wanna know how using data attribute. there must have equal way. $.ajax({ type : "post", url : 'abc.action?name=5&name=6', data : { name : 2, name : 3 }, error : function() { console.error("operate failed"); }, success : function(data) { console.log(data); } }); in above code, request send 5, 6 , 3 server, not 2. maybe problem different using different server side, use struts2. you seem looking array . just define variable name array. , push values it, , once has values send in ajax request. name = []; name.push("2"); name.push("3"); $.ajax({ type : "post", url : 'abc.action', data : { name : name }, error : function() { .....

Logstash timer metrics not working -

i using logstash 2.3.4 i receive lignes apache logs small score @ end ( calculated trough machine learning, spark ). here's line : hackazon.lc:80 192.168.100.133 - - [28/jul/2016:11:07:46 +0200] "get / http/1.1" 200 10442 "http://192.168.100.123/" "mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, gecko) chrome/52.0.2743.82 safari/537.36" pred:0.0859964494393 as can see first part standard apache log , end pred:0.0859964494393 . the logs processed elk visualization, , want have metrics on score called pred . therefore used timer option metrics . here logstash config file : input { file { path => '/home/spark/logstash/*' start_position => "beginning" } } filter { grok { match => { "message" => "%{combinedapachelog} pred:%{number:pred_score}"} } if "_grokparsefailure" in [tags] { drop { } } mutate { con

Android - using Adapter with object -

i have object called "entitytype en" contains string "name" want use array adapter check index of given object without defining list in r.layout because defined in object. what trying showing data (array) in menu dialog lets user select desired "name".

multithreading - Can I run multiple threads in a single heroku (python) dyno? -

does threading module work when running single dyno on heroku? eg: import threading import time import random def foo(x, s): time.sleep(s) print ("%s %s %s" % (threading.current_thread(), x, s)) x in range(4): threading.thread(target=foo, args=(x, random.random())).start() should return like... $ python3 mythread.py <thread(thread-3, started 123145318068224)> 2 0.27166873449907303 <thread(thread-4, started 123145323323392)> 3 0.5510182055055494 <thread(thread-1, started 123145307557888)> 0 0.642366815814484 <thread(thread-2, started 123145312813056)> 1 0.8985126103340428 does it? yes. works fine =) tested on latest python 3 release. can test on heroku yourself. heroku dynos using virtual cpu cores, threading still works fine. edit : here's heroku logs 2016-08-02t20:18:35.040230+00:00 heroku[test.1]: state changed starting 2016-08-02t20:18:36.871061+00:00 app[test.1]: <thread(thread-3, started 140472

salesforce - Exact Target Marketing Cloud Retrieve Automation Status sur Fuel SDK Gem in Rails -

i use rails development , gem fuelsdk retrieve information exact target marketing cloud (salesforce, via api). i can retrieve information campaigns, mails, etc... can't find direct way retrieve data automations (automation studio), exemple, status of job. any ideas?

javascript - JQuery function to allow only alphabets in textbox not working -

i use following jquery function restrict users writing numeric values in textbox. code works fine problem restrict users using other characters full stop(.), comma(,), $, @ , other signs..it not allow users use options of copy , past. want restrict users writing numeric values or numbers user should allowed use other characters. $(function() { $('.txtonly').keydown(function(e) { if (e.shiftkey || e.ctrlkey || e.altkey) { e.preventdefault(); } else { var key = e.keycode; if (!((key == 8) || (key == 32) || (key == 46) || (key >= 35 && key <= 40) || (key >= 65 && key <= 90))) { e.preventdefault(); } } }); }); hope helps: <!doctype html> <html lang="en"> <head> <script src="jquery-1.12.2.js"></script> </head> <body> <input class="txtonly" id="txtonly" name="txtonly" ty

Web socket implementation php on remote server -

i want start project of web-based chatting app, i've looked on internet , found out there's 2 solutions other ajax, long-polling , web-socket. my problem lies web-socket tutorials showing me how on localhost, although own , plan on uploading on remote server bought online. is possible web socket on remote server? or should stick long polling? [edit:] more clarification: this turtorial example requires running daemon script possible create such script on remote servers hostgator ? thank you, appreciate help. it's recommended make use of websocket's in such cases , instead of pulling out data ajax script, can surely host websocket in hosting service if allows http port extension allow websocket apart http. having best performance , full control of setup need "your own" server. today there huge amount of virtual server providers means full control on ip physical server still shared between many clients, meaning cheaper prices , more fle

Shopify Timber Framework Drawer .open() changes page position -

when drawer opens position on page returns top. this frustrating if have large product collection , you've added product cart bottom of collection you're required scroll down. is there workaround? there's nothing on javascript triggering scroll top. the reason it, triggers class .js-drawer-open on <body> has overflow: hidden , makes instantly scroll top , doesn't allow further scrolling. if remove rule, not scroll top itself, allow free scrolling while drawer open. hope helps!

java - How to set right path of property file? -

Image
i have problem can't resolve. need read properties file, can't set right path. documentation of java.io.file saying have set in src/... doesnt work, did path current file , have same problem. exception : filenotfound propertyreader class: public final class propertyreader { private properties prop = new properties(); private inputstream input = null; public properties getproperties(file file) { try { input = new fileinputstream(file); // load properties file prop.load(input); } catch (filenotfoundexception e) { e.printstacktrace(); } catch (ioexception e) { e.printstacktrace(); } { if (null != input) { try { input.close(); } catch (ioexception e) { e.printstacktrace(); } } } return prop; } } and applicationcontroller.class uses prop

excel - Error 13 with Dropdown list Audit Log -

i'm trying audit log report. 1 of things report status section can selected through drop down list. here code. option explicit dim previousvalue variant private sub worksheet_change(byval target range) if not intersect(target, range("d2")) nothing range("e" & target.row & ":f" & target.row).clearcontents if range("d2").value = "i/c" range("e" & target.row).locked = true range("e" & target.row & ":f" & target.row).clearcontents else range("e" & target.row).locked = false end if end if if not intersect(target, range("d3")) nothing range("e" & target.row & ":f" & target.row).clearcontents end if if not intersect(target, range("d4")) nothing range("e" & target.row & ":f" &

android - Twilio: Video call connecting device with computer through ngrok -

i follow [twilio quickstart-android] [1]: https://www.twilio.com/docs/api/video/guide/quickstart-android when put identity give @ url : htp://0fd251a7.ngrok.io/video-quickstart-php-master/token.php inside poupup (invite participant) , when click send @ end of screen show onlocalvideotrackadded , black small squere @ end , closed 30-40 sec. @ url http://0fd251a7.ngrok.io/video-quickstart-php-master/ camera turn on , dont invitation request send app. and problem compile 'com.twilio:conversations-android:0.12.2' @ build.gradle(module:app) in dependencies , not @ build.gradle(project:video-quickstart-php-master_test) // top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.2' } } allprojects { repositories { jcenter() } } /* have comment bec

ruby on rails - Model callbacks not working with self referential association -

i having model evaluation has many sub evaluations (self refential) class evaluation < applicationrecord has_many :sub_evaluations, class_name: "evaluation", foreign_key: "parent_id", dependent: :destroy before_save :calculate_score def calculate_score # end end i creating , updating evaluation sub evaluations nested attributes. calculate_score method triggered on sub evaluation creation not while updating. have tried before_update , after_validation . nothing seems working. evaluation form = form_for @evaluation |f| ... = f.fields_for :sub_evaluations |sub_evaluation| ... what seems issue? this article helped me fix issue. child callback isn't triggered because parent isn't "dirty". the solution in article "force" dirty calling attr_name_will_change! on parent attribute that, in fact, not change. here updated model code: class evaluation < applicationrecord has_many :su

c# - Specflow ComparetoSet throwAnErrorDetailingWhichItemsAreMissing -

i new specflow , trying utilize bdd pattern using specflow integrated visual studio 2015. have composite/complex object way hierarchy works example responsemessage ---- messageheaderclass contexttoken ----this property holds class object have few string properties ---- someconcreteclass messagebody ----this property holds class object have few string properties i have written scenario , want find values getting not reaching point thought let's try utilise comparetoset method of spec flow assist helper getting exception , in message of exception got | contexttoken | messagebody | + | messageheaderclass | someconcreteclass | what expecting , maybe wrong comparetoset set values returned object properties mentioned in scenario. have kept same properties name in feature can see below scenario: request invoker response values check given invoker invoked methodname when request passed methodname response following respo

php - Joomla uploading images issue -

i installed bt property component joomla site , when select multiple of images (more 3 or 4) want upload article, nothing happens. images won't upload. try change code don't know problem is. this code want change. <?php defined('_jexec') or die('restricted access'); $document = jfactory::getdocument(); $path = $this->params->get('images_path', 'images/bt_property'); ?> <ul class="adminformlist" id="uploading"> <li><input type="file" name="attachment" id="attachment" multiple /><img id="spinner" style="display: none; margin-left: 10px;" src="<?php echo juri::root(); ?>components/com_bt_property/assets/img/spinner.gif"> <div style="clear: both"></div> <div id="btss-message"></div></li> </ul> <script type="text/javascript

html - bootstrap col-xs makes content invisible -

let me first : not duplicate of bootstrap col-sm making content disappear . have checked see if have missed rows , fine. having said that, i'm using 24 column bootstrap, , adding col-xs class making content invisible. can see images , buttons on firebug, aren't visible on scree. disabling float:left on column class makes content visible again. have checked using firefox, chrome , ms edge, , got same result. html block affected: <div class="container"> <section id="content-promoted"> <div class="row"> <div class="col-sm-24"> <h2>originals</h2> </div> </div> <div class="row bg-dark p-tb-sm"> <!--start looping--> <div class="col-md-6 col-xs-10"> <div class="block"> <img src="{{ asset('bund

ios - Unable to add test card for apple pay testing -

i working integrate apple pay in application test it, assume need have test card added in wallet app . without getting error in xcode "this device cannot make payments." i have done setup related xcode ,and under capability can see merchant id selected , 3 checkmark done . so tried adding test card apple pay testing (getting token) followed process setting -> wallet , apple pay -> add credit/debit card -> enter manually -> here have given fake credentials taken apple testcards apple site fpan: 5204 2477 5000 1497 expiration date: 11/2022 cvc: 111 but none of cards accepted , mastercards error , issuer doesn't yet offer support card . likewise errors visa test cards getting . so how suppose test apple pay integration without having add cards in apple pay setup or how can add test card token. edit: able see apple pay presentation screen, simulated cards allready added in default. i looking same real device hi have got ans

objective c - how to change the pitch of recorded audio getting me following error -

terminating app due uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition false: node != nil' avaudiofile *file=[[avaudiofile alloc] initforreading:_recordedvoice error:nil]; avaudioformat *format=file.processingformat; avaudioframecount capacity= (avaudioframecount)file.length; avaudiopcmbuffer *buffer=[[avaudiopcmbuffer alloc] initwithpcmformat:format framecapacity:capacity]; [file readintobuffer:buffer error:nil]; [playernode schedulebuffer:buffer completionhandler:nil]; engine = [[avaudioengine alloc] init]; playernode = [[avaudioplayernode alloc] init]; [engine attachnode: playernode]; avaudiomixernode *mixer = engine.mainmixernode; avaudiounittimepitch *autimepitch; autimepitch.pitch=1200.0;// in cents. default value 1.0. range of values -2400 2400 autimepitch.rate = 2.0; //the default value 1.0. range of supported values 1/32 32.0. //get error in following line [engine attachnode: autimepitch]; [engine connect:playernode

php - Intend to get a file content is array variable -

i have file contains multiple array variable this some of content... $variable = array( "a" => array("q" => "1",), "b" => array("w" => "2",), ); some of content... $variable = array( "c" => array("e" => "3",), "d" => array("w" => "4",), );` izzit have way in file_get_contents , using preg_match_all content result this array[0] = $variable = array( "a" => array("q" => "1"), "b" => array("w" => "2"), ); array[1] = $variable = array( "c" => array("e" => "3",), "d" => array("w" => "4",), );` or have other way can same result... thanks you

Spring Boot Hibernate RestFull Service PostgreSQL -

i'm new user of spring , want develop restfull service hibernate-postgresql , spring boot. try learn documentation of spring have lot of problem deploy simple service. don't use xml file properties java class. here different files : persistancejpaconfig.java : package com.spring.configuration; import javax.sql.datasource; import org.springframework.beans.factory.annotation.autowired; import org.springframework.context.annotation.bean; import org.springframework.context.annotation.configuration; import org.springframework.jdbc.datasource.drivermanagerdatasource; import org.springframework.orm.jpa.jpatransactionmanager; import org.springframework.orm.jpa.localcontainerentitymanagerfactorybean; import org.springframework.orm.jpa.vendor.database; import org.springframework.orm.jpa.vendor.hibernatejpavendoradapter; @configuration public class persistencejpaconfig { @bean public datasource datasource() { drivermanagerdatasource driver = new drivermanagerdatasource

javascript - ExtJS 6. How to create a simple pivot grid without cmd -

i want create simple pivot grid, using extjs 6 . have extjs 6 library , pg-6.0.2 package containing related pivot grid. in past, when there extjs 5 version there nice documentation , explained how link pivot grid files index page: {pivotfolder}/packages/pivotgrid/build/pivotgrid.js {pivotfolder}/packages/pivotgrid/build/{themename}/resources/pivotgrid-all.css now, structure of pg-6.0.2 different. in fact there no build/pivotgrid.js anymore, there build/pivot.js . need? i'm not sure of that. besides, great if provide teeny-weeny example, demonstrating how code pivot grid (let 1 column , 1 row of data). code may serve starting point: ext.define("mypivot.view.viewport",{ extend: "ext.container.viewport", layout: "fit", initcomponent:function(){ ext.apply(this,{ layout:{ type: "border" }, items:[{ region: "center",

Bringing data from html to php and posting it onto database -

<img id="image" src="jj.png" onclick="randomizeimage();"/> <h2 id="score" name="score1">0</h2> <script> var counter=0; function randomizeimage() { counter++; var test= document.getelementbyid('score'); test.innerhtml= counter; } </script> <?php $con = mysql_connect("localhost","root"); if (!$con) { die('could not connect: ' . mysql_error()); } mysql_select_db("database", $con); $user_name = $_cookie["username"]; //i stored username cookie , retrieved here echo $user_name; //echo can check if right $new= $_post["score"]; //**this part undefined** $sql = "update user set score = '$new' id='$user_name'"; if (!mysql_query($sql,$con)) { die('error please try again ' . mysql_error()); } mysql_clos

get mobile number from android version 6.0 using TelephonyManager , it works with lowest versions -

i want mobile number device using telephonymanager in android studio , able in version 4.0 app gets crash when test version 6.0 you should check if user has granted permission of telephonymanager version 6.0. can check details link the following code checks if app has permission read user's contacts, , requests permission if necessary: // here, thisactivity current activity if (contextcompat.checkselfpermission(thisactivity, manifest.permission.read_contacts) != packagemanager.permission_granted) { // should show explanation? if (activitycompat.shouldshowrequestpermissionrationale(thisactivity, manifest.permission.read_contacts)) { // show expanation user *asynchronously* -- don't block // thread waiting user's response! after user // sees explanation, try again request permission. } else { // no explanation needed, can request permission. activitycompat.requestpermissions(thisactivity, new string

php - PHPUnit testing, simulate call to external API -

i have class follows class accountsprocessor{ protected $remoteaccountdata = []; /** * process data passed input array */ public function process($inputcsv): array { $this->loadremotedata($inputcsv); return $this->remoteaccountdata; } /** * given data retrieved local csv file, iterate each account, retrieve status info server * , save result instance variable array remoteaccountdata * * @param $inputcsv */ protected function loadremotedata($inputcsv) { foreach ($inputcsv $account) { // lookup status data on remote server account , add remoteaccountdata array $this->remoteaccountdata["{$account[0]}"] = $this->callapi("get", "http://examplurl.com/v1/accounts/{$account[0]}"); } } /** * curl call remote server retrieve missing status data on each account * * @param $me