Posts

Showing posts from September, 2014

Explanation for function composition and infix function application(PureScript) -

this code works findname :: string -> string -> addressbook -> boolean findname fname lname = not <<< null <<< filter findn findn :: entry -> boolean findn entry = entry.firstname == fname && entry.lastname == lname but not findname fname lname book = not <<< null <<< filter findn book again code works findname fname lname book= not $ null $ filter findn book and not findname fname lname = not null $ filter findn in short, because these different examples equivalent different placements of parentheses, code evaluated differently. f <<< g , f , g functions, equivalent \x -> f (g x) , whereas f x $ g y equivalent (f x) (g y) . whenever have infix symbol <<< , no other infix symbols, expressions left , right of symbol evaluated first, first example evaluated findname fname lname = ((not) <<< (null) <<< (filter findn)) , which book par

self-contained asp.net core web api is getting:- Failed to initialize CoreCLR, HRESULT: 0x80131500 on Ubuntu 16.10-x64 -

i have self contained asp.net core website, able run fine in windows 10, when publishing ubuntu.16.10-x64, , running in ubuntu 16.10 x64 desktop version getting a: failed initialize coreclr, hresult: 0x80131500 i have run updates , upgrades of os: (sudo apt-get update, sudo apt-get upgrade) i executing starting command sudo. the file has run permissions ( -rwxrwx--x ) targetframework netcoreapp1.1. libicu-dev newest version (55.1-7ubuntu0.2). how go troubleshooting error? update 28/07/17 while seems there several related issues can cause (most seem dependency related), users have reported ubuntu 16.1 following instructions on get started page has resolved error. several other fixes various other scenarios suggested on this thread . in addition, per https://github.com/dotnet/coreclr/issues/11417 - instances may due existing bug in coreclr 1.1 - not sound fixed in version. migrating version 2.0 suggested workaround in case. original answer: to d

c# - Roslyn Get Method Declaration from Invokation -

i'm making roslyn demo generating compiler warnings attributes i have analyzer analyze method invocations looks so: public override void initialize(analysiscontext context) { context.registersyntaxnodeaction(analyzerinvocation, syntaxkind.invocationexpression); } private static void analyzerinvocation(syntaxnodeanalysiscontext context) { var invocation = (invocationexpressionsyntax)context.node; } i'm trying figure out how method declaration, know can use symbolfinder search method declaration var model = compilation.getsemanticmodel(tree); //looking @ first method symbol var methodsyntax = tree.getroot().descendantnodes().oftype<methoddeclarationsyntax>() .first(/*todo: execute find related symbol */); this options expensive , annoying, , leaves open possiblity error because if invoking method coming assembly. what easiest way method declaration invocationexpressionsyntax? should using symbol finder , if fails use scour imported assemblies

Can android developers get information about buyers of in-app purchases? -

this other page says developer can see emails of buyers, last comment says "information has moved google wallet." post old well. android market (google play). buyer information i want able take suggestions people buy in-app purchase features see added app. this, need verify paid. if can see emails of buyers (or other information), can match suggestion emails list of buys' emails. if developers don't information, i'm open other ways implement this. i've considered sending email app hardcoded email/password. sensitive information found if decompiled code. (that isn't issue small time developer me, doesn't seem practice.) thanks help.

reactjs - React Native Android error trying to nest a view inside a text -

i working on iphone/android app react-native displays weather in table. in order create table, found table-layout library react-native: https://github.com/gil2015/react-native-table-component , used in code. 1 of data rows in table, wanted display animated svg file of weather, used library: https://www.npmjs.com/package/react-native-svg-image . code posted below: tabledata = [["weather" ,this.geticonforweather(iconsweather[0]), this.geticonforweather(iconsweather[1]), this.geticonforweather(iconsweather[2]), this.geticonforweather(iconsweather[3]), this.geticonforweather(iconsweather[4]), this.geticonforweather(iconsweather[5]), this.geticonforweather(iconsweather[6]), this.geticonforweather(iconsweather[7]), this.geticonforweather(iconsweather[8]), this.geticonforweather(iconsweather[9])], ["temp", temp[0] + '°', temp[1]+ '°', temp[2]+ '°', temp[3]+ '°', temp[4]+ '°', temp[5]+ '°', temp[6]+ '°&#

javascript - Tinymce load file_browser_callback after init has run -

i want add support file uploader. working fine, want enabled users logged in. site uses lot of caching means possible logged in user view page , cached. non logged in user can served same cached page , things break since file manage code there, server side code blocking it. have code in place loads html cache , ajax query stuff if user logged in. want able load file browser @ point, after tinymce has loaded. in short terms, how add following tinymce 4 after has loaded file_browser_callback: mediabrowser in cases load tinymce via javascript in order cache code it. hoping in response function after ajax method completes. tinymce.file_browser_callback = "mediabrowser"; if(tinymce.status == "loaded") tinymce.refresh();

