Posts

c# - Update UI element from thread -

i try create in windows phone timer update every 10-15 ms (for ui element). , want have opportunity append time. create timespan , dispatchertimer interval = 15 ms. every 15 ms call event subtract 15 ms timespan , when timespan <= 0 call method. when set timespan 4 seconds (for example) in life passed more 4 sec 4,6 sec. tryed use async/await did't work. tryed use system.threading don't know how update element create in other thread. so every 15 ms call event subtract 15 ms timespan , when timespan <= 0 call method. your logic flawed. can't possibly update timespan way because: as stephen cleary mentioned in answer, have no guarantee timer fire @ 15 ms even if did, doesn't take account time needed update timespan (say takes 1ms compute new timespan, timer drift of 1ms every 15ms) to have accurate time, need store timestamp @ started (retrieve using datetime.utcnow . every time timer tick, take new timestamp , substract 1 saved. way, know how...

mysql - Check table_A before updating table_B -

i'm trying make query checks if field 'field_a' in 'table_a' '0' , if is, update 'field_b' in 'table_b' '10'. i have no idea if possible. have little experience mysql , i'm trying things out. if is, i'd know how done. update table_b set field_b = 10 exists (select 1 table_a field_a = 0)

android - How can i segment an image using opencv4android -

i developing application on android platform. app needs capture image using camera, , analyse captured image see red , blue color ends , next step make contour arround twi shape cirle , triangle.(already done ) have move next step : segmentation can me how segment images. ideas? assuming c contour: rect roi = imgproc.boundingrect(c); mat newmat = mrgba.submat(roi); bitmap bmp1 = bitmap.createbitmap(newmat.width(), newmat.height(), bitmap.config.argb_8888); utils.mattobitmap(newmat, bmp1); bmp1 should hold image want. this give rectangular image shows bounding area of original object, if circle have detected, circle plus other parts of image contained in bounding box. if just want detected object , have rest of content transparent harder problem.

css - Internet Explorer and Chrome: table-hover not displayed properly -

for better visual experience use css style on <tr> when hovering on it. to see complete design: http://jsfiddle.net/rdje3/1/ i used: .table_test tr:hover { outline: none; border-color: #29ec24; box-shadow: 0 0 10px #29ec24; } this works fine in firefox. but in internet explorer hover gets displayed not complete (just between <td> ) , in google chrome nothing displayed. why? first of seems it's official bug chrome. stated here way setting 'display: block' on <tr> element, requires fix positioning afterwards. also, box-shadow requires use -webkit- prefix chrome. can see 'working' , malformed example here . you'll have set width of table cells yourself.

How to import Swift code to Objective-C -

i have written library on swift sclalertview-swift , wasn't able import current project on (objective-c) is there ways import it? #import "sclalertview.swift" - 'sclalertview.swift' file not found you need import targetname-swift.h . note it's target name - other answers make mistake of using class name. this single file autogenerated header defines objective-c interfaces swift classes in project either annotated @objc or inherit nsobject . if target name contain spaces, replace them underscores (e.g. "my project" becomes "my_project-swift.h")

Changing the default dark Android theme to white in Xamarin.Forms? -

xamarin.forms generate greyish android application. i'd have light / white theme in android (like in ios target). does simple way switch exist? you can put theme parameter applicationattribute of main activity like this [assembly: application(icon = "@drawable/icon", theme = "@android:style/theme.holo.light")] or can put string androidmanifest.xml <application android:theme="@android:style/theme.holo.light" />

node.js - Are Express Sessions inherently unique to the visitor -

i'm troubleshooting issue server instance need root cause analysis , right believe driver express sessions. i've implemented sessions primary intra-page data storage mechanism, seems sessions not unique visitor relationship. by mean have session prefills form on "shipping information" page. however, if visit page other browsers or other machines detail first session created on server start prefilled if session data bleeding these other browser relationships. so, i'm trying understand if intention sessions unique visitor default. if not, can made unique? i'm worried because admin authentication done via sessions. yes unique visitor, sounds if code setting global state, , not sessions. may want post config using, plus setting session vars.