Posts

Showing posts from August, 2011

angularjs - Using browser.get causes asynchronous script timeout -

i'm using protractor automation testing , encountered following behavior: when try use browser.get load certin page page loaded following error: error while running testforangular: asynchronous script timeout: result not received in 11 seconds. i use browser.get in following way: beforeeach(function() { browser.ignoresynchronization = false; browser.get('https://.../automation_vf'); browser.ignoresynchronization = true; },60000); it(data.testproperties.description, function () { browser.executescript('return remoteactions;') .then(function(remoteaction) { browser.executeasyncscript(function(remoteaction) { var callback = arguments[arguments.length - 1]; visualforce.remoting.manager.invokeaction(remoteaction.clearalldata, function (res, ev) { callback(res); }, { buffer: false, escape: false, timeout: 15000 }); },re...

subprocess crashes on osx python -

i have gui software in wanted heavy tasks create new subprocesses run tasks. using multiprocessing module , works fine on windows unix. when try same osx 10.6 process crash occurs , long error report cannot decipher. here used make sub-process :- p = multiprocessing.process(target = encode.encode , args = (self.path,self.savepath,) , name = "encode process") p.start() temp = wx.progressdialog('please wait...', 'encoding file....this may take several minutes....\n\t....so sit , relax....',parent = self,style = wx.pd_app_modal | wx.pd_can_abort) temp.setsize((450,130)) while len(multiprocessing.active_children()) != 0: time.sleep(0.1) if not temp.updatepulse("encoding file....this may take several minutes...\n\tso sit , relax.....")[0]: p.terminate() terminated = true break temp.destroy() p.join() p.terminate() here crash report :- path:/library/frameworks/python.framewor...

python 3.x - In a nested for-loop, how can I access the outer loop index in a jinja template? -

{{loop.index}} correctly dereferences innermost loop. i'm not seeing way identify loop index i'd like, however, if have more 1 loop nested. http://jinja.pocoo.org/docs/dev/templates/ yes. part of documentation answers question! the special loop variable points innermost loop. if it’s desired have access outer loop it’s possible alias it: <table> {% row in table %} <tr> {% set rowloop = loop %} {% cell in row %} <td id="cell-{{ rowloop.index }}-{{ loop.index }}">{{ cell }}</td> {% endfor %} </tr> {% endfor %} </table> http://jinja.pocoo.org/docs/dev/tricks/#accessing-the-parent-loop

iphone - iOS - Property 'isConnected' not found on object of type 'CBPeripheral' -

good day. trying replicate android app made ios. i'm trying make ble application ios device able see , connect ble devices , rssi (i don't care message , other data). upon search research, found this blte central peripheral transfer example in ios developer library. upon downloading, opening xcode project, , ran it. however, ran error shorty after code: if (!self.discoveredperipheral.isconnected) { return; } where error is: property 'isconnected' not found on object of type 'cbperipheral' upon searching again, i found link . however, seems thread not have solutions answers discussed seem deprecated. can't seem find solutions issue well. has tried make code ios developer library work? lead appreciated. pretty sad code ios dev site deprecated , not updated. the documentation says deprecation statement use state property instead.

android - How to make text on button appear and disappear continualy -

i have button want text appear 1 second disappear 1 second, loop 6 seconds, here tried: for(int = 0 ; < 6 ; i++) { button.settextsize(18); try { thread.sleep(1000); } catch (interruptedexception e) { e.printstacktrace(); } button.settextsize(0); try { thread.sleep(1000); } catch (interruptedexception e) { e.printstacktrace(); } } first appear button's text size became 36 instead of 18, second is not act expected, never show text, note: text size start 0. how can achieve this? okey suggested want blink textview , here can do. create on folder under res called "anim", create 1 xml file under blink.xml , copy code in it. <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha android:fromalpha="0.0" android:toalpha="1.0" android:duration="10...

php - DHL XML Services - Book Pick Up - Error 108 System Unavailable -

i trying use dhl xml service request pickup. after giving value , using following code getting error error108system unavailable. how can resolve issue. due error in code or server not responding. request_pickup.php <?php $xml = file_get_contents('post_xml.xml'); $url = 'https://xmlpitest-ea.dhl.com/xmlshippingservlet/'; $post_data = array( "xml" => $xml, ); $stream_options = array( 'http' => array( 'method' => 'post', 'header' => "content-type: application/x-www-form-urlencoded\r\n", 'content' => http_build_query($post_data), ), ); $context = stream_context_create($stream_options); $response = file_get_contents($url, null, $context); var_dump($response); and other xml file is <?xml version="1.0" encoding="utf-8"?> <req:bookpurequest xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/x...