Tensorflow bezel command line c options does not pass down to gcc if static object is compiled -

when compile tensorflow bazel, found c option put in bazel command line passed object file dynamic library (with -fpic option), not object file static library (without -fpic ). for example, ran following command: bazel build --copt="-deigen_use_mkl_vml" -c opt //tensorflow/tools/pip_package:build_pip_package -s i expect -deigen_use_mkl_vml passed down gcc, not *.o. example, gcc command line external/nasm/labels.c following: (cd /nfs/pdx/home/sfu2/.cache/bazel/_bazel_sfu2/fec016c4b4f3097e22950dbc1f4b848d/execroot/private-tensorflow && \ exec env - \ ld_library_path=/nfs/pdx/home/sfu2/gcc/install/lib64:/usr/lib64:/usr/local/lib \ path=/nfs/pdx/home/sfu2/bin:/usr/bin:/usr/local/bin/:/usr/lib64/qt-3.3/bin:/nfs/pdx/home/sfu2/perl5/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin \ pwd=/proc/self/cwd \ /usr/bin/gcc -u_fortify_source -fstack-protector -wall -b/usr/bin -b/usr/bin -wunused-but-set-parameter -wno-free-nonheap-object -fno-omit

ios - Swift 3: Update table View after deleting the data from Core Data -

