Posts

ios - How do I move UIView to front of ViewController Swift 3? -

Image
i trying build sign page option use phone or email. in order able send server of views have in 1 view controller. trying figure out how can move 1 view front of controller when pressing button. screenshot 1: screenshot 2: this because trying call on class signupview , rather instance of class. bringsubview(tofront:) instance method. it looks have changed type of view controller's view property signupview, can still access using view , this: view.bringsubview(tofront: youremailviewinstance) note have changed use of emailview in method call. need using property names have assigned instances of views, not class names.

c# - creating a dynamic page in asp.net mvc -

i'm new asp.net mvc , i'm trying create dynamic page using following code.... `@using musicstore.models; @{ viewbag.title = "songs"; ienumerable<songs> songs = viewbag.songslist; } <section id="main" class="container"> <div class="jumbotron"> <h1> tony's music store</h1> <h2>@viewbag.title.</h2> </div> <table class="table"> <thead> <tr> <th><h3>song list</h3></th> </tr> </thead> @foreach (var list in songs) { <tbody> <tr> *<td><a href=" ">@list.songname</a></td>* </tr> </tbody> ...

Why "Use same selection" option is missing in Android Studio 3.0 and later? -

Image
in android studio 2.x, looks this: android studio 2.x but in android studio 3.0, option "use same selection" missing. android studio 3.0 why convenience option deprecated? there move other places didn't find? android studio 3.0 still beta version, if correct. can't assume deprecated. maybe there release version. as current problem, same option in run/debug configurations . select usb device target , select checkbox underneath. should it.

reactjs - React Mobx Firebase.onAuthStateChanged listener -

i have put auth.onauthstatechange().then(user => ... inside componentdidmount() of top level react component. then remove listener inside of componentwillunmount() my question how mobx-ify this? idea this: class store { @observable user = null @action killfirebaselistener = this.removelistener() constructor() { this.removelistener = firebase.auth().onauthstatechange(user => { if (user) this.user = user }) } } i call killfirebaselistener action componentwillunmount of top level container-component... , use user observable necessary. understanding when user observable updates upon successful login or logout, listeners update , trigger re-render accordingly... wrong this? does have experience sort of "user listener" mobx? have pointers or maybe resources can pass along. ok. looks idea works fine. added class store { @observable user = null constructor() { firebase.auth().onauthstatechanged(user => { if (u...

javascript - how to pass promise to map -

i have blog , i've posts on it. in post table inserted posts authorid . , want convert authorid authorname table called user . convert, use function getpostauthor returns promise main function. can't collect returned value getpostauthor map function problem? var db = require('../controllers/db'); var mongo = require('mongodb').mongoclient(); var url = "mongodb://localhost:27017/blog"; var objectid = require('mongodb').objectid; //#1: function lists posts in blog const list = function(req, res){ db.find('post', {}, 10, {timecreated: 1}) .then(posts => { var promises = posts.map(post => getpostauthor(post.author) .then(author => author /* value doesn't go promises*/) ); console.log(promises); //printed [promise {<pending>}, ...] }) } //#2: function gets authorid , gives authorname const getpostauthor = function(authorid){ return db.findo...

C++, OpenCv: Member function not updating member variables -

i have class mainwindow contains function saveimagefile(). reads image, puts canvas object, class stores list of layer objects, each layer containing 2 opencv mats, pre-effects mat , post-effects mat. in saveimagefile(), apply image effect lumatoalpha() on layer[1] of canvas. lumatoalpha() takes layer's pre-effects mat, performs operation on it, , stores in layer's post-effects mat. function tested. works. however, when attempt post-effect mat, original mat. if lumatoalpha() did nothing @ all, or performed on totally different layer object. i believe may have pointers, not confident. going wrong? mainwindow class... //member variables of mainwindow... canvas mcanvas; void mainwindow::saveimagefile() { mat mat = imread("c://picture.jpg), cv_load_image_grayscale); mcanvas.startcanvas(mat, canvas::bgra); mcanvas.getlayer(1).lumatoalpha(); mat canvasmat = mcanvas.getlayer(1).getposteffectmat(); imwrite("c://picture-result.png...

nginx - WebSocket connection to 'ws://<ip>..failed: Error during WebSocket handshake: Unexpected response code: 502 -

i'm using node,socket.io,nginx socket connections http based simple application. below nginx.conf configured websockets, socket io present in socket/socket.io. strange thing same config works when run node application in localhost , nginx port 80. not sure why failing in linux real ip addresses. http { upstream io_nodes { ip_hash; server ip:port; --> application's ip , port server ip:port; } include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 1000; # http server server { listen 80; server_name ip; server_tokens off; #proxy_ssl_verify off; # prevents 502 bad gateway error large_client_header_buffers 8 32k; location /dummy/ { root html; index dummy/index.html; } location /socket/socket.io { proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header host $http_host; p...