Posts

android - React Native: Get flexDirection row items to render on next render if outside of view's boundaries -

i have view container containing multiple view tags using flexdirection: 'row' property. however, issue arises when have many elements in container view . reasons, view components inside container don't wrap , overflow outside container. see image here you can see view container has border, contents flowing outside of it. my render function render() { let test = ["acute pain","acute pain","acute pain","acute","acute","acute","acute"] let tagnames = test.map((tagname, index) => { return ( <view style={{backgroundcolor: '#1bb393', padding: 3, borderradius: 5, marginright: 5}}> <text style={{color: 'white', fontfamily: 'facit'}}>{tagname}</text> </view> ) }) return ( <view style={{flexdirection: 'row', flex: 1, borderwidth: 1}}>{tagnames}</view> ) } ...

c# - I have an existing interface (with properties) whats the best way to segregate read and write -

using c# have existing interface wish split read , write interfaces still keep original. best way? i make 3 independent interfaces: interface iexistingreadwrite{ int width {get; set;} } interface iread{ int width {get;} } interface iwrite{ int width {set;} } or make iexistingreadwrite inheret iread , iwrite, clearer other coders when @ iexistingreadwrite there segregated iread , iwrite interfaces available too... interface iexistingreadwrite: iread, iwrite{ new int width {get; set;} } interface iread{ int width {get;} } interface iwrite{ int width {set;} } but i've had use 'new' on iexistingreadwrite shadow properties in iread , iwrite otherwise warnings ambiguity occur. shadowing not intention iexistingreadwrite 'pass work on' interfaces inhereted define new property (so there no opportunity there being seperate implementations each of seperate interfaces occuring). there better way. it looks corak has best answer far......

regex - Match last dir before filename in unix path -

i need find regex extract last dir before file in full path strings these: ./resources/views/product/edit.html.twig ./resources/views/product/show.html.twig ./resources/views/product/new.html.twig so these strings yield 'product'. you may use ([^/]+)/[^/]*$ see a demo on regex101.com . broken apart, says: ([^/]+) # capture not /, @ least once / # / [^/]* # 0+ not / $ # end of line depending on actual language and/or delimiters used, may need escape forward slashes \/ .

numpy - Python / py2exe - How to resolve / suppress OMP warning messages? -

first, installed versions of python / various modules: python: 2.7.1 numpy: 1.13.1 scipy: 0.19.1 py2exe: 0.6.9 the modules installed wheels available here: http://www.lfd.uci.edu/~gohlke/pythonlibs/ i have python code have written compiling single, stand-alone executable "future-proof" it, , allow run on other pc's might not have same modules installed do. having same issue described in following posts: omp warning when numpy 1.9.2+mkl packaged py2exe omp warning when numpy 1.8.0 packaged py2exe the news is, omp warning message not negatively affecting code. however, either resolve issue causing warning message, or suppress warning messages, since not affect performance of code, might confuse / annoy user. can provide advice? sounds previous posters have tried lot of things already, figured might time fresh look. there part of numpy can modify doesn't make reference omp, since i'm not using (at least, i'm not...

javascript - jquery 3 document ready is blocking turbolinks from executing -

i using jquery 1.12.4 far , ok, had : $(document).ready -> console.log "document ready yaay!" start = -> alert "hello world!!!" document.addeventlistener('turbolinks:load', start) i upgraded rails 5.1 yesterday , decided add , upgrade jquery (yep still need it) installed jquery 3 using yarn, same code above doesn't executed, @ least turbolinks part (the console.log executed every time document loaded "start" method not) i removed $(document).ready -> , code start working expected !!! to make sure removed jquery 3 , installed jquery 1.12 , worked! $(document).ready -> why happening ? make sure add //= require jquery application.js file. in command line, run yarn install jquery lower case here application.js file 1 of project using jquery through yarn. //= require rails-ujs //= require turbolinks //= require jquery //= require_tree . edit: if want console.log , alert fire @ ...

api - Ajax call returns undefined -

i trying make api call , following errors ajax not being function: import $ 'jquery'; const apicall = function () { var url = 'https://images.nasa.gov/#/search-results'; var request = { q: 'sun', media_type: 'image' }; var result = $.ajax({ url: url, datatype: 'json', data: request, type: 'get' }) .done(function() { alert(json.stringify(result)); }) .fail(function() { alert('failed'); }) } module.exports = apicall; i importing above in module , calling on button click in react's render() function like: import apicall './../api/apicall'; class gallery extends react.component { render () { return ( <section id="gallery" classname="g-site-container gallery"> <div classname="grid grid--full"> <div classname="gallery__intro"> <button extraclass="...

Configuring remote access with ssh - Flink -

i'm following guide configure flink cluster: flink cluster setup see "configuring remote access ssh" section. when scp .ssh/authorized_keys <worker>:~/.ssh/ substituting < worker > ip of other nodes of cluster. unfortunately obtain following output: ssh_exchange_identification: read: connection reset peer lost connection some knows problem?