Posts

Why doesn't my listview show expected result in my android app? -

Image
when use listview in app, want use this.setselection(0); skip first item everytime foto girl in attached picture shakes. not smooth , don't know how solve this. if use this.smoothscrolltoposition(0); girl doesn't shake top menu shakes. here picture. replies!

javascript - Mysterious line, used to require html templates in Webpack: templates.keys().forEach(templates)? -

i want import html templates webpack bundle ngtemplate-loader , html-template-loader , found 2 lines of code, used purpose, in project: const templates = require.context(__dirname, true, /\.html$/); templates.keys().foreach(templates); the first line clear me - recursively requires html files under current directory, adding them $templatecache. but second line total mistery me. what's point of it? templates.keys() return array of paths matched files: ['./file1.js', './file2.js'].foreach(templates); then foreach invoke templates function (which require context setted __dirname ) each file: templates('./file1.js'); templates('./file2.js'); or: require('./file1.js'); // files searched relative __dirname require('./file2.js');

javascript - Why can't I return $.ajax result but can return $http.post result? -

i have 2 return statements: return $http.post({ url: cheapwatcher.config.domain + 'api/authenticate', contenttype: 'application/x-www-form-urlencoded; charset=utf-8', data: data }); return $.ajax({ type: 'post', url: cheapwatcher.config.domain + 'api/authenticate', data: data }).done(function (result) { console.log('logged successfuly'); }).fail(function (result) { console.log('loging failed'); }); and background.js function uses api methods: // register api command listener chrome.runtime.onconnect.addlistener(function (port) { port.onmessage.addlistener(function (request, portinfo) { // globally accessible function execure api calls cheapwatcher.executeapicall = function (request, senderid) { var originalrequestmethod = request.method; //dinamically call api method cheapwatcher.api[request.method](request, senderid).then(function (respons...

Configuring Java security policy to allow JUnit? -

i developing java application. want run unit tests in security-restricted jvm block network access. i added -djava.security.manager=default -djava.security.policy=...file... options jvm, , security manager effective. i iterated couple of times running tests, seeing security violation happens, , granting in policy file. now, not getting security violations anymore. instead, this: ------------------------------------------------------- t e s t s ------------------------------------------------------- running org.onebusaway.alexa.authedspeechlettest tests run: 1, failures: 0, errors: 1, skipped: 0, time elapsed: 0.143 sec <<< failure! - in org.onebusaway.alexa.authedspeechlettest org.onebusaway.alexa.authedspeechlettest time elapsed: 0.06 sec <<< error! java.lang.noclassdeffounderror: org.junit.runner.runner @ org.apache.maven.surefire.junit4.junit4provider.execute(junit4provider.java:364) @ org.apache.maven.surefire.junit4.junit4provider.executewith...

Draw ECG Graph from ECG (Dicom) Modality -

how draw ecg graph ecg (dicom) modality. which tags use draw intervals or scale on x.y axis and how draw x,y co-ordinate on x.y axis i.e. plot points on graph tags need consideration thanks reply use information on documentation. in particular case should have here: waveform data , related data elements on other side, please consider giving vote or accepting answer when find provided information useful.

How to break a callback chain in JavaScript? -

i uploading multiple files browser , need sequentially. so chain next upload commencement previous upload completion callback. it's simple , works fine. during upload display progress user along cancel button. if user hits cancel want stop entire callback chain. how that? there mechanism in javascript halt callback chain? ok here example of callback chain in javascript. question is, how break "cancel" button? https://jsfiddle.net/jq7m9beq/ var filenamestoprocessqueue = ['v.jpg','w.jpg','x.jpg','y.jpg','z.jpg'] function finishedprocessing (filename) { console.log('finished processing: ' + filename) // processing finished file, start again chaining next 1 doprocessfiles() } function waitforeachfile (filename, callback) { // wait couple of seconds , log filename settimeout(function(){ console.log('waited 2 seconds for: ' + filename);callback(filename);}, 2000) } function doprocessfiles() { // n...

Google App Engine PHP script to process email and send data to a Google Sheet -

our water district sends out automated alarms , process statistics scada computer in our water treatment plant. information sent in form of sms messages , daily emails csv file attachments. because have informational website on google sites, automatically display real-time process statistics on our website in simple google sheet automatically updated. i have been handling sms alarms through custom php/twilio scripts separately hosted, integrate in google cloud google appengine. think can accomplished in variety of ways, , evaluating alternative automation approaches using php , gmail api. google cloud/appengine noob, have couple of architectural questions: can accomplish automation enabling google sheet incoming mail , processing data through spreadsheet scripting? if elect approach, can google sheet receive email directly, or must send email data sheet http request? alternatively, google cloud more reliable , robust platform automation? examples have seen, looks appeng...