Posts

c# - My WPF ContextMenu is not dismissing when I click elsewhere -

i have wpf contextmenu instance declared in xaml this <window.contextmenu> <contextmenu> <menuitem header="do nothing"/> <separator/> <menuitem header="{x:static p:resources.menuexit}" click="iconmenu_exit"/> </contextmenu> </window.contextmenu> i'm using winforms notifyicon display tray icon this _notifyicon = new system.windows.forms.notifyicon(); _notifyicon.icon = properties.resources.mainicon; _notifyicon.visible = true; _notifyicon.mouseclick += new system.windows.forms.mouseeventhandler(ontrayiconmouseclick); the implementation of mouse click handler this private void ontrayiconmouseclick(object sender, system.windows.forms.mouseeventargs e) { if (e.button == system.windows.forms.mousebuttons.right) { contextmenu.isopen = true; } } this displays context menu , clicking on menu items dismisses it, if click away on window, context menu ...

php - Laravel executes the POST route upon loading page -

so have form on front page: {{ form::open(array('url' => url::to('', array(), true))) }} <p> {{form::label('author') }} {{form::text('author') }} </p> <p> {{form::label('title') }} {{form::text('title') }} </p> <p> {{form::label('message') }} {{form::text('message') }} </p> <p> {{ form::submit() }} </p> {{ form::close() }} then these routes: route::get('/', function() { /* unrelated stuff here */ }); route::post('/', function() { /* testing */ print_r("done!"); exit; }); so trying test whether form submission works or not. , doesn't. reason post method being executed once load front page instead of when form submitted. why , how can fix this? your form url shou...

scala.js - Resolving ScalaJSPlugin from Build.scala and plugins.sbt -

i'm trying make "scalajsplugin" work, resolved in: project/build.scala object buildproject extends build { .. lazy val scalarx = project(id = "scalarx", base = file("scalarx")).enableplugins(scalajsplugin).settings( version := "0.1", scalaversion := "2.11.7", librarydependencies ++= scalarxdependencies ) ... in project/plugins.sbt file, put. addsbtplugin("org.scala-js" % "sbt-scalajs" % "0.6.8") it fails with compilation error in build.scala trying resolve "scalajsplugin" there links repo 1 , 2 for keep changes commented.

html - Using Javascript to subtract two dates given from form entries -

i'm trying use javascript subtract 2 dates. date values come form fields. i'm using formidable pro on wordpress site form. the form 1 allow business pay taxes. taxes due on 20th of each month. business may pay taxes late, @ beginning of form specify month paying taxes for. the first date current date. it's populated form field using formidable short code in format mm/dd/yyyy. the second date calculated from entries year , month. values concatenated "20" form full date value 20th of month paying taxes. if paying taxes on or before 20th, there no penalty. if it's after 20th, there's penalty. want subtract dates , determine whether payment late based on difference being greater zero--and difference value being populated form field. this code i've been using. you'll see commented out 1 method of calculating , returning difference value form. with code below, script returns "nan" error difference field. why? how fix error , ...

gluon - Android back button closes app -

i'm showing local html file in webview center node of glisten view . when presss android button, instead of going previous view, app gets closed. when use appbar button switch previous view works fine. tried attach event filter both, webview , scene, doesn't triggered. javafxports version: 8.60.6 update: the issue occures when webview focused. public class importhelppresenter extends basepresenter { @fxml private webview web; @override protected void initialize() { super.initialize(); web.setcontextmenuenabled(false); loadhelppage(); } private void loadhelppage() { string htmlcontent = null; try { htmlcontent = readcontent("importhelp.html"); } catch (ioexception e) { e.printstacktrace(); } web.getengine().loadcontent(htmlcontent); } string readcontent(string filename) throws ioexception { inputstream = getclass().getresour...

What can I do if I lose my Chrome extension private key? -

the hard drive stored private key (needed uploading chrome web store) got erased. option delete extension web store , recreate it? tips salvaging have? yes, i'm aware stupid not keep backup of key. the moment when including key has effect first time upload extension chrome web store, determine extension id. after that, don't need private key update extension.

regex - Extracting last-names from a vector of names in R -

i have dataframe contains u.s. senator names , need extract last names can fuzzy match them dataframe has other information senators, (and column contains last names.) the problem names contain middle initial or middle name , have senator's party @ end. how can write gsub command extract senator's last name? apologies, i'm new regex , bad @ it. snippet of data here: names <- c("john kerry (d)", "john h chafee (r)", "chris dodd (d)", "joe lieberman (d)", "frank r lautenberg (d)", "daniel patrick moynihan (d)", "alfonse m d'amato (r)", "arlen specter (r)", "jay rockefeller (d)", "carl levin (d)") you can use strsplit() along lapply() on resulting list: > unlist(lapply(strsplit(names, " "), function(x) { return(x[length(x)-1]) })) [1] "kerry" "chafee" "dodd" "lieberman" "...