Posts

Showing posts from January, 2011

android - How to improving test tsx file running with more true result or high rate passing? -

Image
we have test file survey module written in typescript, available in tsx here. methods can used make test results of test module more effective. for example how can make suitable immutable.js format? or wants share me suggestions title.

python - How to use PyFFTW's wisom -

i didn't see actual example on pyfftw's documentation of how use 'wisdom' feature i'm little confused. my code looks following: # first fft input = pyfftw.zeros_aligned(arraysize, dtype='complex64') input[:] = image fftwobj = pyfftw.builders.fft2(input, planner_effort='fftw_exhaustive') imagefft = fftwobj(input) wisdom = pyfftw.export_wisdom() pyfftw.import_wisdom(wisdom) # second fft same input size different input input = pyfftw.zeros_aligned(arraysize, dtype='complex64') input[:] = image2 fftwobj = pyfftw.builders.fft2(input, planner_effort='fftw_exhaustive') imagefft2 = fftwobj(input) the docs export_wisdom outputs tuple of strings , import_wisdom takes in tuple argument. when supposed export wisdom , supposed save tuple out file each fft? when load in? before call each fft? basically, exporting , importing wisdom method maintain state between sessions. the wisdom knowledge how best plan fft. during

php - Result Not Display in Json when use sms api -