python - How to install OpenCV3 in Anaconda3 offline? -

i tried install opencv python-3.5 in anaconda using following command conda install -c https://conda.binstar.org/menpo opencv3 this taking long time download file. seems download accelerator better @ doing this. file location at https://anaconda.org/menpo/opencv3/3.1.0/download/osx-64/opencv3-3.1.0-py35_0.tar.bz2 is there way same installation offline given opencv3-3.1.0-py35_0.tar.bz2 file? if want install package file directly do conda install path_to_file/opencv3-3.1.0-py35_0.tar.bz2 where, of course, path_to_file file path file. note warning in conda install here: conda can called list of explicit conda package filenames (e.g. ./lxml-3.2.0-py27_0.tar.bz2). using conda in mode implies --force option, , should likewise used great caution. explicit filenames , package specifications cannot mixed in single command. you can use --offline argument make sure don't connect internet.

image - python screenshot file moved or renamed -

i wrote code on python suppost take screenshot , show it. shis code: from pil import imagegrab,image import pil def screenshot(): num=1 takescsh = imagegrab.grab() takescsh.save(str(num)+'.png') takescsh.show() num=num+1 x=raw_input() while x!='stop': screenshot() x=raw_input() it opens windows picture viewer in picture viewer says "it looks file moved or renamed" idea why that? in screenshot function, num equal 1 . so, each , every time call screenshot , file rewritten on disk. try like: def screenshot(num): takescsh = imagegrab.grab() takescsh.save(str(num) + '.png') takescsh.show() count = 1 while 'capturing': screenshot(count) count += 1 if raw_input() == 'stop': break

javascript - Rack middleware to to prepend while(1); to all ajax/json requests -

