Posts

Showing posts from September, 2014

spark kafka security kerberos -

i try use kafka(0.9.1) secure mode. read data spark, must pass jaas conf file jvm. use cmd start job : /opt/spark/bin/spark-submit -v --master spark://master1:7077 \ --conf "spark.executor.extrajavaoptions=-djava.security.auth.login.conf=kafka_client_jaas.conf" \ --files "./conf/kafka_client_jaas.conf,./conf/kafka.client.1.keytab" \ --class kafka.consumersasl ./kafka.jar --topics test i still have same error : caused by: java.lang.illegalargumentexception: must pass java.security.auth.login.config in secure mode. @ org.apache.kafka.common.security.kerberos.login.login(login.java:289) @ org.apache.kafka.common.security.kerberos.login.<init>(login.java:104) @ org.apache.kafka.common.security.kerberos.loginmanager.<init>(loginmanager.java:44) @ org.apache.kafka.common.security.kerberos.loginmanager.acquireloginmanager(loginmanager.java:85) @ org.apache.kafka.common.network.saslchannelbuilder.configure(saslch

javascript - Play an audio file on hover -

i have made script forum , wondering if guide me how browser play audio file if user hovers on class style113 , has give them warning alert says "audio play" if press ok on alert should play if press cancel should not. how can achieve this? here script have far: my script has been removed you can use following code: var elems = document.getelementsbyclassname("style113"); for(i in elems) { elems[i].addeventlistener("mouseover", function() { if(confirm(" %%% confirmation message %%% ")) { // %%% code play sound %%% } }); } what does: loops on elements of class style113 adds event listener each element event mouseover in each event listener, creates confirm() popup (has 2 buttons, 1 confirm , 1 cancel) if confirm() method returns true (if positive button clicked), play sound working example on jsfiddle update per op request in comments below, can add code specific code in for

networking - What is the "Python" way to parse through mroutes -

i network engineer trying script out specific "mroute" (multicast route) exported data. trying figure out "pythonic" path this. the data looks (nothing specific network, lab exports): (*,224.0.0.0/4) rpf nbr: 96.34.35.36 flags: c rpf p up: 1w5d (*,224.0.0.0/24) flags: d p up: 1w5d (*,224.0.1.39) flags: s p up: 1w5d (96.34.246.55,224.0.1.39) rpf nbr: 96.34.35.36 flags: rpf up: 1w4d incoming interface list bundle-ether434 flags: f a, up: 1w4d outgoing interface list bvi100 flags: f, up: 1w4d tengige0/0/0/3 flags: f, up: 1w4d tengige0/0/1/1 flags: f, up: 1w4d tengige0/0/1/2 flags: f, up: 1w4d tengige0/0/1/3 flags: f, up: 1w4d tengige0/1/1/1 flags: f, up: 1w4d tengige0/1/1/2 flags: f, up: 1w4d tengige0/2/1/0 flags: f, up: 1w4d tengige0/2/1/1 flags: f, up: 1w4d tengige0/2/1/2 flags: f, up: 1w4d bundle-ether234 (0/3/cpu0) flags: f, up: 2d17h bundle-ether434 flags: f a, up: 1w4d (*,224.0.1.40) fla

javascript - How to check angularfire authentication status in app.js -

i following angularfire tutorial authenticate users. users able register, signin , signout in app. when try use resolve check $requiresignin() routes(ui-route), doesn't work. also, want check user authentication status($onauthstatechanged()) in app.js modules loaded. if there change in authentication, update authentication service( userauth). using ng-show="authdata" / ng-hide="authdata change html logged in elements. after login, of these elements still showing not logged in. think has authentication update status. if user logged in , try visit login/signup page send them home page. here app.js angular .module('myapp', [ 'nganimate', 'ngaria', 'ngcookies', 'ngresource', 'ui.router', 'ngmeta', 'firebase' ]) .run(["$rootscope", "$state", function($rootscope, $state) { $rootscope.$on("$statechangeerror", function(event, t

Does Java 8 provide Locking Priority? -

i have 1 writer object , multiple reader objects. read/write single object "stateobject" reader: readlock read stateobject readunlock writer: writelock update stateobject writelock assume 5 outof 10 readers holding readlock: at time t1, writer issues writelock request @ time t2 > t1, 3 readers issue readlock request now requirement since writer has asked writelock, other 3 read threads should not readlock , after first 5 threads done readlock, writer should lock is there java8 locking mechanism suppports ?

solr - How to crawl a website that has SAML authentication using ManifoldCF or nutch? -

i trying crawl website, more google site using manifoldcf has saml authentication , index crawled data apache solr. crawl url, gives me 302 redirection login page , says responsecodenotindexable . i not sure if have authenticated correctly or not. in manifoldcf have options http basic authentication, ntlm authentication , session-based access credentials authentication method. used session based authentication method more looks form based authentication rather saml authentication. has crawled website using manifoldcf has saml authentication? , if not manifoldcf , has been able accomplish via apache nutch, because afraid, provides http basic , digest , ntlm authentication. any insight helpful. can provide more information regarding issue, if here thinks can accomplished. when crawl https://sites.google.com/a/my-sub-domain.com , redirects sso login page , crawler refuses crawl more giving 302 error. it's intranet based website. not sure whether helps, t

php - Issue with storing values of Multiselect in database -

Image
alright have hell of problem right . i have bootstrap multiselect below allows me add or remove groups user. well works there bug remove me 1 additional group each time click on "submit" example : if user in 3 groups( blabla, bleble , blibli ) , press submit without touching groups, remove user 1 group , have 2 left ( blabla , bleble ). here php code used treatement : $groupes = $_get['groupes']; $idc = $_get['idc']; if ($groupes != "null") { $g = explode(',', $groupes); ($i = 0; $i < count($g); $i++) { $sqldel = "delete appartenir idc = $idc"; $reqdel = mysqli_query($mysqli, $sqldel) or die('erreur sql !<br/>' . $sqldel . '<br/>' . mysqli_error($mysqli)); } ($i = 0; $i < count($g); $i++) { $sql1 = "insert appartenir(idc,idg) values('$idc', '$g[$i]')"; $req1 = mysqli_query($mysqli, $sql1) or die('erre

excel - How do I tell Matlab that some of the data which is being imported is in Hex? -

Image
i trying import data excel sheet in there 3 columns (time; id; , data). the first column contains time (in seconds) while next column has numbers (id). third column (data), however, has hexadecimal numbers, therefore matlab unable process information , shows 'nan' in command window/structure whenever try retrieve information third column. i want create structure each ids , display respective information inside id. hence there anyway obtain information third column without getting nan error? here's code: [dat1, dat2, dat3] = xlsread('1'); flds=dat3(1,:); bus=cell2struct(dat3(2:end,:),flds,2); k=1:length(bus) if bus(k).id == 150 i=i+1; can_bus(k,:) end end you can raw text , conversion yourselves: to text, have other output parameters xlsread. example: [num,txt,raw] = xlsread('file.xls'); will return numeric values in num, text values in txt, , raw cell data in raw. source

One line Scala function to invert (Int => Boolean) function -

question if there way in scala define inv function below in 1 line? // function invert decision function such even/odd/positive/... def inv(f: int => boolean):(int => boolean) = { def g(a:int):boolean = { !f(a) } g } // test def even(x:int):boolean = (x % 2 == 0) val odd = inv(even) println("odd(99) %s".format(odd(99))) ---- odd(99) true problem tried below !f or !f(a) below got errors. not sure wrong. if explanation can provided, appreciated. def inv(f: int => boolean):(int => boolean) = !f ---- error: value unary_! not member of int => boolean def inv(f: a:int => b:boolean):(int => boolean) = !f(a) ---- error: ')' expected ':' found. def inv(f: a:int => b:boolean):(int => boolean) = !f(a) ^ you can write def inv(f: int =&g

cordova - Can't build android - Multiple dex files -

i'm trying build apk app using adobe phonegap , i'm getting error. tried older versions of app apk building succeeded in past same error now. i'll appreciate help. found in logs: running dex in-process requires build tools 23.0.2. faster builds update project use latest build tools. dex: error converting bytecode dex: cause: com.android.dex.dexexception: multiple dex files define landroid/support/v4/accessibilityservice/accessibilityserviceinfocompat$accessibilityserviceinfoversionimpl; unexpected top-level exception: com.android.dex.dexexception: multiple dex files define landroid/support/v4/accessibilityservice/accessibilityserviceinfocompat$accessibilityserviceinfoversionimpl; @ com.android.dx.merge.dexmerger.readsortabletypes(dexmerger.java:596) @ com.android.dx.merge.dexmerger.getsortedtypes(dexmerger.java:554) @ com.android.dx.merge.dexmerger.mergeclassdefs(dexmerger.java:535) @ com.android.dx.merge.dexmerger.mergedexes(dexmerger.java:171) @ com.android.dx.mer

c - Checking library version of shared library (so-file) in autoconf -

libraries typically have package/release version library version. these have different semantics. is there standard way check availability of library given library version using autoconf, i.e., macro in configure.ac? things can done, bad in opinion (correct me if wrong): rely on name of postfix of so-file. weak verification. add artificial function in each version of library , check in standard autoconf way. ugly , assumes build library. embed lib version in header file, check matches grep-ish tricks, , assume matches version in lib. risk of mismatch between header file , library , assumes build library. what want solution inspects actual library version embedded in library itself. feel stupid, have googled quite lot , not find anything.

windows installer - WiX CopyFile with unknown path on DiskCost -

i need copy external file, location acquire dialog. file should copied on installation, i'm trying use copyfile element. problem is, sourceproperty copyfile not set when installer starts, throws error 1606. not access network location . after costfinalize . assume, installer trying acquire size of external file. there way force installer not compute size of copyfile element, or must implement custom action copying of file, installer not know it? my file component: <component id="configurationinifiledeploy" directory="applicationfolder" guid="my-guid"> <copyfile id="configurationinifilecopy" sourceproperty="wixui_ini_location" destinationproperty="applicationfolder"/> </component> property filled in dialog before installation: <property id="wixui_ini_location" value=" " /> documentation specifies sourceproperty : the property not have exist in installer d

java - ScrollBar gets stuck when defining Max and Min -

i trying implement scrollbar eclipse view , have method setup behavior. when run program, no matter how long list<number> data is, thumb big scrollbar , not able move. there doing wrong? i debugged program , scrollbar maximum set, thumb fills bar. private void setupscrollbar(scrollbar scrollbar, list<number> data) { // set max/minimum if (data.size() > 0) { comparator<number> comparator = new comparator<number>() { @override public int compare(number o1, number o2) { return (int) (o2.doublevalue() - o1.doublevalue()); } }; double max, min; data.sort(comparator); max = data.get(data.size() - 1).doublevalue(); min = data.get(0).doublevalue(); scrollbar.setmax(max); scrollbar.setmin(min); scrollbar.setvisibleamount(100 * (max-min)); } else { scrollbar.setmax(0); scrollbar.setmin(0); } }

swift - Swift3 iOS - How to make UITapGestureRecognizer trigger function -

i trying add uitapgesture uibutton trigger function when tapped. using swift 3 , getting error: terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[swiftrunner.viewcontroller tapblurbutton]: unrecognized selector sent instance 0x149e07610' this have: // swift 3 import uikit class viewcontroller { @iboutlet weak var qsblurbutton: uibutton! override func viewdidload() { super.viewdidload() let tapgesture = uitapgesturerecognizer(target: self, action: selector(("tapblurbutton"))) qsblurbutton.addgesturerecognizer(tapgesture) } func tapblurbutton(sender: uitapgesturerecognizer) { print("please help!") } } from code using swift 3.0 change selector syntax let tapgesture = uitapgesturerecognizer(target: self, action: #selector(self.tapblurbutton(_:))) and function this func tapblurbutton(_ sender: uitapgesturerecognizer) { print("please hel

c++ - std::fstream on windows network share -

i struggling reading files windows network shares. have network share mounted s: code looks this: std::fstream in; in.open("s:/adir/new folder/afile.txt", std::fstream::in); if (in.fail()) throw "failed"; ... //use in reading when first run program, throws "failed". keeps failing until navigate windows explorer directory, after that, works. how can fix problem? in order open file, system executing code should have access share or mapped network drive @ time of execution. the wnetaddconnection2 function makes connection network resource , can redirect local device network resource. dword dwretval; netresource nr; dword dwflags; // 0 out netresource struct memset(&nr, 0, sizeof (netresource)); nr.dwtype = resourcetype_any; nr.lplocalname = <name of local device>; nr.lpremotename = <network resource connect to>; nr.lpprovider = null; dwflags = connect_update_profile; // call wnetaddconnection2 function assign

typescript - PrimeNG components d.ts files does not contain @Input @Output metadata -

i experimenting primeng library , angular 2.0. using typescript , have noticed *.d.ts files primeng components not contain standard angular 2.0 metadata @input() @output(). example dialog.d.ts : export declare class dialog implements afterviewinit, afterviewchecked, ondestroy { private el; private domhandler; private renderer; header: string; draggable: boolean; resizable: boolean; ... you can notice dragable: boolean; not have @input() metadata above lead editor not showing intelisence component has such bindable property. example <p-dialog dragable...? ></p-dialog> in both webstorm 2016 or visual studio code when creating angular 2.0 template , try use primeng components don't intelisence api component exposing. question why *.d.ts files not contain metadata ? there workaround code hinting work without metadata in *.d.ts files ?

docusignapi - Draw signature and upload via DocuSign API -

i have question. there possibility draw sign document usign api? have webpage canvas. can send picture sign via api? c# example. in advance. i think you're asking: can upload person's graphical signature docusign via api? the answer yes. see docs usersignatures: create method. method not included sdk, need call directly. if, instead, you're asking: with docusign, can app sign document sending graphical signature via api? the answer no. documents signed using docusign signing ceremony either directly or embedding signing ceremony within application. see embedded signing docs .

python - Scrapy return a updated dict item back -

im trying scrape details subsite. each item new subsite want retrieve additional information from. im storing information dict per item , per detail. the problem duplicate items when yielding item dict items , , expect has me parising whole item in function instead of updated dict items. however, i have been successful in parsing updated dict item the item. instead new item of every updated dict item. expect problem either has for loop , or ' def parse_item_sub ' function. to give quick intro im doing in code; retrive id's database scrape site attributes item. because site contains several identical items, varying information. have created additional sub_items, scraped main item, dictionaries. loop on each dict item contains href, information site , scrape dict in dictionary. ' item['subsite_dic'][position] ' thereafter return item is possible return updated dict item of item? the code from scrapy.spiders import spider scrapy.selector impo

javascript - popup image not changing issue -

i trying create popup under popup when try adding thing in place of images not display old image appears. close link not working. knows why happening below code // modal var modal = document.getelementbyid('mymodal'); // button opens modal var btn = document.getelementbyid("mybtn"); // <span> element closes modal var span = document.getelementsbyclassname("close")[0]; // when user clicks button, open modal btn.onclick = function() { modal.style.display = "block"; } // when user clicks on <span> (x), close modal span.onclick = function() { modal.style.display = "none"; } // when user clicks anywhere outside of modal, close window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } // modal var modal = document.getelementbyid('mymodal'); // button opens modal var btn = document.getelementbyid("mybtn2");

How to visualize a ByteArrayOutputStream as PDF on Android? -

i creating application generate pdf on android (with itextg library) without storing it, show info pdf. i have following code generate pdf: bytearrayoutputstream baos = new bytearrayoutputstream(); document document = new document(); pdfwriter pdfwriter = pdfwriter.getinstance(document, baos); document.open(); document.add(new paragraph("hello world")); document.close(); byte[] pdfbytearray = baos.tobytearray(); and works fine not find working example work me (using bytearrayoutputstream ). these questions have looked: need convert pdf page bitmap in android java how render pdf in android how read pdf in android pdf byte array , vice versa pdf text extraction using itext but of responses have been able show pdf on android. how can visualize pdf have generated in android application? thanks in advance!

git - Close GitLab CE Merge Requests From Commit Message -

a useful feature of github users able close "pull requests" (prs) via commit message. instance, if closes #1 written in commit message , commit subsequently lands on master branch, github automatically close pr. gitlab has similar setup, pull requests known "merge requests" (mrs). although have found support automatic-pr-closing feature in github, appears though gitlab devoid of useful feature. way close merge requests (that i've found) manually clicking "accept" or "close" buttons on gitlab itself. this question illustrates feature in question. and yes, i'm aware can close issues , stated here: http://docs.gitlab.com/ee/customization/issue_closing.html but page says: when commit or merge request resolves 1 or more issues, possible automatically have these issues closed when commit or merge request lands in project's default branch. so issues closed if mr or commit lands in master , doesn't speak closing of

javascript - how to dojo button background invisible or remove? -

Image
i`m trying put image in place of dojo button. able add image, background, but, outline of button visible. want ot show image only. should do? my code follows. css: .editbuttonwidgetimage { background-image: url("editbutton/images/edit.png"); background-position: center; background-repeat: no-repeat; height: 25px; width: 25px; } javascript: var infotablecontainer = dojo.create("div", null, map.container); var x = 200 - map.position.x; var y = 50 - map.position.y; this.infotable = new floatingpane({ title : "<b>editor</b>", resizable: true, dolayout: true, dockable: false, closable: true, //constraintocontainer: true, 'class': "editwidgetcontainer", style: "left:"+x+"px;top:"+y+"px;padding:0px" }, infotablecontainer); //dojo.attr(infotable, 'class', 'tableinfowidgetcont

javascript - Rotated shape is moving on y-axis when resizing shape width -

i'm trying resize rotated shape on canvas. problem when call rendering function, shape starts "drifting" depending on shape angle. how can prevent this? i've made simplified fiddle demonstrating problem, when canvas clicked, shape grown , reason drifts upwards. here's fiddle: https://jsfiddle.net/x5gxo1p7/ <style> canvas { position: absolute; box-sizing: border-box; border: 1px solid red; } </style> <body> <div> <canvas id="canvas"></canvas> </div> </body> <script type="text/javascript"> var canvas = document.getelementbyid('canvas'); canvas.width = 300; canvas.height= 150; var ctx = canvas.getcontext('2d'); var counter = 0; var shape = { top: 120, left: 120, width: 120, height: 60, rotation: math.pi / 180 * 15 }; function draw() { var h2 = shape

utf 8 - How to convert between UTF-8 and native String in Java? -

Image
just picture, i'd convert between encoded utf-8 string , native string in java. suggestions? lot! ps. example, string = "&#x8fd9;&#x662f;&#x4e00;&#x4e2a;&#x4f8b;&#x5b50;,this example"; string b = null; // block a: processing a, , let b = "这是一个例子,this example" how implement "block a"? apache commons lang stringescapeutils.unescapexml(...) want. depending on original string came from, 1 of html variants may more appropriate. use so: string = "&#x8fd9;&#x662f;&#x4e00;&#x4e2a;&#x4f8b;&#x5b50;,this example"; string b = stringescapeutils.unescapexml(a); // block a: processing a, , let b = "这是一个例子,this example" system.out.println(a); system.out.println(b); output: &#x8fd9;&#x662f;&#x4e00;&#x4e2a;&#x4f8b;&#x5b50;,this example 这是一个例子,this example there methods converting other way also.

Ruby on Rails, return 0 instead of error -

i'm building ruby on rails application , i'm meet error: typeerror: nil can't coerced float or string or other variables type when calculation or queries such as: upcoming = appointment.where(:hairdresser_id => hairdresser_id).where('status = ? or status = ?', 'accepted', 'personal').map{|app| app.price}.reduce(0, :+) i think understand problem, know if there simple way can return 0 instead of errors that, because happens maybe hairdresser not have accepted appointments. one solution check if exists before doing caluclation i'm sure won't best solution! thanks help! if appointment#price db column can add additional check: .where.not(price: nil) if it's method or virtual attribute either convert value float or int, convert nil it's numeric representation of 0: .map{ |app| app.price.to_f } # or `app.price.to_i` or compact result of map , removes entries result nil .map{ |app| app.price }.compact

java - How to multiply two values with the same key name from different linkedHashMaps? -

i have 2 linkedhashmaps same length same key names values different. example : map<string, double> map1= new linkedhashmap<string, double>(); map1.put("a", 2.3); map1.put("b", 6.1); map1.put("c", 5.3); map<string, double> map2= new linkedhashmap<string, double>(); map2.put("a", 10.3); map2.put("b", 60.1); map2.put("c", 0.3); how multiply each value map1 same corresponding key in map2 (a 2.3*10.3, b 6.1*60.1 etc etc) , save results new linkedhashmap? i tried no luck. map<string, double> map3= new linkedhashmap<string, double>(); double valuemap1 = map1.get(key); double valuemap2 = map2.get(key1); for(string key : map1.keyset()) for(string key1 : map2.keyset()){ if(map1.containskey(key1)){ double newvalue =valuemap1* valuemap2; map3.put(key1, newvalue);

linux - Program in C executed and the terminal shows: Finished (killed) -

i running program in c terminal in linux , message "finished (killed)". output obtained see execution more or less killed @ same point. working huge amount of data , executing program locally in computer. writing in console ulimit -a following information: core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 29117 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 posix message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 29117 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited but see in there normal values.

php - 2 input types for 1 html form field -

i need add 2 input types 1 form field in html form viz. type=email , type=number html form field email/mobile. how done? below code: <label for="modlgn-username">email/mobile</label> <input type="email" name="email" class="inputbox" size="18" required /> is possible add input type=number in above code same field namely [email/mobile]? i'm beginner , apprecaite in matter lot no not possible can take input type="text" email/number.

android - How to: Create an onclick listener for ListView -

i've used listview show data wamp server using mysql, using json parsing , following code.... public class jsontask extends asynctask<string, string, list<pumpmodel>> { @override protected list<pumpmodel> doinbackground(string... params) { httpurlconnection connection = null; bufferedreader reader = null; try { url url = new url(params[0]); connection = (httpurlconnection) url.openconnection(); connection.connect(); inputstream stream = connection.getinputstream(); reader = new bufferedreader(new inputstreamreader(stream)); stringbuffer buffer = new stringbuffer(); string line = ""; while ((line = reader.readline()) != null) { buffer.append(line); } string finaljson = buffer.tostring(); jsonobject parentobject = new jsonobject(finaljson); jsonarray parenta

java - Bullets in document getting as a question mark in GATE NLP -

i new gate nlp . have document, contains bullets. when load gate . bullets detected unknown type symbol printed  . tried set encoding utf-8 . , tryed load document programmatically, bullets gets detected ? . can explain me this? example:  promoted senior member technical in 2.5 years of experience. here symbol in gate developer ui , ? symbol shown when did "programmatically". in experience, doc , docx files not produce  characters. bullets either missing (text formatted bullet-list) or printed • (text raw bullet characters). see related question: parsing either font style or block of paragraph in gate pdf files produce "  -bullet characters" in gate document. may related pdf or apache pdfbox issues, see e.g. this one . these characters have unicode value. in xml, encoded example &#xf0b7; . in case, advice trace such characters (they may have different unicode values depending on original bullet character) , replace them

php - PayPal REST API [Sandbox] - INTERNAL_SERVICE_ERROR on payment sale execute -

i've been using paypal rest api since months handle sale payments programmatically without problems, both on live , sanbox platform. couple of days figured that, sanbox, impossible finalize (execute) payments using resource post https://api.sandbox.paypal.com/v1/payments/payment/pay-xxxxxxxxxxxxxxxxxxxx/execute , indeed every time internal_service_error response status code 500. last response: got http response code 500 when accessing https://api.sandbox.paypal.com/v1/payments/payment/pay-xxxxxxxxxxxxxxxxxxxx/execute. {"name":"internal_service_error","message":"an internal service error has occurred","information_link":"https://developer.paypal.com/docs/api/#internal_service_error","debug_id":"2205fb9528a0f"} any idea happening? full disclosure, work @ paypal leading developer advocacy. there issue sandbox today , escalated through try have resolved. i'm being told issue should

unity3d - ARToolkit for Unity on Android : Camera won't start, just black screen -

i've been working on project artoolkit unity. built android apk. installed xiaomi device. when run app, following : it pops out small square camera on upper left corner it shows unity animation text usual it goes black forever i've set permission app access phone's camera. how can solve matter? do have phone's camera working? newbie way don't go harsh on me. notes : i've tried build scene without artoolkit android apk. worked fine , no black screen. sorry if english isn't good. appreciated, before. just guess... artoolkit android on startup attempts contact web-server on internet download camera parameters. i've noticed if phone not have internet access, you'll see black screen quite while (at least 30 seconds i've seen) until http request times out. can see if run android studio studio , view logs app. unfortunately @ moment there appears no switch turn off. see: http://artoolkit.org/community/forums/viewtopic.php

Read value from a complex XML structure using SQL Server -

i trying read value in sql server query out of xml structure column of datatype ntext . this xml structure want extract value read!!! : <printerprocessdef xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns="http://dev.docuware.com/settings/workflow/processdef" id="3e62848d-040e-4f4c-a893-ed85a7b2878a" type="printerprocess" configid="c43792ed-1934-454b-a40f-5f4dfec933b0" enabled="true" pcid="2837f136-028d-47ed-abdc-4103bedce1d2" timestamp="2016-08-08t09:44:38.532415"> <configs> <config xmlns:q1="http://dev.docuware.com/settings/workflow/processconfig" xsi:type="q1:printerprocessconfig" id="c43792ed-1934-454b-a40f-5f4dfec933b0" /> <config xmlns:q2="http://dev.docuware.com/settings/workflow/processconfig" xsi:type="q2:recognizeactconfig" id="b89a6fc2-5573

c++ - Export POD-structure from DLL -

consider following source library.cpp struct parameter { const char *path; int num; bool flag; /* , many, many more members... */ }; __declspec(dllexport) void func(const parameter &); this compiles library library.dll . as far understand, export declarations export functions , data. since structure parameter doesn't define functions it's not necessary here , omitted it. but dumpbin.exe /exports library.dll reveals, there in fact real difference here: method operator = (const parameter &) exported. question: there important reasons export parameter , i.e. add __declspec(dllexport) in front of parameter ? best practice pod-structures. normally, pod struct , contain data(that of fundamental types) , no functions, declared in ".h" file given along corresponding .dll . //mydll.h ------------------------------------------------- #ifndef __mydll_dot_h__ #define __mydll_dot_h__ struct parameter { const char *pat

android - How to select first item in recyclerview -

suppose have selected position 3 in recyclerview when navigate previous page , come again want frist item of recyclerview selected int selectposition = 0; if (selectedposition == position ) { chckbox.setvisibility(view.visible); chckbox.setchecked(true); chckbox.setbackgroundresource(r.drawable.checkbox_selector); chckbox.forcelayout(); layout.setbackgroundresource(r.drawable.selected_address_bg); } else { chckbox.setvisibility(view.visible); chckbox.setchecked(false); layout.setbackgroundresource(r.color.white); } you can scroll first position following code: can replace layout manager linearlayoutmanager layoutmanager = (linearlayoutmanager) mrecyclerview .getlayoutmanager(); layoutmanager.scrolltopositionwithoffset(0, 0);

python - Tastypie decimal and datetime filters not working -

the following lte , gte filter queries returns 0 objects: curl http://localhost/river/river/?runoff__lte=100.0&runoff__gte=150.0 curl http://localhost/river/river/?runoff__lte=100&runoff__gte=150 http://localhost/river/river/?dt_timestamp__lte=2015-01-01t03:00&dt_timestamp__gte=2015-01-07t18:00&format=json here's models.py class river(models.model): dt_timestamp = models.datetimefield() stage = models.decimalfield(max_digits=10, decimal_places=3, blank=true, null=true) runoff = models.decimalfield(max_digits=10, decimal_places=3) api.py class riverresults(modelresource): class meta: queryset = river.objects.all() resource_name = 'river' authorization = authorization() filtering = { 'user': all_with_relations, 'dt_timestamp': 'stage': all, 'runoff': all, } in settings.py use_tz = false am running postgresq

Sharing Static Content Between ASP.NET Core Apps -

i have customized customized swashbuckle ui using custom html, css , image files in following folders of asp.net core site: wwwroot swagger ui images background.jpg favicon.ico logo_small.png index.html skin.css how can share these files in separate class library multiple sites can use same ui.

Serialize a java.io.File within a JSON w/ Jackson -

i've got web service (jersey 2) returns several docx , pdf files. don't know best way that: return them octet-stream. had before implementing in 2: @get @path("solicitudusuario/plantilla") @produces(mediatype.application_octet_stream) public response descargarplantillasolicitudusuario() throws configurationexception, urisyntaxexception, ioexception{ file plantillasolicitudusuario = this.generalservice.getplantillasolicitudusuario(); return response.ok(plantillasolicitudusuario, mediatype.application_octet_stream).header("content-disposition", "attachment; filename=\"" + plantillasolicitudusuario.getname() + "\"" ).build(); } wrap files within json. i'm using jackson json provider. i've done far: web service: @get @path("solicitudusuario/plantilla") @produces(mediatype.application_json) public response download() throws configurat

Rails - Rspec: Is it possible to exclude / remove a test case in a shared_example? -

hello everyone. i have been working on project , use shared example group manage rspec test. for instance, have 2 actions in controller. class userscontroller < applicationcontroller def show #... end def inspect #... end end and shared_example: shared_examples "test" #...some examples "raise exception" # ... end end however, when call "inspect", not raise exception , result in test failure. possible disable or remove test case temporary when try test "inspect" action? (in real case, shared examples have been used many different tests , 1 has different behavior.) thanks million. you should able mark them broken , i.e exclude example based on flag. see more info here . rspec.configure |c| # declare exclusion filter c.filter_run_excluding :broken => true end try declare configuration in seperate context test inspect configuration not affect others examples use sh

user interface - Unity Button text not showing on some devices -

so earlier using best fit in text , working fine. ui became inconsistent , removed best fit , set size each screen/panel. the problem text not visible on devices(like nexus 7). but while on unity scene works fine. can suggest how proceed this. thanks in advance.. you have several options adjust ui.text : increase recttransform width , height decrease font size manually adjust font size using best fit shorten text , can hard in rather lengthy languages let overflow setting " horizontal overflow " and/or " vertical overflow " "overflow" then need test in resolutions (test extrem cases in aspect ratio , resolution) , in languages app supports. you need decide on each case, options fits better.

Send button not working of custom keyboard in android in case of instagram -

i have created custom keyboard working fine far , getting issue , when try send message in instagram app (or other app) , action enter didn't work. my code : private void sendkey(int keycode) { switch (keycode) { case '\n': keydownup(keyevent.keycode_enter); break; default: if (keycode >= '0' && keycode <= '9') { keydownup(keycode - '0' + keyevent.keycode_0); } else { this.minputconnection.committext(string.valueof((char) keycode), 1); removesuggestionfromtextview(); } break; } } thanks in advance.

scala - ScalaTest: merge multiple html outputs (-h option) -

i use scalatest 3.0.0 in multi-project build , use -h directory use html reporter generate nice html report. possible merge test results of multiple projects 1 such html report? currently, there's 1 such report generated every subproject.

angular - In Angular2 routing, with new router, how do i redirect empty path only? -

environment: rc4 new router i have following router config .. export const routes: routerconfig = [ {path: 'search-documents', component: searchdocumentscomponent}, { path: '', pathmatch: 'prefix', redirectto: '/search-documents' }, {path: '**', component: notfoundcomponent} ]; it works follows ... http://server ------------------> http://server/search-documents http://server/ -----------------> http://server/search-documents http://server/does-not-exist ---> http://server/search-documents but want ... http://server ------------------> http://server/search-documents http://server/ -----------------> http://server/search-documents http://server/does-not-exist ---> notfoundcomponent how achieve please? additional info: if remove .. { path: '', pathmatch: 'prefix', redirectto: '/search-documents' } i .. http://server -----------------

node.js - Error while running nodejs project on jenkins -

can please i'm running nodejs project on jenkins , got error : [info] building node-js-project::server::node-js-project-appli 0.0.1-snapshot [info] ------------------------------------------------------------------------ [warning] pom org.apache.maven.plugins:maven-resources-plugin:jar:2.8-beta missing, no dependency information available [info] ------------------------------------------------------------------------ [info] reactor summary: [info] [info] node-js-project .................................... success [ 1.002 s] [info] node-js-project::delivery .......................... success [ 3.013 s] [info] node-js-project::server ............................ success [ 0.256 s] [info] node-js-project::server::node-js-project-appli ..... failure [ 0.101 s] [info] node-js-project::common ............................ skipped [info] node-js-project::common::vertxstub ................. skipped [info] ------------------------------------------------------------------------ [

Spring Integration Java DSL How to use Spel for Service Activator -

could know how call spel .handle() (invoke service activator) in spring integration java dsl? the reason call service activator parameter. xml, use spel similar "@myservice.mymethod('param1', 'param2')" in expression attribute. i can't find similar in si java dsl there no .handle(string expression) variant. found bit redundant , decided lambda variant full java access better: .handle(payload, headers) -> this.myservice.mymethod('param1', 'param2')) where this.myservice @autowired service. parameter can determined similar way. let know why insist expression variant, when there full java code access.