Posts

Showing posts from June, 2012

android - Detect in Azure Notification Hub when an app has been uninstalled -

i need detect when application has been uninstalled, in both android , ios. purpose update table record in backend. seems it's not exists "canonical way" detect uninstall in device side, people it's possible handling message error when publish push notification. we use azure notification hub, class notificationhubclient, can't see value in response alert notification fail uninstalled app. gcm must return "not registered" receive "0 success" in result. can see registration of device response of notificationhubclient.getallregistrations method. in response of registrations still appear registration of device did uninstall app. really it's possible know azure notification hub if app has been uninstalled? it's possible request firebase o apple registration ids if still installed applications doing tests can see registrations of azure disappear 1 or 2 hours after application it's uninstalled. work in android gcm. in io

image - html img scr no showing -

i've been putting following in wysiwyg html view , image refuses show up: <img src=“http://evolveddigital.co.uk/wp-content/uploads/2016/10/google.png" alt="a screencapture of unpublished media release" height="330" width="623"> i text. i've tried http, https , www nothing working. any great! here go <img src="http://www.eadt.co.uk/polopoly_fs/1.4709095.1474628177!/image/image.jpg_gen/derivatives/landscape_630/image.jpg" alt="a screencapture of unpublished media release" height="330" width="623"> change <img src=“http <img src="http

Wordpress: Output a custom post type list by two Custom Taxonomies -

