Posts

Showing posts from June, 2015

rest - PHP Token Authentication - Expiration -

i have hybrid spa php web application makes calls remote rest api it's needs. i'm starting implement token authentication between web server , api , i'm not quite sure how handle expiration of token. there may flaws in design well. user submits login credentials (username & password) web server. web server sends call api. api looks creds., if good, jwt auth token generated , returned web server token stored in php session variable. token never made public. each call web server makes api sends request authorization header includes token pulled session. my problem is, what's best way issue new token if 1 has expired during incoming request. api checks each request's token determine if it's valid , if it's expired. if request api foo/bar example, expecting json string in return, token has expired, expected behavior? hope makes sense. please let me know if i'm not clear enough. have not had luck researching particular scenario.

ios - Add tapGesture to tableView then can not perform tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) method -

as know, use below code can endediting searchbar's firstresponder, if there scrollview or tableview, effect different. override func touchesbegan(_ touches: set<uitouch>, event: uievent?) { super.touchesbegan(touches, with: event) self.view.endediting(true) } i add tapgesture tableview, can endediting searchbar's firstresponder. but after add tapgesture tableview, tableview's tableview(_ tableview: uitableview, didselectrowat indexpath: indexpath) function not work more. how can solve issue? addition my useful code below: let tap:uitapgesturerecognizer = uitapgesturerecognizer.init(target: self, action: #selector(taptableview)) self.tableview.addgesturerecognizer(tap) func taptableview() { self.searchbar.endediting(true) } add tapgesture on view not on tableview let tap:uitapgesturerecognizer = uitapgesturerecognizer.init(target: self, action: #selector(taptableview)) self.view.addgesturerecognizer(tap)

ruby on rails - Capybara does not waiting for ajax to finish -

i trying test signup flow using rspec , cpaybara within feature spec. signup happens via ajax , capybara doesn't wait request complete. using capybara matchers specified in documentation. if add sleep statement test succeeds let(:user) { create(:user, email: 'test@example.com', password: 'password') } scenario 'visitor can sign valid email address , password', js: true sign_up_with('name', 'test@example.com', 'password') expect(page).to have_content(i18n.t( 'devise.registrations.signed_up')) end helper method handle signup: def sign_up_with(name, email, password) visit root_path find(:xpath,"//a[text()='join']").click within("#sign_up_choices") click_on "sign email" end within("#sign_up") fill_in 'user[name]', with: name fill_in 'user[email]', with: email fill_in 'user[password]', with: password click_button

How to know about what authentication method a wcf service from wsdl -

i consuming wcf service, have wsdl me. trying consume getting 401 (authorization error). is possible know authentication method service supports wsdl have , if not how can authenticate against service? in wsdl see following binding <wsdl:binding name="webcontractorsoap12" type="tns:webcontractorsoap"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="callwebcontractor"> does mean supports transport level security, i.e. https , doesn't need username password authentication? <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="https://www.ramm.co.nz/webservices/6.1webcontractor" xmlns:s="http://www.w3.org/2001/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/

linux - How to get gsettings scheme string from another user, trough javascript in gnome -

i wish know way pull gsettings user. example path background image, stored in org.gnome.desktop.background picture-uri. with shell command, write: gsettings org.gnome.desktop.background picture-uri or sudo -u taylorswift -b gsettings org.gnome.desktop.background picture-uri and in javascript with: const background_schema = 'org.gnome.desktop.background'; let background = new gio.settings({ schema: background_schema }); let location = background.get_string(picture_uri_key); ...but draw current active user. want act.user.get_icon_file() does, provided accountservice , stored in user file, have get_background_file() instead. i know ubuntu’s unity stores background path both in gsettings , in user file, , draws login screen backgrounds. tried searching how did trough source code, couldn’t find anything. may have looked in wrong sources, ones managed find, on own. sorry bad english. hope provided information needed. regards.

c# - Fastest method to remove Empty rows and Columns From Excel Files using Interop -