$url='https://mysmsapi.com/api/sendhttp.php?authkey='.authkey.'&mobiles='.$mob_no.'&message='.urlencode(message .$key).'&sender='.sender.'&response=json&route='.route; $ch = curl_init($url); curl_setopt($ch, curlopt_header, false); curl_setopt($ch, curlopt_returntransfer, 1); $resp = curl_exec($ch); $json = json_decode($resp); if($json->type == 'success') { mysql_query("insert mobile_sms_verifier_data(mobile_no,email,name,verification_key) values('$mob_no','$email','$name','$key')"); $id = mysql_insert_id(); $responce = '<table align="center" border="1"><tr><td align="center">enter verification code</td></tr><tr><td align="center"><input type="hidden" value="'.$id.&

java - one-to-one mapping hibernate using foreign key association -

am new hibernate learning entity mapping using hibernate framework via instead of annotation using xml mapping entities here have 2 classes employee , address [address target class , employee source class i.e employee table have foreign key column refers address table primary key] class employee{ string name; int id; address addr; //getter , setter methods } class address{ string state; string city } mapping.hbm.xml file:- <hibernate-mapping> <class name="employee" table="emp"> <id name="id" column="id"> <generator class="assigned"/> </id> <property name="name" column="emp_name"/> <one-to-one name="addr" class="address" foreign-key="addr_id" cascade="all"/> </class> <!--mapping address entity--> <class name="address" table="address> <property name="city"/> <property name&

java - WebDriver throws org.openqa.selenium.SessionNotCreatedException while using Firefox browser -

i'm using below configurations : gecko driver version: 0.17 firefox version: 54.0.1 selenium java version: 3.4.0 tried below code open browser : desiredcapabilities dc = desiredcapabilities.firefox(); dc.setcapability("marionette", true); system.setproperty("webdriver.gecko.driver", properties.getproperty("firefoxdriverpath")); driver = new firefoxdriver(dc); but encountered below exception: failed: testrunner("instance1", local, firefox, 1, 1) org.openqa.selenium.sessionnotcreatedexception: unable create new remote session. desired capabilities = capabilities [{marionette=true, firefoxoptions=org.openqa.selenium.firefox.firefoxoptions@596982, browsername=firefox, moz:firefoxoptions=org.openqa.selenium.firefox.firefoxoptions@596982, version=, platform=any}], required capabilities = capabilities [{}] build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:

Couchbase View empty, N1QL returns results -

i using travel-sample provided editor perform tests. when map (below) using doc.type=="landmark" or doc.type=="route" , results, when user "airline" type, no results view. rather puzzling. function (doc, meta) { if (doc.type && doc.type=="airline") { emit(doc.id, doc.type); } } i can't quite figure out why returns empty view. although following equivalent n1ql query returns results : select id `travel-sample` type = "airline" limit 10

objective c - Adding a CarPlay UI -

Image
i working on current iphone audio app supported in carplay. got approved apple , received development entitlement, , watched video "enabling app carplay"( https://developer.apple.com/videos/play/wwdc2017/719/ ). in video there piece of swift code demonstrating how add carplay ui: func updatecarwindow() { guard let screen = uiscreen.screens.first(where: { $0.traitcollection.userinterfaceidiom == .carplay }) else { // carplay not connected self.carwindow = nil; return } // carplay connected let carwindow = uiwindow(frame: screen.bounds) carwindow.screen = screen carwindow.makekeyandvisible() carwindow.rootviewcontroller = carviewcontroller(nibname: nil, bundle: nil) self.carwindow = carwindow } i re-wrote objective-c version following: - (void) updatecarwindow { nsarray *screenarray = [uiscreen screens]; (uiscreen *screen in screenarray) {

perl - In Moose, how do I modify an attribute any time it is set? -

if have attribute needs modified time set, there slick way of doing short of writing accessor , mucking around directly content of $self , done in example? package foo; use moose; has 'bar' => ( isa => 'str', reader => 'get_bar', ); sub set_bar { ($self, $bar) = @_; $self->{bar} = "modified: $bar"; } i considered trigger , seemed require same approach. is working directly hash reference in $self considered bad practice in moose , or worrying non-issue? i'm not sure kind of modification need, might able achieve need using type coercion: package foo; use moose; use moose::util::typeconstraints; subtype 'modstr' => 'str' => { /^modified: /}; coerce 'modstr' => 'str' => via { "modified: $_" }; has 'bar' => ( isa => 'modstr', => 'rw', coerce => 1, ); if use approach, not valu

install GitLab on a server running Windows 7 -

i need install gitlab on server running windows 7, i'm blocked @ line. documentation doesn't helping me. following command prompt: c:\gitlab-runner>gitlab-runner.exe register please enter gitlab-ci coordinator url (e.g. https://gitlab.com/): https://gitlab.com please enter gitlab-ci token runner: where can find token? you're attempting install gitlab runner used run jobs , send results gitlab server. you're talking gitlab running @ server have install , not runner . but not supported install gitlab on windows, see here in gitlab forum . recommend use linux in virtual machine if want on windows. in seriousness never supported. nevertheless needed project registration token follow these steps described here . there discussion on github . to create specific runner without having admin rights gitlab instance, visit project want make runner work in gitlab: go settings ➔ pipelines obtain token register runner furth

angular - Post method returns 404 in Asp.net core Web API Controller -

routes code below: app.usemvc(routes => { routes.maproute( name: "default", template: "{controller=home}/{action=index}/{id?}"); }); controller code below : // post api/values [httppost] public void post([frombody]employee employee) { employeemanager.createasync(employee); } all other methods working except post method. call angular component : onsubmit(employeeitems: any) { console.log(employeeitems); this.getdata(); var headers = new headers(); headers.append('content-type', 'application/json; charset=utf-8'); this.http.post('api/employee/post', employeeitems, { headers: headers }).subscribe(); this.createemployeeflag = false; } i tried postman, no luck. your url , route templates not match [route("api/[controller]&quo

reactjs - Error message "No 'Access-Control-Allow-Origin' header is present on the requested resource" -

error: xmlhttprequest cannot load http://kostat.go.kr/file_total/kor3/korip1_14.pdf . no 'access-control-allow-origin' header present on requested resource. origin ' http://www.lululala.co.kr:8000 ' therefore not allowed access. i'm front-end developer... want other web site infomation. cors error... how can do? i set header access-control-allow-origin header * , other. use react. , install middleware lib. not working. please me...

AVSpeechUtterance (Text to Speech) volume seems to increase when reading out sentences on iPhone 7 / iOS 10 using Swift -

i had dig around while couldn't find out there. i'm working in swift 3 , using avspeechutterance in project , have come across appears anomaly. whilst testing voice playback on few iphone 7s running ios 10, volume of sentences seems increasing drastically longer sentence goes on. i've tried setting volume set value e.g. float per docs here nothing seems fix issue. here's snippet of code. let synth = avspeechsynthesizer() synth.speak(avspeechutterance(string: "testing out string. becomes louder.") does know workarounds or causes of seems working fine on iphone 6 running ios 11.

sql server - SQL different aggregates in single query -

Image
i trying work out query have table representing following: and need result indicate earliest start time (blue), latest end time (green), , sum of lunch breaks (yellow): i got blue , green blocks right, struggling yellow aggregation. my (partial) query looks like: select name, min(starttime) starttime, max(endtime) endtime, sum( <please here alternative aggregation> ) lunch sometable group name when use normal subquery, sql complains column not contained in either "group by" or aggregate, , cannot use subquery inside aggregate. please point me direction "lunch" column. this on sql server. assuming value time, sum little challenging. suggest converting minutes: select name, min(starttime) starttime, max(endtime) endtime, sum(case when activity = 'lunch' datediff(minute, 0, duration) end) lunch_minutes sometable group name

ios - Getting thread 1: signal sigabrt when trying to use tap gesture recognizer to open url -

i trying use tap gesture recognizer open url when tapping image. code builds when try tap image, terminates , displays terminating uncaught exception of type nsexception (lldb) in console. console displays [hello.viewcontroller clicktoopen]: unrecognized selector sent instance. and there thread 1: signal sigabrt in line class appdelegate: uiresponder, uiapplicationdelegate {" in appdelegate.swift. the viewcontroller code below: // // viewcontroller.swift // hello // import uikit class viewcontroller: uiviewcontroller, uitextfielddelegate { //mark: outlets @iboutlet weak var nametextfield: uitextfield! @iboutlet weak var helloname: uilabel! @iboutlet weak var imagetotap: uiimageview! override func viewdidload() { super.viewdidload() nametextfield.delegate = self let tapgesturerecognizer = uitapgesturerecognizer(target: self, action: selector(("clicktoopen"))) self.imagetotap.addgesturerecognizer(tapgesturerecog

ios - Right constraints not working properly on iphone SE -

Image
im using stack views , constraints in app. problem have encountered view working in iphone 7, when turn iphone se text positioned away screen. iphone 7 screen: and iphone se screen and how im using stackview constraints change following constraints in following screenshots : trailing space status label >= 63 add right-hand side constraints status label. same "ordered date" , "ordered time" label

tensorflow - why doesn't the q-learning function converge in openai mountain car -

update 1: revised greedy epsilon policy number of episodes took before making epsilon less quantity less. have updated code. the new problem after training should not deviate picks wrong values , instantly diverges epsilon becomes small i have been working on openai gym platform quite sometime goal learn more reinforcement learning. have implemented double deep-q learning(dqn) prioritized experience replay(per) of stack overflow user @sajad. on cart-pole problem , received success rate careful hyper-parameter tuning. far best algorithm have learned whatever cannot seem work on mountain car problem reward keeps on -200 episodes. have looked code , various tutorials think memory implementation correct. neither of algorithms basic dqn dqn per seems work. it helpful if in debugging code or other implementation changes might causing not converge here implementation: parameters have usual names # implemented using sum_tree import os import random import gym import

spring - Can property name be given alias -

i'm using 3rd party spring boot module requires "validation.url" property set this same value exists in our centralized config service "url.for.validation" , retrieve via propertyplaceholderconfigurer outside of intercepting properties propertyplaceholderconfigurer , adding new 1 "validation.url", recommended way achieve this? is there alias functionality properties?

c# - how to call a method in another method with return? -

i relatively new c# programming. working forms , want print value in text box not working. getting error "not code paths return value" public void button1_click(object sender, eventargs e) { double res = test(); tbox.text = res.tostring(); } public double test() { if (cbtest.checked == false) { return 10 + 5.1; } } the issue test method, need consider cbtest.checked==true condition otherwise code raise error "not code paths return value" , better change signature following: public double test() { if (!cbtest.checked) { return 10 + 5.1; } return 0.0; // or other values }

inheritance - Odoo 8 - Add button in invoice supplier form -

i try add documentation says , when update module doesn't work. <record id="some_example_id" model="ir.ui.view"> <field name="name">example.name</field> <field name="model">account.invoice</field> <field name="inherit_id" ref="account.invoice_supplier_form" /> <field name="arch" type="xml"> <data> <button name="invoice_cancel" position="after"> <button name="test_button" states="draft,proforma2,open" string="test" groups="base.group_no_one" class="oe_highlight"/> </button> </data> </field> </record> exactly here your code seems me. may try following tips. make sure xml file name given in manifest file. active debugger mode. temporary remove gro

r - Tidy data frame: German characters being removed -

i using following code convert data frame tidy data frame: replace_reg <- "https://t.co/[a-za-z\\d]+|http://[a-za-z\\d]+|&amp;|&lt;|&gt;|rt|https" unnest_reg <- "([^a-za-z_\\d#@']|'(?![a-za-z_\\d#@]))" tidy_tweets <- tweets %>% filter(!str_detect(text, "^rt")) %>% mutate(text = str_replace_all(text, replace_reg, "")) %>% unnest_tokens(word, text, token = "regex", pattern = unnest_reg) %>% filter(!word %in% custom_stop_words2$word, str_detect(word, "[a-zäöüß]")) however, produces tidy data frame german characters üäöß removed newly-created word column, example, "wählen" becomes 2 words: "w" , "hlen," , special character removed. i trying tidy data frame of german words text analysis , term frequencies. could point me in right direction how approach problem? you need replace a-za-z\\d in bracket expressions [:alnum:] . the posix

dbpedia - SPARQL Federated Queries - Using uri returned from a query in another query -

Image
in below query want use ?uri variable identifies dbpedia resource obtain dbpedia element dbpedia sparql service, returns no result expects uri within <> . i tried <?uri> again no results had returned. when write uri directly, returns desired results, couldn't manage using variable. prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix lit: <http://purl.org/net/cnyt-literature#> select distinct ?writer ?play ?character ?uri ?type { { ?writer lit:writerof ?play . ?play lit:character ?character . ?character lit:dbpediauri ?uri } service <http://dbpedia.org/sparql> { ?uri rdf:type ?type } } limit 50 here result of query service part ommitted : when replace ?uri in service part " http://dbpedia.org/resource/julius_caesar ", fetches information dbpedia don't know how using ?uri variable. here owl file : <?xml version="1.0"?> <rdf:rdf xmlns=&q

Woocommerce lightbox not working -

after updating woocommerce 3.0.8, lightbox not working anymore. found lot of people adding following code functions.php in theme folder solves problem. add_action( 'after_setup_theme', 'yourtheme_setup' ); function yourtheme_setup() {     add_theme_support( 'wc-product-gallery-zoom' );     add_theme_support( 'wc-product-gallery-lightbox' );     add_theme_support( 'wc-product-gallery-slider' ); } however, in our case not solve problem (actually nothing changes). have idea how can enable lightbox again? you can see in action on www.lightningkabels.nl. thanks lot!

Nametag of data point in python animation code prints over and over -

so i'm struggeling problem, namely annotations don't refresh , stay in figure. i've tried ax.cla() (in init function , update_point function), doesn't seem work. code random numbers , not own data. i'm running script 10 datasets of 10 people walking. want see these people walked. can please me seemingly simple question? my code: import numpy np import matplotlib.pyplot plt import matplotlib.animation animation x1 = np.linspace(0,1,50) y1 = x1 x2 = np.linspace(0,1,50) y2 = y1+1 print(max(x1)) print(x1[10],y1[0]) fig = plt.figure() ax = fig.add_subplot(111) ax.set_xlim(0, 1) ax.set_ylim(0, 2) point1, = ax.plot([x1[0]], [y1[0]], 'ro', label='data1') anno1 = plt.annotate("data1", xy=(x1[0], y1[0])) point2, = ax.plot([x2[0]], [y2[0]], 'bo', label='data2') anno2 = plt.annotate("data2", xy=(x2[0], y2[0])) def init(): return point1, point2, anno1, anno2 def update_point(n): point1.set_data(np.array([

jquery - How to pass a data retrieved from DataTable to PHP -

Image
i have been able retrieve data first column of datatable, alert on jquery. but now, need pass data php, use on query in order retrieve data database. but not beeing able this...could 1 me? <?php include 'db.php'; session_start(); if(array_key_exists("matricula",$_cookie)) { $_session['matricula'] = $_cookie['matricula']; } if (array_key_exists("matricula",$_session)) { } else { echo "<script> window.location.replace('login.php') </script>"; } ?> <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>gestão cartões diária</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="font-aw

javascript - Express does not receive parameters via POST from React using Fetch API -

i'm developing simple app using express.js , react, both applications in development environment (local machine) on different ports, server (express) on localhost: 3001 , frontend (react) on localhost: 3000. the problem have trying send data frontend using fetch api express not receive data sent via post react. did test doing post normal form , server did accept parameters send via post, think problem call javascript using fetch api. in express installed cors module accept requests not of same domain problem persists. below snippet of code both better understanding. ... // handler recieves 'e' event object formpreventdefault(e) { var headers = new headers(); headers.append('accept', 'application/json, application/xml, text/plain, text/html, *.*'); headers.append('content-type', 'multipart/form-data; charset=utf-8'); headers.append('access-control-allow-origin', '*'); headers.append('access-c

node.js - NodeJS. Google Execution API. OAuth server side -

i'm trying use google execution api (call script modify of google spreadsheets) within backend part (nodejs server). problem i'd make authorized api calls without user/ui login interaction (like in case of oauth 2 flow), rather own account's api key or whatever, point use google execution api 'silently'. as can see far - can achieved using service account key , somehow cannot access scripts attached documents. maybe i'm missing , me out issue?

php - Howto Know difference - clicked Link vs email preview - for 1 time use URL's? -

i'm using email text gateway url stops further email texts. when text arrives on phone, provider preview attempt on url - triggers application stop sending future texts. is there way tell difference - way of env variables (php) running because clicked on link , not cellular provider doing preview attempt? i'm using apache web server, php server side. previously i've used ip check see if "barracuda" remote address , ignore - has not been successful - added new ip address blocks. seemed cellular provider using barracuda email->text gateway email services. wondering if has better suggestion keep searching logs new ip blocks add application. the log entries are: first hits base domain name, hits base url, full url itself. 64.74.215.166 - - [24/jul/2017:19:02:47 -0600] "get / http/1.1" 200 882 "-" "mozilla/5.0 (windows nt 6.1) applewebkit/537.36 (khtml, gecko) chrome/56.0.2924.76 safari/537.36" 64.74.215.176 -

xcode - How to change iOS in app purchase when changing to lifetime membership instead of subscription? -

our app allows users either have 1 month subscription, or lifetime subscription. 1 month auto-renew subscription, lifetime 1 time purchase. our issue arises when user has 1 month subscription, , wants change lifetime subscription, aren't sure how cancel user's monthly subscription them, or if possible.

multithreading - php exec() haphazardly working in pthreads -

i use loop exec() file 300 times in pthreads. full 300 exec() calls successful, times few of exec() fail , between 295 or 299 successful executes of file. the error code exec() comes @ #127, checked file_exists on failures , says "file exists", says "file not executable" on failures. strange because executable other 295 times within loop. my pthread version 2 months old. confident don't have pthread workers sharing files or writing same spots. scratching head else can do. class workerthreads extends thread { private $workerid; public function __construct($id) { $this->workerid = $id; } public function run() { $mainfile="/pastlotto_1/".$this->workerid."/preset_pthread.php"; for($x=0; $x<100; $x++) { for($o=0; $o<3; $o++) { $command="php $mainfile"; $finde=exec($command,$output,$return_var); if($return_var !== 0){ echo " fil

Spring Controller Mapping Issues - Double Wildcard -

i map following url: /resource/{path/to/git/repo.git}/{branch}/{path/within/repository} to spring framework controller. having issues. have tried following pattern no success: /resource/**.git/{branch}/** matches resource/anything.git/branch/path/etc (no slashes in path git repo) does not match resource/path/anything.git/branch/path/etc expect i have tried /resource/**/.git/{branch}/** in testing behaves expected, allowing number of slashes in both ant pattern wildcards, not suit situation added slash. is there way map without resorting /resource/** , doing work of matching in controller? i ended fixing using mapping: /resource/**/*.git/{branch}/** a side effect of example given in original post working

matlab - Subplot with decomposed morphological structuring element -

Image
i using matlab 2014b, function strel behaves in different way respect newer versions [1] . in case, generating disk shaped structuring element approximation of 8 (in reality 10) linear structuring elements. i visualize these linear structuring elements , example in subplot. unfortunately, after these years using matlab, still have many problems understanding how obtain want plot. in case able visualize them "comparable" scale, 1 can notice differences in size , orientation. (note: using imcomplement black lines on white background, instead of opposite, printing reasons.) the minimal code this: se = strel('disk', 300, 8); seq = getsequence(se); k = 1:length(seq) subplot(5,2,k); imshow(imcomplement(seq(k).getnhood)); axis equal end as can see, results in suboptimal subplot: so summarize, question is: is possible obtain visualization (either subplot, or 10 different plots) where strels have same scale , , visible enough reader can idea of

python - Write from Text files to CSV Files -

i trying write rows contain string: bunch of text files. code: import os import glob import csv import re #defining keyword keyword = '2012-07-02' #code merge relevant log files 1 file , insert open('combined-01022012.txt' , 'w', newline = '') combined_file: csv_output = csv.writer(combined_file) filename in glob.glob('fao_agg_2012_part_*.txt'): open(filename, 'rt', newline = '') f_input: #with gzip.open((filename.split('.')[0]) + '.gz', 'rt', newline='') f_input: csv_input = csv.reader(f_input) row in csv_input: row.insert(0, os.path.basename(filename)) try: if keyword in row[2]: csv_output.writerow(row) #row.insert(0, os.path.basename(filename)) #csv_output.writerow(row) except: continue

algorithm - Time complexity pseudo code -

i want calculate time complexity of following code : for(i=0;i<n;i++){ func(); . // other o(1) operations . } where func() has complexity of o(k). the time complexity o(k*n) then.

dynamics crm - How to retrieve all Opportunity Products for the specific Opportunity through c#? -

Image
i have opportunity shown in below image: yesterday, posted question on how create opportunity products (motor products) & dave provided me answer on how achieve this. now, requirement has been extended delete these existing motor products & add new products. i'm thinking first retrieving relative motor products opportunity. for creating opportunity product used below code: var opportunityproduct = new entity(entitymotorname); opportunityproduct["tmeic_opportunitymotorproductid"] = new entityreference("opportunity", guid("opportunityid")); var opportunityproductid = crmservice.create(opportunityproduct); but, i'm stuck here retrieing these motor products. once motor products related opportunity can use below query. crmservice.delete(entityname,guid); note: opportunity has opportunityid no tmeic_opportunitymotorproductid & motor product (opportunityproduct) doesn't have opportunityid has tmeic_opportunitymotorpr

elasticsearch - Is an nGram fuzzy search possible? -

i'm trying ngram filter work fuzzy search, won't. specifically, i'm trying "rugh" match on "rough". i don't know whether it's not possible, or possible i've defined mapping wrong, or mapping fine search isn't defined correctly. mapping: { settings = new { index = new { number_of_shards = 1, number_of_replicas = 1, analysis = new { filter = new { edge_ngram_filter = new { type = "ngram", min_gram = 3, max_gram = 8 } }, // filter analyzer = new { analyzer_ngram = new { type = "custom",

php - Variable + Number to Database -

i confused great. i trying press button add 40 sales in order add 40 need current number of sales used fetch array output number , see '40' set variable tried $varible + 40 set number. not seem working check online , anyhelp awesome! $query = "select `sales` `sales`"; if ($result=mysqli_query($link, $query)) { $row = mysqli_fetch_array($result); print_r($row); } if ($_post['update']) { echo 'updating...'; $query="update `sales` set `sales` = '$row+40' `sales`.`id` = 1"; mysqli_query($link, $query); echo '<br>successfully updated'; } else { echo 'unsuccessful'; } as far query goes in mysql don't need 2 separate ones add existing data. query go follows: update `sales` set `sales` = `sales` + 40 `sales`.`id` = 1; so code this... if($_post['update']) { echo 'updating...';

objective c - iOS App crashes when it's updated in the AppStore, but not when it's installed in Xcode -

i'm using coredata in app. when modify entity or attribute, upload appstore , try update it, crashes. have uninstall , download again. there way bypass , update automatically deletes outdated version , installs latest version? how can resolve in user friendly , efficient way? you need create new core data model , migration. please use tutorial: https://code.tutsplus.com/tutorials/core-data-from-scratch-migrations--cms-21844

java - Invalid byte 1 of 1-byte UTF-8 sequence: RestTemplate -

i integrating third party api using rest template, send response in format of xml. of request, getting below error. could not unmarshal [class com.xxx.searchresponse]: null; nested exception javax.xml.bind.unmarshalexception\n - linked exception:\n[com.sun.org.apache.xerces.internal.impl.io.malformedbytesequenceexception: invalid byte 1 of 1-byte utf-8 sequence. i tried contenttype "application/xml", "text/plain", "text/xml" , "text/xml,charset=utf-8" only of response, getting error , xml response has many lines. hard detect characters facing problem. guess content type missing it. xml element: <search-response xmlns="" xmlns:info="" xmlns:common=""> <search-response> when hit third party api in postman, getting content type "text/xml;charset=iso-8859-1"

python - Tracking decorator not passing arguments -

i'm working on alexa skill flask-ask. want log intent calls , arguments, , since intents conveniently annotated ask.intent decorator, figured either change code of flask-ask logging in code of decorator, or decorate myself, preferable avoid problems patching library when deploying production. i've built solution below, problem *args , **kwargs empty, instead of being passed on over voted solution this issue . def tracked_intent(intent_name, mapping={}, convert={}, default={}): def decorator(f): @ask.intent(intent_name, mapping, convert, default) def new_func(*args, **kwargs): print('got intent {} arguments {} , {}'.format(intent_name, str(args), str(kwargs))) return f(*args, **kwargs) new_func.__name__ = f.__name__ return new_func return decorator thus, when have intent call requires argument, typeerror: function() missing 2 required positional arguments: 'arg1' , 'arg2' how can

android - Auto Focus Modes Not Working In Samsung S8 -

update 2: focus modes apparently don't work update 1: problem seems isolated samsung s8 device. it's working on nexus 5x , xiaomi phones i've been trying make focus_mode_continuous_picture work no avail. i've confirmed device supports continuous auto picture via getsupportedfocusmodes() , , not sure why doesn't work. here's code, continuous auto focus being set in startcamera() : class capturereceiptfragment : fragment(), capturereceiptcontract.view { private val my_permissions_request_camera = 1 private var camera: camera? = null private var hascamerapermission: boolean? = null private lateinit var preview: camerapreview override var presenter: capturereceiptcontract.presenter? = null private val picture = camera.picturecallback { data, camera -> val picturestoragedir = file(environment.getexternalstoragepublicdirectory( environment.directory_pictures), getappname()) presenter?.savereceipt(picturestoragedir, data) }