Image
i need list out custom post type organised 2 different taxonomies on these posts. i have custom post type of properties/apartments taxonomies of location , type/size trying list them out below required layout custom post type apartment location apartment size 1 list item 1 list item 2 list item 3 apartment size 2 list item 4 list item 5 list item 6 apartment location 2 apartment size 1 list item 7 list item 8 list item 9 apartment size 2 list item 10 list item 11 list item 12 i'm using current code it's spitting out under each taxonomy size? , cant filter location , size <?php $terms = get_terms('apartment_location'); foreach( $terms $term ): ?> <h2><?php echo $term->name;?></h2> <?php $posts = get_posts(array( 'post_type' => 'apartments', 'taxonomy' => $term->taxonomy, 'term

angular - Property 'xxxx' does not exist on type '{ [key: string]: AbstractControl; }' -

import { formgroup } '@angular/forms'; export class mastervendorformcontactcomponent implements oninit { @input() formcontactgroup: formgroup; // rest of code } <fieldset [formgroup]="formcontactgroup" class="master-vendor-form-contact"> <md-input-container class="master-vendor-form-contact__phone" [dividercolor]="formcontactgroup.controls.phone?.valid ? 'default' : 'warn'"> <input mdinput placeholder="enter phone" formcontrolname="phone"> <md-hint align="end" *ngif="!formcontactgroup.controls.phone?.valid"> vendor phone number must in (xxx) xxx-xxxx format </md-hint> </md-input-container> <!-- rest of code --> </fieldset> on compiling code aot gives following error: angular_app/src/$$_gendir/app/master-vendors/master-vendor-form-contact/master-vendor-form-contact.

windows - Alternative to appactivate (so SendKeys works in background) -

this question has answer here: how mock background window active state using vb script? 1 answer i have written script , of course every 10 seconds 'my program' window activated send f9 key. however, i'd send f9 key every 10s 'my program' window without activating interupts work on other windows/browsers. need run continuously during day background process ideally. (the f9 key refreshes screen) option explicit dim wshshell set wshshell = wscript.createobject("wscript.shell") wshshell.appactivate "my program" wshshell.sendkeys "{f9}" wscript.sleep (1000 * 10) loop as alex k. mentioned, sendkeys can send keystrokes foreground window, you're asking not possible vbscript.

javascript - Passing data from jQueryUI dialog form to controller -

i'm new asp.net/javascript , i'm having little trouble implementation of simple crud operations using jqueryui dialog form. code: <button class="update" id="@model.id">update</button> <div id="dialog-form" title="update"> <form> <fieldset> <input type="text" name="state" id="state"> <input type="text" name="note" id="note"> <input type="submit"> </fieldset> </form> </div> <script> $(function() { var dialog, state = $("#state"), note = $("#note"), id = this.id, //?? dialog = $("#dialog-form").dialog({ autoopen: false, height: 400, width: 350, modal: true, buttons: { "ok": func

llvm - How to construct Program Dependence Graph of a binary -

i'd construct ferrante's program dependence graph binary. once binary disassembled i'd create graph nodes instructions , edges relate nodes writes or read same data space (regs, memory address, ...). there tool accomplish ? i've been using radare2 i'm able extract cfg of entire program, xrefs , regs read , writen per instruction. algorithm ... in advance.

jsf - Unable to close modalpanel popup window after file download JSF1.2? -

i using jsf1.2, below code in xhtml file, code popup on click of save hit respective bean method , file downloaded. requirement if validation error occurs error should displayed in popup , if no validation error there file should downloaded , popup should closed automatically. know oncomplete event not work <a4j:htmlcommandlink> or <h:commandlink> tag. tried googling lot not find optimal solution. helpful if helps me. file getting downloaded popup not getting closed automatically, , if validation error there getting displayed in mainpage popup called. in advance. <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <rich:modalpanel id="strategymodalpanelid" res

Read OTP/SMS in MI device not working (Android) -

Image
i have integrated auto read otp in code , it's working fine except in miui devices. broadcastreceiver never wake in case of mi devices when sms received. after efforts think mi devices runs on permission manager permissions regarding read sms disabled default comes in category of privacy permissions , looks : now can't figure out way notify user first accept or decline permission. device disable permissions default after app installed in device.is there way notify user accept permission's when app installed ? some code: smsreciever.class - broadcastreceiver wakes when sms received. public class smsreciever extends broadcastreceiver { private static final string otp_length = "6"; private string otp = ""; private imessagecallback callable; private static final string tag = smsreciever.class.getsimplename(); @override public void onreceive(context context, intent intent) { bundle bundle = intent.getextras(); smsmessage[] msg

java - OKTA SSO SAML Response -

trying setup sso java web application built spring mvc. i've registered application okta server, got metadata url , signon url. i'm using signon url application, authenticating success, post request made form data include saml response object. what should next step here? i've decoded saml response, , understanding need token or session id i'll need use further requests okta server. edit 1: ran spring-boot-saml-example , authentication works expected. but, when trying current session using okta session api spring application, http 404 code returned. fetching current session using browser work fine. take @ blog post , example uses spring security , okta saml app . take @ that, , if doesn't let know.

c++11 - Aliasing a template template parameters -

is possible use using keyword aliasing template template parameter? template <template<int> class t> struct foo { using type = t; }; thanks using (or typedef ) provide alias type , never higher-kinded type (template template parameter) . can templatize alias on int : template <template<int> class t> struct foo { template <int x> using type = t<x>; };

oop - Different constructor signature for derived class -

is break oop principles (ex, liskov principle), if constructor signature derived class not same base class? class base { protected x: number; protected y: number; constructor(x: number, y: number) { this.x = x; this.y = y; } } class derived extends base { private text: string; constructor(text: string, x: number, y: number) { super(x, y); this.text = text; } } no not, because liskov principle talks "contravariance of method arguments , return types in subtype". when this: foo(bar:base){ //do stuff } this method expects instance of base class, not constructor contravariance of methods not apply case. it break principle if did this, because base instance not replaced extended 1 : class base{ foo():string{ return ""; } bar(arg:string){} } class extended extends base{ foo():number{ return 1; } bar(arg:boolean){} } but not allowed typescript compiler.

Selenium with PHP timeout -

i have couple of selenium tests written in php. since yesterday 1 test keeps timing out simple $webdriver->get($url); happening in 80% of executions. it takes 5 minutes finish request. when open url in browser (same browser, without selenium) page loading imediately. selenium standalone-server, chromedriver , chrome date. does know issue?

Splitting CSV cell (but leave the original as is) using Powershell -

Image
i'm trying add pdf's files directory csv file. i'm using below powershell script add pdfs issue need split (but leave original pdf path on each file is) path numbers calls. is there way accomplish one? get-childitem -recurse "c:\users\alon\desktop\mypdf\" | foreach-object { $_ | add-member -name "owner" -membertype noteproperty -value (get-acl $_.fullname).owner -passthru } | sort-object fullname | select fullname, creationtime, lastwritetime, length, owner | export-csv -force -notypeinformation "c:\users\alon\desktop\mypdf\directory.csv" the output should this: you mean want add numbers filename additional fields in output? split each file's basename , construct custom objects information , file metadata: get-childitem ... | foreach-object { $numbers = $_.basename -split '_' [pscustomobject]@{ fullname = $_.fullname company = [

open chrome with local file in android -

hello trying launch chrome app local file.html here code: string url2 = "file:///" + environment.getexternalstoragedirectory().getabsolutepath() + file.separator + "new folder"+ "/index.html"; url2 = url2 .replaceall(" ", "%20"); uri uri2 = uri.parse(url2 ); intent intent = new intent(intent.action_view, uri2); intent.addflags(intent.flag_activity_new_task); intent.setpackage("com.android.chrome"); try { startactivity(intent); } catch (activitynotfoundexception ex) { intent.setpackage(null); startactivity(intent); } i open manually paste url in chrome works fine. when opening application opens text file html code not in chrome in text viewer try this: uri uri2 = uri.fromfile(new file(environment.getexternalstoragedirectory().getabsolutepath() + file.separator + "new folder"+ "/index.html")); intent intent =

How to send non english character in json from php? -

i have non-english word e.g 'परीक्षण' in database.i fetch data slim framework (php) , code : while($row=$result->fetch_assoc()){ $data[]=$row; } return $response->withstatus(200) ->withheader('content-type', 'application/json') ->write(json_encode($data)); the response e.g; [{"s.n":"1","english_word":"test","nepali_word":"???????"}] could please tell me how can send non-english word in json php? you may want use json_unescaped_unicode constant $arr = ['s.n' => 1, 'english_word' => 'test', 'nepali_word' => 'परीक्षण']; echo json_encode($arr, json_unescaped_unicode); // output : {"s.n":1,"english_word":"test","nepali_word":"परीक्षण"} live demo : https://3v4l.org/dvejs in issue context , when using headers c

Cannot use CSS '#' symbol in iframe -

scenario i have created simple iframe dynamically generating user provided html , css. jsfiddle https://jsfiddle.net/jaup3769/1/ problem whenever use '#' symbol, css parsing stopped beyond point. p#para1{ } won't parse beyond p# similarly, p{ color: green; background-color: #ff0000; } won't parse beyond background-color: # what might issue? just use encodeuricomponent instead of encodeuri . mdn article: encodeuricomponent differ encodeuri in encode reserved characters , number sign # i think makes more sense use in code provided, since not encoding whole uri, data:whatever/charset:… part there… mdn article jsfiddle related question

parsing - How to load in Spark 2.1 XML file with repeating tags and attributes? -

i have xml file such structure: <?xml version="1.0"?> <catalog> <new> <book id="bk101" language="en"> <author id="4452" primary="true">gambardella, matthew</author> <title primary="true">xml developer's guide</title> <genre primary="false">computer</genre> <publisher primary="true" id="us124"> <firm id="4124">amazon llc</firm> <address>ny, usa</address> <email type="official">books@amazon.com</email> <contact_person id="3351"> <name>rajesh k.</name> <email type="personal">rajesh@amazon.com</email> </contact_person> </publisher> </book> <book id="bk103" language="en">

mysql - Insert Select with Multiplication from other table -

i want insert data table1 table2 data in table2 multiplicated value @ table3. table1 , table2 has same column (id,rangking,status,access,facility,popularity) (id auto increment) table2 has data : id | rangking | status | access | facility | popularity 1 | 9 | 4 | 2 | 4 | 6 2 | 4 | 5 | 1 | 2 | 7 3 | 5 | 8 | 5 | 3 | 4 table3 has data : id | value c2 | 0.2 c3 | 0.5 c4 | 0.1 c5 | 0.3 $sql = mysqli_query ($koneksi, "select value table3 id ='c2'") or die(mysqli_error($koneksi)); $c2 = mysqli_fetch_array($sql); $sql = mysqli_query ($koneksi, "select value table3 id ='c3'") or die(mysqli_error($koneksi)); $c3 = mysqli_fetch_array($sql); insert table1 (rangking,status,access,facility,popularity) select (rangking*$c2['value'] rank,status *$c3['value'] stat,access,facility,popularity) table2 from query found error, help? you select column named value should accessing value in

database - How adding redundant data can get rid of complex join in Denormalization? -

i going through denormalizaition definition , wondering how adding redundant data can rid of complex join ? consider following 2 relations: department (department_id pk, department_name, manager_employee_id) employee (employee_id pk, employee_name, department_id) to list of employee names managers' names, need query following: select e.employee_name, m.employee_name manager_name employee e inner join department d on e.department_id = d.department_id inner join employee m on d.manager_employee_id = m.employee_id now, if denormalize transitive functional dependency employee_id -> department_id -> manager_employee_id -> employee_name employee table, our tables this: department (department_id pk, department_name, manager_employee_id) employee (employee_id pk, employee_name, department_id, manager_employee_id, manager_name) practically, might not design since redundancies result in data consistency if it's not kept in sync. however, we'll ignor

javascript - Is there any better way to handle this function with multiple if statements doing almost the same? -

i have function: private addadditionalresults(resultstoadd: any) { if(!isnan(resultstoadd.xx) && this.x.length > 0) this.x.unshift(resultstoadd.xx); if(!isnan(resultstoadd.yy) && this.y.length > 0) this.y.unshift(resultstoadd.yy); if(!isnan(resultstoadd.zz) && this.z.length > 0) this.z.unshift(resultstoadd.zz); } x,y,z arrays of numbers. resultstoadd object variables xx,yy,zz can different nan. there anyway make code more beautiful? these if statements doing same. you can create variables array inside function , iterate on them. affect program response because of loop. results = array(resultstoadd.xx, resultstoadd.yy, resultstoadd.zz); numbers = array(this.x, this.y, this.z); for(i = 0; < results.length; i++){ if(!isnan(results[i]) && numbers[i] > 0) numbers[i].unshift(results[i]); }

entity framework - Visual Studio 2017 mistakenly thinks EF 6 is installed -

i upgraded asp.net core, ef core class library solution visual studio 2017. however when want run migrations commands add-migration following warning. both entity framework core , entity framework 6 installed. entity framework core tools running. use 'entityframework\update-database' entity framework 6. however don't have ef 6 installed my csproj ... <itemgroup> <packagereference include="microsoft.aspnetcore.identity.entityframeworkcore" version="1.1.1" /> <packagereference include="microsoft.csharp" version="4.3.0" /> <packagereference include="microsoft.entityframeworkcore.design" version="1.1.1" /> <packagereference include="microsoft.entityframeworkcore.sqlserver" version="1.1.1" /> <packagereference include="microsoft.entityframeworkcore.tools" version="1.1.0" /> <packagereferenc

How to pass variable value or Listbox value into function of another class in Python Tkinter -

i want pass variable selected in autocompleteentry fuinction (i.e func2) in form or class. tried follow import tkinter, tkfiledialog, tkconstants , os tkinter import * import tkmessagebox messagebox, tkinter import sys import ttk import tkfont list1233 = ['a', 'actions', 'additional', 'also', 'an', 'and', 'angle', 'are', 'as', 'be', 'bind', 'bracket', 'brackets', 'button', 'can', 'cases', 'configure', 'course', 'detail', 'enter', 'event', 'events', 'example', 'field', 'fields', 'for', 'give', 'important', 'in', 'information', 'is', 'it', 'just', 'key', 'keyboard', 'kind', 'leave', 'left', 'like', 'manager', 'many', 'match', 'modifier', 'm

python - post contact for specific rent in rest framework -

i developing rental application practice rest framework. there feature buyer can contact rent owner clicking contact button on rent has fill his/her email_id etc. know if want contact specific rent have this rent = rental.objects.get(id=token) contact.objects.create(rent=rent, email_id=email_id, buyer=request.user) i confuse in rest framework create function of serializer , post function of apiview. can enlighten me example? class rental(models.model): user = models.foreignkey(user) name = models.charfield(max_length=300, blank=false, null=false) phone_number = models.positiveintegerfield(null=false, blank=false) class contact(models.model): buyer = models.foreignkey(user) rental = models.foreignkey(rental, related_name="rent") email_id = models.emailfield(blank=false, null=false) class rentalserializer(serializers.modelserializer): user = serializers.readonlyfield(source='user.username') galleries = galleryserializer(many=

java - How do I use a stored procedure in h2 database while using junit? -

i have junit class file in turn calls dao class , creates stored procedure through entitymanager interface in dao class this: @persistencecontext(unitname = "webapplication2pu") private entitymanager entitymanager; // entitmanager.createnamedstoredprocedurequery("next_prime") in method the next_prime procedure finds next prime provided number. procedure specified in entity bean class. as have read h2 database not support stored procedure , instead have create java class, providing sql file database in junit class in runscript as: jdbc:h2:~/test;init=runscript mysql.sql this sql file contains stored procedure as: create alias next_prime $$ string nextprime(string value) { return new biginteger(value).nextprobableprime().tostring(); } $$; i want override procedure specified in dao class use 1 providing in sql file. how achieve this? or doing wrong, please suggest.

javascript - AWS S3 putobject and after DetectFaces with Rekognition -

iam doing project nodejs , aws. i using webrtc , taking photo. after taking photos base64 data , posting nodejs , putting aws console , using detectfaces giving error. but adding photo aws console manually detect faces not giving error. my codes here : webcam js : giving base64 me. > drawimage(video, 0, 0, canvas.width, canvas.height); > var data = canvas.todataurl('image/jpeg'); > photo.setattribute('src', data); > console.log(data); and trying post postman chrome extension nodejs can put can't using detect faces. my nodejs : app.post('/addphoto', function (req, res) { var base64data=new buffer(req.body.photo.replace(/^data:image\/\w+;base64,/, ""),'base64'); console.log(base64data); var params = {bucket: "realeyeshomework", key:"111111111.jpg", body: base64data}; s3.putobject(params, function(err, data) { if (err) console.log(err) else{

ms access - Return a "mmm-yy" value from an acecss query -

i writing query need return set of data, 1 of needs date in format mmm-yy. i using format(datevalue([cccontactdate]),"mmm-yy") shows in excel apr-17 value in cell still 02/04/2017 , need report month , year. is there way amend query return apr-17? use monthname(month(ccdate)) & "-" & year(ccdate)

elixir - %HTTPoison.Error{id: nil, reason: :closed} -

we using httpoison in our code base post , requests while using hackney pool. posting here because want opinions experts. we working lot of cameras, where, each camera, getting images, , images, saving them to seaweedfs servers. we making thousand of request on per second range. on seaweedfs side, have initiated servers timeout of 10 seconds. , on our code base side, uploading image using hackney configuration. :hackney_pool.child_spec(:seaweedfs_upload_pool, [timeout: 5000, max_connections: 1000]), :hackney_pool.child_spec(:seaweedfs_download_pool, [timeout: 5000, max_connections: 1000]), for last few days, having issue in this. @ first, timeout , max_connections on our side 10 secs , 5k. , started getting httpoison errors as {%httpoison.error{id: nil, reason: :closed}} the errors count high 12k , on, time being, after discussing in elixir slack channel changed timeout , max_connections above settings. after this, errors reduced 3k 12k 2 or 3 days, after error co

hide - Windows system tray in c# -

on closing application have hided application , set windowstate minimize.now system tray, on right click on application's icon, select exit , 1 alertbox opened selected no. in exit event code, changed windowstate normal , activated window not used show(). on single click on application's icon, application's homesceen showing in taskbar not coming in focus though have used show() , windowstate set normal. can any1 please??

php - Selecting Max Value and Key mySQL -

i know simple fix, cannot mind wrapped around it. i have table factproductsales has sales transactions. have find product has highest sales. have give productid , amount. here have: select productid, max(salestotalcost) factproductsales it gives me right amount, gives me wrong productid. should 5 instead gives me 1. think mistake making obvious one. help select productid, max(salestotalcost) max_cost factproductsales group productid order max_cost desc limit 5; use group by , order , limit 5 find max saletotalcost

java - JPA/Hibernate: Allow Integer to be null or in a set range of numbers? -

i want have integer field field in table should allowed take 1 of following values: null 0 1 2 is possible accomplish using jpa or hibernate annotations? i've tried @min @max , @range didn't seem work. to more precise: want error thrown when insert or update command executed sets field different null, 0, 1 or 2. @entity public class counter { @id private int id; @notnull private string name; @null @min(0) @max(2) private int count; .. .. } for validation need validate this counter counter = new counter(); counter.setname("msg"); counter.setcount(3); validatorfactory factory = validation.builddefaultvalidatorfactory(); validator validator = factory.getvalidator(); set<constraintviolation<counter>> constraints = validator .validate(counter); (constraintviolation<counter> constraint : constraints) { system.out.println(constraint.getpropertypath() + " " + const

ruby - undefined method `params_require' - New into rails -

i try code small blog in rails , when tried save post through website error. can create post console thats not goal. this code create method: def create @post = post.new(post_params) if post.save redirect_to post.path else render "new" end end def post_params params_require(:post).permit(:title, :content) end would nice if can me. def post_params params.require(:post).permit(:title, :content) end change params_require params.require

python - Error with xlrd and open_woorkbook -

i´m starting programming python , keep receiving same error in program: import xlrd import numpy np import matplotlib plt file_location = " x:\ \blabla.xlsx" import workbook wb=xlrd.open_workbook(filename= 'blabla.xlsx') traceback (most recent call last): file "", line 1, in attributeerror: module 'xlrd' has no attribute 'open_workbook' the paths written , don´t have more 1 xlrd module, looked trough function: help(xlrd) help on package xlrd: name xlrd package contents file (built-in) attributeerror: module 'xlrd' has no attribute 'open_workbook' it means open_workbook not recognized method (i. e. function ) - wanted - attribute (i. e. variable ). methods have opening parenthesis ( after them while attributes don't. so bad - real code different code in question, because in question have ( after name open_workbook .

Sending Files over VB.Net using net sockets -

i using vb.net , net-sockets establish connection in form of server-client. have accomplished task of communication between server , client. however, i'm having trouble sending files , receiving them. don't know start. tried refer codes. didn't understand quite clearly. please me sending , receiving part.

window function for Spark 1.6 -

i have dataframe : +----+------+--------------------+--------+-------------+ | id | name | end time | value | comment | --------------------------------------------------------- |1 |node1 |2017-03-24 08:30:00 | 5 | blabla | --------------------------------------------------------- |2 |node1 |2017-03-24 09:00:00 | 3 | blabla | --------------------------------------------------------- |3 |node1 |2017-03-24 09:30:00 | 8 | blabla | --------------------------------------------------------- |4 |node2 |2017-03-24 10:00:00 | 5 | blabla | --------------------------------------------------------- |5 |node2 |2017-03-24 10:30:00 | 3 | blabla | --------------------------------------------------------- |6 |node2 |2017-03-24 11:00:00 | 1 | blabla | --------------------------------------------------------- |7 |node2 |2017-03-24 11:30:00 | 3 | blabla | -----------------------------------------------

oracle - Split string into tokens in pl sql -

how can parse string tokens in pl/sql? for example, string: 170823-14785 and parsing want is: 17 08 23 -1 47 85 as see, want replace consecutive 2 chars, following space symbol if so, this: (no pl/sql needed this) select regexp_replace('170823-14785', '(.{2})', '\1 ') dual;

python 3.x - TypeError: compile() missing 1 required positional argument: 'self' -

what 'self' in model.copmpile try run code python in keras model error model.compile(loss="binary_crossentropy", optimizer='adam', metrics=['accuracy']) typeerror: compile() missing 1 required positional argument: 'self' instantiate class , use methods... should this model().compile() or m = model() m.compile()

Multiprocessing in python, work with several files -

i have done script convert several files simultaneously, instead of converting 4 files several processes, code converts files 1 one several processes, here's code: def convert (directoryname): path, dirs, files in os.walk(directoryname): f in files: if f.endswith(".txt") f1=f path1=path p=mp.process(target=convert1, args=(path1,f1,)) p.start() does have idea? your code overwrites p everytime, start 1 process when loop finished. instead, call p.start when create process, , store can call join on processes in end: def convert (directoryname): process_list = [] path, dirs, files in os.walk(directoryname): f in files: if f.endswith(".txt") f1=f path1=path p=mp.process(target=convert_stdf_hdf5, args=(path1,f1,)) p.start() process_list.append(p) # wait processes finish p in process_list: p.join()

python - Plot 3D mesh using mplot3d -

Image
starting text file containing points coordinates of 3d surface, deformed due pressure applied on , values of pressure applied according following example: node_label x_in y_in z_in x_def y_def z_def press 11542 15229 17734 18332 11.4645 67.7709 138.905 4.97573e-03 11543 3283 3238 16784 7.73624 67.3238 138.781 13.2628e-03 11540 13506 13385 17482 18.9023 67.6291 139.051 3.61705e-03 11541 7637 7516 18637 15.2164 68.0038 139.031 12.7343e-03 11546 16137 16651 16886 -2.98896 66.1776 138.431 19.0185e-03 11547 7360 7361 16903 -6.42838 65.3547 138.177 2.74949e-03 ....

Preventing an 'Open Redirect' exploit on C# Web Forms Application -

Image
the code looks following- apparent offending code: readonly regex alphanumericregex = new regex("^[a-za-z0-9_]*$"); private const string username = "bitzleon"; protected void page_preinit(object sender, eventargs e) { if (httpcontext.current.request.querystring.get("userid") == null) { uribuilder uribuilder = new uribuilder(request.url); namevaluecollection query = httputility.parsequerystring(uribuilder.query); query["userid"] = username; uribuilder.query = query.tostring(); if (alphanumericregex.ismatch(query["userid"]) && islocalurl(uribuilder.tostring())) { response.redirect(uribuilder.tostring()); } } } the line response.redirect(uribuilder.tostring()); throwing error in veracode scans- i'm running 2 checks ensure redirect valid , internal. firstly, query needs alpha-numeric- regex takes care of that- , secondly, url redirecting l

woocommerce - Wordpress fatal error line 5162 -

so local wordpress crashed , got following message fatal error: allowed memory size of 134217728 bytes exhausted (tried allocate 1742791683 bytes) in c:\xampp\htdocs\wordpress\wp-includes\functions.php on line 5162 so decided try setting new one. when installed woocommerce got error on same line. fatal error: allowed memory size of 268435456 bytes exhausted (tried allocate 1742791683 bytes) in c:\xampp\htdocs\wptest\wp-includes\functions.php on line 5162 i guess these problems related? idea how solve it? thanks!

Using ServiceStack Ormlite global filters with Session -

i want alter example found here modifyby populated session's username every time change made. possible? you need singleton access access username need populate in either reqeustcontext or asp.net's httpcontext.current.items dictionary, e.g: globalrequestfilters.add((req,res,dto) => { requestcontext.instance.items["username"] = req.getsession().userauthname; }); which can access inside updatefilter , e.g: ormliteconfig.updatefilter = (dbcmd, row) => { var auditrow = row iaudit; var username = requestcontext.instance.items["username"] string; if (auditrow != null) auditrow.username = username; }; note: "username" work within context of http request.

html - Override @media style using JavaScript -

i need save pdf pages of screened web site mozilla ff. i've stumbled upon site css protection prevents print (and print pdf): prints blank page. need pure javascript, when run js console override @media print styles. tried few commands without success. know how manually need easier way. the css stylesheet * {-moz-user-select: none;-khtml-user-select: none;-webkit-user-select: none;-ms-user-select: none;-o-user-select: none;user-select: none;} @media print {html, body {display: none;}} ps. nice text select prevention too, not important. one option override css injecting <style> <head> this: var override = document.createelement("style"); override.innertext = "* {user-select: auto;} @media print {html, body { display: block; }}"; document.head.appendchild(override); example on codepen (try print preview , without js)

c# - Nhibernate fail to delete Value Object that has null property value -

i faced sort of problem nhibernate: when try delete component (object no id) has null value of property, operation fails because condition translated field = null instead of field null i have rilevanzafinding object mapped component of finding : hasmany<rilevanzafinding>(x => x.rilevanze) .access.camelcasefield(prefix.underscore) .table("rilevanzafinding_t045") .keycolumn("int_t045_idfinding") .cascade.alldeleteorphan() .asset() .component(fee => { fee.references<rating>(x => x.rating).column("int_t045_idrating").fetch.join(); fee.map(x => x.datafine) .column("dte_t045_datafine") .customsqltype("date"); fee.map(x => x.note) .column("nvc_t045_note") .length(100000); }); public class finding : baseobject<f

web - Backend Server fetching data vs UI fetching data -

i have architecture question. i working on system architecture employee information system show employee information. information needs shown user stored in 2 systems. on ui user need show data in consolidated view. have 2 option approach this. option#1: one backend server fetches both data 2 systems , send ui display. option#2: one backend server sends data 1 system , links data other system.ui fetches data other system display on ui. according me option#2 better since data fetched ui , when needed. concern approach ui needs make repeated calls system2 makes lot of http requests. can suggestions on option better , why? you can put both calls in parallel instead of sending links first service..

python - tensorflow TypeError: float() argument must be a string or a number, not 'dict' -

i have problem. try execute code got error. import matplotlib.pyplot plt # visualizations shown in notebook. %matplotlib inline import glob import cv2 import numpy np def plot_figures(figures, nrows, ncols, labels=none): fig, axs = plt.subplots(ncols=ncols, nrows=nrows, figsize=(12, 14)) axs = axs.ravel() index, title in zip(range(len(figures)), figures): axs[index].imshow(figures[title], plt.gray()) if(labels != none): axs[index].set_title(labels[index]) else: axs[index].set_title(title) axs[index].set_axis_off() plt.tight_layout() ### visualize network's feature maps here. ### feel free use many code cells needed. # image_input: test image being fed network produce feature maps # tf_activation: should tf variable name used during training procedure represents calculated state of specific weight layer # activation_min/max: can used view activation contrast in more detail, default matplot sets min , m

python 2.7 - Why do I haven't the keras.applications module? -

from scipy.misc import imsave import numpy np import time keras.applications import vgg16 keras import backend k importerror: no module named applications i have installed keras, , other modules work well, why there no "applications" module

javascript - How to triger function in child component from parent component in AngularJS? -

by using & binding in child component can run function part of parent components controller. strugling same in oposite direction - when happens in parent component, child component runs function. i have mapcomponent direct child of maincomponent . mapcomponent displays fullscreen google map(using ngmap ) markers. maincomponent handles login , registration. if users start registration need run function in mapcomponent removes markers , attaches map event user click on map show lives , coordinates saved on registration. just example wouldnt complex, here code plunker found while searching stackoverflow: var app = angular.module('plunker', []); app.controller('rootcontroller', function() {}); app.component('parentcomponent', { template: ` <h3>parent component</h3> <a class="btn btn-default btn-sm" ng-click="$ctrl.click()">notify child</a> <span data-ng-bind="$ctrl.childmessage&qu

What is type '()' in swift? -

this question has answer here: difference between returning void , () in swift closure 3 answers i'm receiving event passes parameter of type () . is empty tuple..? i'm referring type of expression: let x = () () both type (and void type alias empty tuple type) , value of type. so let x = () defines x constant property of type () (aka void ) value () . equivalent statements be let x:() = () let x:void = () but not let x = void // error: expected member name or constructor call after type name because void type not value. when defining function types no parameters and/or no return value there seems consensus use () empty parameter list, , void no return value. can example seen in uikit completion handlers, or execution blocks submitted gcd dispatch queues, e.g. func sync(execute block: () -> void)

c++ - How can I retrieve a pointer to a variable that is in a list data structure? -

(all of done in c++) i working tree of nodes. node class variables , list of child-nodes. goal retrieve pointer node x layers down matching on variable. i aiming create function looks this. node* node::returnchild(int depth, string match) { ... } this should recursively iterate down of nodes children , search node variable matching string variable. when finding matching node should take address of node, save in pointer , return functioncall. i managed make working function iterated down sub-tree of nodes specified depth , found correct node. printed out string value make sure correct node. when trying use node via pointer (provided function) outside of function got nothing. in function used for-loop looking this: for(auto fornode : this->children) this worked fine, seems node "fornode" accessed within scope of loop temporary copy of real node list. copy not "exist" outside of for-loops scope , therefore not able access node located @ poin

Cannot update Access database in C# -

i trying build update button able edit data textbox . using access database , having problems , cannot update it. bellow code: private void cmdupdate_click(object sender, eventargs e) { try { con = new oledbconnection(cs.dbconn); con.open(); string queryupdate = @"update tblfixing set title=@title, codebefore=@codebefore, codafter=@codafter, exp=@exp, example=@example, notes=@notes fixid=@fixid"; cmd = new oledbcommand(queryupdate); cmd.connection = con; cmd.parameters.add(new oledbparameter("@fixid", oledbtype.wchar, 20, "fixid")); cmd.parameters.add(new oledbparameter("@title", oledbtype.wchar, 255, "title")); cmd.parameters.add(new oledbparameter("@codebefore", oledbtype.wchar, 0, "codebefore")); cmd.parameters.add(new oledbparameter("@codafter", oledbtype.wchar, 0, "codafter")); cmd.parameters.add

setValue onComplete not called from Firebase on Android -

i'm using security rules determine in conditions value can written database. @ moment i've setup security rules, these working fine (i checked simulator), no issues far. in case permission write denied (security rules not met), want take action. in order this, i'm planning use oncomplete on setvalue , if there error have code. at moment, if security rules met, values written online database , can check in browser. if value not written database due security reasons, can see error in debug/log saying permission denied, good. the issue when value written or not written database, oncomplete not called @ all, it's doesn't exist in code. checked in debug mode breakpoints. code i'm using comes straight documentation, please see below. does have ideas? lot! dataref.setvalue(frequency, new databasereference.completionlistener() { @override public void oncomplete(databaseerror databaseerror, databasereference dataref) { if (databaseerror != n