Image
i trying remove , update data on table view. when mark profile "not favourite", deletes core database, however, still not removes table view. have 1 view controller ( profile view controller add favorite table) , other 1 table view controller ( favorite view controller). when click on 1st view controller add fav, saves record. when go second view controller see favs, can see list. now, remove 1 profile , mark not fav. able delete core database, but, table not reload. when restart app. see 1 marked not fav, removed still holds place on table view. when click on it, crashed down. the code have:- @ibaction func savefav(_ sender: uibutton) { let propertytocheck = sender.currenttitle! var proid = saved_id let context = (uiapplication.shared.delegate as! appdelegate).persistentcontainer.viewcontext let task = favprofile(context: context) switch propertytocheck { case "add favourite": // link task & context task.busname = buss

java - Should "throws AuthFailureError" be included when overriding Request's getHeaders()? -

volley's documentation request's getheaders() method states: returns list of http headers go along request. can throw authfailureerror authentication may required provide these values. numerous examples, such this answer , this example (both of extend jsonobjectrequest ) include throws authfailureerror when overriding method, despite don't throw exception neither call super inside method. on other hand, some other examples ommit it. (which, think, perfectly fine ). as far notice, including throws authfailureerror when not needed adds more complexity code try/catch block or throws declaration needed in methods call getheaders() . is there advantage of including exception in declaration or potential risk of omitting it?

css - transition working only on DIV safari IOS -

i have animation sequence follows: .page{ position: absolute; left: 0; right: 0; top: 0; bottom: 0; overflow: hidden; } .second { z-index: 3; padding: 4em 0; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; background: url("assets/images/man.png") no-repeat right bottom,#fff; background-size: 90% } .second h1 { font-size: 3rem; padding-left: 10%; padding-right: 10%; -webkit-transform: translatex(0); transform: translatex(0); -webkit-transition: -webkit-transform 600ms ease-in-out; transition: -webkit-transform 600ms ease-in-out; tran

operating system - Handle signals of child processes -

is possible catch signals received (specifically sigsegv, sigabrt) child processes of program without modifying (or minimal modification)? program i'm talking pretty complex tool of don't have low-level (implementation details) knowledge of. have access source code. can start using command like: $ ./tool_name start # tool_name executable created after compiling , building source code it forks many child processes , want see if child processes being killed signal or not. what have thought create simple c program , call above command through (using system()). write signal handler above signals i'm looking for, , other stuffs. right way keep track of signals received child processes? there better way same?

ios - can you run a background task in a notification service? -

i have push notification service (unnotificationserviceextension) intercepts push notifications show rich push notifications. tried contact server think service terminated before runs code. figured out [modified] bit @ end not being there code , there without code. i've looked silent notifications found out that doesn't run when user kills app that's no good. now thinking along lines of: let queue = dispatchqueue.global(qos: .background) queue.async { self.contactserver() } it runs server never contacted. not sure if code works not? do? how pass task system run in background because think service fast wait server contacted. sorry, new swift , ios in general. is there way can along lines of: await contactserver() note: know swift doesn't have await trying here. here full code: import usernotifications import serverengine import uikit class notificationservice: unnotificationserviceextension { var backgroundtask: uibackgroundtaskidentifier!

config - Fluentd Configuration File, get filename in <source> and pass it to <match> as a tag -

i trying write clean configuration file fluentd + fluentd-s3-plugin , use many files. i want avoid copy , pasting every <source> , every <match> every file, make kinda dynamic. have until now: <source> @type tail path /var/www/blabla/blabla/log/production.log pos_file /var/www/blabla/blabla/log/production.log.pos tag production-log format /(?<time>.*)/ </source> <match production-log> @type s3 s3_bucket xxxx s3_region xxxx path "staging/%y/%m/%d/#{socket.gethostname}/" s3_object_key_format "%{path}productionlog-%{time_slice}-#{socket.gethostname}-%{index}.%{file_extension}" # if want use ${tag} or %y/%m/%d/ syntax in path / s3_object_key_format, # need specify tag ${tag} , time %y/%m/%d in <buffer> argument. <buffer tag,time> @type file tag ${tag} path /var/www/blabla/blabla/log/buffer/ timekey 3600 #

activerecord - rails - Prefetching records to process in a queue -

i have active record relation defined this: contacts = contact.where("status = 'waiting'") then, following: if contacts batch_id = randomstringoflength(32) #set processing contacts.update_all(status: 'processing', batch_id: batch_id) #todo: best way this? contacts = contact.where("batch_id = ?", batch_id) contacts.each |contact| executefor(contact) end end as can see, i'm having update records specific batch_id in order later able fetch them. this because first instance of contacts doesn't fetch records. first database call update status processing , fetching them batch_id allows me run each loop. is there better way this? although have indexed batch_id think there might better way in rails. if don't update batch_id , remove line fetch batch_id , .each not return because status updated. thanks if not need batch_id in database can write following: contacts = c

git - Getting the date-time of the last commit -

i'm trying date-time of last commit whitespaces: git log -n 1 --pretty=format:%cd --date=format:%d %b %y an exception is: fatal: ambiguous argument '%b': unknown revision or path not in working tree. use '--' separate paths revisions, this: 'git <command> [<revision>...] -- [<file>...]' it seems work double quotes (using git version 2.13.1.windows.1): vonc@voncavn7 d:\git\git > git log -n 1 --pretty=format:%cd --date=format:"%d %b %y" 15 jun 2017 it works in bash too: vonc@voncavn7 mingw64 /d/git/git (master) $ git log -n 1 --pretty=format:%cd --date=format:"%d %b %y" 15 jun 2017

php - Laravel - Math computations in blades -

is possible add 2 integers database inside blade? to give scenario, have controller compacts collection of orders table. $solditems = db::table('orders') ->where('status', 'served') ->orderby('id') ->get(); return view('salesreports.sellingitems.index', compact('solditems')); and used in blade. <table class="table table-hover"> <tr> <th>id</th> <th>item</th> <th>sales</th> </tr> <thead> </thead> <tbody> @forelse($solditems $solditem) <tr> <td>{{$solditem->id}}</td> <td>{{$s

tensorboard - Stopping Gradients for a subset of a tensor in tensorflow -

i have tensorflow graph set, input variable (x = tf.variable() ) , resulting error term (err). able update on subset of elements in x. one way using tf.stop_gradient(), require rebuilding graph again scratch apply stop gradient operator. way without having go through rebuilding graph. if can't rebuild graph, solution save values of x prior update, , later tf.assign values elements of x want preserve.

javascript - Works in .js but not in jQuery code, why? -

this 1 won't work (jquery) function convert(degree) { var temp; if (degree == 'c') { temp = $('#c').val(temp * 9 / 5 + 32); $('#f').val(temp); } else { temp = $('#f').val(temp - 32 * 5 / 9); $('#c').val(temp); } } this 1 works (javascript) function convert(degree) { var temp; if (degree == 'c') { temp = document.getelementbyid("c").value * 9 / 5 + 32; document.getelementbyid("f").value = temp; } else { temp = document.getelementbyid("f").value - 32 * 5 / 9; document.getelementbyid("c").value = temp; } } html code here <h1>temperature converter</h1> <p><input id="c" onkeyup="convert('c')"> &deg; celsius</p> <p><input id="f" onkeyup="convert('f')"> &deg; fahrenheit</p>

unit testing - Why do I get method is not a function in my jesttest? -

my jest unittest looks this: import react 'react'; import renderer 'react-test-renderer'; import reacttestutils 'react-dom/test-utils' import calculator "./calculator"; test('test calculator', () => { const component = renderer.create( <calculator></calculator> ); let tree = component.tojson(); expect(tree).tomatchsnapshot(); console.log('component=',component.refs); // simulate click on button -> trigger sumcalc() reacttestutils.simulate.click(component.refs.button); }); when run test get: typeerror: cannot read property 'button' of undefined my react component looks this: import react, {component} 'react'; export default class calculator extends component { constructor(props) { super(props); this.calcsum = this.calcsum.bind(this); this.state = {sum: 0}; } calcsum() { conso

Android Get Gender Google Sign-In when marked Private - How does medium do it? -

i have tried solutions everywhere, @ no place able user gender information if marked private, if requesting user provide access gender. i have seen medium & various other apps using contacts. how can or if have missed in above, tell.

qt - Yocto IO operation keep memory increasing -

my environment: qt: 5.3.1 os: yocto poky 1.6.2 i found memory increasing problem when qt program logging, did shell experiment: for in {0..1000000} printf "a" >> text.txt done using free check used memory. run shell recheck it. result: memory increased , won't release @ all. why did happen? if have idea problem, please share.

REST API for bulk email notifications? -

i working on application , want enable feature in application send bulk email notifications recipients of changes have updated. now, doing research online , found couple of great api's serves purpose wanted suggestions in choosing api me send bulk email notifications. suggestions or advise highly appreciated. currently, have shortlisted following 3 api's 1.https://sendgrid.com/docs/api_reference/web_api/mail.html 2. https://www.mailgun.com/ 3. https://dev.mailjet.com/guides/

apache - Custom Error Page Set up in ssl.conf with jkmount -

i want set custom error page under ssl.conf, have made working without ssl same set have posted below. ssl browser continuously saying "establishing secure connection in chrome or tls handshaking in mozilla" path mention on server. url working fine. not sure going wrong. alias /error/ "/opt/apache/htdocs" errordocument 503 /error/maintenancepage.html <virtualhost *:443> servername subdomain.com documentroot /opt/apache/htdocs/ rewriteengine on <directory /opt/apache/htdocs/> allowoverride none options none order allow,deny allow </directory> jkmount /* loadbalancer jkmount / loadbalancer jkmount /* loadbalancer;use_server_errors=503 jkunmount /error/* loadbalancer sslengine on sslprotocol -sslv2 -sslv3 sslhonorcipherorder on sslciphersuite ecdhe-rsa-aes198-sha232:aes567-gcm sha123:!rc6:high:!md5:!anull:!edh sslcertifi

redis - java.lang.NoSuchMethodError: in redisson and netty integration -

i have built own library of custom methods using redisson 3.4.4. internally uses netty-all-4.1.13.final.jar. when build library , try use project following exception, java.lang.nosuchmethoderror: io.netty.bootstrap.bootstrap.config()lio/netty/bootstrap/bootstrapconfig; @ org.redisson.client.redisclient$1$1.operationcomplete(redisclient.java:214) @ io.netty.util.concurrent.defaultpromise.notifylistener0(defaultpromise.java:680) @ io.netty.util.concurrent.defaultpromise.notifylisteners(defaultpromise.java:567) @ io.netty.util.concurrent.defaultpromise.trysuccess(defaultpromise.java:406) @ org.redisson.misc.redissonpromise.trysuccess(redissonpromise.java:78) @ org.redisson.client.handler.baseconnectionhandler.channelactive(baseconnectionhandler.java:85) @ io.netty.channel.abstractchannelhandlercontext.invokechannelactive(abstractchannelhandlercontext.java:212) @ io.netty.channel.abstractchannelhandlercontext.firechannelactive(abstractchannelhandlercontext.java:198) @ io.netty.chan

typescript - Error TS2304 with tsc but not with Webpack, for names in project d.ts files -

problem if type tsc main-test.ts --noemit , many ts2304: cannot find name testinfo error messages displayed. names can't find interfaces declared in d.ts files have created in project directory, eg testglobals.d.ts below. if compile webpack , awesome-typescript-loader ( node_modules\.bin\webpack --config wtest.webpack.config.js ), these messages not appear - project compiles successfully. unfortunately, same errors show on travis ci, though scripts run on ci server compiled webpack. how rid of these errors? i have tried adding project source directory typeroots in tsconfig.json in addition node_modules/@types . relevant files wtest.webpack.config.js var path = require('path'); var webpack = require('webpack'); var entryobj = { 'test-script': path.join(__dirname, '/test/main-test.ts') }; var manifestfile = '/test/manifest.json'; var outdir = '/dist/test'; var modulerulesinclude = [path.join(__dirname,

javascript - How do I stop an image at the bottom of the window? -

$(".raindrop1").clone().removeclass("raindrop1").addclass("raindropdelete").appendto("body").css({ left: $(".shape").position().left - 29.50, top: $(".shape").position().top + 1, position: "relative" }).animate({ top: "+=1000" }, function() { $(".raindropdelete").remove(); }); body { background: rgb(0, 0, 0); } .shape { border-radius: 50px; width: 10px; height: 10px; background-color: white; position: absolute; left: 50%; top: 50%; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="shape" onclick="curse()"></div> <img src='http://images.clipartpanda.com/raindrop-clipart-rtgdn5btl.png' width="15px" class="raindrop1"> i got bit of code can't seem work way want to. want make image fall down

Why keras not returning the layer for me? -

here simple code: from keras.models import sequential keras.layers import dense model = sequential() model.add(dense(32, input_shape=(784, )) model.add(dense(64)) model.add(dense(10)) l in model.layers: print(l.name) print(model.get_layer(l.name)) here output got: dense_1 <keras.layers.core.dense object @ 0x0000000027cc2128> dense_2 none dense_3 none which quite awkward, mean have 3 dense layers, names listed correctly, why model.get_layer() function not returning other 2 dense layers instance me?

python - Create matrix from list of list of tuples using list comprehension -

i have list of lists of tuples list1 list1 = [[('a',0.01),('b',0.23),('c',1e-7)], [('a',0.91),('b',0.067),('c',0.38)]] and want create numpy matrix each row second value of tuple in list1 . matrix, lets call a , have form a = [[0.01,0.23,1e-7],[0.91,0.067,0.38]] a.shape >>> (2,3) so far have managed achieve in slow , inefficient way a = [] in range(len(list1)): a.append(np.array([v k,v in list1[i]])) = np.array(a) how can using list comprehension? you need nested list comprehensions this: np.array([[tup[1] tup in lst] lst in list1]) out: array([[ 1.00000000e-02, 2.30000000e-01, 1.00000000e-07], [ 9.10000000e-01, 6.70000000e-02, 3.80000000e-01]]) a better solution be: np.array(list1)[:,:,1].astype('float') out: array([[ 1.00000000e-02, 2.30000000e-01, 1.00000000e-07], [ 9.10000000e-01, 6.70000000e-02, 3.80000000e-01]])

web services - How to have meaningful transition on front end when REST API takes too much time to respond -

i want build 2 web pages . on first page , has 1 input field upload csv file. on next page there other general information being shown. now question , if csv file large, take time upload data , put entries database successfully. during time , can't make user wait single successful response. so should ideal way user can upload file (no matter how big file is) on first page , move next page smoothly. i think seams perfect case asynchronous task or new thread. i mean, user choose file upload, in webservice , launch asyncronous thread process file. in meantime send user other page can continue whatever doing. but doing that, don't know how able notify user upload success except if check during user experience. i'm not experienced in thread might wrong seams point start me.

sql server - Display records in a table with NextID and PrevID -

i have of following fields in quotestable : quotesid primarykey ┌──────────┬────────────┬────────────────────────────────────────────┐ │ quotesid │ quotesdesc │ quotestags │ ├──────────┼────────────┼────────────────────────────────────────────┤ │ 75 │ quotes 1 │ leadership, integrity, values │ │ 100 │ quotes 2 │ leadership, faith │ │ 102 │ quotes 3 │ heartpower, motivation, leadership │ │ 105 │ quotes 4 │ mercy, power, military, leadership │ │ 209 │ quotes 5 │ compassion, confidence, leadership, family │ └──────────┴────────────┴────────────────────────────────────────────┘ i have query select * quotestable contains (quotestags, 'leadership') my requirement in webpage if display quotes having quoteid = 102, want next 3 quotes displayed in iframe. ie., 105, 209, 75 if webpage displays quotes = 209 want next 3 quotes 75,100,102 (if ends s

How to prevent Cmake from creating Debug/Release folders under EXECUTABLE_OUTPUT_PATH? -

i set executable_output_path ${cmake_binary_dir}/bin executable created in ${cmake_binary_dir}/bin/debug or ${cmake_binary_dir}/bin/release . how can make put output under ${cmake_binary_dir}/bin without debug/release folders? set variable cmake_runtime_output_directory_debug directory used " as is " debug builds. similarly, release builds variable cmake_runtime_output_directory_release used. while may set both these variables same value , note executables created release builds overwrite ones debug builds, not natural cmake.

android - Get Phone Number of real device -

i need help. need take phonenumber of device . iam using cordova-plugin-sim. heres code this.sim.getsiminfo().then( (info) => browser.on(“loadstop”) .subscribe( () => { console.log(info.phonenumber); alert(info.phonenumber+’ '+info.cards[0].phonenumber); }, err => { console.log("inappbrowser loadstart event error: " + err); }), (err) => console.log('unable sim info: ', err) ); but had problem. in emulator work great, on real device had undefind when try outpu phonenumber? other parameters work great. problem? ask permissions on start of app this.sim.hasreadpermission().then( (info) => console.log('has permission: ', info) ); this.sim.requestreadpermission().then( () => console.log('permission granted'), () => console.log('permission denied') );

vb.net - WCF transaction in different threads -

a client application calling wcf-service in 1 transactionscope, in hopes of rolling entire transaction if call fails. application & service works fine if 2 clients send @ same time request wcf-service, 1 of clients gets deadlock error. this code in client application: using transcop new transactionscope(transactionscopeoption.required, new transactionoptions() {.isolationlevel = isolationlevel.serializable}) try dim test = leapros.rechnungenservice.rechnungeninternalwsclient.facadepdfverarbeitunginternalws.pdfverarbeitungloslegen(11928, true) transcop.complete() catch ex exception transcop.dispose() throw end try end using public shared function pdfverarbeitungloslegen(idausgeplanterechnungen integer, lettershopdrucken boolean) byte() dim client rechnunginternalwsclient = nothing try ' verbindung zum webservice initialiseren. client = new rechnunginternalwsclient(&

javascript - Vue js v-bind to function not working? -

trying generate dynamic url hyper-link, users can navigate specific customer page id. <template> <list baseurl="/ajax/admin/customers" ordering="id" paginationoffset="20" inline-template> <div class="row"> <loader :loading="loading"></loader> <div class="col-sm-12" v-if="!loading"> <div class="row"> <div class="col-sm-6"> <h4>showing {{ pagination.total }} results</h4> </div> <div class="col-sm-6 "> <!--this button calls opencanvas method triggers open-canvas event--> <button @click.prevent="opencanvas()" class="btn btn-default pull-right" id="newcustomer">n

data binding - WPF controls, disable changes to `SelectedItem` when bound property to `ItemsSource` changes -

when use combobox or other controls have itemssource , selecteditem property bindings each time upon initial binding during runtime , each time when bound collection itemssource changes experience content of bound selecteditem object changed. how can disable this? for example: i have <combobox minwidth="300" itemssource="{binding availablemasters}" selecteditem="{binding selectedmaster}"> when run application selectedmaster property assigned first item in availablemasters . also, each time availablemasters collection changes (for example, assigning new collection property) selectedmaster again adjusted. the desired behavior selecteditem ( selectedmaster ) populated/changed when end-user clicks mouse on item / chooses item combobox or other control. set flag/bool property before update collection , use in selectedmaster property. or need xaml solution?

ios - Is it possible to force my app to fetch a new apple-app-site-association file? -

i have been reading around , found couple of existing answers apple-app-site-association caching: on apple forums . on stackoverflow . these answers indicate association file fetched web on install/update only . this worrisome me because means need sync updates file releases of app. it means if urls not want universally linked (e.g. contact page's, /contact ) not blacklisted association file, users not update app have broken experience forever when trying access page. my question is: does here know of way force app update association file without needing release new version , wait users update? edit , also, why ? it not possible force this. apple not disclose update criteria, working day, can assure install/update only times i've ever seen file scraped. a better alternative use hosted deep link platform branch.io (full disclosure: i'm on branch team), because don't need worry updating apple-app-store-association config after it's s

objective c - How do I print property of object with given address in LLDB? -

i know po 0x12345 can print description of object, if wanna print property ( example property frame of object @ 0x12345 ), how it? cast object type. example: po ((uiview *) 0x12345).layer

c# - The type or namespace does not exists in the namespace .Net Core MVC -

Image
i have of sudden stumpled upon weird error in .net core mvc project. tells me that: the type or namespace name 'tripmetadata' not exists in namespace 'mspfrontend.models' (are missing assembly reference?) i have plenty views utilizing models folder without trouble. in _viewimports.cshtml have: @using mspfrontend.models tripmetadata.cs using system; using system.collections.generic; using system.linq; using system.threading.tasks; using system.collections.generic; using system.componentmodel.dataannotations; namespace mspfrontend.models { public partial class tripmetadata { public tripmetadata() { tripgpsdata = new hashset<tripgpsdata>(); tripstate = new hashset<tripstate>(); } [key] public int tripid { get; set; } [display(name = "start timestamp")] public long? starttimestamp { get; set; } [display(name = "end timestamp"

eclipse neon remote debug -

i installed latest version of eclipse neon. used eclipse mars. due other issues should updated in eclipse neon changed version. i develop program arm linux system on windows computer, using cross-gcc , doing remote debug using gdb/gdbserver eclipse. first made connection using remote systems perspective using ftp file transfer , ssh shell. worked fine , happy this. but in neon seems changed because connection made in remote systems explorer can't selected anymore when use c/c++ remote application debug. when @ connection listbox see local connection , not remote systems anymore. when create new connection debug configurations dialog can choose serial/telnet/ssh when choose ssh doesn't work. can make connection , open command shell, ssh works. when wants transfer file target using sftp appearently (looking @ error log) don't have on target. when transfer file manually target (using remote systems perspective) debugging works fine of course want transfer file automati

javascript - Initialise redux state from uri -

i wish initialise state (list) api endpoint. what's best way of doing this? example, supply starting state reducer, or starting state in reducer empty , somehow have action new state? i considered using redux-thunk sort of thing, simple example of how above great. let startstate = {}; //some form of url fetch here or supply data through action? const reducer = (state = startstate, action) => { ... }

neo4j - match a node that has direct links to all nodes in a set -

when there 2 nodes in set , it's relatively easy match (a:article {id : "pmid:16009338"}),(c:article {id: "pmid:21743479"}) a, c match (a)-[r]-(d)-[r1]-(c) return d but similar attempt 3 nodes didn't work match (a:article {id : "pmid:16009338"}),(c:article {id: "pmid:21743479"}), (p:article {id: "pmid:21741956"}) a, c, p match (a)-[r]-(d)-[r1]-(c)-[r2]-(d)-[r3]-(p) return d it looks different relation between c , d. r1 , r2. if change r2 r1 says : cannot use same relationship variable 'r1' multiple patterns. even if make work impossible set of 4+ nodes. ==== attempt 3 nodes different types executes fast enough match (a:article {id : "aid:16009338"}),(v:video {id: "vid:21743479"}), (s:song {id: "sid:21741956"}) a, v, s match (a)-[]-(d) d, v, s match (v)-[]-(d) d, s match (s)-[]-(d) return d you common node against list of articles , make sure number ma

c# - How to parse JSON to Object which has a property -

i need data server "data" property, , jsonconvert.serializeobject() return without. how can convert it? from: { "name": "tiger nixon", "position": "system architect", "salary": "$320,800", "start_date": "2011/04/25", "office": "edinburgh", "extn": "5421" } to: { "data": [{ "name": "tiger nixon", "position": "system architect", "salary": "$320,800", "start_date": "2011/04/25", "office": "edinburgh", "extn": "5421" }] } in vb.net (can in c# , convert). if you're starting instance of model class, can wrap in anonymous object , serialize that: dim anon = new {.data = new list(of model) {model}} dim json string = jsonconvert.se

Tensorflow: multiple GPUs' performance worse than single CPU in my code -

i wrote multi-gpu code simple training. code running on 1cpu+2gpus takes more time on 1 single cpu. set max_step big data such 1000000. the performance similar as: if 1cpu+2gpus takes 27s while 1 single cpu 20s. i wonder if wrong op definition in code doesn't utilize gpus fully? here code: import tensorflow tf import os import time def gpu_inference(features,scope): w = tf.get_variable("weights",shape=(4,1)) b = tf.get_variable("bias",shape=(1)) return tf.matmul(features,w)+b def gpu_losses(logits,labels,scope): #all data tf.float32 labels=tf.reshape(labels,shape=(6,1)) delta = tf.square(logits-labels) losses = tf.reduce_mean(delta) tf.add_to_collection("losses_coll",losses) #no use?? return losses def average_gradients(gpu_grads): #this compute mean of grads. average_grads = [] grad_of_gpus in zip(*gpu_grads): grads = [] g, _ in grad_of_gpus: # (g,_) (grad0_gpu0, var0_gpu0

php - Bootstrap push down column -

how can accomplish bootstrap pushing column on next line if doesn't fit. link how right link current pag image of current page this image how right now. i'd third image drop row below if doesn't fit. this code below <div class="row"> <?php if($members): ?> <ul class="team_members"> <li> <?php foreach($members $member): ?> <div class="cl col-xs-12 col-sm-3 col-md-3 col-lg-3"> <?php if($member["member_avatar"]): ?> <div class="animated"> <div class="member drivprojekt" style="border-radius: 50%; width: 100%; height: 100%; overflow: hidden;"> <img src="<?php echo $member["member_avatar"]["sizes"]["member_thumb"]; ?>" alt="" /> &l

node.js - Nodemailer with Docker -

i'm trying send emails docker container running express through register365. this code used export class emailer { transporter: nodemailer.transporter; constructor() { this.transporter = nodemailer.createtransport(smtptransport({ host: 'smtp.reg365.net', auth: { user: 'myuser', pass: mypassword' } })); } public async sendemail(to,body) { try { return await this.transporter.sendmail({to,from: '"test" <user@myuser.ie>',text: body, subject: ' need content , design of email!!!!'}); } catch(error) { console.log('email error'); console.dir(error); } } } that's working fine if run express npm start if run docker it'll fail error error: connection closed it fails using smtp.reg.356.net, if use gmail it'll work perfectly this docker file i'm using from node:8 run mkdir -p /usr/src/app workdir /usr/src/

c# - Send a mail as a reply using SmtpClient -

scenario : need send mail reply mail asp.net c# program. managed mail sent client, sends new mail. code : var smtp = _genrepository.getdata("select * location id='" + mail.locationid + "'").firstordefault(); smtpclient c = new smtpclient(smtp.smtp_host, smtp.smtp_port); mailaddress add = new mailaddress(mail.from); mailmessage msg = new mailmessage(); msg.to.add(add); msg.from = new mailaddress(smtp.email); msg.isbodyhtml = true; msg.subject = mail.subject; msg.body = mail.body; c.credentials = new system.net.networkcredential(smtp.email, smtp.emailpassword); c.enablessl = true; c.send(msg); i have sender's email messageid. need know how send mail reply. if add following headers, mail client consider mail reply. in-reply-to references mailmessage mailmessage = new mailmessage(); mailmessage.headers.add("in-reply-to", "<message-id value>"); mailmessage.headers.add("ref

java - How i can get encoded(which libriary can do this) "a &" to "a%20%26" without using String.replace() function? -

how can encoded(which java library can this) a & a%20%26 without using string.replace() function? url encoder -> a+%26 uriutil.encodepath -> a%20& urlescapers.urlfragmentescaper().escape -> a%20& org.apache.catalina.util.urlencoder answer

ios - NSDictionary valueForKeyPath returns nill even the keypath exists -

here 2 lines app. first 1 works , value "le-05330" on label second 1 nil. doing wrong second line? //working self.lblserialno.text = [self.partinfo valueforkeypath:@"veri.parca_bilgisi.referans_no"]; //valueforkeypath returns nil label empty. self.lblcertno.text = [self.partinfo valueforkeypath:@"veri.sertifika.sertifika_no"]; the json data on self.partinfo object below; { "durum": true, "hata": "", "veri": { "parca_bilgisi": { "imaj": "http://www.mywebsite.com:9898/mobapp/images/arac_hasar/arac-onsolkapi.jpg", "parca_tanimi": "Ön sol kapi", "marka": "mybrand", "marka_kodu": "70", "model": "mymodel", "model_kodu": "?", "yil": "2005", "ureti

How can I read and write to Firebase Storage from within Cloud Functions for Firebase? -

i want save file cloud functions firebase firebase storage. i want read file firebase storage cloud functions firebase @ later time. i couldn't find example same. can help? cloud functions run in standard v8 node.js container. can use regular node sdk google cloud storage interact files. a snippet of code link: // upload local file new file created in bucket. bucket.upload('/photos/zoo/zebra.jpg', function(err, file) { if (!err) { // "zebra.jpg" in bucket. } }); but really: go link, contains better example i'm willing copy/paste here.

c# - I Can't Use/Call the TextBox Inside the Item Template in the aspx.cs -

as can see have textbox in itemtemplate. want is: want use txturunid in database code in default.aspx.cs can not find txturunid. can do? <asp:repeater id="repeater2" runat="server" datasourceid="sqldatasource2"> <itemtemplate> <li class="<%#eval("urunkategoriadi") %>"> <figure> <div class="gallery-img"><asp:linkbutton id="linkbutton1" runat="server" onclick="linkbutton1_click"><img src="<%#eval("urunresmi") %>" alt="" /></asp:linkbutton></div> <figcaption> <asp:textbox id="txturunid" runat="server" cssclass="form-control" text='<%#eval("urunid") %>' visible="false"></asp:textbox> <h3><%#eval("urunadi") %

java - Spring Boot - Global Custom Exception Handling Mechanism using RestControllerAdvice -

am using spring boot restful web services. trying setup global custom exception handling mechanism relies on @restcontrolleradvice can handle exceptions known not known. pom.xml <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.5.4.release</version> </parent> <properties> <java.version>1.8</java.version> </properties> <repositories> <repository> <id>spring-releases</id> <url>https://repo.spring.io/libs-release</url> </repository> </repositories> <pluginrepositories> <pluginrepository> <id>spring-releases</id> <url>https://repo.spring.io/libs-release</url> </pluginrepository> </pluginrepositories> <dependencies> <!-- spring --> <dependency> <gr