Image
i have lot of excel files contains data , contains empty rows , empty columns. shown bellow i trying remove empty rows , columns excel using interop. create simple winform application , used following code , works fine. dim lstfiles new list(of string) lstfiles.addrange(io.directory.getfiles(m_strfolderpath, "*.xls", io.searchoption.alldirectories)) dim m_xlapp = new excel.application dim m_xlwrkbs excel.workbooks = m_xlapp.workbooks dim m_xlwrkb excel.workbook each strfile string in lstfiles m_xlwrkb = m_xlwrkbs.open(strfile) dim m_xlwrksheet excel.worksheet = m_xlwrkb.worksheets(1) dim introw integer = 1 while introw <= m_xlwrksheet.usedrange.rows.count if m_xlapp.worksheetfunction.counta(m_xlwrksheet.cells(introw, 1).entirerow) = 0 m_xlwrksheet.cells(introw, 1).entirerow.delete(excel.xldeleteshiftdirection.xlshiftup) else introw += 1 end if end while dim intcol integer = 1 while i

How to access the params in controller ember.js -

this router.js code. this.route('contact',{'path': '/contact/:chat_id'}); and route.js code. model(params) { return this.store.findrecord("chat", params.chat_id) }, and controller.js code , can use this. shows error null value please me. how use params in controller recordchat: function() { var chat = this.get(params.chat_id) ember.rsvp.hash({ offer_id: chat, }) } in route.js, need call setupcontroller function this: setupcontroller(controller, model) { this._super(...arguments); controller.set('chat', model); } now have access in controller calling: recordchat() { const chat = this.get('chat'); // if don't call setupcontroller function, do: // const chat = this.get('model') or this.get('model.id') if want id } update: see working twiddle here

html - I am trying to display text over image on more info click -

i trying display text on image on more info click , hide text image on hide info button click. i developing website in razor. trying display text on image on more info click , hide text image on hide info button click. <style> .portfolioimage { position: relative; overflow: hidden; } .portfolioimage .footerbar { position: absolute; width: 100%; height: 100%; position: absolute; left: 0; margin-top: -200px; border-radius: 5px; } .portfolioimage:hover .footerbar { margin-top: 0px; background-color: #ffb268; opacity: 0.8; } .footerbar { -webkit-transition: 0.7s ease; transition: 0.7s ease; } </style> <div class="thumbnail" style="padding:0px;height:200px"> <div class="portfolioimage" id="portfolioimage@(i)"> <div class="footerbar&qu

javascript - How to Open a Links in a div tag in same page? -

<a href="webform1.aspx">form1</a> <a href="webform2.aspx">form2</a> <a href="webform3.aspx">form3</a> <div id="content"> </div> `` here have 3 links in page. if click link go assigned page .now want load link div tag. there answers available not working. i have tried doing (a clarification comments): $(document).ready(function () { $('a').on("click", function () { e.preventdefault(); $("#content").load(this.getattribute('href')); }); when using jquery must link jquery library or download copy , link it. example: link jquery library <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> </head> once have done can start using jquery . jquery has dom ready function, it's recommended place of

Crate: Why require the PRIMARY KEY column to be present in a PARTITIONED BY clause? -

can me understand reading in documentation? https://crate.io/docs/reference/sql/partitioned_tables.html in these example tables, column id long not primary_key ; indeed, id not primary key here, because noted below "if primary key set, must present in partition by clause" in app, i've historically had primary key on id string not null , want add partitioning on table, on generated date column in example partition_date timestamp generated date_trunc('day', created_at) . i've read partitioning on date column speed of queries scoped time period (counting today's records, example, hit today's partitions), , helping me archive older frames of data (e.g. > 180 days), don't want lose performance of single pk lookups. so since can't partitioned (partition_date) , best if i... a) remove primary key constraint id ? i'm nervous affect performance single row lookups! in context, makes sense pk must in partition key, because lookup wh

html - Behavior of NVDA -

i trying add live region support in web page make nvda usable page. however, have seen quite different behavior aria-live attributes expected. i have tried adding single live region hidden , dump messages (each message enclosed in <p> tag) region read screen reader. works fine, problem first message inserted live region div never read nvda screen reader. subsequent messages read perfectly. live regions div created dynamically when first message announced. aria-live="assertive" doesn't interrupt current flow announce message. i using knockout in web page. when html div, marked live-region, displayed based on knockout condition, not detected screen reader. example: <!-- ko if: $data --> <div aria-live="polite" data-bind="text: $data"> </div> <!-- ko --> when page loaded initially, $data null. live-region div absent. when data fetched div gets inserted. however, nvda doesn't read content in added div. expe

javascript - Scope error in constructor (ES6) -

this question has answer here: how access correct `this` inside callback? 5 answers i've encountered strange error while working new version of es6. when run piece of code i'm getting referenceerror: alertbox not defined . there way call alertbox inside function? in advance :) here's code class main { constructor(data){ this.data=data; // 1 works this.alertbox(this.data); this.watchfile(function(){ // 1 throws error this.alertbox(this.data); }); } alertbox(data){ alert(data); } watchfile(cb){ cb("changed"); } } // app.js new main("hello"); here can find snippet: https://repl.it/fjuo by passing normal function watchfile you're losing context of this . in es6 can use "arrow function" syntax create function keeps correct context. this.watchfile(()

x86 - Even and odd numbers in assembly language -

i have code in assembly language, , show me if number odd or even. want if number show opposite of number, , if odd show number/2. can me ? thanks. sorry bad english .model small .stack 100h .data msg db 10,13,'enter number=$' msg1 db 10,13,'number even$' msg2 db 10,13,'number odd$' msg3 db 10,13, 'case convertion=$' .code mov ax,@data mov ds,ax lea dx,msg mov ah,9 int 21h mov ah,1 int 21h mov bl,al cmp bl,'9' ja cc sar bl,1 jc odd lea dx,msg1 mov ah,9 int 21h jmp exit odd: lea dx,msg2 mov ah,9 int 21h jmp exit cc: lea dx,msg3 mov ah,9 int 21h cmp bl,'a' jnle next next: cmp bl,'z' jnge con jmp lower con: add bl,32d mov dl,bl mov ah,2 int 21h jmp exit lower: cmp bl,'a' jnle ln ln: cmp bl,'z' jnge conl

Formating http get request output in python -

i trying read data our internal web-page using following code: import requests requests_toolbelt.utils import dump resp = requests.get('xxxxxxxxxxxxxxxx') data = dump.dump_all(resp) print(data.decode('utf-8')) and output getting in following format: <tr> <td bgcolor="#ffffff"><font size=2><a href=javascript:openwin(179)>kevin</a></font></td> <td bgcolor="#ffffff"><font size=2>45.50/week</font></td> </tr> <tr> <td bgcolor="#ffffff"><font size=2><a href=javascript:openwin(33)>eliza</a></font></td> <td bgcolor="#ffffff"><font size=2>220=00/week</font></td> </tr> <tr> <td bgcolor="#ffffff"><font size=2><a href=javascript:openwin(97)>sam</a></font></td> <td bgcolor="#ffffff"&g

java - how to convert Arraylist<myClass> in JSONArray -

i'm trying convert generic arraylist in jsonarray displaying null value. but working fine if i'm trying display specific value arraylist . arraylist<myclass> experience = new arraylist<>(); ... //adding values log.v("testing", experience.get(0).company); //this showing value jsonarray json = new jsonarray(experience); log.v("testing", json.tostring()); //this showing [null] there might problem recognizing andn converting "myclass" bean json. try using gson library create json , parse object .

python - Fast reading of specified columns in df using pandas.to_hdf -

i have dataframe of 2gb write once, read many df. use df in pandas, therefore using df.read_hdf , df.to_hdf in fixed format works pretty fine in reading , writing. however, df growing more columns being added, use table format instead, can select columns need when reading data. thought give me speed advantage, testing doesn't seem case. this example: import numpy np import pandas pd df = pd.dataframe(np.random.randn(10000000,9),columns=list('abcdefghi')) %time df.to_hdf("temp.h5", "temp", format ="fixed", mode="w") %time df.to_hdf("temp2.h5", "temp2", format="table", mode="w") shows fixed format faster (6.8s vs 5.9 seconds on machine). then reading data (after small break make sure file has been saved): %time x = pd.read_hdf("temp.h5", "temp") %time y = pd.read_hdf("temp2.h5", "temp2") %time z = pd.read_hdf("temp2.h5", "te

python - pip install MySQLdb is not working in my pc and some other errors -

Image
this question has answer here: python 3.5 - django 1.10 - mysqlclient windows 7 installation error 2 answers i using python-3.6.0 & windows10. during learning django created project , when typed python manage.py makemigrations began show errors. checked many q/a. nothing working there suggestion. i tried pip install mysqlclient , pip install mysqldb , other commands. here screenshots now can do. please need help. you need install mysql-python via pip pip install mysql-python

sql - MySql 5.7 ORDER BY clause is not in GROUP BY clause and contains nonaggregated column -

i'm trying figure out without disabling "only_full_group_by" in my.ini here query: select p.title, count(t.qty) total payments t left join products p on p.id = t.item t.user = 1 group t.item order t.created desc; and tables: payments: id item user created ============================ 1 1 1 2017-01-10 2 2 1 2017-01-11 3 3 1 2017-01-12 4 4 1 2017-01-13 5 1 1 2017-01-14 products: id title created ========================== 1 first 2016-12-10 1 second 2016-12-11 1 third 2016-12-12 1 fourth 2016-12-13 the final result should lie: name total first 2 second 1 third 1 fourth 1 but if change query group t.item, t.created error gone, end 5 records instead of four, not want. since i'm grouping items based on "item" field, there should 4 records this query: select p.title, count(t.qty)

ios - write something to already opened view, when coming back from the modal view -

edit in parent view, when moved child modal view. should use "viewwillappear" or other pre-defined functions view appeared in foreground.. there plenty of ways achieve want. one checking on viewwillappear , another way create protocol, , call protocol method when child going dismissed. also, have property in child class hold object reference parent, , when being dismissed call method on parent notify parent modal being dismissed. you use notificationcenter , , post notification, , handle notification on parent update it, well. i don't know 1 suitable you, if give more context problem, clarify answer. luck! edit: here official apple documentation; here can find information how use notifications , notification center. you can search google more on notifications , notificationcenter.

c - Parse network 'interfaces' for read/write using pointer as parameter of functions -

i write small program read /etc/network/interfaces, save *ethernet_t[], change value, , write interfaces. works fine in main function. can not separate code function , pass pointer of array that. following code: #include <stdio.h> #include <ctype.h> typedef struct { char sys_ifname[10]; char address[20]; char netmask[20]; char network[20]; char gateway[20]; protocol_e protocol; } ethernet_t; #define max_nic 4 char *removing_leading_and_trailing_whitespace(char *a); int write_to_interface (ethernet_t *interface[], const char *filename) { file *fp; /* should grant root privilege */ if ((fp = fopen(filename, "w")) == null) { perror ("fopen"); exit (-1); } printf ("file open %s writing successfully\n", filename); /* set dhcp test */ interface[2]->protocol = dhcp; fprintf (fp, "# /etc/network/interface\n"); fprintf (fp, "\nauto lo\n"); fprintf (fp, "iface lo inet loopb

python - How to stop program from crashing - "The version of Tcl/Tk (8.5.9) in use may be unstable" -

beginner python learner here! my idle keeps crashing after input code: import pandas pd import pickle import quandl quandl.apiconfig.api_key = "vsq61-wrwp_m_hwh5bv9" fiftystates = pd.read_html('https://simple.wikipedia.org/wiki/list_of_u.s._states') main_df = pd.dataframe() abbv in fiftystates[0][0][1:]: query = "fmac/hpi_"+str(abbv) df = quandl.get(query) df.columns = [str(abbv)] if main_df.empty: main_df = df else: main_df = main_df.join(df) i think has line of code: df.columns = [str(abbv)] , didn't crash until after inserted it. everytime try save code, crashes. i've installed http://www.activestate.com/activetcl/downloads activetcl 8.6.4, everytime save code, still crashes. here's info computer: i'm using python 2.7.13 (and prefer not install python 3, because find 2.7.13 works better me). have macos sierra 10.12.1. furthermore, here's window looks after force quit idle (aft

Posting multi dimensional form via jquery to php -

i have form. first 2 inputs customer id , address id. rest multidimensional form usuer can dynamically add more items. <div class='invoice_object'> <input name='item[1][quantity]' type='text' value=''/> <textarea name='item[1][description]' ></textarea> <input name='item[1][unit_price]' type='text' value=''/> <input name='item[1][amount]' type='text' value=''/> </div> another invoice object can added jquery , so: <div class='invoice_object'> <input name='item[2][quantity]' type='text' value=''/> <textarea name='item[2][description]' ></textarea> <input name='item[2][unit_price]' type='text' value=''/> <input name='item[2][amount]' type='text&

How can you make an Azure SQL server publicly accessible? -

i know can modify firewall rules azure sql server allow connections specific ip address, there way specify wildcards allow ip addresses? not sql wild cards .but can below . example : adding below allows ips in range after 49.205 49.205.0.0 49.205.0.0 adding below allows whole world access db. 0.0.0.0 0.0.0.0 note: makes server less secure ,as allowed ip addresses feature 1 way protect database against unauthorized usage

linux - How to use FREngine11 recognition in both English and Chinese documents? -

when using frengine11 identification documents in both chinese , english, using put_textlanguage recognizerparams method, have been created multilingual textlanguage object add to, still can't identify chinese.

angular2 routing - How to modify app.component.ts property from child component in angular 2/4 -

i have created different modules login , signup. go login page main page navigation link using < router-outlet>. menu in landing page below - menu -- login, signup, continue without login . when user clicks on login link, login page displayed. on success login want change above menu i.e should menu -- users, orders etc. how achieve in angular 2/4. note - have created different components , modules login , signup , these modules(login.module.ts , signup.module.ts) included in app.module.ts.

database - DBS-2 phase locking -

does know, why these transactions t1 , t2 don't folow two-locking phase ? (it said because unlock(y) followed write_lock(x) in transaction t1 , same in t2 , why doesn't follow 2 phase locking, don't understand, explain me? ) thank you t1 read_lock(y ); read_item(y ); unlock(y ); write_lock(x ); read_item(x ); x := x + y; write_item(x ); unlock(x );` t2 read_lock(x ); read_item(x ); unlock(x ); write_lock(y ); read_item(y ); y := x + y; write_item(y ); unlock(y );

c# - Microsoft.Web.Administration FlushUrl method returns 0x080070032 -

i've been wrapping head around last few days, fail come solution. i want purge arr cache server. however, when execute fails comexception: request not supported. exception hresult: 0x80070032. when don't run in admin mode, -as expected- error: acces_denied. i have following code: private const string diskcachesection = "system.webserver/diskcache"; private const string flushurlmethod = "flushurl"; private const string urlmethodattribute = "url"; private const string errorcodestring = "errorcode"; public flushurlresponse flushurl(uri url) { if (url == null) { _logger.error("argumentnullexception on url"); throw new argumentnullexception(nameof(url)); } try { _logger.info($"flush url: {url.absoluteuri}"); //every sections has it's own methods. //but methods not publicly available/described. method f

ruby - What is the Rails part in an hybrid Rails+Ember App -

this question exact duplicate of: rails back-end + ember front-end since use ember's crud in hybrid, rails used for? validation's on ember side, routing in ember side, crud in ember side. what rails have this? why people couple them? , lastly, there framework let me keep logic in rails , take care of views ? rails takes care of server side of ember.js application other server side languages rest api , not neccessary has in rails , eg, have used ember.js php , java well.

java - How do I create a row key prefix scan using asynchbase -

i'm trying row-key prefix scan using java asynchbase library. e.g. want find first 10 records row key has prefix "abc": byte[] prefix = bytes.tobytes("abc"); scanner scanner = hbaseclient.newscanner(tblname); scanner.setfamily(bytes.tobytes("cf_test")); scanner.setfilter(new rowfilter(comparefilter.compareop.equal, new binaryprefixcomparator(prefix))); result = scanner.nextrows(10).join(); // ... i use rowfilter job, doesn't work. seems trigger full-table scan. i don't find filter class rowprefixfilter , neither #setrowkeyprefix() method in scanner class. how create scan match row key prefix? update : read code of hbase-client project , found 1 solution. in org.apache.hadoop.hbase.client.scan class, #setrowprefixfilter() method implemented below: public scan setrowprefixfilter(byte[] rowprefix) { if (rowprefix == null) { setstartrow(hconstants.empty_start_row); setstoprow(hconstants.empty_end_row); } else {

networking - Calculating centralitity of an Aggregated network -

i trying calculate various centrality measurements ( closeness centrality, betweenness centrality) on large network. example, lets assume following small network: 0 1 2 0 2 3 1 1 2 1 1 4 1 2 4 2 2 3 2 2 4 2 3 4 2 4 5 2 3 5 3 2 3 3 1 3 3 3 4 3 3 5 3 3 6 data set format follows: 1st parameter: indicates day (total 4 days) 2nd parameter: indicates 1st actor (total 6 actors) 3rd parameter: indicates 2nd actor for example: 0 1 2 means: @ day 0 there messaging between actor 1 , 2 if take short interval network length of 2 days (sin length) , above network becomes: sin 1: 0 1 2 0 2 3 1 1 2 1 1 4 1 2 4 and sin 2: 2 2 3 2 2 4 2 3 4 2 4 5 2 3 5 3 2 3 3 1 3 3 3 4 3 3 5 3 3 6 i can calculate centrality on above 2 sin's separately. have small confusion. want calculate centrality of aggregated network . question is: if take sin length of 4 , calculate centrality measurements, won't equivalent

android - How to synchronize all the phone contacts with my app -

in application want show option sync contacts app . should synchronize contacts app (just facebook when go contact tab of find friends page). so when contacts synchronized, i'll match contacts server , latter return members in contact list ones registered on server not in friends list. so can me? how synchronize device contacts application? you should create sync adapter , inside should sync , observe content provider contacts. for detailed explanation can take reference below reference. http://blogs.quovantis.com/syncing-contacts-with-an-android-application-2/

r - Downloading data via ftp to use in shinyapp causes readRDS unknown input format error -

i having trouble downloading data external ftp-source use in shinyapp. http://shinyapps.io not allow writing file on server, must avoid , try saving externally ftp , later read directly memory there. see wes sauder @ https://stackoverflow.com/a/32631356/3493503 got started. library(rcurl) <- "test" saverds(a, file="data.rdata") data_path <- my_data_path url <- my_ftp_url ftpupload(data_path, to=url, connecttimeout=120) #upload bin = getbinaryurl(url, verbose = true, ftp.use.epsv = true) readrds(rawconnection(bin)) uploading works fine, can download file filezilla afterwards , read readrds. however, trying download in r above code not work: > library(rcurl) > <- "test" > saverds(a, file="data.rdata") > data_path <- "**************" > url <-"ftp://******************/results.rdata" > ftpupload(data_path, to=url, connecttimeout=120) #upload

java - setting up Jetty 8.1.16 with pre-installed/configured Oskari in my ubuntu 15.04 -

i setting jetty 8.1.16 pre-installed/configured oskari in ubuntu 15.04 following this tutorial . after starting jetty , points http://localhost:8080 taking me default tomcat7 home page. wrong?

Danish and Finnish Localization on the App Store -

we localized our app in danish , finnish, description, screenshots, keywords , etc. but. app store still displays our app in english. there exists specific features when working danish , finnish? other languages displayed correctly. thanks.

How to dump mysql with all procedure and function using phpmyadmin -

i trying export mysql dump file checked option 'add create procedure / function' in export page using phpmyadmin neither function nor procedure dumping ... please suggest me how can dump procedure , function mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt <database> > outputfile.sql in case want backup stored procedures , triggers , not mysql tables , data, might helpful above... hope helps...

javascript - Call jQuery widget from outside -

i wrote jquery-widget method clear : (function($) { $.widget('ccf.mobileheaderautocomplete', { ... clear: function () { this.ulelement.empty(); }, ... }); })(jquery); i sucessfully call method on input element: $('.header-searchfield input') .on('input', function () { var value = $(this).val(); $(this).mobileheaderautocomplete('suggest', value); }); i want call when clicking button (outside input element, widget attached to), doesn't work: $('.header-searchfield__close-button').on('click', function () { $('.header-searchfield input').data('mobileheaderautocomplete').clear(); } the error in js console uncaught typeerror: cannot read property 'clear' of undefined i used this answer reference , tried ui-mobileheaderautocomplete . missing here?

javascript - React Native API Fetch -

i'm trying use fetch api in react native using following code snippet. whenever try console.log api data array comes 'undefined'?!?! home.js import api '../components/api'; class home extends component { constructor(props){ super(props); this.state = { profile: [] } } componentwillmount(){ api.getprofile().then((res) => { this.setstate({ profile: res.profile }) }); } render() { console.log("profile: ", this.state.profile); // console out api data return ( <view style={styles.container}> <text style={styles.welcome}></text> </view> ); } }; api.js var api = { getprofile(){ var url = 'https://api.lootbox.eu/xbl/us/food%20market/profile'; return fetch(url).then((res) => res.json()); } }; module.exports = api; the problem here using componentwillmount fetch data. check these part of docs: componentwillmount() invoked before mounting occurs. called befo

email - smtp delivery banner -unable to send mails via outlook -

i unable send , receive mails through outlook mail server. keep getting following error message ssmtp. ssmtp: 550 5.3.4 554-554 5.2.0 storedrv.deliver; delivery result banner /etc/ssmtp/ssmtp.conf : root=venkatsierradev04@outlook.com mailhub=smtp-mail.outlook.com:587 authuser=venkatsierradev04@outlook.com authpass=****** usestarttls=yes hostname=sierra-test fromlineoverride=yes how avoid delivery banner?

php - Total price based shipping extension not working opencart v2.x -

i using following extension calculate shipping charge based on total price. extension installed , enabled too. not working in checkout. how solve this? using fastor theme , opencart version 2.x. kindly help. https://www.opencart.com/index.php?route=extension/extension/info&extension_id=17494]

python - Get rows of a first array matching rows of a second one -

suppose have array a of shape (m, k) , b of shape (n, k) . the rows of b possible patterns can encountered (each pattern 1d array of size k ). i array c of shape (m,) c[i] indice of pattern (in b ) of row i in a . i doing in loop (i.e. looping on possible patterns) end using vectorization. here example: a = np.array([[0, 1], [0, 1], [1, 0]]) b = np.array([[0, 0], [0, 1], [1, 0], [1, 1]]) i expecting: c = np.array([1, 1, 2]) based on this solution , here's vectorized solution using np.searchsorted - dims = b.max(0)+1 a1d = np.ravel_multi_index(a.t,dims) b1d = np.ravel_multi_index(b.t,dims) sidx = b1d.argsort() out = sidx[np.searchsorted(b1d,a1d,sorter=sidx)] sample run - in [43]: out[43]: array([[72, 89, 75], [72, 89, 75], [93, 38, 61], [47, 67, 50], [47, 67, 50], [93, 38, 61], [72, 89, 75]]) in [44]: b out[44]: array([[47, 67, 50], [93, 38, 61], [41, 55, 27], [72, 89, 75]])

TcpClient hangs after connection to remote host & application freezes c# -

Image
i trying establish connection remote host via ip address , port number. connection established (even verified using cmd netstat) when try close connection in code: clientconnection.client.close(); clientconnection.client.dispose(); clientconnection.close(); the program crashes because socket not have available data read client stream. in windows application (client) have button click call connecttofalcon method , calls readstream method. please let me know have been going wrong. public void readstream(object argument) { clientconnection = (tcpclient)argument; //tcpclient client = new tcpclient(); datetime start_time = datetime.now; timespan delay = new timespan(0, 0, 10); while (clientconnection.available == 0) { application.doevents(); if (datetime.now.subtract(start_time) > delay) break; } if ((clientconnection != n

spring mvc - Aspect Auditing Field changes -

i'm trying capture filed changes using aspect auditing posibilities , custom anotations, can't old value. here code: public aspect fieldauditaspect { @autowired activityservice activityservice; @autowired userservice userservice; pointcut auditfield(object t, object value): set(@ge.shemo.model.client.aopaudit * *) && args(value) && target(t); before (object target, object newvalue): auditfield(target, newvalue) { fieldsignature sig = (fieldsignature) thisjoinpoint.getsignature(); field field = sig.getfield(); field.setaccessible(true); object oldvalue; try { oldvalue = field.get(target); } catch (illegalaccessexception e) { throw new runtimeexception("failed create audit action", e); } system.out.println("changed " + oldvalue + " " + newvalue); } } this custom annotation use mapping desired filed capture changes: @retention(runtime) @target(value = { type, field}) pu