i'd similar google/facebook in post: why google prepend while(1); json responses? adding while(1); beginning of script , json posts, using rack middleware in rails app. way can go doing ajax requests (which may or may not have authentity_token or or sensitive data embedded in response). we have api needs not use this, thinking url matching middleware not kick in. can point me in right direction code might like? thanks! there's quite lot of questions molded one, think. the middleware something(haven't checked it, feels right) this: class antihijackingmiddleware def call(env) status, headers, body = @app.call(env) # save initial state if env["http_x_requested_with"] == "xmlhttprequest" && headers['content-type'].to_s.include?("application/json") body = "while(1);"+body headers['content-length'] = rack::utils.bytesize(body.to_s).to_s end [status, headers...

ruby on rails - For newbie : Test with rspec in a model using a method -

i have ownership model, has start_date , end_date , in model, have following code : def current? self.start_date.present? && self.end_date.nil? end now want test ownership.current? how going ? here tried, using expect... describe "when owning , giving date nil" before @ownership.agreed = true @ownership.save @ownership.update_attributes(start_date: nil, end_date: nil) end { should be_valid } expect(@ownership.current?).to be_false describe "then product owned" before { @ownership.update_attributes(start_date: 1.day.ago) } { should be_valid } expect(@ownership.current?).to be_true describe "then product given" before { @ownership.update_attributes(end_date: 1.hour.ago) } { should be_valid } expect(@ownership.current?).to be_false end end end ... didn't worked. tried replace expect(@ownership.current?).to be_false @ownership.current? { should be_false } , didn...

How to install qt 5.6.0 in a computer without network access -

Image
i've downloaded offline version of qt sdk 5.6.0 , when tried it, requires me input account information, in computer, have no network access. is there possible way install in computer? are sure installer requires sing-up? in case, can omit singing , press skip button:

records missing when I loop though xml php -

this question has answer here: retrieving children xml php 1 answer apologies if duplicate, see other similar problems, cant mine work. i have xml: <?xml version="1.0" encoding="iso-8859-1"?> <quizzes> <quiz> <title>arithmetic quiz</title> <description> <text>seeing how mathematical quiz works</text> </description> <grading> <range start="0" end="49"> <grade>f</grade> <rank/> </range> <range start="50" end="60"> <grade>d</grade> <rank/> </range> <range start="60" end="69"> <grade>c</grade> <rank/> </range> <range start="70" end="79"> <grade>b</grade> <rank/> </range> <range start=...

mysql - Sequilize association for 2 foriegn key of same model -

i need execute below query using sequelize select * haulerrfquotes left join quotes on quotes.jobid = haulerrfquotes.jobid , haulerrfquotes.haulerid = quotes.haulerid haulerrfquotes.jobid = '11' but not getting how use 2 foriegn keys in same model(haulerrfquotes) , create association of both foriegn keys single model (quotes) in sequelize, define own join condition supplying on options in include object. here's example perform query in question haulerrfquotes.findall({ where: { jobid: 11 }, include: [{ model: quotes, required: false, on: { jobid: { $col: 'haulerrfquotes.jobid' }, haulerid: { $col: 'haulerrfquotes.haulerid' } } }] }).then(result => { // rest of logic here... });

javascript - How to listen to socket events and http post ? node js -

i working on node js server use socket io. var express = require('express') app = express.createserver(); app.use(function(req, res, next) { res.header("access-control-allow-origin", "*"); res.header("access-control-allow-methods", "get,put,post,delete"); res.header("access-control-allow-headers", "origin, x-requested-with, content-type, accept, x-auth-token"); next(); }); app.get("/", function(req, res) {res.send('admin')}); i need listen post request json body i've added these lines: app.post('/testpost',function(req,res){ console.log("post json : " + req.body ); }); but receiving undefined request body. because should add : app.use(bodyparser.json()); app.use(bodyparser.urlencoded({ extended: true })); but after adding bodyparser.json() socket io doesn't connect ! what should ? how ask node js use bodyparser.urlencoded /t...

vbscript - How can I make a VBS Message Box appear in a random place? -

in vbs script, have created simple message box application. stays in front of windows until user responds , uses simple coding x=msgbox("test text" ,1+4069, "test title") but appears in same place. there way of making appear in random place on screen? please help! there 1 type of box allows position on screen: inputbox title = "hello" defaultvaluetext = "hello stackoverflow !" message = "type here" xpos = 0 ypos = 0 text = inputbox(message,title,defaultvaluetext,xpos,ypos) xpos = 3000 ypos = 800 text = inputbox(message,title,defaultvaluetext,xpos,ypos)

html - How to clip an SVG plot? -

my svg element setup this: svg.attr("viewbox", "0 0 " + chartview.displaywidth + " " + chartview.displayheight); inside i'm drawing plots. there way create "see through window" inside can see plots? i tried using: svg.append("clippath").append("rect") .attr("x", 10) .attr("y", 10) .attr("width", 50) .attr("height", 100); but doesn't work as mentioned in comments use clippath. tried create 1 using append . far know, d3.js or jquery syntax. tagged svg.js . in svg.js this: svg.viewbox(0, 0, chartview.displaywidth, chartview.displayheight); var plot = svg.path('your plots path data').stroke('#000') var clipper = svg.rect(50, 100).move(10, 10) // clip whole svg use svg instead of plot plot.clipwith(clipper) if use d3.js there. created clippath. have give id, ...

cordova - How to configure the StatusBarOverlaysWebView phonegap plugin to prevent the status bar from overlapping the app content -

i cannot work. have added plugin directory via phonegap cli, , inserted: <preference name="statusbaroverlayswebview" value="false" /> into config.xml in ios platform block, status bar still overlays content. install latest version of cordova statusbar plugin using following command, cordova plugin add cordova-plugin-statusbar add following lines in config.xml under ios platform section, <preference name="statusbaroverlayswebview" value="false" /> <preference name="statusbarstyle" value="default" /> remove ios platform, re-add , build ios platform again.

mysql - Join with multiple conditions -

my entire query bit complex i'll try show need understand problem, i'm fetching tickets data base, displays title, creator, people in charge of ticket, , last updater, creator , people in charge find id in tickets_users.users_id , type 1 or 2 depending if creator of ticket or if in charge, title , informations of ticket table named tickets users id name etc it's users so query looks that: select tickets.id, tickets.name, group_concat( case when tickets_users.type = 1 concat(users.firstname, ' ', users.realname) end) creator, group_concat( case when tickets_users.type = 1 concat(tickets_users.users_id) end) creator_id, group_concat( case when tickets_users.type = 2 concat(users.firstname, ' ', users.realname) end) in_charge, group_concat( case when tickets_users.type = 2 ...

amazon web services - Create dynamic paths in AWS S3 -

i have bunch of files in s3 in following path example: s3://bucket/date=2016-01-02/2016-01-02_1012_582.txt s3://bucket/date=2016-01-07/2016-01-07_1415_272.txt when files put in, partition, in case date, kept simple because quick. now, want partition based on file names. so, 2 paths these: s3://bucket/data/date=2016-01-02/a=1012/b=582/2016-01-02_1012_582.txt s3://bucket/data/date=2016-01-07/a=1415/b=272/2016-01-07_1012_272.txt is there clever way without reprocessing files? i've looked @ aws cli, doesn't seem part of it. thanks you have write script take each file , copy or move them new key.

c++ - undeclared identifier in using Eigen with visual studio -

i trying use eigen visual studio , when include file #include <unsupported/eigen/cxx11/tensor> following error occurs error 4 error c2065: 'derived' : undeclared identifier c:\libs\ville-k-eigen-cdf3d4834d6d\unsupported\eigen\cxx11\src\tensor \tensorforwarddeclarations.h 19 1 eigenclstm no idea why so. searched well, there no helpful posts. appreciated. update i have read far, 1 internal msvc bug. perhaps, helps understanding. thanks

asp.net - Can I test OpenID Provider on server from a Relying Party in my local machine? - DotNetOpenAuth -

i had created provider , relying party in visual studio using dnoa library , worked well. then, moved provider server , tried test relying party local machine. rp gives error of 'no openid endpoint found'. i think missing in web.config. in whitelisthost attribute, have added wildcard "*" should make provider accept requrests (for testing purpose). there else not aware of? relatively new topic. web.config - <!-- uri section necessary turn on .net 3.5 support idn (international domain names), necessary openid urls unicode characters in domain/host name. required put uri class rfc 3986 escaping mode, openid , oauth require. --> <uri> <idn enabled="all"/> <iriparsing enabled="true"/> </uri> <!-- optional configuration section aspects of dotnetopenauth can customized --> <dotnetopenauth> ...

sql - Oracle Regex Replace on String Query -

query fetches sub xml xml saved in clob column of table given : select regexp_replace(xmltype(t.prov_request).extract('//soap_domain_msg/body').getstringval(),'<body>|</body>','') xml tbl_prov_comptel there "so1_username" value="xxx" in string returned above query. want achieve form consolidated query , append in start of expression above. ie. "so1_username" value="qwexxx" oracle setup : create table tbl_prov_comptl ( prov_request clob ); insert tbl_prov_comptl values ( '<soap_domain_msg><body><ns4:modifyrequest xmlns:ns4="http://soa.comptel.com/2011/02/instantlink"><ns4:requestparameters> <ns4:parameter name="so1_username" value="222671150"/></ns4:requestparameters> </ns4:modifyrequest></body></soap_domain_msg>' ); query : select extractvalue( xml, '//ns4:modifyrequest...

google admin sdk - Create New Service account programmatically -

is there google admin api create new service account using credentials of service account? i'm creating saas solution i'm providing services end users different domains. google recommends (not restricts) use different service account (esa) each domain data entirely segregated. to achieve this, need create new esa programmatically whenever new customer signsup. i'm able provide services users (from different domains) using single esa, not able find api allows me create new esa programmatically. possible?

java - delete selected text from JScrollpane -

i developing gui in java using netbeans ide , swing forms. here want delete selected text jscrollpane using delete button have added using add button. able delete entire text not selected one. have searched on internet not help. below code have tried. suggestions helpful me. private void buttondelactionperformed(java.awt.event.actionevent evt) { jfilechooser chooser = new jfilechooser(); filefilter ft = new filenameextensionfilter( "arxml files", "arxml" ); chooser.setfilefilter(ft); jscrollpane1.getcontainerlisteners(); chooser.setmultiselectionenabled(true); joptionpane.showconfirmdialog(frame, "you selected : " + list.getselectedvalue()); if (evt.getsource() == buttondel ) { file[] files = chooser.getselectedfiles(); log.settext(""); } your jscrollpane must have jtextarea putting content. add listener jtextarea , selected text on ...

php - unlimited parameters get last one -

i'm using codeigniter. how can last part of url like: www.example.com/uk-en/category/subcategory parameters may unlimited or there may one. inside of controller home , method index, want last part of url e.g "subcategory" if url www.example.com/uk-en/category want "category" if url www.example.com/uk-en want "uk-en" edit if url www.example.com/home/index/uk-en/category it's working want without class name "home" , method "index" like www.example.com/uk-en/category <?php defined('basepath') or exit('no direct script access allowed'); class home extends ci_controller{ public function index($params=[]){ $params=func_get_args(); $last=end($params); echo $last; } } ?> routes.php <?php defined('basepath') or exit('no direct script access allowed'); $route['(:any)'] = 'home/index'; $route['default_cont...

Oracle sql execute sql from varchar field -

i have column in table sql-where clause stored: table_a id | entry -------------- 1 | "(select some_id table_one)" -- stored varchar(4000) 2 | "(select some_id table_one column_one 'test')" is possible use statement in entry column in select? something like: select * table_b, table_a table_b.id = table_a.id , table_b.value in --and here should entry column table_a you can't dynamicly add sql within sql. alternatively can use encapsulate query logic in function , use dynamic sql in pl/sql. for need create function (my_function in sql below) returns collection of string , accepts sql statement parameter , write query way select * table_b, table_a table_b.id = table_a.id , table_b.value in (select column_value table(my_function(table_a.sql_statement)) performance not ignored approach. suggest evaluate consequence of context switching before going solution additionally, you...

linux - Interrupt rate in modern computers -

when computer connected wifi, see 180-200 interrupts per second. when start typing - 2-3 cps, interrupt rate spikes @ 300 interrupts per second. i'm running cinnamon @ gnu/linux (x86_64) , firefox @ modern laptop, believe other os/browsers have same behavior. why there many interrupts? happens when press key in browser? understand there many things process in code, why require many interrupts? if need it, here /proc/interrupts: https://gist.github.com/amarao/654e5dd0f2460b7d475711e8ae3b6338 .

list - remove R level of unlisted object -

i have variable named 'feedb' here when called : > feedb [[1]] [1] nocoment 319 levels: - --- ... variasu barang ditambah [[2]] [1] mantao 319 levels: - --- ... variasu barang ditambah [[3]] [1] tolong takpilkan no resi pengiriman. 319 levels: - --- ... variasu barang ditambah i not know '319 levels : - --- ... variasu barang ditambah' comes from. , unlist of variable abc<-unlist(feedb) and still has level : > abc [1] nocoment mantao [3] tolong takpilkan no resi pengiriman. 319 levels: - --- ... variasu barang ditambah what levels? , how remove it? want abc contains value. tried stringasfactor=false cannot used we can use droplevels drop unused levels or call factor again. should have happened when factor column or vector got subsetted, levels of original vector still remains. feedb[] <- lapply(feedb, droplevels) or feedb[] <- lapply(feedb, factor) ...

r - How to select a genetic distance range to plot a mst using vengan library -

i've tried perform genetic distance analysis using ape , vegan. first of calculated genetic distances using ape: data<-read.dna(file = "proof.txt", format = 'fasta') d <- dist.dna(data, model ='tn93', as.matrix ='true') this code gives me huge matrix d = 0 in many cases. then, perform mst follows: mst <-spantree(distances, toolong = 0.015) i chose toolong select max parwise distances = 0.015 but when i've tried plot it, error apeared: error in fun 8d, y):zero or negative distances between objects 1 , 2 does know how choose distances larger "0" , >= 0.015? supply configuration on plot spanning tree. the error message comes function mass::sammon() used find configuration of points if none given, , function not accept 0 distances. instance, following should work: plot(mst, ord = cmdscale(as.dist(dist.dna)))

mysql - LEFT JOIN 3 tables sql OpenCart -

i need join table in function name vendors, possible public function getproducts($data = array()) { $sql = "select * " . db_prefix . "product p left join " . db_prefix . "product_description pd on (p.product_id = pd.product_id) pd.language_id = '" . (int)$this->config->get('config_language_id') . "'"; $sql = " select c.olumns, y.ou, a.ctually, w.ant product p join product_description pd on pd.product_id = p.product_id join vendors v on v.product_id = p.product_id pd.language_id = ? order p.product_id; "; now see prepared statements

hadoop - How are hive udf, udaf, udtfs written in java debugged in an ide like eclipse? -

for e.g debugging pig udfs works : http://ben-tech.blogspot.ie/2011/08/how-to-debug-pig-udfs-in-eclipse.html have hive script in use udaf failing step through udf code. junit can debugged eclipse ide. , since java class. consider udf. example 1 class simplehelloworldudfexample extends udf { public text evaluate(text input) { if(input == null) return null; return new text("hello " + input.tostring()); } } junit test method this... @test public void testudfnullcheck() { simplehelloworldudfexample example = new simplehelloworldudfexample(); assert.assertnull(example.evaluate(null)); } example 2 package com.hive.udftest import java.util.list; import org.apache.hadoop.hive.ql.exec.udfargumentexception; import org.apache.hadoop.hive.ql.exec.udfargumentlengthexception; import org.apache.hadoop.hive.ql.metadata.hiveexception; import org.apache.hadoop.hive.ql.udf.generic.genericudf; import org.apache.hadoop.hive.serde2.objectinspect...

.net - How to identify Processor Architecture in Xamarin.Android? -

lets android processors of type arm testing, emulators of type x86. native library runs on arm , want put dummy code x86 in order create unit tests. know simple try/catch suffice, problem wan create interface dummy code unit tests. i have tried, system.reflection.portableexecutablekinds pekind; system.reflection.imagefilemachine machine; typeof(object).module.getpekind(out pekind, out machine); and various answers found .net, while in android, x86 always, though running app on device, not give me correct answer. type(object).assembly.getname().processorarchitecture always returns x86. you can use android.os.build class confirm if device arm or intel x86 ( intel ) armeabi-v7a or x86 etc. ilist<string> abis = android.os.build.supportedabis; alternatively you can use java.lang.javasystem.getproperty method os architecture, armv71 , i686 etc. string osarchitecture = java.lang.javasystem.getproperty("os.arch"); ...

javascript - Running if/each statement to select divs and alter background image position independently -

i trying change position of background image within div depending on text within span. my problem multiple divs have same class not changeable. for example. every cell want change image position looks like: <td class="js-gridblock js-pre-order" data-attvalue1="3xl" data-attvalue2="plum"> <div class="js-gridimage"> <div class="prodpagegridtext" id="gridtext-gridbox34"> <span class="status">due in 4 weeks</span><br> <div class="prodpagegridtextarrow"> </div> </div> </div> </td> where span class status value changes anywhere between 1-10. my jquery looks like; jquery(document).ready(function() { if (jquery('span.status:contains("4")')) { jquery('.js-pre-order .js-gridimage').css("background-position", "-4px -213px"); } ...

performance - Javascript array deletion for garbage collection -

i have javascript array of objects each created 'new'. in event of error clear whole array gc'ed js engine. end sufficient set array variable 'null' or need splice elements array , set them null before setting array variable 'null'? the reason asking in firefox displayed (console.log) array before assigning null , displayed object (which updated in display assume later) still shows elements of array when inspect later, hence doubt if elements being free'd or not. tia to clear array can set length zero: var arr = [1,2,3,4,5]; console.log(arr); arr.length=0; console.log(arr); result: [1, 2, 3, 4, 5] [] edit: found on topic: http://davidwalsh.name/empty-array looking @ comments seems setting variable new array simplest method: arr = []; according test results memory gc'd quicker setting length 0. imagine allocations triggering gc. there interesting performance test on various methods here: http://jsperf.com/array-destr...

C# - Change volume using external Midi controller -

in app use midi-dot-net noteon messages , naudio play audio samples / notes. in naudio i'm using asio implementation lower latency , works perfectly. have problem controlling volume. before used asio engine able controll volume way (some part of code): private void...() { int newvolume = ((ushort.maxvalue / 50) * trackwave.value); uint newvolumeallchannels = (((uint)newvolume & 0x0000ffff) | ((uint)newvolume << 16)); waveoutsetvolume(intptr.zero, newvolumeallchannels); volumen.text = trackwave.value.tostring(); } when i'm using asio implementation in naudio it's not working, can mute sounds, can't change volume. do know how can controll volume use of volume slider placed in external midi controller? somehow works when testing steinberg or synthogy or other audio software producers asio drivers. thank help. with asio change volume modifying level of samples send device. there isn't concept of device volume. ...

android - Display a Viewpager that scrolls together with a RecyclerView -

i want display viewpager scrolls when recyclerview have placed below scrolls up. the information displayed in recyclerview depends on page displayed in viewpager. above viewpager there toolbar. this layout i'm using: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout android:id="@+id/coordinatorlayout" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".main.mainactivity"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/colorprim...

serialization - Writable Double-nested serializers with Django Rest Framework -

i have invoice 1 or multiple product_invoice, , product_invoice can have 1 product_order (so in productorder, productinvoiceid shoulb onetoone relashionship not important issue). i able data on 2 level, can't create, there error : typeerror: 'orderinfo' invalid keyword argument function. but if remove 'orderinfo' in productinvoiceserializer able create invoice , related product_invoice. what doing wrong ? django : 1.9.3, drf : 3.3.3 [ { "invoiceid": 43, "stocklocationid": 1, "invoicecode": "obr00040", "invoicedate": "2016-05-07", "totalamount": 500000, "buypricetotal": 125000, "discount": 0, "ppnamount": 50000, "ispaid": true, "deposit": 0, "emailaddress": "", "customername": "", "invoicenote": "", "isorder": f...

how to add validations in mini-login form without redirecting in header itself of magento -

i using default mini-login form in header , works logged in correct details whenever enter wrong username , password validation redirects customer/login page don't want use. want validations customer/login page in header , don't want redirect anywhere. please give suggestion. i found answer myself validations below : in form tag have added id : <form action="<?php echo $this->getpostactionurl() ?>" method="post" id="login-form-header"> then put below script validate <script type="text/javascript"> //<![cdata[ var dataform = new varienform('login-form-header', true); //]]> </script> and required classes in input box question : when both fields validate , email, password not matching redirects customer/login page don't want redirect , should stay on same.

how to mange tab laoding in tab bar in android -

tabbar activity here i attach view pager code in below, problem in tab bar ,when launch activity tab1 , tab 2 load automatic. want tab 1 when scroll tab 1 tab tab 2 ,then tab 3 loaded not tab 2 (but want when scroll tab1 tab 2 tab 2 load )and when scroll tab 4 tab 5 nothing loaded(i want when scroll tab 4 tab 5 tab 5 load)same happening when scroll tab 2 tab 1 nothing loaded (i want tab tab 1 loaded).and when scroll tab 3 tab 2 tab 1 loaded (but want tab 2 loaded)i facing problem before 1 month till now. package activity; in 'getitem()' method ,i think have reversed tab2<->tab3 try interchanging

android data binding: how to get useful error messages -

in android studio 2.1, compile time error messages xml mistakes entirely non-helpful: error:(11, 41) error: package mypackage.databinding not exist error:(15, 13) error: cannot find symbol class myactivitybinding the real error "there's no such attribute android:adapter ", or "variable foo doesn't contain property bar" or that. instead of showing such errors, shows above unhelpful ones, tell bindings weren't generated because of unknown error. there's no easy way now. in general, if face such compilation error , error messages point @ missing databinding classes either bad reference layout (i.e. try access members classes assigned not expose - happens when c&p layouts). even worse, when use other code generating libraries (icepick, butterknife, etc) real culprit can in code unrelated binding. when occur in code, check gradle console view , read end up, ignoring error messages related databinding "missing class" or ...

executing a SCUFL xml in Taverna Workbench -

i relatively new workflow management system , exploring taverna. understand taverna workbench gui building , editing workflows, if have scufl xml underlying language graphical workflow represents, there provision in taverna workbench allows me directly import , execute given xml ?. or must taverna command line tool?, tried find in documentation not find reference.

java - How can I change or override a factor defined in JScience library? -

jscience library implementation uses set of values converting units each other. not sure defined constants. i use own conversion factor convert meters feet. there way accomplish in jscience api? thanks consider using jsr-363 , went final month ago, while jsr-275 never did. extension modules uom-systems convert meters feet, inch or other customary units. let know, either here or better in github issue tracker(s) if there's you're missing or think not work intended.

android - WSO2 EMM - Usage limitations -

helpers , everyone, first, site give access @ source of information, has been helpful in past. i'm newbie in world of developing , mdm. today, i'm working on wso2 emm 2.0.1 solution. after first setup, have public , enterprise apps deployed on 2 android devices, in lan. work android devices moment. plan deploy amazing program need answers , technical advices features , possibilities before going further. here : because need limit usage of devices, need restrict use of native apps on each devices such internet browser or play store , allow installation app store. so, there way restrict actions or else ? does blacklist feature still available in version of wso2 emm ? for security topic, know in circonstances, can filter url web browser disable access on specific sites. have pass through proxy in network ? or exist way when devices connected on public network ? and question of mobility, how can setup devices , lan devices communicates server , access apps store or others...

regex - regular expression evaluation in string matching -

i reading regular expression in algorithms robert sedgwick book. here regular expression mention below a* | (a*ba*ba*)* here author mentioned matches are: aaa, bbaabb, , babaaa. not match above regular expression aba bbb babbaaa. my question how bbaabb matching , same way how babaaa matching. kindly explain. in general looking how evaluate | , * operators in regular expressions. in below example how can b alone in set if have a+ since says must have atleast 1 a. (a+b)* = (λ, a, b, aa, ab, ba, bb, aaa, ...) there 1 difference between * , + . character after put * can have no repetition. in + case, can have minimum 1 repetition. in a* | (a*ba*ba*)* , bbaabb valid following reasons , according (a*ba*ba*)* pattern no a @ start a* 1 b ba* , no a 1 b ba* , 2 a * @ end of (a*ba*ba*)* shows pattern can repeat. second repetition bb valid these points bbaabb valid.

angularjs - Retaining user details on page refresh -

on login request, sending id, password & in return i'm getting unique token key, uid, email & uname , saving them in local. after user logged in, if refresh page, header changes & ask again login. how can retain values after page refresh. here code:- angular.module('feapp').controller('loginctrl', function($scope, $rootscope, $uibmodalinstance, login, appsettings, appservices, lclstorage) { $scope.userlogin = function() { var checkbox = $("#rememberme"), userpwd = $("#regu_pwd") var requestparam = { "email_id": $scope.user.email_id, "password": $scope.user.password } if (checkbox.prop('checked')) { lclstorage.set('user_det.user_name', $('#regu_id').val()) lclstorage.set('user_det.user_pwd', $('#regu_pwd').val()) }; appservices.doapirequest(appsettings.appapi_ci.logininfo.overviewdata, requestparam, null, ...

dynamics crm - Control access to Case(incident) in MSCRM 2015 -

we came across scenario need control access case records based on value selected in field. there 2 users u1 , u2 under business units b1 , b2 respectively. both users having organization level full access on contact , account entities , business unit level full access on case entity. user u1 created case c1 customer a1 , user u2 created case customer a2. got requirement, users u1 & u2 should having access c2 & c1 respectively. but, since both of them having read access a1 & a2, can still access cases c1 & c2 (which created customers a1 & a2). so, there way control access cases irrespective of access customers (account & contact)? it resolve issue if there workaround control access based on field value selected have category field on case. appreciate if solution this. thanks,

c++ - Connect HTTP thread handlers to SessionPools. -

we using model set in poco-project library documentation. thread/handler spawned every connection http server. want connect each thread shared sessionpoolcontainer(spc). working on assumption should instantiate spc in handlerfactory , give handler reference spc. class handler: public poco::net::httprequesthandler{ public: handler(sessionpoolcontainer &spc){ //here goes wrong. "spc private." sessionpool sp = spc.getpool("p1"); //todo fetch session once have sessionpool reference. } void handlerequest(poco::net::httpserverrequest& request, poco::net::httpserverresponse& response){ //do stuff. } }; class handlerfactory : public poco::net::httprequesthandlerfactory{ public: sessionpoolcontainer spc; poco::net::httprequesthandler* createrequesthandler(const poco::net::httpserverrequest &request){ poco::data::mysql::connector::registerconnector(); ...

node.js - API Authorization Strategy -

i have web application in node js consumes api aspects of content of website e.g news. api written in node.js , points mongodb database. i advice best authorization strategy type of requirement. don't need user-name , password solution (i don't think). sort of static token web app can pass api applications have token can browse data returned api. want stop old application consuming api. here best blog can how authenticate rest api in node js of basic http authentication, oauth1 , oauth2 https://stormpath.com/blog/secure-your-rest-api-right-way basically there 3 type of authentication used basic authentication oauth1.0a oauth2 http basic authentication more convenient, can expire or regenerate tokens without affecting user's account password. if compromised, vulnerability limited api, not user's master account you can have multiple keys per account (e.g. users can have "test" , "production" keys side side.) oaut...

excel - Parse string and total the positive & negative numeric components -

i have string in excel cell. each row represents sentence. string represents positive , negative score word in sentence. sentences can of length, e.g. joy: pos=0.37 neg=0.0, honest: pos=0.4 neg=0.0, pick: pos=0.0 neg=0.0 hello: pos=0.0 neg=0.0, ok: pos=0.0 neg=0.0 i want calculate total positive , negatives in cell. without splitting string text columns feature in excel, don't know possible way formula. an example of output in case be: pos=0.77 neg=0.0 pos=0.0 neg=0.0 any ideas? there may better way believe work you: function pos(rtest range) string dim a() string dim integer dim ival double dim wf worksheetfunction set wf = application.worksheetfunction = split(rtest, ",") dim istart integer dim iend integer = lbound(a) ubound(a) istart = wf.find("=", a(i)) + 1 iend = instr(wf.find("=", a(i)) + 1, a(i), " ") ival = ival + cdbl(mid(a(i), istart, iend - istart)) next pos = "p...

php - Error "mysqli_num_rows" -

this question has answer here: mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row() expects parameter 1 resource 33 answers how fix error ? edit.php: <?php include 'connect.php'; if(isset($_post['btn_submit'])){ } $cpf = ''; $nome = ''; $cep = ''; if(isset($_get['cpf'])){ $sql = "select cpf, nome, cep pessoas where cpf=" .$_get['cpf']; $result = mysqli_query($con, $sql); if(mysqli_num_rows($result) > 0){ $row = mysqli_fetch_assoc($result) ; $cpf = $row['cpf']; echo $cpf; } } ?> error: warning: mysqli_num_rows() expects parameter 1 mysqli_result, boolean given in c:\xampp\htdocs\banco_de_dados\edit.php on line 158 connect.php: <?php $servername = "localhost"; $username = ...